mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
update app launcher
This commit is contained in:
parent
3179b6a33a
commit
3cc6b9a76a
2 changed files with 17 additions and 21 deletions
28
src/main.rs
28
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) => {
|
||||
use app::App;
|
||||
use std::rc::Rc;
|
||||
|
||||
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}");
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
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…
Add table
Add a link
Reference in a new issue