|
|
@ -5,7 +5,7 @@ |
|
|
|
using namespace app; |
|
|
|
using namespace app; |
|
|
|
|
|
|
|
|
|
|
|
Browser::Browser( |
|
|
|
Browser::Browser( |
|
|
|
//const Glib::RefPtr<Gtk::Application> & app,
|
|
|
|
const Glib::RefPtr<Gtk::Application> & APP |
|
|
|
//const std::shared_ptr<lib::Database> & db
|
|
|
|
//const std::shared_ptr<lib::Database> & db
|
|
|
|
) { |
|
|
|
) { |
|
|
|
// Init window actions
|
|
|
|
// Init window actions
|
|
|
@ -33,80 +33,112 @@ Browser::Browser( |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Tab actions
|
|
|
|
APP->set_accel_for_action( |
|
|
|
add_action( |
|
|
|
"win.debug", |
|
|
|
"main_tab_append", |
|
|
|
"<Primary>i" |
|
|
|
[this] |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
browserMain->tab_append(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const auto ACTION__MAIN_TAB_CLOSE = add_action( |
|
|
|
add_action( |
|
|
|
"main_tab_close", |
|
|
|
"main_tab_append", |
|
|
|
[this] |
|
|
|
[this] |
|
|
|
{ |
|
|
|
{ |
|
|
|
browserMain->tab_close(); |
|
|
|
browserMain->tab_append(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
APP->set_accel_for_action( |
|
|
|
|
|
|
|
"win.main_tab_append", |
|
|
|
|
|
|
|
"<Primary>t" |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
add_action( |
|
|
|
const auto ACTION__MAIN_TAB_CLOSE = add_action( |
|
|
|
"main_tab_close_left", |
|
|
|
"main_tab_close", |
|
|
|
|
|
|
|
[this] |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
browserMain->tab_close(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
add_action( |
|
|
|
|
|
|
|
"main_tab_close_left", |
|
|
|
|
|
|
|
[this] |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
browserMain->tab_close_left(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
)->set_enabled( |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
add_action( |
|
|
|
|
|
|
|
"main_tab_close_right", |
|
|
|
|
|
|
|
[this] |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
browserMain->tab_close_right(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
)->set_enabled( |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
add_action( |
|
|
|
|
|
|
|
"main_tab_close_all", |
|
|
|
|
|
|
|
[this] |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
browserMain->tab_close_all(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
)->set_enabled( |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Tab page navigation actions
|
|
|
|
|
|
|
|
const auto ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE = add_action( |
|
|
|
|
|
|
|
"main_tab_page_navigation_update", |
|
|
|
[this] |
|
|
|
[this] |
|
|
|
{ |
|
|
|
{ |
|
|
|
browserMain->tab_close_left(); |
|
|
|
browserMain->tab_page_navigation_update(); |
|
|
|
} |
|
|
|
} |
|
|
|
)->set_enabled( |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
add_action( |
|
|
|
ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE->set_enabled( |
|
|
|
"main_tab_close_right", |
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
APP->set_accel_for_action( |
|
|
|
|
|
|
|
"win.main_tab_page_navigation_update", |
|
|
|
|
|
|
|
"<Primary>r" |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const auto ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK = add_action( |
|
|
|
|
|
|
|
"main_tab_page_navigation_history_back", |
|
|
|
[this] |
|
|
|
[this] |
|
|
|
{ |
|
|
|
{ |
|
|
|
browserMain->tab_close_right(); |
|
|
|
browserMain->tab_page_navigation_history_back(); |
|
|
|
} |
|
|
|
} |
|
|
|
)->set_enabled( |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
add_action( |
|
|
|
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK->set_enabled( |
|
|
|
"main_tab_close_all", |
|
|
|
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] |
|
|
|
[this] |
|
|
|
{ |
|
|
|
{ |
|
|
|
browserMain->tab_close_all(); |
|
|
|
browserMain->tab_page_navigation_history_forward(); |
|
|
|
} |
|
|
|
} |
|
|
|
)->set_enabled( |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Tab page navigation actions
|
|
|
|
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD->set_enabled( |
|
|
|
const auto ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE = add_action( |
|
|
|
false |
|
|
|
"main_tab_page_navigation_update", |
|
|
|
|
|
|
|
[this] |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
browserMain->tab_page_navigation_update(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE->set_enabled( |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const auto ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK = add_action( |
|
|
|
|
|
|
|
"main_tab_page_navigation_history_back", |
|
|
|
|
|
|
|
[this] |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
browserMain->tab_page_navigation_history_back(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const auto ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD = add_action( |
|
|
|
APP->set_accel_for_action( |
|
|
|
"main_tab_page_navigation_history_forward", |
|
|
|
"win.main_tab_page_navigation_history_forward", |
|
|
|
[this] |
|
|
|
"<Primary>Right" |
|
|
|
{ |
|
|
|
|
|
|
|
browserMain->tab_page_navigation_history_forward(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Init widget
|
|
|
|
// Init widget
|
|
|
|