making loading work and allow for canceling
This commit is contained in:
parent
cb47858c17
commit
bbb9f910d0
2 changed files with 15 additions and 7 deletions
|
@ -307,13 +307,17 @@ Kirigami.ApplicationWindow {
|
||||||
/* } */
|
/* } */
|
||||||
|
|
||||||
function load() {
|
function load() {
|
||||||
const file = fileHelper.loadFile("Load Presentation");
|
const file = fileHelper.loadFile("Load Presentation", "pres");
|
||||||
const loaded = mainPage.serviceItems.load(file);
|
if (file != "") {
|
||||||
loaded ? showPassiveNotification("Loaded: " + file)
|
const loaded = mainPage.serviceItems.load(file);
|
||||||
: showPassiveNotification("File wasn't loaded");
|
loaded ? showPassiveNotification("Loaded: " + file)
|
||||||
loaded ? RSettings.loadFile = file
|
: showPassiveNotification("File wasn't loaded");
|
||||||
: showPassiveNotification("Didn't set loadfile!");
|
loaded ? RSettings.loadFile = file
|
||||||
showPassiveNotification(RSettings.loadFile);
|
: showPassiveNotification("Didn't set loadfile!");
|
||||||
|
showPassiveNotification(RSettings.loadFile);
|
||||||
|
} else {
|
||||||
|
showPassiveNotification("Loading Canceled");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
|
|
@ -113,6 +113,7 @@ impl file_helper::FileHelper {
|
||||||
"jpg", "png", "gif", "jpeg", "JPG", "PNG", "webp", "gif",
|
"jpg", "png", "gif", "jpeg", "JPG", "PNG", "webp", "gif",
|
||||||
];
|
];
|
||||||
let audio_filters = ["mp3", "opus", "ogg", "flac", "wav"];
|
let audio_filters = ["mp3", "opus", "ogg", "flac", "wav"];
|
||||||
|
let pres_filter = ["pres"];
|
||||||
let title = title.to_string();
|
let title = title.to_string();
|
||||||
let filter = filter.to_string();
|
let filter = filter.to_string();
|
||||||
let mut file = FileDialog::new().set_title(title);
|
let mut file = FileDialog::new().set_title(title);
|
||||||
|
@ -126,6 +127,9 @@ impl file_helper::FileHelper {
|
||||||
"audio" => {
|
"audio" => {
|
||||||
file = file.add_filter(filter, &audio_filters);
|
file = file.add_filter(filter, &audio_filters);
|
||||||
}
|
}
|
||||||
|
"pres" => {
|
||||||
|
file = file.add_filter(filter, &pres_filter);
|
||||||
|
}
|
||||||
_ => debug!("nothing"),
|
_ => debug!("nothing"),
|
||||||
};
|
};
|
||||||
debug!("trying to load file");
|
debug!("trying to load file");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue