attempting to display to user which file was saved

This commit is contained in:
Chris Cochrun 2024-04-17 10:08:32 -05:00
parent 479c22087f
commit 3b96885afd
2 changed files with 12 additions and 3 deletions

View file

@ -289,9 +289,10 @@ Kirigami.ApplicationWindow {
target: ServiceItemModel
function onSavedToFile(saved, file) {
if (saved) {
Utils.dbg(file);
console.log(file);
showPassiveNotification("Saved to ", + Qt.resolvedUrl(file));
let path = file.toString();
path = path.replace(/^(file:\/{2})/,"");
let cleanPath = decodeURIComponent(path);
showPassiveNotification("Saved to ", + cleanPath);
}
}
}

View file

@ -56,6 +56,7 @@ mod utilities {
unsafe extern "C++" {
include!("cxx-qt-lib/qstring.h");
type QString = cxx_qt_lib::QString;
type QUrl = cxx_qt_lib::QUrl;
}
unsafe extern "RustQt" {
@ -71,6 +72,9 @@ mod utilities {
#[qinvokable]
fn inf(self: &Utils, message: QString);
#[qinvokable]
fn url_to_string(self: &Utils, url: QUrl) -> QString;
}
}
@ -99,6 +103,10 @@ impl utilities::Utils {
pub fn inf(self: &Self, message: QString) {
info!(msg = ?message);
}
pub fn url_to_string(self: &Self, url: QUrl) -> QString {
url.path()
}
}
pub fn setup() {