From eb1f3baf130d304dbd26a51d0a9577ad540a7e6c Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 15 Sep 2024 09:51:58 +0300 Subject: [PATCH] rename actions --- README.md | 1 + src/app/browser.cpp | 94 +++++++-------- src/app/browser/header.cpp | 36 +++--- src/app/browser/header.hpp | 18 +-- src/app/browser/header/menu.cpp | 112 +++++++++--------- src/app/browser/header/menu.hpp | 18 +-- src/app/browser/main.cpp | 20 ++-- src/app/browser/main.hpp | 10 +- src/app/browser/main/tab.cpp | 14 +-- src/app/browser/main/tab.hpp | 6 +- src/app/browser/main/tab/label.cpp | 6 +- src/app/browser/main/tab/label.hpp | 4 +- src/app/browser/main/tab/page.cpp | 12 +- src/app/browser/main/tab/page.hpp | 6 +- src/app/browser/main/tab/page/navigation.cpp | 14 +-- src/app/browser/main/tab/page/navigation.hpp | 6 +- .../main/tab/page/navigation/history.cpp | 8 +- .../main/tab/page/navigation/history.hpp | 4 +- .../main/tab/page/navigation/reload.cpp | 8 +- .../main/tab/page/navigation/reload.hpp | 4 +- .../main/tab/page/navigation/request.cpp | 6 +- .../main/tab/page/navigation/request.hpp | 4 +- 22 files changed, 206 insertions(+), 205 deletions(-) diff --git a/README.md b/README.md index 4f085c6b..32952966 100644 --- a/README.md +++ b/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` * 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 +* Window actions called same as their menu actors. Children widgets operate with `SimpleAction` objects, not name strings (follow encapsulation) ### Environment diff --git a/src/app/browser.cpp b/src/app/browser.cpp index 5169f4be..aba23989 100644 --- a/src/app/browser.cpp +++ b/src/app/browser.cpp @@ -47,32 +47,32 @@ Browser::Browser( } ); - const auto ACTION__CLEAN = add_action( - "clean", + const auto ACTION__SESSION_CLEAN = add_action( + "session_clean", [this] { clean(); } ); - const auto ACTION__RESTORE = add_action( - "restore", + const auto ACTION__SESSION_RESTORE = add_action( + "session_restore", [this] { restore(); } ); - const auto ACTION__SAVE = add_action( - "save", + const auto ACTION__SESSION_SAVE = add_action( + "session_save", [this] { save(); } ); - const auto ACTION__DEBUG = add_action( - "debug", + const auto ACTION__TOOLS_DEBUG = add_action( + "tools_debug", [this] { // @TODO https://gitlab.gnome.org/GNOME/gtkmm/-/commit/5f3b82537d3daad7bda59dd01e719788070f4b6c @@ -82,28 +82,28 @@ Browser::Browser( } ); - const auto ACTION__MAIN_TAB_APPEND = add_action( - "main_tab_append", + const auto ACTION__TAB_APPEND = add_action( + "tab_append", [this] { browserMain->tab_append(); } ); - const auto ACTION__MAIN_TAB_CLOSE_ACTIVE = add_action( - "main_tab_close_active", + const auto ACTION__TAB_CLOSE = add_action( + "tab_close", [this] { browserMain->tab_close(); } ); - ACTION__MAIN_TAB_CLOSE_ACTIVE->set_enabled( + ACTION__TAB_CLOSE->set_enabled( false ); add_action( - "main_tab_close_left", + "tab_close_left", [this] { browserMain->tab_close_left(); @@ -113,7 +113,7 @@ Browser::Browser( ); add_action( - "main_tab_close_right", + "tab_close_right", [this] { browserMain->tab_close_right(); @@ -122,51 +122,51 @@ Browser::Browser( false ); - const auto ACTION__MAIN_TAB_CLOSE_ALL = add_action( - "main_tab_close_all", + const auto ACTION__TAB_CLOSE_ALL = add_action( + "tab_close_all", [this] { browserMain->tab_close_all(); } ); - ACTION__MAIN_TAB_CLOSE_ALL->set_enabled( + ACTION__TAB_CLOSE_ALL->set_enabled( false ); - const auto ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD = add_action( - "main_tab_page_navigation_reload", + const auto ACTION__TAB_PAGE_NAVIGATION_RELOAD = add_action( + "tab_page_navigation_reload", [this] { browserMain->tab_page_navigation_reload(); } ); - ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD->set_enabled( + ACTION__TAB_PAGE_NAVIGATION_RELOAD->set_enabled( false ); - const auto ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK = add_action( - "main_tab_page_navigation_history_back", + const auto ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK = add_action( + "tab_page_navigation_history_back", [this] { browserMain->tab_page_navigation_history_back(); } ); - ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK->set_enabled( + ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK->set_enabled( false ); - const auto ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD = add_action( - "main_tab_page_navigation_history_forward", + const auto ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD = add_action( + "tab_page_navigation_history_forward", [this] { browserMain->tab_page_navigation_history_forward(); } ); - ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD->set_enabled( + ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD->set_enabled( false ); @@ -192,17 +192,17 @@ Browser::Browser( // Init components browserHeader = Gtk::make_managed( - ACTION__DEBUG, + ACTION__TOOLS_DEBUG, ACTION__QUIT, - ACTION__CLEAN, - ACTION__RESTORE, - ACTION__SAVE, - ACTION__MAIN_TAB_APPEND, - ACTION__MAIN_TAB_CLOSE_ACTIVE, - ACTION__MAIN_TAB_CLOSE_ALL, - ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, - ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, - ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD + ACTION__SESSION_CLEAN, + ACTION__SESSION_RESTORE, + ACTION__SESSION_SAVE, + ACTION__TAB_APPEND, + ACTION__TAB_CLOSE, + ACTION__TAB_CLOSE_ALL, + ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, + ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, + ACTION__TAB_PAGE_NAVIGATION_RELOAD ); set_titlebar( @@ -212,11 +212,11 @@ Browser::Browser( browserMain = Gtk::make_managed( db, ACTION__UPDATE, - ACTION__MAIN_TAB_CLOSE_ACTIVE, - ACTION__MAIN_TAB_CLOSE_ALL, - ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, - ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, - ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD + ACTION__TAB_CLOSE, + ACTION__TAB_CLOSE_ALL, + ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, + ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, + ACTION__TAB_PAGE_NAVIGATION_RELOAD ); set_child( @@ -235,27 +235,27 @@ Browser::Browser( ); APP->set_accel_for_action( - "win.main_tab_append", + "win.tab_append", "t" ); APP->set_accel_for_action( - "win.main_tab_close_active", + "win.tab_close", "Escape" ); APP->set_accel_for_action( - "win.main_tab_page_navigation_reload", + "win.tab_page_navigation_reload", "r" ); APP->set_accel_for_action( - "win.main_tab_page_navigation_history_back", + "win.tab_page_navigation_history_back", "Left" ); APP->set_accel_for_action( - "win.main_tab_page_navigation_history_forward", + "win.tab_page_navigation_history_forward", "Right" ); diff --git a/src/app/browser/header.cpp b/src/app/browser/header.cpp index 15a1c612..32d819b9 100644 --- a/src/app/browser/header.cpp +++ b/src/app/browser/header.cpp @@ -8,15 +8,15 @@ using namespace app::browser; Header::Header( const Glib::RefPtr & ACTION__DEBUG, const Glib::RefPtr & ACTION__QUIT, - const Glib::RefPtr & ACTION__CLEAN, - const Glib::RefPtr & ACTION__RESTORE, - const Glib::RefPtr & ACTION__SAVE, - const Glib::RefPtr & ACTION__MAIN_TAB_APPEND, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ACTIVE, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ALL, - const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, - const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, - const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD + const Glib::RefPtr & ACTION__SESSION_CLEAN, + const Glib::RefPtr & ACTION__SESSION_RESTORE, + const Glib::RefPtr & ACTION__SESSION_SAVE, + const Glib::RefPtr & ACTION__TAB_APPEND, + const Glib::RefPtr & ACTION__TAB_CLOSE, + const Glib::RefPtr & ACTION__TAB_CLOSE_ALL, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_RELOAD ) { // Init widget set_show_title_buttons( @@ -27,15 +27,15 @@ Header::Header( headerMenu = Gtk::make_managed( ACTION__DEBUG, ACTION__QUIT, - ACTION__CLEAN, - ACTION__RESTORE, - ACTION__SAVE, - ACTION__MAIN_TAB_APPEND, - ACTION__MAIN_TAB_CLOSE_ACTIVE, - ACTION__MAIN_TAB_CLOSE_ALL, - ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, - ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, - ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD + ACTION__SESSION_CLEAN, + ACTION__SESSION_RESTORE, + ACTION__SESSION_SAVE, + ACTION__TAB_APPEND, + ACTION__TAB_CLOSE, + ACTION__TAB_CLOSE_ALL, + ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, + ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, + ACTION__TAB_PAGE_NAVIGATION_RELOAD ); pack_start( diff --git a/src/app/browser/header.hpp b/src/app/browser/header.hpp index e661b0c8..be7c8341 100644 --- a/src/app/browser/header.hpp +++ b/src/app/browser/header.hpp @@ -31,15 +31,15 @@ namespace app::browser Header( const Glib::RefPtr & ACTION__DEBUG, const Glib::RefPtr & ACTION__QUIT, - const Glib::RefPtr & ACTION__CLEAN, - const Glib::RefPtr & ACTION__RESTORE, - const Glib::RefPtr & ACTION__SAVE, - const Glib::RefPtr & ACTION__MAIN_TAB_APPEND, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ACTIVE, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ALL, - const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, - const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, - const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD + const Glib::RefPtr & ACTION__SESSION_CLEAN, + const Glib::RefPtr & ACTION__SESSION_RESTORE, + const Glib::RefPtr & ACTION__SESSION_SAVE, + const Glib::RefPtr & ACTION__TAB_APPEND, + const Glib::RefPtr & ACTION__TAB_CLOSE, + const Glib::RefPtr & ACTION__TAB_CLOSE_ALL, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_RELOAD ); void update( diff --git a/src/app/browser/header/menu.cpp b/src/app/browser/header/menu.cpp index 125b3dcc..21cf3a78 100644 --- a/src/app/browser/header/menu.cpp +++ b/src/app/browser/header/menu.cpp @@ -5,15 +5,15 @@ using namespace app::browser::header; Menu::Menu( const Glib::RefPtr & ACTION__DEBUG, const Glib::RefPtr & ACTION__QUIT, - const Glib::RefPtr & ACTION__CLEAN, - const Glib::RefPtr & ACTION__RESTORE, - const Glib::RefPtr & ACTION__SAVE, - const Glib::RefPtr & ACTION__MAIN_TAB_APPEND, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ACTIVE, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ALL, - const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, - const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, - const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD + const Glib::RefPtr & ACTION__SESSION_CLEAN, + const Glib::RefPtr & ACTION__SESSION_RESTORE, + const Glib::RefPtr & ACTION__SESSION_SAVE, + const Glib::RefPtr & ACTION__TAB_APPEND, + const Glib::RefPtr & ACTION__TAB_CLOSE, + const Glib::RefPtr & ACTION__TAB_CLOSE_ALL, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_RELOAD ) { // Init widget set_tooltip_text( @@ -21,144 +21,144 @@ Menu::Menu( ); // 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"), get_action_detailed_name( - ACTION__CLEAN + ACTION__SESSION_CLEAN ) ); - MENU__MAIN_SESSION->append( + MENU__SESSION->append( _("Restore"), get_action_detailed_name( - ACTION__RESTORE + ACTION__SESSION_RESTORE ) ); - MENU__MAIN_SESSION->append( + MENU__SESSION->append( _("Save"), get_action_detailed_name( - ACTION__SAVE + ACTION__SESSION_SAVE ) ); - MENU__MAIN->append_submenu( + MENU->append_submenu( _("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.."), 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"), 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"), 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"), - MENU__MAIN_TAB_PAGE_NAVIGATION_HISTORY + MENU__TAB_PAGE_NAVIGATION_HISTORY ); - MENU__MAIN_TAB_PAGE_NAVIGATION->append( + MENU__TAB_PAGE_NAVIGATION->append( _("Reload"), 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"), - MENU__MAIN_TAB_PAGE_NAVIGATION + MENU__TAB_PAGE_NAVIGATION ); - MENU__MAIN_TAB->append_submenu( + MENU__TAB->append_submenu( _("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"), get_action_detailed_name( - ACTION__MAIN_TAB_CLOSE_ACTIVE + ACTION__TAB_CLOSE ) ); // @TODO /* - MENU__MAIN_TAB_CLOSE->append( + MENU__TAB_CLOSE->append( _("All tabs to left"), 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"), get_action_detailed_name( - ACTION__MAIN_TAB_CLOSE_RIGHT + ACTION__TAB_CLOSE_RIGHT ) ); */ - MENU__MAIN_TAB_CLOSE->append( + MENU__TAB_CLOSE->append( _("All tabs"), get_action_detailed_name( - ACTION__MAIN_TAB_CLOSE_ALL + ACTION__TAB_CLOSE_ALL ) ); - MENU__MAIN_TAB->append_submenu( + MENU__TAB->append_submenu( _("Close"), - MENU__MAIN_TAB_CLOSE + MENU__TAB_CLOSE ); - MENU__MAIN->append_submenu( + MENU->append_submenu( _("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"), get_action_detailed_name( ACTION__DEBUG ) ); - MENU__MAIN->append_submenu( + MENU->append_submenu( _("Tools"), - MENU__MAIN_TOOLS + MENU__TOOLS ); - MENU__MAIN->append( + MENU->append( _("Quit"), get_action_detailed_name( ACTION__QUIT @@ -166,7 +166,7 @@ Menu::Menu( ); set_menu_model( - MENU__MAIN + MENU ); } diff --git a/src/app/browser/header/menu.hpp b/src/app/browser/header/menu.hpp index 3aa41fd7..21382d4f 100644 --- a/src/app/browser/header/menu.hpp +++ b/src/app/browser/header/menu.hpp @@ -20,15 +20,15 @@ namespace app::browser::header Menu( const Glib::RefPtr & ACTION__DEBUG, const Glib::RefPtr & ACTION__QUIT, - const Glib::RefPtr & ACTION__CLEAN, - const Glib::RefPtr & ACTION__RESTORE, - const Glib::RefPtr & ACTION__SAVE, - const Glib::RefPtr & ACTION__MAIN_TAB_APPEND, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ACTIVE, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ALL, - const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, - const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, - const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD + const Glib::RefPtr & ACTION__SESSION_CLEAN, + const Glib::RefPtr & ACTION__SESSION_RESTORE, + const Glib::RefPtr & ACTION__SESSION_SAVE, + const Glib::RefPtr & ACTION__TAB_APPEND, + const Glib::RefPtr & ACTION__TAB_CLOSE, + const Glib::RefPtr & ACTION__TAB_CLOSE_ALL, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_RELOAD ); }; } diff --git a/src/app/browser/main.cpp b/src/app/browser/main.cpp index 312b2b0f..205cec16 100644 --- a/src/app/browser/main.cpp +++ b/src/app/browser/main.cpp @@ -6,11 +6,11 @@ using namespace app::browser; Main::Main( sqlite3 * db, const Glib::RefPtr & ACTION__UPDATE, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ACTIVE, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ALL, - const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, - const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, - const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD + const Glib::RefPtr & ACTION__TAB_CLOSE, + const Glib::RefPtr & ACTION__TAB_CLOSE_ALL, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_RELOAD ) { // Init database DB::SESSION::init( @@ -30,11 +30,11 @@ Main::Main( mainTab = Gtk::make_managed( db, ACTION__UPDATE, - ACTION__MAIN_TAB_CLOSE_ACTIVE, - ACTION__MAIN_TAB_CLOSE_ALL, - ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, - ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, - ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD + ACTION__TAB_CLOSE, + ACTION__TAB_CLOSE_ALL, + ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, + ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, + ACTION__TAB_PAGE_NAVIGATION_RELOAD ); append( diff --git a/src/app/browser/main.hpp b/src/app/browser/main.hpp index 0cff87a9..997fe735 100644 --- a/src/app/browser/main.hpp +++ b/src/app/browser/main.hpp @@ -76,11 +76,11 @@ namespace app::browser Main( sqlite3 * db, const Glib::RefPtr & ACTION__UPDATE, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ACTIVE, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ALL, - const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, - const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, - const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD + const Glib::RefPtr & ACTION__TAB_CLOSE, + const Glib::RefPtr & ACTION__TAB_CLOSE_ALL, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_RELOAD ); // Actions diff --git a/src/app/browser/main/tab.cpp b/src/app/browser/main/tab.cpp index ee052b9f..9cdb480b 100644 --- a/src/app/browser/main/tab.cpp +++ b/src/app/browser/main/tab.cpp @@ -7,8 +7,8 @@ using namespace app::browser::main; Tab::Tab( sqlite3 * db, const Glib::RefPtr & ACTION__UPDATE, - const Glib::RefPtr & ACTION__TAB_CLOSE_ACTIVE, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ALL, + const Glib::RefPtr & ACTION__TAB_CLOSE, + const Glib::RefPtr & ACTION__TAB_CLOSE_ALL, const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_RELOAD @@ -20,8 +20,8 @@ Tab::Tab( // Init actions action__update = ACTION__UPDATE; - action__tab_close_active = ACTION__TAB_CLOSE_ACTIVE; - action__tab_close_all = ACTION__MAIN_TAB_CLOSE_ALL; + action__tab_close = 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; action__tab_page_navigation_reload = ACTION__TAB_PAGE_NAVIGATION_RELOAD; @@ -157,7 +157,7 @@ void Tab::update( ); // Update tab actions status - action__tab_close_active->set_enabled( + action__tab_close->set_enabled( get_n_pages() > 0 ); @@ -188,7 +188,7 @@ void Tab::update( ); // Update tab actions status - action__tab_close_active->set_enabled( + action__tab_close->set_enabled( get_n_pages() > 0 ); @@ -215,7 +215,7 @@ int Tab::append( const auto TAB_LABEL = new tab::Label( // @TODO manage db, - action__tab_close_active + action__tab_close ); const int PAGE_NUMBER = append_page( diff --git a/src/app/browser/main/tab.hpp b/src/app/browser/main/tab.hpp index 55339f24..37327ee4 100644 --- a/src/app/browser/main/tab.hpp +++ b/src/app/browser/main/tab.hpp @@ -68,7 +68,7 @@ namespace app::browser::main // Actions Glib::RefPtr action__update, - action__tab_close_active, + action__tab_close, action__tab_close_all, action__tab_page_navigation_history_back, action__tab_page_navigation_history_forward, @@ -86,8 +86,8 @@ namespace app::browser::main Tab( sqlite3 * db, const Glib::RefPtr & ACTION__UPDATE, - const Glib::RefPtr & ACTION__TAB_CLOSE_ACTIVE, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ALL, + const Glib::RefPtr & ACTION__TAB_CLOSE, + const Glib::RefPtr & ACTION__TAB_CLOSE_ALL, const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_RELOAD diff --git a/src/app/browser/main/tab/label.cpp b/src/app/browser/main/tab/label.cpp index 9a610026..3e404097 100644 --- a/src/app/browser/main/tab/label.cpp +++ b/src/app/browser/main/tab/label.cpp @@ -4,7 +4,7 @@ using namespace app::browser::main::tab; Label::Label( sqlite3 * db, - const Glib::RefPtr & ACTION__CLOSE_ACTIVE + const Glib::RefPtr & ACTION__TAB_CLOSE ) { // Init database DB::SESSION::init( @@ -12,7 +12,7 @@ Label::Label( ); // Init actions - action__close_active = ACTION__CLOSE_ACTIVE; + action__tab_close = ACTION__TAB_CLOSE; // Setup label controller auto GtkGestureClick = Gtk::GestureClick::create(); @@ -27,7 +27,7 @@ Label::Label( { if (n == 2) // double click { - action__close_active->activate(); + action__tab_close->activate(); } } ); diff --git a/src/app/browser/main/tab/label.hpp b/src/app/browser/main/tab/label.hpp index 13550902..032662d5 100644 --- a/src/app/browser/main/tab/label.hpp +++ b/src/app/browser/main/tab/label.hpp @@ -59,7 +59,7 @@ namespace app::browser::main::tab sqlite3 * db; // Actions - Glib::RefPtr action__close_active; + Glib::RefPtr action__tab_close; /* * Class API @@ -68,7 +68,7 @@ namespace app::browser::main::tab Label( sqlite3 * db, - const Glib::RefPtr & ACTION__CLOSE_ACTIVE + const Glib::RefPtr & ACTION__TAB_CLOSE ); // Actions diff --git a/src/app/browser/main/tab/page.cpp b/src/app/browser/main/tab/page.cpp index f65b4450..56d11a4d 100644 --- a/src/app/browser/main/tab/page.cpp +++ b/src/app/browser/main/tab/page.cpp @@ -10,9 +10,9 @@ Page::Page( const Glib::ustring & TITLE, const Glib::ustring & DESCRIPTION, const Glib::RefPtr & ACTION__UPDATE, - const Glib::RefPtr & ACTION__PAGE_NAVIGATION_HISTORY_BACK, - const Glib::RefPtr & ACTION__PAGE_NAVIGATION_HISTORY_FORWARD, - const Glib::RefPtr & ACTION__PAGE_NAVIGATION_RELOAD + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_RELOAD ) { // Init meta mime = MIME; @@ -37,9 +37,9 @@ Page::Page( pageNavigation = Gtk::make_managed( this->db, ACTION__UPDATE, - ACTION__PAGE_NAVIGATION_HISTORY_BACK, - ACTION__PAGE_NAVIGATION_HISTORY_FORWARD, - ACTION__PAGE_NAVIGATION_RELOAD + ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, + ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, + ACTION__TAB_PAGE_NAVIGATION_RELOAD ); append( diff --git a/src/app/browser/main/tab/page.hpp b/src/app/browser/main/tab/page.hpp index 21bf9f96..17a77f2d 100644 --- a/src/app/browser/main/tab/page.hpp +++ b/src/app/browser/main/tab/page.hpp @@ -117,9 +117,9 @@ namespace app::browser::main::tab const Glib::ustring & TITLE, const Glib::ustring & DESCRIPTION, const Glib::RefPtr & ACTION__UPDATE, - const Glib::RefPtr & ACTION__PAGE_NAVIGATION_HISTORY_BACK, - const Glib::RefPtr & ACTION__PAGE_NAVIGATION_HISTORY_FORWARD, - const Glib::RefPtr & ACTION__PAGE_NAVIGATION_RELOAD + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_RELOAD ); // Actions diff --git a/src/app/browser/main/tab/page/navigation.cpp b/src/app/browser/main/tab/page/navigation.cpp index 444209d5..db0b3e0b 100644 --- a/src/app/browser/main/tab/page/navigation.cpp +++ b/src/app/browser/main/tab/page/navigation.cpp @@ -10,9 +10,9 @@ using namespace app::browser::main::tab::page; Navigation::Navigation( sqlite3 * db, const Glib::RefPtr & ACTION__UPDATE, - const Glib::RefPtr & ACTION__NAVIGATION_HISTORY_BACK, - const Glib::RefPtr & ACTION__NAVIGATION_HISTORY_FORWARD, - const Glib::RefPtr & ACTION__NAVIGATION_RELOAD + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_RELOAD ) { // Init database DB::SESSION::init( @@ -53,8 +53,8 @@ Navigation::Navigation( navigationHistory = Gtk::make_managed( db, - ACTION__NAVIGATION_HISTORY_BACK, - ACTION__NAVIGATION_HISTORY_FORWARD + ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, + ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD ); append( @@ -62,7 +62,7 @@ Navigation::Navigation( ); navigationReload = Gtk::make_managed( - ACTION__NAVIGATION_RELOAD + ACTION__TAB_PAGE_NAVIGATION_RELOAD ); append( @@ -72,7 +72,7 @@ Navigation::Navigation( navigationRequest = Gtk::make_managed( db, ACTION__UPDATE, - ACTION__NAVIGATION_RELOAD + ACTION__TAB_PAGE_NAVIGATION_RELOAD ); append( diff --git a/src/app/browser/main/tab/page/navigation.hpp b/src/app/browser/main/tab/page/navigation.hpp index f94514c8..cb11bda3 100644 --- a/src/app/browser/main/tab/page/navigation.hpp +++ b/src/app/browser/main/tab/page/navigation.hpp @@ -83,9 +83,9 @@ namespace app::browser::main::tab::page Navigation( sqlite3 * db, const Glib::RefPtr & ACTION__UPDATE, - const Glib::RefPtr & ACTION__NAVIGATION_HISTORY_BACK, - const Glib::RefPtr & ACTION__NAVIGATION_HISTORY_FORWARD, - const Glib::RefPtr & ACTION__NAVIGATION_RELOAD + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_RELOAD ); // Actions diff --git a/src/app/browser/main/tab/page/navigation/history.cpp b/src/app/browser/main/tab/page/navigation/history.cpp index d9065d55..eecdc56d 100644 --- a/src/app/browser/main/tab/page/navigation/history.cpp +++ b/src/app/browser/main/tab/page/navigation/history.cpp @@ -6,8 +6,8 @@ using namespace app::browser::main::tab::page::navigation; History::History( sqlite3 * db, - const Glib::RefPtr & ACTION__HISTORY_BACK, - const Glib::RefPtr & ACTION__HISTORY_FORWARD + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD ) { // Init database DB::SESSION::init( @@ -20,7 +20,7 @@ History::History( ); historyBack = Gtk::make_managed( - ACTION__HISTORY_BACK + ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK ); append( @@ -28,7 +28,7 @@ History::History( ); historyForward = Gtk::make_managed( - ACTION__HISTORY_FORWARD + ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD ); append( diff --git a/src/app/browser/main/tab/page/navigation/history.hpp b/src/app/browser/main/tab/page/navigation/history.hpp index 1216bcc0..2f4797ce 100644 --- a/src/app/browser/main/tab/page/navigation/history.hpp +++ b/src/app/browser/main/tab/page/navigation/history.hpp @@ -92,8 +92,8 @@ namespace app::browser::main::tab::page::navigation History( sqlite3 * db, - const Glib::RefPtr & ACTION__HISTORY_BACK, - const Glib::RefPtr & ACTION__HISTORY_FORWARD + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD ); // Actions diff --git a/src/app/browser/main/tab/page/navigation/reload.cpp b/src/app/browser/main/tab/page/navigation/reload.cpp index 54d9f794..197906cf 100644 --- a/src/app/browser/main/tab/page/navigation/reload.cpp +++ b/src/app/browser/main/tab/page/navigation/reload.cpp @@ -3,10 +3,10 @@ using namespace app::browser::main::tab::page::navigation; Reload::Reload( - const Glib::RefPtr & ACTION__RELOAD + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_RELOAD ) { // Init actions - action__reload = ACTION__RELOAD; + action__tab_page_navigation_reload = ACTION__TAB_PAGE_NAVIGATION_RELOAD; // Init widget set_icon_name( @@ -24,7 +24,7 @@ Reload::Reload( signal_clicked().connect( [this] { - action__reload->activate(); + action__tab_page_navigation_reload->activate(); } ); } @@ -36,7 +36,7 @@ void Reload::update( IS_ENABLED ); - action__reload->set_enabled( + action__tab_page_navigation_reload->set_enabled( IS_ENABLED ); } \ No newline at end of file diff --git a/src/app/browser/main/tab/page/navigation/reload.hpp b/src/app/browser/main/tab/page/navigation/reload.hpp index 6727d23e..c45782a4 100644 --- a/src/app/browser/main/tab/page/navigation/reload.hpp +++ b/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 { - Glib::RefPtr action__reload; + Glib::RefPtr action__tab_page_navigation_reload; public: Reload( - const Glib::RefPtr & ACTION__RELOAD + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_RELOAD ); void update( diff --git a/src/app/browser/main/tab/page/navigation/request.cpp b/src/app/browser/main/tab/page/navigation/request.cpp index d72d4706..3e92a1c2 100644 --- a/src/app/browser/main/tab/page/navigation/request.cpp +++ b/src/app/browser/main/tab/page/navigation/request.cpp @@ -6,7 +6,7 @@ using namespace app::browser::main::tab::page::navigation; Request::Request( sqlite3 * db, const Glib::RefPtr & ACTION__UPDATE, - const Glib::RefPtr & ACTION__RELOAD + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_RELOAD ) { // Init database DB::SESSION::init( @@ -15,7 +15,7 @@ Request::Request( // Init actions action__update = ACTION__UPDATE; - action__reload = ACTION__RELOAD; + action__tab_page_navigation_reload = ACTION__TAB_PAGE_NAVIGATION_RELOAD; // Init extras progress_fraction = 0; @@ -44,7 +44,7 @@ Request::Request( signal_activate().connect( [this] { - action__reload->activate(); + action__tab_page_navigation_reload->activate(); } ); } diff --git a/src/app/browser/main/tab/page/navigation/request.hpp b/src/app/browser/main/tab/page/navigation/request.hpp index dfca577c..dffffb60 100644 --- a/src/app/browser/main/tab/page/navigation/request.hpp +++ b/src/app/browser/main/tab/page/navigation/request.hpp @@ -62,7 +62,7 @@ namespace app::browser::main::tab::page::navigation // Actions Glib::RefPtr action__update, - action__reload; + action__tab_page_navigation_reload; // Extras double progress_fraction; @@ -81,7 +81,7 @@ namespace app::browser::main::tab::page::navigation Request( sqlite3 * db, const Glib::RefPtr & ACTION__UPDATE, - const Glib::RefPtr & ACTION__RELOAD + const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_RELOAD ); // Actions