mirror of
https://github.com/13hannes11/toolbx-tuner.git
synced 2024-09-03 23:21:00 +02:00
add unsupported dialogue to be shown if not all prerequisits are fulfilled
This commit is contained in:
15
src/app.rs
15
src/app.rs
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user