mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-09-10 05:52:03 +00:00
update app launcher
This commit is contained in:
parent
3179b6a33a
commit
3cc6b9a76a
28
src/main.rs
28
src/main.rs
@ -2,29 +2,25 @@ mod app;
|
|||||||
mod profile;
|
mod profile;
|
||||||
mod tool;
|
mod tool;
|
||||||
|
|
||||||
use app::App;
|
|
||||||
use gtk::glib::ExitCode;
|
use gtk::glib::ExitCode;
|
||||||
use profile::Profile;
|
use profile::Profile;
|
||||||
use std::rc::Rc;
|
|
||||||
|
|
||||||
fn main() -> ExitCode {
|
fn main() -> ExitCode {
|
||||||
match Profile::new() {
|
use app::App;
|
||||||
Ok(profile) => {
|
use std::rc::Rc;
|
||||||
|
|
||||||
if let Err(e) = gtk::init() {
|
if let Err(e) = gtk::init() {
|
||||||
eprintln!("Failed to initialize GTK: {e}");
|
eprintln!("Failed to initialize GTK: {e}");
|
||||||
return ExitCode::FAILURE;
|
return ExitCode::FAILURE;
|
||||||
}
|
}
|
||||||
match App::build(&Rc::new(profile)).run() {
|
|
||||||
Ok(result) => result,
|
match Profile::init() {
|
||||||
Err(e) => {
|
Ok(profile) => match App::build(&Rc::new(profile)).run() {
|
||||||
eprintln!("Failed to initialize application: {e}");
|
Ok(app) => return app,
|
||||||
|
Err(e) => eprintln!("Failed to initialize application: {e}"),
|
||||||
|
},
|
||||||
|
Err(e) => eprintln!("Failed to initialize profile: {e}"),
|
||||||
|
}
|
||||||
|
|
||||||
ExitCode::FAILURE
|
ExitCode::FAILURE
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(e) => {
|
|
||||||
eprintln!("Failed to initialize profile: {e}");
|
|
||||||
ExitCode::FAILURE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -33,7 +33,7 @@ pub struct Profile {
|
|||||||
impl Profile {
|
impl Profile {
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
pub fn new() -> Result<Self> {
|
pub fn init() -> Result<Self> {
|
||||||
// Init profile path
|
// Init profile path
|
||||||
let mut config_path = user_config_dir();
|
let mut config_path = user_config_dir();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user