diff --git a/src/app/browser.cpp b/src/app/browser.cpp index 4f4f4e58..d2c33dce 100644 --- a/src/app/browser.cpp +++ b/src/app/browser.cpp @@ -83,6 +83,23 @@ Browser::Browser( } ); + // History + add_action( + "main_tab_page_navigation_history_back", + [this] + { + browserMain->tab_page_navigation_history_back(); + } + ); + + add_action( + "main_tab_page_navigation_history_forward", + [this] + { + browserMain->tab_page_navigation_history_forward(); + } + ); + // Tool add_action( "debug", @@ -111,20 +128,4 @@ Browser::Browser( ); } ); - - add_action( - "tab_history_back", // @TODO rename - [this] - { - browserMain->tab_history_back(); - } - ); - - add_action( - "tab_history_forward", // @TODO rename - [this] - { - browserMain->tab_history_forward(); - } - ); } \ No newline at end of file diff --git a/src/app/browser/main.cpp b/src/app/browser/main.cpp index df1702fe..6d41be66 100644 --- a/src/app/browser/main.cpp +++ b/src/app/browser/main.cpp @@ -74,16 +74,16 @@ void Main::tab_close_all() mainTab->close_all(); }; -void Main::tab_history_back() +void Main::tab_page_navigation_history_back() { - mainTab->back( + mainTab->page_navigation_history_back( mainTab->get_current_page() ); }; -void Main::tab_history_forward() +void Main::tab_page_navigation_history_forward() { - mainTab->forward( + mainTab->page_navigation_history_forward( mainTab->get_current_page() ); }; diff --git a/src/app/browser/main.hpp b/src/app/browser/main.hpp index 82416c3f..a41b80ff 100644 --- a/src/app/browser/main.hpp +++ b/src/app/browser/main.hpp @@ -35,8 +35,8 @@ namespace app::browser void tab_close_left(); void tab_close_right(); void tab_close(); - void tab_history_back(); - void tab_history_forward(); + void tab_page_navigation_history_back(); + void tab_page_navigation_history_forward(); void tab_update(); void refresh(); diff --git a/src/app/browser/main/tab.cpp b/src/app/browser/main/tab.cpp index 6179b2c1..cce5f4b9 100644 --- a/src/app/browser/main/tab.cpp +++ b/src/app/browser/main/tab.cpp @@ -96,20 +96,20 @@ void Tab::close_all() } } -void Tab::back( +void Tab::page_navigation_history_back( const int & PAGE_NUMBER ) { get_tabPage( PAGE_NUMBER - )->back(); + )->navigation_history_back(); } -void Tab::forward( +void Tab::page_navigation_history_forward( const int & PAGE_NUMBER ) { get_tabPage( PAGE_NUMBER - )->forward(); + )->navigation_history_forward(); } void Tab::refresh( diff --git a/src/app/browser/main/tab.hpp b/src/app/browser/main/tab.hpp index 906cdc0e..86ccddb2 100644 --- a/src/app/browser/main/tab.hpp +++ b/src/app/browser/main/tab.hpp @@ -30,6 +30,7 @@ namespace app::browser::main Tab(); + // Getters Glib::ustring get_page_title( const int & PAGE_NUMBER ); @@ -38,6 +39,7 @@ namespace app::browser::main const int & PAGE_NUMBER ); + // Actions void append( const Glib::ustring & TITLE, const Glib::ustring & REQUEST = "", @@ -52,11 +54,11 @@ namespace app::browser::main void close_right(); void close_all(); - void back( + void page_navigation_history_back( const int & PAGE_NUMBER ); - void forward( + void page_navigation_history_forward( const int & PAGE_NUMBER ); diff --git a/src/app/browser/main/tab/page.cpp b/src/app/browser/main/tab/page.cpp index b8ac416f..bc076c5e 100644 --- a/src/app/browser/main/tab/page.cpp +++ b/src/app/browser/main/tab/page.cpp @@ -73,12 +73,12 @@ Glib::ustring Page::get_subtitle() } // Actions -void Page::back() +void Page::navigation_history_back() { pageNavigation->history_back(); } -void Page::forward() +void Page::navigation_history_forward() { pageNavigation->history_forward(); } diff --git a/src/app/browser/main/tab/page.hpp b/src/app/browser/main/tab/page.hpp index c7ba0e14..53684e1a 100644 --- a/src/app/browser/main/tab/page.hpp +++ b/src/app/browser/main/tab/page.hpp @@ -54,8 +54,8 @@ namespace app::browser::main::tab Glib::ustring get_subtitle(); // Actions - void back(); - void forward(); + void navigation_history_back(); + void navigation_history_forward(); void refresh( const Glib::ustring & TITLE, diff --git a/src/app/browser/main/tab/page/navigation/history/back.cpp b/src/app/browser/main/tab/page/navigation/history/back.cpp index 8517e9ec..e49d1103 100644 --- a/src/app/browser/main/tab/page/navigation/history/back.cpp +++ b/src/app/browser/main/tab/page/navigation/history/back.cpp @@ -5,7 +5,7 @@ using namespace app::browser::main::tab::page::navigation::history; Back::Back() { set_action_name( - "win.tab_history_back" + "win.main_tab_page_navigation_history_back" ); set_icon_name( @@ -19,13 +19,4 @@ Back::Back() set_sensitive( false // @TODO no effect by set_action_name ); - - signal_clicked().connect( - [this] - { - activate_action( - "win.tab_history_back" - ); - } - ); } diff --git a/src/app/browser/main/tab/page/navigation/history/forward.cpp b/src/app/browser/main/tab/page/navigation/history/forward.cpp index 84c69452..f261545f 100644 --- a/src/app/browser/main/tab/page/navigation/history/forward.cpp +++ b/src/app/browser/main/tab/page/navigation/history/forward.cpp @@ -5,7 +5,7 @@ using namespace app::browser::main::tab::page::navigation::history; Forward::Forward() { set_action_name( - "win.tab_history_forward" + "win.main_tab_page_navigation_history_forward" ); set_icon_name( @@ -19,13 +19,4 @@ Forward::Forward() set_sensitive( false // @TODO no effect by set_action_name ); - - signal_clicked().connect( - [this] - { - activate_action( - "win.tab_history_forward" - ); - } - ); } \ No newline at end of file