add unsupported dialogue to be shown if not all prerequisits are fulfilled

This commit is contained in:
2024-02-26 23:40:54 +01:00
parent 06e9f44995
commit 914b5899f1
6 changed files with 239 additions and 1 deletions

View File

@@ -11,8 +11,10 @@ use gtk::{gio, glib};
use crate::config::{APP_ID, PROFILE};
use crate::modals::about::AboutDialog;
use crate::modals::unsupported::UnsupportedDialog;
pub(super) struct App {
unsupported_dialog: Controller<UnsupportedDialog>,
about_dialog: Controller<AboutDialog>,
}
@@ -96,7 +98,15 @@ impl SimpleComponent for App {
.launch(())
.detach();
let model = Self { about_dialog };
let unsupported_dialog = UnsupportedDialog::builder()
.transient_for(root)
.launch(())
.detach();
let model = Self {
about_dialog,
unsupported_dialog,
};
let widgets = view_output!();
@@ -116,6 +126,9 @@ impl SimpleComponent for App {
})
};
let sender = model.unsupported_dialog.sender().clone();
sender.send(()).unwrap();
actions.add_action(shortcuts_action);
actions.add_action(about_action);
actions.register_for_widget(&widgets.main_window);