mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-13 06:01:21 +00:00
update app launcher
This commit is contained in:
parent
3179b6a33a
commit
3cc6b9a76a
36
src/main.rs
36
src/main.rs
@ -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
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user