mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
reorganize accels, remove extra argument from browser construction
This commit is contained in:
parent
5ab36db613
commit
bddaa43024
3 changed files with 40 additions and 41 deletions
|
|
@ -22,7 +22,6 @@ int main(
|
|||
return app->make_window_and_run<app::Browser>(
|
||||
argc,
|
||||
argv,
|
||||
db,
|
||||
app
|
||||
db
|
||||
);
|
||||
}
|
||||
|
|
@ -5,8 +5,7 @@
|
|||
using namespace app;
|
||||
|
||||
Browser::Browser(
|
||||
sqlite3 * db,
|
||||
const Glib::RefPtr<Gtk::Application> & APP
|
||||
sqlite3 * db
|
||||
) {
|
||||
// Init database
|
||||
DB::SESSION::init(
|
||||
|
|
@ -62,11 +61,6 @@ Browser::Browser(
|
|||
}
|
||||
);
|
||||
|
||||
APP->set_accel_for_action(
|
||||
"win.debug",
|
||||
"<Primary>i"
|
||||
);
|
||||
|
||||
const auto ACTION__MAIN_TAB_APPEND = add_action(
|
||||
"main_tab_append",
|
||||
[this]
|
||||
|
|
@ -75,11 +69,6 @@ Browser::Browser(
|
|||
}
|
||||
);
|
||||
|
||||
APP->set_accel_for_action(
|
||||
"win.main_tab_append",
|
||||
"<Primary>t"
|
||||
);
|
||||
|
||||
const auto ACTION__MAIN_TAB_CLOSE_ACTIVE = add_action(
|
||||
"main_tab_close_active",
|
||||
[this]
|
||||
|
|
@ -92,11 +81,6 @@ Browser::Browser(
|
|||
false
|
||||
);
|
||||
|
||||
APP->set_accel_for_action(
|
||||
"win.main_tab_close_active",
|
||||
"<Primary>Escape"
|
||||
);
|
||||
|
||||
add_action(
|
||||
"main_tab_close_left",
|
||||
[this]
|
||||
|
|
@ -141,11 +125,6 @@ Browser::Browser(
|
|||
false
|
||||
);
|
||||
|
||||
APP->set_accel_for_action(
|
||||
"win.main_tab_page_navigation_reload",
|
||||
"<Primary>r"
|
||||
);
|
||||
|
||||
const auto ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK = add_action(
|
||||
"main_tab_page_navigation_history_back",
|
||||
[this]
|
||||
|
|
@ -158,11 +137,6 @@ Browser::Browser(
|
|||
false
|
||||
);
|
||||
|
||||
APP->set_accel_for_action(
|
||||
"win.main_tab_page_navigation_history_back",
|
||||
"<Primary>Left"
|
||||
);
|
||||
|
||||
const auto ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD = add_action(
|
||||
"main_tab_page_navigation_history_forward",
|
||||
[this]
|
||||
|
|
@ -175,11 +149,6 @@ Browser::Browser(
|
|||
false
|
||||
);
|
||||
|
||||
APP->set_accel_for_action(
|
||||
"win.main_tab_page_navigation_history_forward",
|
||||
"<Primary>Right"
|
||||
);
|
||||
|
||||
const auto ACTION__QUIT = add_action(
|
||||
"quit",
|
||||
[this]
|
||||
|
|
@ -188,11 +157,6 @@ Browser::Browser(
|
|||
}
|
||||
);
|
||||
|
||||
APP->set_accel_for_action(
|
||||
"win.quit",
|
||||
"<Primary>q"
|
||||
);
|
||||
|
||||
// Init widget
|
||||
set_title(
|
||||
_("Yoda")
|
||||
|
|
@ -242,6 +206,43 @@ Browser::Browser(
|
|||
signal_realize().connect(
|
||||
[this]
|
||||
{
|
||||
const auto APP = get_application();
|
||||
|
||||
APP->set_accel_for_action(
|
||||
"win.debug",
|
||||
"<Primary>i"
|
||||
);
|
||||
|
||||
APP->set_accel_for_action(
|
||||
"win.main_tab_append",
|
||||
"<Primary>t"
|
||||
);
|
||||
|
||||
APP->set_accel_for_action(
|
||||
"win.main_tab_close_active",
|
||||
"<Primary>Escape"
|
||||
);
|
||||
|
||||
APP->set_accel_for_action(
|
||||
"win.main_tab_page_navigation_reload",
|
||||
"<Primary>r"
|
||||
);
|
||||
|
||||
APP->set_accel_for_action(
|
||||
"win.main_tab_page_navigation_history_back",
|
||||
"<Primary>Left"
|
||||
);
|
||||
|
||||
APP->set_accel_for_action(
|
||||
"win.main_tab_page_navigation_history_forward",
|
||||
"<Primary>Right"
|
||||
);
|
||||
|
||||
APP->set_accel_for_action(
|
||||
"win.quit",
|
||||
"<Primary>q"
|
||||
);
|
||||
|
||||
restore(); // last session from DB
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -80,8 +80,7 @@ namespace app
|
|||
public:
|
||||
|
||||
Browser(
|
||||
sqlite3 * db,
|
||||
const Glib::RefPtr<Gtk::Application> & APP
|
||||
sqlite3 * db
|
||||
);
|
||||
|
||||
// Actions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue