Browse Source

rename actions

CPP-GTK4
yggverse 2 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 @@ -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

94
src/app/browser.cpp

@ -47,32 +47,32 @@ Browser::Browser( @@ -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( @@ -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( @@ -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( @@ -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( @@ -192,17 +192,17 @@ Browser::Browser(
// Init components
browserHeader = Gtk::make_managed<browser::Header>(
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( @@ -212,11 +212,11 @@ Browser::Browser(
browserMain = Gtk::make_managed<browser::Main>(
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( @@ -235,27 +235,27 @@ Browser::Browser(
);
APP->set_accel_for_action(
"win.main_tab_append",
"win.tab_append",
"<Primary>t"
);
APP->set_accel_for_action(
"win.main_tab_close_active",
"win.tab_close",
"<Primary>Escape"
);
APP->set_accel_for_action(
"win.main_tab_page_navigation_reload",
"win.tab_page_navigation_reload",
"<Primary>r"
);
APP->set_accel_for_action(
"win.main_tab_page_navigation_history_back",
"win.tab_page_navigation_history_back",
"<Primary>Left"
);
APP->set_accel_for_action(
"win.main_tab_page_navigation_history_forward",
"win.tab_page_navigation_history_forward",
"<Primary>Right"
);

36
src/app/browser/header.cpp

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

18
src/app/browser/header.hpp

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

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

@ -5,15 +5,15 @@ using namespace app::browser::header; @@ -5,15 +5,15 @@ using namespace app::browser::header;
Menu::Menu(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__DEBUG,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__QUIT,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__CLEAN,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__RESTORE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__SAVE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_APPEND,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ACTIVE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD
const Glib::RefPtr<Gio::SimpleAction> & ACTION__SESSION_CLEAN,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__SESSION_RESTORE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__SESSION_SAVE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_APPEND,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE,
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_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
) {
// Init widget
set_tooltip_text(
@ -21,144 +21,144 @@ Menu::Menu( @@ -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( @@ -166,7 +166,7 @@ Menu::Menu(
);
set_menu_model(
MENU__MAIN
MENU
);
}

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

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

20
src/app/browser/main.cpp

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

10
src/app/browser/main.hpp

@ -76,11 +76,11 @@ namespace app::browser @@ -76,11 +76,11 @@ namespace app::browser
Main(
sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ACTIVE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE,
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_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
);
// Actions

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

@ -7,8 +7,8 @@ using namespace app::browser::main; @@ -7,8 +7,8 @@ using namespace app::browser::main;
Tab::Tab(
sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE_ACTIVE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE,
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_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
@ -20,8 +20,8 @@ Tab::Tab( @@ -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( @@ -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( @@ -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( @@ -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(

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

@ -68,7 +68,7 @@ namespace app::browser::main @@ -68,7 +68,7 @@ namespace app::browser::main
// Actions
Glib::RefPtr<Gio::SimpleAction> 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 @@ -86,8 +86,8 @@ namespace app::browser::main
Tab(
sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE_ACTIVE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE,
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_FORWARD,
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; @@ -4,7 +4,7 @@ using namespace app::browser::main::tab;
Label::Label(
sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__CLOSE_ACTIVE
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE
) {
// Init database
DB::SESSION::init(
@ -12,7 +12,7 @@ Label::Label( @@ -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( @@ -27,7 +27,7 @@ Label::Label(
{
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 @@ -59,7 +59,7 @@ namespace app::browser::main::tab
sqlite3 * db;
// Actions
Glib::RefPtr<Gio::SimpleAction> action__close_active;
Glib::RefPtr<Gio::SimpleAction> action__tab_close;
/*
* Class API
@ -68,7 +68,7 @@ namespace app::browser::main::tab @@ -68,7 +68,7 @@ namespace app::browser::main::tab
Label(
sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__CLOSE_ACTIVE
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE
);
// Actions

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

@ -10,9 +10,9 @@ Page::Page( @@ -10,9 +10,9 @@ Page::Page(
const Glib::ustring & TITLE,
const Glib::ustring & DESCRIPTION,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_RELOAD
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_RELOAD
) {
// Init meta
mime = MIME;
@ -37,9 +37,9 @@ Page::Page( @@ -37,9 +37,9 @@ Page::Page(
pageNavigation = Gtk::make_managed<page::Navigation>(
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(

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

@ -117,9 +117,9 @@ namespace app::browser::main::tab @@ -117,9 +117,9 @@ namespace app::browser::main::tab
const Glib::ustring & TITLE,
const Glib::ustring & DESCRIPTION,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_RELOAD
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_RELOAD
);
// Actions

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

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

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

@ -83,9 +83,9 @@ namespace app::browser::main::tab::page @@ -83,9 +83,9 @@ namespace app::browser::main::tab::page
Navigation(
sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_RELOAD
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_RELOAD
);
// Actions

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

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

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

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

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

@ -3,10 +3,10 @@ @@ -3,10 +3,10 @@
using namespace app::browser::main::tab::page::navigation;
Reload::Reload(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__RELOAD
const Glib::RefPtr<Gio::SimpleAction> & 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( @@ -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( @@ -36,7 +36,7 @@ void Reload::update(
IS_ENABLED
);
action__reload->set_enabled(
action__tab_page_navigation_reload->set_enabled(
IS_ENABLED
);
}

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

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

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

@ -6,7 +6,7 @@ using namespace app::browser::main::tab::page::navigation; @@ -6,7 +6,7 @@ using namespace app::browser::main::tab::page::navigation;
Request::Request(
sqlite3 * db,
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
DB::SESSION::init(
@ -15,7 +15,7 @@ Request::Request( @@ -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( @@ -44,7 +44,7 @@ Request::Request(
signal_activate().connect(
[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 @@ -62,7 +62,7 @@ namespace app::browser::main::tab::page::navigation
// Actions
Glib::RefPtr<Gio::SimpleAction> action__update,
action__reload;
action__tab_page_navigation_reload;
// Extras
double progress_fraction;
@ -81,7 +81,7 @@ namespace app::browser::main::tab::page::navigation @@ -81,7 +81,7 @@ namespace app::browser::main::tab::page::navigation
Request(
sqlite3 * db,
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

Loading…
Cancel
Save