feat: add alert dialog for opening failures
This commit is contained in:
parent
ef898dfb76
commit
a19aa8206b
2 changed files with 55 additions and 6 deletions
11
src/main.rs
11
src/main.rs
|
@ -7,7 +7,7 @@ use std::{borrow::Cow, path::PathBuf, time::Duration};
|
|||
|
||||
use color_eyre::eyre::{OptionExt, Result, bail};
|
||||
use gobject::GtkZiplineFolder;
|
||||
use relm::{Dialog, DialogInput, Toast, ToastInput};
|
||||
use relm::{Dialog, DialogInput, StandaloneDialog, Toast, ToastInput};
|
||||
use relm4::{
|
||||
Component, ComponentController, Controller, RelmApp, Sender,
|
||||
adw::{self, prelude::*},
|
||||
|
@ -400,11 +400,10 @@ fn main() -> Result<()> {
|
|||
|
||||
color_eyre::install()?;
|
||||
|
||||
// TODO: show dialog in case these error
|
||||
let config = get_config()?;
|
||||
|
||||
let app = RelmApp::new("net.uku3lig.Tyrolienne");
|
||||
app.run_async::<Tyrolienne>(config);
|
||||
match get_config() {
|
||||
Ok(config) => RelmApp::new("net.uku3lig.Tyrolienne").run_async::<Tyrolienne>(config),
|
||||
Err(e) => RelmApp::new("net.uku3lig.Tyrolienne").run::<StandaloneDialog>(e.to_string()),
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue