Browse Source

rename actions

CPP-GTK4
yggverse 3 months ago
parent
commit
eb1f3baf13
  1. 1
      README.md
  2. 94
      src/app/browser.cpp
  3. 36
      src/app/browser/header.cpp
  4. 18
      src/app/browser/header.hpp
  5. 112
      src/app/browser/header/menu.cpp
  6. 18
      src/app/browser/header/menu.hpp
  7. 20
      src/app/browser/main.cpp
  8. 10
      src/app/browser/main.hpp
  9. 14
      src/app/browser/main/tab.cpp
  10. 6
      src/app/browser/main/tab.hpp
  11. 6
      src/app/browser/main/tab/label.cpp
  12. 4
      src/app/browser/main/tab/label.hpp
  13. 12
      src/app/browser/main/tab/page.cpp
  14. 6
      src/app/browser/main/tab/page.hpp
  15. 14
      src/app/browser/main/tab/page/navigation.cpp
  16. 6
      src/app/browser/main/tab/page/navigation.hpp
  17. 8
      src/app/browser/main/tab/page/navigation/history.cpp
  18. 4
      src/app/browser/main/tab/page/navigation/history.hpp
  19. 8
      src/app/browser/main/tab/page/navigation/reload.cpp
  20. 4
      src/app/browser/main/tab/page/navigation/reload.hpp
  21. 6
      src/app/browser/main/tab/page/navigation/request.cpp
  22. 4
      src/app/browser/main/tab/page/navigation/request.hpp

1
README.md

@ -63,6 +63,7 @@ Currently, main application sources located at `src/app` folder, written by foll
* `#include` application `.hpp` files in `.cpp`. For system libraries, use headers only. Do not place system dependencies in `.cpp` * `#include` application `.hpp` files in `.cpp`. For system libraries, use headers only. Do not place system dependencies in `.cpp`
* App interact SQLite database, where table name match related class namespace, it may contain optional feature postfix (separated with double line) * App interact SQLite database, where table name match related class namespace, it may contain optional feature postfix (separated with double line)
* App class tables in database wanted to store user data between app sessions and must contain only fields that related to this class (e.g. private and public variable values); also may contain primary key fields, to their parent (table) according to the namespace hierarchy * App class tables in database wanted to store user data between app sessions and must contain only fields that related to this class (e.g. private and public variable values); also may contain primary key fields, to their parent (table) according to the namespace hierarchy
* Window actions called same as their menu actors. Children widgets operate with `SimpleAction` objects, not name strings (follow encapsulation)
### Environment ### Environment

94
src/app/browser.cpp

