|
|
@ -25,7 +25,7 @@ pub struct App { |
|
|
|
// Extras
|
|
|
|
// Extras
|
|
|
|
// database: Arc<Database>,
|
|
|
|
// database: Arc<Database>,
|
|
|
|
// GTK
|
|
|
|
// GTK
|
|
|
|
app: Application, |
|
|
|
application: Application, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
impl App { |
|
|
|
impl App { |
|
|
@ -52,30 +52,30 @@ impl App { |
|
|
|
let action_tab_pin = Action::new("win", true); |
|
|
|
let action_tab_pin = Action::new("win", true); |
|
|
|
|
|
|
|
|
|
|
|
// Init GTK
|
|
|
|
// Init GTK
|
|
|
|
let app = Application::builder() |
|
|
|
let application = Application::builder() |
|
|
|
.application_id(APPLICATION_ID) |
|
|
|
.application_id(APPLICATION_ID) |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
|
|
|
|
|
|
|
|
|
// Init accels
|
|
|
|
// Init accels
|
|
|
|
app.set_accels_for_action(&action_tool_debug.detailed_name(), &["<Primary>i"]); |
|
|
|
application.set_accels_for_action(&action_tool_debug.detailed_name(), &["<Primary>i"]); |
|
|
|
app.set_accels_for_action(&action_update.detailed_name(), &["<Primary>u"]); |
|
|
|
application.set_accels_for_action(&action_update.detailed_name(), &["<Primary>u"]); |
|
|
|
app.set_accels_for_action(&action_quit.detailed_name(), &["<Primary>Escape"]); |
|
|
|
application.set_accels_for_action(&action_quit.detailed_name(), &["<Primary>Escape"]); |
|
|
|
app.set_accels_for_action(&action_tab_append.detailed_name(), &["<Primary>t"]); |
|
|
|
application.set_accels_for_action(&action_tab_append.detailed_name(), &["<Primary>t"]); |
|
|
|
app.set_accels_for_action(&action_tab_pin.detailed_name(), &["<Primary>p"]); |
|
|
|
application.set_accels_for_action(&action_tab_pin.detailed_name(), &["<Primary>p"]); |
|
|
|
app.set_accels_for_action(&action_tab_close.detailed_name(), &["<Primary>q"]); |
|
|
|
application.set_accels_for_action(&action_tab_close.detailed_name(), &["<Primary>q"]); |
|
|
|
app.set_accels_for_action( |
|
|
|
application.set_accels_for_action( |
|
|
|
&action_tab_page_navigation_base.detailed_name(), |
|
|
|
&action_tab_page_navigation_base.detailed_name(), |
|
|
|
&["<Primary>h"], |
|
|
|
&["<Primary>h"], |
|
|
|
); |
|
|
|
); |
|
|
|
app.set_accels_for_action( |
|
|
|
application.set_accels_for_action( |
|
|
|
&action_tab_page_navigation_history_back.detailed_name(), |
|
|
|
&action_tab_page_navigation_history_back.detailed_name(), |
|
|
|
&["<Primary>Left"], |
|
|
|
&["<Primary>Left"], |
|
|
|
); |
|
|
|
); |
|
|
|
app.set_accels_for_action( |
|
|
|
application.set_accels_for_action( |
|
|
|
&action_tab_page_navigation_history_forward.detailed_name(), |
|
|
|
&action_tab_page_navigation_history_forward.detailed_name(), |
|
|
|
&["<Primary>Right"], |
|
|
|
&["<Primary>Right"], |
|
|
|
); |
|
|
|
); |
|
|
|
app.set_accels_for_action( |
|
|
|
application.set_accels_for_action( |
|
|
|
&action_tab_page_navigation_reload.detailed_name(), |
|
|
|
&action_tab_page_navigation_reload.detailed_name(), |
|
|
|
&["<Primary>r"], |
|
|
|
&["<Primary>r"], |
|
|
|
); |
|
|
|
); |
|
|
@ -99,7 +99,7 @@ impl App { |
|
|
|
)); |
|
|
|
)); |
|
|
|
|
|
|
|
|
|
|
|
// Init events
|
|
|
|
// Init events
|
|
|
|
app.connect_activate({ |
|
|
|
application.connect_activate({ |
|
|
|
let action_update = action_update.simple(); |
|
|
|
let action_update = action_update.simple(); |
|
|
|
move |_| { |
|
|
|
move |_| { |
|
|
|
// Make initial update
|
|
|
|
// Make initial update
|
|
|
@ -107,7 +107,7 @@ impl App { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
app.connect_startup({ |
|
|
|
application.connect_startup({ |
|
|
|
let browser = browser.clone(); |
|
|
|
let browser = browser.clone(); |
|
|
|
let database = database.clone(); |
|
|
|
let database = database.clone(); |
|
|
|
move |this| { |
|
|
|
move |this| { |
|
|
@ -129,7 +129,7 @@ impl App { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
app.connect_shutdown({ |
|
|
|
application.connect_shutdown({ |
|
|
|
// let browser = browser.clone();
|
|
|
|
// let browser = browser.clone();
|
|
|
|
let database = database.clone(); |
|
|
|
let database = database.clone(); |
|
|
|
move |_| { |
|
|
|
move |_| { |
|
|
@ -170,12 +170,12 @@ impl App { |
|
|
|
// Extras
|
|
|
|
// Extras
|
|
|
|
// database,
|
|
|
|
// database,
|
|
|
|
// GTK
|
|
|
|
// GTK
|
|
|
|
app, |
|
|
|
application, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Actions
|
|
|
|
// Actions
|
|
|
|
pub fn run(&self) -> ExitCode { |
|
|
|
pub fn run(&self) -> ExitCode { |
|
|
|
self.app.run() |
|
|
|
self.application.run() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|