refactor: split action declarations into separate brackets
Add more readability to the code.merge-requests/8/head
parent
5945c06ed8
commit
1296157638
|
@ -18,12 +18,14 @@ impl MenubarImplementedEditor for EchidnaWindow {
|
|||
let app = self
|
||||
.application()
|
||||
.expect("self does not have an application set.");
|
||||
let menubuilder = gtk::Builder::from_string(include_str!("../../../ui/menu.ui"));
|
||||
let menubuilder = gtk::Builder::from_string(include_str!("./menu.ui"));
|
||||
let menubar: MenuModel = menubuilder
|
||||
.object("menu")
|
||||
.expect("Could not get object 'menu' from builder.");
|
||||
app.set_menubar(Some(&menubar));
|
||||
self.set_show_menubar(true);
|
||||
|
||||
{
|
||||
let act_exit: SimpleAction = SimpleAction::new("exit", None);
|
||||
app.add_action(&act_exit);
|
||||
|
||||
|
@ -32,7 +34,8 @@ impl MenubarImplementedEditor for EchidnaWindow {
|
|||
app.quit();
|
||||
}
|
||||
));
|
||||
|
||||
}
|
||||
{
|
||||
let act_about: SimpleAction = SimpleAction::new("about", None);
|
||||
app.add_action(&act_about);
|
||||
act_about.connect_activate(|_action, _value| {
|
||||
|
@ -45,7 +48,8 @@ impl MenubarImplementedEditor for EchidnaWindow {
|
|||
about_dialog.set_copyright(Some("Made with by ❤️ Echidna contributors"));
|
||||
about_dialog.set_visible(true);
|
||||
});
|
||||
|
||||
}
|
||||
{
|
||||
//app.notebook = Some(Rc::new(RefCell::new(notebook)));
|
||||
let act_exit: SimpleAction = SimpleAction::new("exit", None);
|
||||
app.add_action(&act_exit);
|
||||
|
@ -55,7 +59,8 @@ impl MenubarImplementedEditor for EchidnaWindow {
|
|||
app.quit();
|
||||
}
|
||||
));
|
||||
|
||||
}
|
||||
{
|
||||
let act_about: SimpleAction = SimpleAction::new("about", None);
|
||||
app.add_action(&act_about);
|
||||
act_about.connect_activate(|_action, _value| {
|
||||
|
@ -68,7 +73,8 @@ impl MenubarImplementedEditor for EchidnaWindow {
|
|||
about_dialog.set_copyright(Some("Made with by ❤️ Echidna contributors"));
|
||||
about_dialog.set_visible(true);
|
||||
});
|
||||
|
||||
}
|
||||
{
|
||||
let act_report_issue = SimpleAction::new("report-issue", None);
|
||||
|
||||
app.add_action(&act_report_issue);
|
||||
|
@ -76,6 +82,8 @@ impl MenubarImplementedEditor for EchidnaWindow {
|
|||
act_report_issue.connect_activate(|_action, _variant| {
|
||||
webbrowser::open("https://github.com/EchidnaHQ/Echidna/issues/new");
|
||||
});
|
||||
}
|
||||
{
|
||||
let act_search_feature_requests = SimpleAction::new("search-feature-requests", None);
|
||||
|
||||
app.add_action(&act_search_feature_requests);
|
||||
|
@ -83,18 +91,18 @@ impl MenubarImplementedEditor for EchidnaWindow {
|
|||
act_search_feature_requests.connect_activate(|_action, _variant| {
|
||||
webbrowser::open("https://github.com/EchidnaHQ/Echidna/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement");
|
||||
});
|
||||
|
||||
}
|
||||
{
|
||||
let act_window_close = SimpleAction::new("close", None);
|
||||
|
||||
self.add_action(&act_window_close);
|
||||
{
|
||||
let window = self.clone();
|
||||
|
||||
act_window_close.connect_activate(move |_action, _variant| {
|
||||
window.close();
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
let action_open_file: SimpleAction = SimpleAction::new("open-file", None);
|
||||
|
||||
self.add_action(&action_open_file);
|
||||
|
@ -104,3 +112,4 @@ impl MenubarImplementedEditor for EchidnaWindow {
|
|||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue