update app launcher

This commit is contained in:
yggverse 2025-03-08 08:36:34 +02:00
parent 3179b6a33a
commit 3cc6b9a76a
2 changed files with 17 additions and 21 deletions

View File

@ -2,29 +2,25 @@ mod app;
mod profile;
mod tool;
use app::App;
use gtk::glib::ExitCode;
use profile::Profile;
use std::rc::Rc;
fn main() -> ExitCode {
match Profile::new() {
Ok(profile) => {
if let Err(e) = gtk::init() {
eprintln!("Failed to initialize GTK: {e}");
return ExitCode::FAILURE;
}
match App::build(&Rc::new(profile)).run() {
Ok(result) => result,
Err(e) => {
eprintln!("Failed to initialize application: {e}");
ExitCode::FAILURE
}
}
}
Err(e) => {
eprintln!("Failed to initialize profile: {e}");
ExitCode::FAILURE
}
use app::App;
use std::rc::Rc;
if let Err(e) = gtk::init() {
eprintln!("Failed to initialize GTK: {e}");
return ExitCode::FAILURE;
}
match Profile::init() {
Ok(profile) => match App::build(&Rc::new(profile)).run() {
Ok(app) => return app,
Err(e) => eprintln!("Failed to initialize application: {e}"),
},
Err(e) => eprintln!("Failed to initialize profile: {e}"),
}
ExitCode::FAILURE
}

View File

@ -33,7 +33,7 @@ pub struct Profile {
impl Profile {
// Constructors
pub fn new() -> Result<Self> {
pub fn init() -> Result<Self> {
// Init profile path
let mut config_path = user_config_dir();