diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-12-08 18:32:13 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-12-08 18:44:24 +0100 |
commit | 8b019270a0fb90e801ca6d44cbb32e8340e371ea (patch) | |
tree | e0dd27fdfaa811733b536d1720bf6200b14f9f09 /gui/src/gui/mod.rs | |
parent | cbdcf2228513e3f8ef87028bbabb802558039f30 (diff) |
Add passing of profile name to GUI bootup code
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'gui/src/gui/mod.rs')
-rw-r--r-- | gui/src/gui/mod.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gui/src/gui/mod.rs b/gui/src/gui/mod.rs index 2eb936e..c54a17a 100644 --- a/gui/src/gui/mod.rs +++ b/gui/src/gui/mod.rs @@ -46,13 +46,13 @@ enum Message { impl Application for Distrox { type Executor = iced::executor::Default; // tokio type Message = Message; - type Flags = (); + type Flags = String; - fn new(_flags: ()) -> (Self, iced::Command<Self::Message>) { + fn new(name: String) -> (Self, iced::Command<Self::Message>) { ( Distrox::Loading, iced::Command::perform(async { - match Profile::new_inmemory(Config::default()).await { + match Profile::new_inmemory(Config::default(), &name).await { Err(_) => Message::FailedToLoad, Ok(instance) => { Message::Loaded(Arc::new(instance)) @@ -169,7 +169,7 @@ impl Application for Distrox { } -pub fn run() -> Result<()> { +pub fn run(name: String) -> Result<()> { let settings = iced::Settings { window: iced::window::Settings { resizable: true, @@ -178,6 +178,7 @@ pub fn run() -> Result<()> { always_on_top: false, ..iced::window::Settings::default() }, + flags: name, exit_on_close_request: true, ..iced::Settings::default() }; |