@ -47,32 +47,32 @@ Browser::Browser(
} }
); );
const auto ACTION__CLEAN = add_action( const auto ACTION__SESSION_CLEAN = add_action(
"clean", "session_clean",
[this] [this]
{ {
clean(); clean();
} }
); );
const auto ACTION__RESTORE = add_action( const auto ACTION__SESSION_RESTORE = add_action(
"restore", "session_restore",
[this] [this]
{ {
restore(); restore();
} }
); );
const auto ACTION__SAVE = add_action( const auto ACTION__SESSION_SAVE = add_action(
"save", "session_save",
[this] [this]
{ {
save(); save();
} }
); );
const auto ACTION__DEBUG = add_action( const auto ACTION__TOOLS_DEBUG = add_action(
"debug", "tools_debug",
[this] [this]
{ {
// @TODO https://gitlab.gnome.org/GNOME/gtkmm/-/commit/5f3b82537d3daad7bda59dd01e719788070f4b6c // @TODO https://gitlab.gnome.org/GNOME/gtkmm/-/commit/5f3b82537d3daad7bda59dd01e719788070f4b6c
@ -82,28 +82,28 @@ Browser::Browser(
} }
); );
const auto ACTION__MAIN_TAB_APPEND = add_action( const auto ACTION__TAB_APPEND = add_action(
"main_tab_append", "tab_append",
[this] [this]
{ {
browserMain->tab_append(); browserMain->tab_append();
} }
); );
const auto ACTION__MAIN_TAB_CLOSE_ACTIVE = add_action( const auto ACTION__TAB_CLOSE = add_action(
"main_tab_close_active", "tab_close",
[this] [this]
{ {
browserMain->tab_close(); browserMain->tab_close();
} }
); );
ACTION__MAIN_TAB_CLOSE_ACTIVE->set_enabled( ACTION__TAB_CLOSE->set_enabled(
false false
); );
add_action( add_action(
"main_tab_close_left", "tab_close_left",
[this] [this]
{ {
browserMain->tab_close_left(); browserMain->tab_close_left();
@ -113,7 +113,7 @@ Browser::Browser(
); );
add_action( add_action(
"main_tab_close_right", "tab_close_right",
[this] [this]
{ {
browserMain->tab_close_right(); browserMain->tab_close_right();
@ -122,51 +122,51 @@ Browser::Browser(
false false
); );
const auto ACTION__MAIN_TAB_CLOSE_ALL = add_action( const auto ACTION__TAB_CLOSE_ALL = add_action(
"main_tab_close_all", "tab_close_all",
[this] [this]
{ {
browserMain->tab_close_all(); browserMain->tab_close_all();
} }
); );
ACTION__MAIN_TAB_CLOSE_ALL->set_enabled( ACTION__TAB_CLOSE_ALL->set_enabled(
false false
); );
const auto ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD = add_action( const auto ACTION__TAB_PAGE_NAVIGATION_RELOAD = add_action(
"main_tab_page_navigation_reload", "tab_page_navigation_reload",
[this] [this]
{ {
browserMain->tab_page_navigation_reload(); browserMain->tab_page_navigation_reload();
} }
); );
ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD->set_enabled( ACTION__TAB_PAGE_NAVIGATION_RELOAD->set_enabled(
false false
); );
const auto ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK = add_action( const auto ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK = add_action(
"main_tab_page_navigation_history_back", "tab_page_navigation_history_back",
[this] [this]
{ {
browserMain->tab_page_navigation_history_back(); browserMain->tab_page_navigation_history_back();
} }
); );
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK->set_enabled( ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK->set_enabled(
false false
); );
const auto ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD = add_action( const auto ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD = add_action(
"main_tab_page_navigation_history_forward", "tab_page_navigation_history_forward",
[this] [this]
{ {
browserMain->tab_page_navigation_history_forward(); browserMain->tab_page_navigation_history_forward();
} }
); );
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD->set_enabled( ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD->set_enabled(
false false
); );
@ -192,17 +192,17 @@ Browser::Browser(
// Init components // Init components
browserHeader = Gtk::make_managed<browser::Header>( browserHeader = Gtk::make_managed<browser::Header>(
ACTION__DEBUG, ACTION__TOOLS_DEBUG,
ACTION__QUIT, ACTION__QUIT,
ACTION__CLEAN, ACTION__SESSION_CLEAN,
ACTION__RESTORE, ACTION__SESSION_RESTORE,
ACTION__SAVE, ACTION__SESSION_SAVE,
ACTION__MAIN_TAB_APPEND, ACTION__TAB_APPEND,
ACTION__MAIN_TAB_CLOSE_ACTIVE, ACTION__TAB_CLOSE,
ACTION__MAIN_TAB_CLOSE_ALL, ACTION__TAB_CLOSE_ALL,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD ACTION__TAB_PAGE_NAVIGATION_RELOAD
); );
set_titlebar( set_titlebar(
@ -212,11 +212,11 @@ Browser::Browser(
browserMain = Gtk::make_managed<browser::Main>( browserMain = Gtk::make_managed<browser::Main>(
db, db,
ACTION__UPDATE, ACTION__UPDATE,
ACTION__MAIN_TAB_CLOSE_ACTIVE, ACTION__TAB_CLOSE,
ACTION__MAIN_TAB_CLOSE_ALL, ACTION__TAB_CLOSE_ALL,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD ACTION__TAB_PAGE_NAVIGATION_RELOAD
); );
set_child( set_child(
@ -235,27 +235,27 @@ Browser::Browser(
); );
APP->set_accel_for_action( APP->set_accel_for_action(
"win.main_tab_append", "win.tab_append",
"<Primary>t" "<Primary>t"
); );
APP->set_accel_for_action( APP->set_accel_for_action(
"win.main_tab_close_active", "win.tab_close",
"<Primary>Escape" "<Primary>Escape"
); );
APP->set_accel_for_action( APP->set_accel_for_action(
"win.main_tab_page_navigation_reload", "win.tab_page_navigation_reload",
"<Primary>r" "<Primary>r"
); );
APP->set_accel_for_action( APP->set_accel_for_action(
"win.main_tab_page_navigation_history_back", "win.tab_page_navigation_history_back",
"<Primary>Left" "<Primary>Left"
); );
APP->set_accel_for_action( APP->set_accel_for_action(
"win.main_tab_page_navigation_history_forward", "win.tab_page_navigation_history_forward",
"<Primary>Right" "<Primary>Right"
); );

36
src/app/browser/header.cpp

@ -8,15 +8,15 @@ using namespace app::browser;
Header::Header( Header::Header(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__DEBUG, const Glib::RefPtr<Gio::SimpleAction> & ACTION__DEBUG,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__QUIT, const Glib::RefPtr<Gio::SimpleAction> & ACTION__QUIT,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__CLEAN, const Glib::RefPtr<Gio::SimpleAction> & ACTION__SESSION_CLEAN,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__RESTORE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__SESSION_RESTORE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__SAVE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__SESSION_SAVE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_APPEND, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_APPEND,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ACTIVE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE_ALL,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
) { ) {
// Init widget // Init widget
set_show_title_buttons( set_show_title_buttons(
@ -27,15 +27,15 @@ Header::Header(
headerMenu = Gtk::make_managed<header::Menu>( headerMenu = Gtk::make_managed<header::Menu>(
ACTION__DEBUG, ACTION__DEBUG,
ACTION__QUIT, ACTION__QUIT,
ACTION__CLEAN, ACTION__SESSION_CLEAN,
ACTION__RESTORE, ACTION__SESSION_RESTORE,
ACTION__SAVE, ACTION__SESSION_SAVE,
ACTION__MAIN_TAB_APPEND, ACTION__TAB_APPEND,
ACTION__MAIN_TAB_CLOSE_ACTIVE, ACTION__TAB_CLOSE,
ACTION__MAIN_TAB_CLOSE_ALL, ACTION__TAB_CLOSE_ALL,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD ACTION__TAB_PAGE_NAVIGATION_RELOAD
); );
pack_start( pack_start(

18
src/app/browser/header.hpp

@ -31,15 +31,15 @@ namespace app::browser
Header( Header(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__DEBUG, const Glib::RefPtr<Gio::SimpleAction> & ACTION__DEBUG,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__QUIT, const Glib::RefPtr<Gio::SimpleAction> & ACTION__QUIT,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__CLEAN, const Glib::RefPtr<Gio::SimpleAction> & ACTION__SESSION_CLEAN,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__RESTORE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__SESSION_RESTORE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__SAVE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__SESSION_SAVE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_APPEND, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_APPEND,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ACTIVE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE_ALL,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
); );
void update( void update(

112
src/app/browser/header/menu.cpp

@ -5,15 +5,15 @@ using namespace app::browser::header;
Menu::Menu( Menu::Menu(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__DEBUG, const Glib::RefPtr<Gio::SimpleAction> & ACTION__DEBUG,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__QUIT, const Glib::RefPtr<Gio::SimpleAction> & ACTION__QUIT,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__CLEAN, const Glib::RefPtr<Gio::SimpleAction> & ACTION__SESSION_CLEAN,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__RESTORE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__SESSION_RESTORE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__SAVE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__SESSION_SAVE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_APPEND, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_APPEND,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ACTIVE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE_ALL,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
) { ) {
// Init widget // Init widget
set_tooltip_text( set_tooltip_text(
@ -21,144 +21,144 @@ Menu::Menu(
); );
// Init components @TODO make builder // Init components @TODO make builder
const auto MENU__MAIN = Gio::Menu::create(); const auto MENU = Gio::Menu::create();
const auto MENU__MAIN_SESSION = Gio::Menu::create(); const auto MENU__SESSION = Gio::Menu::create();
MENU__MAIN_SESSION->append( MENU__SESSION->append(
_("Clean"), _("Clean"),
get_action_detailed_name( get_action_detailed_name(
ACTION__CLEAN ACTION__SESSION_CLEAN
) )
); );
MENU__MAIN_SESSION->append( MENU__SESSION->append(
_("Restore"), _("Restore"),
get_action_detailed_name( get_action_detailed_name(
ACTION__RESTORE ACTION__SESSION_RESTORE
) )
); );
MENU__MAIN_SESSION->append( MENU__SESSION->append(
_("Save"), _("Save"),
get_action_detailed_name( get_action_detailed_name(
ACTION__SAVE ACTION__SESSION_SAVE
) )
); );
MENU__MAIN->append_submenu( MENU->append_submenu(
_("Session"), _("Session"),
MENU__MAIN_SESSION MENU__SESSION
); );
const auto MENU__MAIN_TAB = Gio::Menu::create(); const auto MENU__TAB = Gio::Menu::create();
MENU__MAIN_TAB->append( MENU__TAB->append(
_("New.."), _("New.."),
get_action_detailed_name( get_action_detailed_name(
ACTION__MAIN_TAB_APPEND ACTION__TAB_APPEND
) )
); );
const auto MENU__MAIN_TAB_PAGE = Gio::Menu::create(); const auto MENU__TAB_PAGE = Gio::Menu::create();
const auto MENU__MAIN_TAB_PAGE_NAVIGATION = Gio::Menu::create(); const auto MENU__TAB_PAGE_NAVIGATION = Gio::Menu::create();
const auto MENU__MAIN_TAB_PAGE_NAVIGATION_HISTORY = Gio::Menu::create(); const auto MENU__TAB_PAGE_NAVIGATION_HISTORY = Gio::Menu::create();
MENU__MAIN_TAB_PAGE_NAVIGATION_HISTORY->append( MENU__TAB_PAGE_NAVIGATION_HISTORY->append(
_("Back"), _("Back"),
get_action_detailed_name( get_action_detailed_name(
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK
) )
); );
MENU__MAIN_TAB_PAGE_NAVIGATION_HISTORY->append( MENU__TAB_PAGE_NAVIGATION_HISTORY->append(
_("Forward"), _("Forward"),
get_action_detailed_name( get_action_detailed_name(
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD
) )
); );
MENU__MAIN_TAB_PAGE_NAVIGATION->append_submenu( MENU__TAB_PAGE_NAVIGATION->append_submenu(
_("History"), _("History"),
MENU__MAIN_TAB_PAGE_NAVIGATION_HISTORY MENU__TAB_PAGE_NAVIGATION_HISTORY
); );
MENU__MAIN_TAB_PAGE_NAVIGATION->append( MENU__TAB_PAGE_NAVIGATION->append(
_("Reload"), _("Reload"),
get_action_detailed_name( get_action_detailed_name(
ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD ACTION__TAB_PAGE_NAVIGATION_RELOAD
) )
); );
MENU__MAIN_TAB_PAGE->append_submenu( MENU__TAB_PAGE->append_submenu(
_("Navigation"), _("Navigation"),
MENU__MAIN_TAB_PAGE_NAVIGATION MENU__TAB_PAGE_NAVIGATION
); );
MENU__MAIN_TAB->append_submenu( MENU__TAB->append_submenu(
_("Page"), _("Page"),
MENU__MAIN_TAB_PAGE MENU__TAB_PAGE
); );
const auto MENU__MAIN_TAB_CLOSE = Gio::Menu::create(); const auto MENU__TAB_CLOSE = Gio::Menu::create();
MENU__MAIN_TAB_CLOSE->append( MENU__TAB_CLOSE->append(
_("Active tab"), _("Active tab"),
get_action_detailed_name( get_action_detailed_name(
ACTION__MAIN_TAB_CLOSE_ACTIVE ACTION__TAB_CLOSE
) )
); );
// @TODO // @TODO
/* /*
MENU__MAIN_TAB_CLOSE->append( MENU__TAB_CLOSE->append(
_("All tabs to left"), _("All tabs to left"),
get_action_detailed_name( get_action_detailed_name(
ACTION__MAIN_TAB_CLOSE_LEFT ACTION__TAB_CLOSE_LEFT
) )
); );
MENU__MAIN_TAB_CLOSE->append( MENU__TAB_CLOSE->append(
_("All tabs to right"), _("All tabs to right"),
get_action_detailed_name( get_action_detailed_name(
ACTION__MAIN_TAB_CLOSE_RIGHT ACTION__TAB_CLOSE_RIGHT
) )
); );
*/ */
MENU__MAIN_TAB_CLOSE->append( MENU__TAB_CLOSE->append(
_("All tabs"), _("All tabs"),
get_action_detailed_name( get_action_detailed_name(
ACTION__MAIN_TAB_CLOSE_ALL ACTION__TAB_CLOSE_ALL
) )
); );
MENU__MAIN_TAB->append_submenu( MENU__TAB->append_submenu(
_("Close"), _("Close"),
MENU__MAIN_TAB_CLOSE MENU__TAB_CLOSE
); );
MENU__MAIN->append_submenu( MENU->append_submenu(
_("Tab"), _("Tab"),
MENU__MAIN_TAB MENU__TAB
); );
const auto MENU__MAIN_TOOLS = Gio::Menu::create(); const auto MENU__TOOLS = Gio::Menu::create();
MENU__MAIN_TOOLS->append( MENU__TOOLS->append(
_("Debug"), _("Debug"),
get_action_detailed_name( get_action_detailed_name(
ACTION__DEBUG ACTION__DEBUG
) )
); );
MENU__MAIN->append_submenu( MENU->append_submenu(
_("Tools"), _("Tools"),
MENU__MAIN_TOOLS MENU__TOOLS
); );
MENU__MAIN->append( MENU->append(
_("Quit"), _("Quit"),
get_action_detailed_name( get_action_detailed_name(
ACTION__QUIT ACTION__QUIT
@ -166,7 +166,7 @@ Menu::Menu(
); );
set_menu_model( set_menu_model(
MENU__MAIN MENU
); );
} }

18
src/app/browser/header/menu.hpp

@ -20,15 +20,15 @@ namespace app::browser::header
Menu( Menu(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__DEBUG, const Glib::RefPtr<Gio::SimpleAction> & ACTION__DEBUG,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__QUIT, const Glib::RefPtr<Gio::SimpleAction> & ACTION__QUIT,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__CLEAN, const Glib::RefPtr<Gio::SimpleAction> & ACTION__SESSION_CLEAN,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__RESTORE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__SESSION_RESTORE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__SAVE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__SESSION_SAVE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_APPEND, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_APPEND,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ACTIVE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE_ALL,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
); );
}; };
} }

20
src/app/browser/main.cpp

@ -6,11 +6,11 @@ using namespace app::browser;
Main::Main( Main::Main(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ACTIVE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE_ALL,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
) { ) {
// Init database // Init database
DB::SESSION::init( DB::SESSION::init(
@ -30,11 +30,11 @@ Main::Main(
mainTab = Gtk::make_managed<main::Tab>( mainTab = Gtk::make_managed<main::Tab>(
db, db,
ACTION__UPDATE, ACTION__UPDATE,
ACTION__MAIN_TAB_CLOSE_ACTIVE, ACTION__TAB_CLOSE,
ACTION__MAIN_TAB_CLOSE_ALL, ACTION__TAB_CLOSE_ALL,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD ACTION__TAB_PAGE_NAVIGATION_RELOAD
); );
append( append(

10
src/app/browser/main.hpp

@ -76,11 +76,11 @@ namespace app::browser
Main( Main(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ACTIVE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE_ALL,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
); );
// Actions // Actions

14
src/app/browser/main/tab.cpp

@ -7,8 +7,8 @@ using namespace app::browser::main;
Tab::Tab( Tab::Tab(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE_ACTIVE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE_ALL,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
@ -20,8 +20,8 @@ Tab::Tab(
// Init actions // Init actions
action__update = ACTION__UPDATE; action__update = ACTION__UPDATE;
action__tab_close_active = ACTION__TAB_CLOSE_ACTIVE; action__tab_close = ACTION__TAB_CLOSE;
action__tab_close_all = ACTION__MAIN_TAB_CLOSE_ALL; action__tab_close_all = ACTION__TAB_CLOSE_ALL;
action__tab_page_navigation_history_back = ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK; action__tab_page_navigation_history_back = ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK;
action__tab_page_navigation_history_forward = ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD; action__tab_page_navigation_history_forward = ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD;
action__tab_page_navigation_reload = ACTION__TAB_PAGE_NAVIGATION_RELOAD; action__tab_page_navigation_reload = ACTION__TAB_PAGE_NAVIGATION_RELOAD;
@ -157,7 +157,7 @@ void Tab::update(
); );
// Update tab actions status // Update tab actions status
action__tab_close_active->set_enabled( action__tab_close->set_enabled(
get_n_pages() > 0 get_n_pages() > 0
); );
@ -188,7 +188,7 @@ void Tab::update(
); );
// Update tab actions status // Update tab actions status
action__tab_close_active->set_enabled( action__tab_close->set_enabled(
get_n_pages() > 0 get_n_pages() > 0
); );
@ -215,7 +215,7 @@ int Tab::append(
const auto TAB_LABEL = new tab::Label( // @TODO manage const auto TAB_LABEL = new tab::Label( // @TODO manage
db, db,
action__tab_close_active action__tab_close
); );
const int PAGE_NUMBER = append_page( const int PAGE_NUMBER = append_page(

6
src/app/browser/main/tab.hpp

@ -68,7 +68,7 @@ namespace app::browser::main
// Actions // Actions
Glib::RefPtr<Gio::SimpleAction> action__update, Glib::RefPtr<Gio::SimpleAction> action__update,
action__tab_close_active, action__tab_close,
action__tab_close_all, action__tab_close_all,
action__tab_page_navigation_history_back, action__tab_page_navigation_history_back,
action__tab_page_navigation_history_forward, action__tab_page_navigation_history_forward,
@ -86,8 +86,8 @@ namespace app::browser::main
Tab( Tab(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE_ACTIVE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE_ALL,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD

6
src/app/browser/main/tab/label.cpp

@ -4,7 +4,7 @@ using namespace app::browser::main::tab;
Label::Label( Label::Label(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__CLOSE_ACTIVE const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE
) { ) {
// Init database // Init database
DB::SESSION::init( DB::SESSION::init(
@ -12,7 +12,7 @@ Label::Label(
); );
// Init actions // Init actions
action__close_active = ACTION__CLOSE_ACTIVE; action__tab_close = ACTION__TAB_CLOSE;
// Setup label controller // Setup label controller
auto GtkGestureClick = Gtk::GestureClick::create(); auto GtkGestureClick = Gtk::GestureClick::create();
@ -27,7 +27,7 @@ Label::Label(
{ {
if (n == 2) // double click if (n == 2) // double click
{ {
action__close_active->activate(); action__tab_close->activate();
} }
} }
); );

4
src/app/browser/main/tab/label.hpp

@ -59,7 +59,7 @@ namespace app::browser::main::tab
sqlite3 * db; sqlite3 * db;
// Actions // Actions
Glib::RefPtr<Gio::SimpleAction> action__close_active; Glib::RefPtr<Gio::SimpleAction> action__tab_close;
/* /*
* Class API * Class API
@ -68,7 +68,7 @@ namespace app::browser::main::tab
Label( Label(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__CLOSE_ACTIVE const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE
); );
// Actions // Actions

12
src/app/browser/main/tab/page.cpp

@ -10,9 +10,9 @@ Page::Page(
const Glib::ustring & TITLE, const Glib::ustring & TITLE,
const Glib::ustring & DESCRIPTION, const Glib::ustring & DESCRIPTION,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
) { ) {
// Init meta // Init meta
mime = MIME; mime = MIME;
@ -37,9 +37,9 @@ Page::Page(
pageNavigation = Gtk::make_managed<page::Navigation>( pageNavigation = Gtk::make_managed<page::Navigation>(
this->db, this->db,
ACTION__UPDATE, ACTION__UPDATE,
ACTION__PAGE_NAVIGATION_HISTORY_BACK, ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
ACTION__PAGE_NAVIGATION_HISTORY_FORWARD, ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
ACTION__PAGE_NAVIGATION_RELOAD ACTION__TAB_PAGE_NAVIGATION_RELOAD
); );
append( append(

6
src/app/browser/main/tab/page.hpp

@ -117,9 +117,9 @@ namespace app::browser::main::tab
const Glib::ustring & TITLE, const Glib::ustring & TITLE,
const Glib::ustring & DESCRIPTION, const Glib::ustring & DESCRIPTION,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
); );
// Actions // Actions

14
src/app/browser/main/tab/page/navigation.cpp

@ -10,9 +10,9 @@ using namespace app::browser::main::tab::page;
Navigation::Navigation( Navigation::Navigation(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_BACK, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
) { ) {
// Init database // Init database
DB::SESSION::init( DB::SESSION::init(
@ -53,8 +53,8 @@ Navigation::Navigation(
navigationHistory = Gtk::make_managed<navigation::History>( navigationHistory = Gtk::make_managed<navigation::History>(
db, db,
ACTION__NAVIGATION_HISTORY_BACK, ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
ACTION__NAVIGATION_HISTORY_FORWARD ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD
); );
append( append(
@ -62,7 +62,7 @@ Navigation::Navigation(
); );
navigationReload = Gtk::make_managed<navigation::Reload>( navigationReload = Gtk::make_managed<navigation::Reload>(
ACTION__NAVIGATION_RELOAD ACTION__TAB_PAGE_NAVIGATION_RELOAD
); );
append( append(
@ -72,7 +72,7 @@ Navigation::Navigation(
navigationRequest = Gtk::make_managed<navigation::Request>( navigationRequest = Gtk::make_managed<navigation::Request>(
db, db,
ACTION__UPDATE, ACTION__UPDATE,
ACTION__NAVIGATION_RELOAD ACTION__TAB_PAGE_NAVIGATION_RELOAD
); );
append( append(

6
src/app/browser/main/tab/page/navigation.hpp

@ -83,9 +83,9 @@ namespace app::browser::main::tab::page
Navigation( Navigation(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_BACK, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
); );
// Actions // Actions

8
src/app/browser/main/tab/page/navigation/history.cpp

@ -6,8 +6,8 @@ using namespace app::browser::main::tab::page::navigation;
History::History( History::History(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__HISTORY_BACK, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__HISTORY_FORWARD const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD
) { ) {
// Init database // Init database
DB::SESSION::init( DB::SESSION::init(
@ -20,7 +20,7 @@ History::History(
); );
historyBack = Gtk::make_managed<history::Back>( historyBack = Gtk::make_managed<history::Back>(
ACTION__HISTORY_BACK ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK
); );
append( append(
@ -28,7 +28,7 @@ History::History(
); );
historyForward = Gtk::make_managed<history::Forward>( historyForward = Gtk::make_managed<history::Forward>(
ACTION__HISTORY_FORWARD ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD
); );
append( append(

4
src/app/browser/main/tab/page/navigation/history.hpp

@ -92,8 +92,8 @@ namespace app::browser::main::tab::page::navigation
History( History(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__HISTORY_BACK, const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__HISTORY_FORWARD const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD
); );
// Actions // Actions

8
src/app/browser/main/tab/page/navigation/reload.cpp

@ -3,10 +3,10 @@
using namespace app::browser::main::tab::page::navigation; using namespace app::browser::main::tab::page::navigation;
Reload::Reload( Reload::Reload(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
) { ) {
// Init actions // Init actions
action__reload = ACTION__RELOAD; action__tab_page_navigation_reload = ACTION__TAB_PAGE_NAVIGATION_RELOAD;
// Init widget // Init widget
set_icon_name( set_icon_name(
@ -24,7 +24,7 @@ Reload::Reload(
signal_clicked().connect( signal_clicked().connect(
[this] [this]
{ {
action__reload->activate(); action__tab_page_navigation_reload->activate();
} }
); );
} }
@ -36,7 +36,7 @@ void Reload::update(
IS_ENABLED IS_ENABLED
); );
action__reload->set_enabled( action__tab_page_navigation_reload->set_enabled(
IS_ENABLED IS_ENABLED
); );
} }

4
src/app/browser/main/tab/page/navigation/reload.hpp

@ -10,12 +10,12 @@ namespace app::browser::main::tab::page::navigation
{ {
class Reload : public Gtk::Button class Reload : public Gtk::Button
{ {
Glib::RefPtr<Gio::SimpleAction> action__reload; Glib::RefPtr<Gio::SimpleAction> action__tab_page_navigation_reload;
public: public:
Reload( Reload(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
); );
void update( void update(

6
src/app/browser/main/tab/page/navigation/request.cpp

@ -6,7 +6,7 @@ using namespace app::browser::main::tab::page::navigation;
Request::Request( Request::Request(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
) { ) {
// Init database // Init database
DB::SESSION::init( DB::SESSION::init(
@ -15,7 +15,7 @@ Request::Request(
// Init actions // Init actions
action__update = ACTION__UPDATE; action__update = ACTION__UPDATE;
action__reload = ACTION__RELOAD; action__tab_page_navigation_reload = ACTION__TAB_PAGE_NAVIGATION_RELOAD;
// Init extras // Init extras
progress_fraction = 0; progress_fraction = 0;
@ -44,7 +44,7 @@ Request::Request(
signal_activate().connect( signal_activate().connect(
[this] [this]
{ {
action__reload->activate(); action__tab_page_navigation_reload->activate();
} }
); );
} }

4
src/app/browser/main/tab/page/navigation/request.hpp

@ -62,7 +62,7 @@ namespace app::browser::main::tab::page::navigation
// Actions // Actions
Glib::RefPtr<Gio::SimpleAction> action__update, Glib::RefPtr<Gio::SimpleAction> action__update,
action__reload; action__tab_page_navigation_reload;
// Extras // Extras
double progress_fraction; double progress_fraction;
@ -81,7 +81,7 @@ namespace app::browser::main::tab::page::navigation
Request( Request(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE, const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
); );
// Actions // Actions

Loading…
Cancel
Save