Browse Source

rename update button and action to reload

CPP-GTK4
yggverse 2 months ago
parent
commit
1df58f17de
  1. 2
      Makefile
  2. 2
      po/POTFILES.in
  3. 14
      src/app/browser.cpp
  4. 4
      src/app/browser/header.cpp
  5. 2
      src/app/browser/header.hpp
  6. 6
      src/app/browser/header/menu.cpp
  7. 2
      src/app/browser/header/menu.hpp
  8. 8
      src/app/browser/main.cpp
  9. 4
      src/app/browser/main.hpp
  10. 10
      src/app/browser/main/tab.cpp
  11. 6
      src/app/browser/main/tab.hpp
  12. 12
      src/app/browser/main/tab/page.cpp
  13. 4
      src/app/browser/main/tab/page.hpp
  14. 14
      src/app/browser/main/tab/page/navigation.cpp
  15. 6
      src/app/browser/main/tab/page/navigation.hpp
  16. 16
      src/app/browser/main/tab/page/navigation/reload.cpp
  17. 14
      src/app/browser/main/tab/page/navigation/reload.hpp

2
Makefile

@ -25,8 +25,8 @@ SRCS = src/app.cpp\
src/app/browser/main/tab/page/navigation/history.cpp\ src/app/browser/main/tab/page/navigation/history.cpp\
src/app/browser/main/tab/page/navigation/history/back.cpp\ src/app/browser/main/tab/page/navigation/history/back.cpp\
src/app/browser/main/tab/page/navigation/history/forward.cpp\ src/app/browser/main/tab/page/navigation/history/forward.cpp\
src/app/browser/main/tab/page/navigation/reload.cpp\
src/app/browser/main/tab/page/navigation/request.cpp\ src/app/browser/main/tab/page/navigation/request.cpp\
src/app/browser/main/tab/page/navigation/update.cpp\
src/app/browser/main/tab/label.cpp src/app/browser/main/tab/label.cpp
OBJS = $(SRCS:.cpp=.o) OBJS = $(SRCS:.cpp=.o)

2
po/POTFILES.in

@ -20,6 +20,6 @@ src/app/browser/main/tab/page/navigation/bookmark.cpp
src/app/browser/main/tab/page/navigation/history.cpp src/app/browser/main/tab/page/navigation/history.cpp
src/app/browser/main/tab/page/navigation/history/back.cpp src/app/browser/main/tab/page/navigation/history/back.cpp
src/app/browser/main/tab/page/navigation/history/forward.cpp src/app/browser/main/tab/page/navigation/history/forward.cpp
src/app/browser/main/tab/page/navigation/reload.cpp
src/app/browser/main/tab/page/navigation/request.cpp src/app/browser/main/tab/page/navigation/request.cpp
src/app/browser/main/tab/page/navigation/update.cpp
src/app/browser/main/tab/label.cpp src/app/browser/main/tab/label.cpp

14
src/app/browser.cpp

@ -116,20 +116,20 @@ Browser::Browser(
false false
); );
const auto ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE = add_action( const auto ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD = add_action(
"main_tab_page_navigation_update", "main_tab_page_navigation_reload",
[this] [this]
{ {
browserMain->tab_page_navigation_update(); browserMain->tab_page_navigation_reload();
} }
); );
ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE->set_enabled( ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD->set_enabled(
false false
); );
APP->set_accel_for_action( APP->set_accel_for_action(
"win.main_tab_page_navigation_update", "win.main_tab_page_navigation_reload",
"<Primary>r" "<Primary>r"
); );
@ -201,7 +201,7 @@ Browser::Browser(
ACTION__MAIN_TAB_CLOSE_ALL, ACTION__MAIN_TAB_CLOSE_ALL,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD
); );
set_titlebar( set_titlebar(
@ -215,7 +215,7 @@ Browser::Browser(
ACTION__MAIN_TAB_CLOSE_ALL, ACTION__MAIN_TAB_CLOSE_ALL,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD
); );
set_child( set_child(

4
src/app/browser/header.cpp

@ -15,7 +15,7 @@ Header::Header(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL, 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_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD
) { ) {
// Init widget // Init widget
set_show_title_buttons( set_show_title_buttons(
@ -33,7 +33,7 @@ Header::Header(
ACTION__MAIN_TAB_CLOSE_ALL, ACTION__MAIN_TAB_CLOSE_ALL,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD
); );
pack_start( pack_start(

2
src/app/browser/header.hpp

@ -38,7 +38,7 @@ namespace app::browser
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL, 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_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD
); );
void update( void update(

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

@ -12,7 +12,7 @@ Menu::Menu(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL, 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_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD
) { ) {
// Init widget // Init widget
set_tooltip_text( set_tooltip_text(
@ -78,9 +78,9 @@ Menu::Menu(
); );
MENU__MAIN_TAB_PAGE_NAVIGATION->append( MENU__MAIN_TAB_PAGE_NAVIGATION->append(
_("Update"), _("Reload"),
get_action_detailed_name( get_action_detailed_name(
ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD
) )
); );

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

@ -27,7 +27,7 @@ namespace app::browser::header
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL, 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_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD
); );
}; };
} }

8
src/app/browser/main.cpp

@ -10,7 +10,7 @@ Main::Main(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL, 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_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD
) { ) {
// Init widget // Init widget
set_orientation( set_orientation(
@ -29,7 +29,7 @@ Main::Main(
ACTION__MAIN_TAB_CLOSE_ALL, ACTION__MAIN_TAB_CLOSE_ALL,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD
); );
append( append(
@ -85,8 +85,8 @@ void Main::tab_close_all()
mainTab->close_all(); mainTab->close_all();
}; };
void Main::tab_page_navigation_update() { void Main::tab_page_navigation_reload() {
mainTab->page_navigation_update( mainTab->page_navigation_reload(
mainTab->get_current_page(), // @TODO mainTab->get_current_page(), // @TODO
true true
); );

4
src/app/browser/main.hpp

@ -33,7 +33,7 @@ namespace app::browser
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL, 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_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD
); );
// Actions // Actions
@ -48,7 +48,7 @@ namespace app::browser
void tab_close_right(); void tab_close_right();
void tab_close(); void tab_close();
void tab_page_navigation_update(); void tab_page_navigation_reload();
void tab_page_navigation_history_back(); void tab_page_navigation_history_back();
void tab_page_navigation_history_forward(); void tab_page_navigation_history_forward();

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

@ -11,7 +11,7 @@ Tab::Tab(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL, const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_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_UPDATE const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
) { ) {
// Init database // Init database
DB::SESSION::init( DB::SESSION::init(
@ -24,7 +24,7 @@ Tab::Tab(
action__tab_close_all = ACTION__MAIN_TAB_CLOSE_ALL; action__tab_close_all = ACTION__MAIN_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_update = ACTION__TAB_PAGE_NAVIGATION_UPDATE; action__tab_page_navigation_reload = ACTION__TAB_PAGE_NAVIGATION_RELOAD;
// Init widget // Init widget
set_scrollable( set_scrollable(
@ -193,7 +193,7 @@ int Tab::append(
action__refresh, action__refresh,
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_update action__tab_page_navigation_reload
); );
const auto TAB_LABEL = new tab::Label( // @TODO manage const auto TAB_LABEL = new tab::Label( // @TODO manage
@ -252,13 +252,13 @@ void Tab::close_all()
} }
} }
void Tab::page_navigation_update( void Tab::page_navigation_reload(
const int & PAGE_NUMBER, const int & PAGE_NUMBER,
const bool & ADD_HISTORY const bool & ADD_HISTORY
) { ) {
get_tabPage( get_tabPage(
PAGE_NUMBER PAGE_NUMBER
)->navigation_update( )->navigation_reload(
ADD_HISTORY ADD_HISTORY
); );
} }

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

@ -69,7 +69,7 @@ namespace app::browser::main
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_update; action__tab_page_navigation_reload;
// Defaults // Defaults
const bool REORDERABLE = true; const bool REORDERABLE = true;
@ -87,7 +87,7 @@ namespace app::browser::main
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL, const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_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_UPDATE const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
); );
// Actions // Actions
@ -104,7 +104,7 @@ namespace app::browser::main
void close_right(); void close_right();
void close_all(); void close_all();
void page_navigation_update( void page_navigation_reload(
const int & PAGE_NUMBER, const int & PAGE_NUMBER,
const bool & ADD_HISTORY const bool & ADD_HISTORY
); );

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

@ -12,7 +12,7 @@ Page::Page(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH, const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_HISTORY_BACK, 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_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_UPDATE const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_RELOAD
) { ) {
// Init meta // Init meta
mime = MIME; mime = MIME;
@ -34,7 +34,7 @@ Page::Page(
ACTION__REFRESH, ACTION__REFRESH,
ACTION__PAGE_NAVIGATION_HISTORY_BACK, ACTION__PAGE_NAVIGATION_HISTORY_BACK,
ACTION__PAGE_NAVIGATION_HISTORY_FORWARD, ACTION__PAGE_NAVIGATION_HISTORY_FORWARD,
ACTION__PAGE_NAVIGATION_UPDATE ACTION__PAGE_NAVIGATION_RELOAD
); );
append( append(
@ -165,7 +165,7 @@ void Page::update(
); );
} }
void Page::navigation_update( void Page::navigation_reload(
const bool & ADD_HISTORY const bool & ADD_HISTORY
) { ) {
// Update navigation history // Update navigation history
@ -355,7 +355,7 @@ void Page::navigation_update(
"gemini://" + pageNavigation->get_request_text() "gemini://" + pageNavigation->get_request_text()
); );
navigation_update( navigation_reload(
false false
); );
} }
@ -376,7 +376,7 @@ void Page::navigation_history_back()
request request
); );
navigation_update( navigation_reload(
false false
); );
} }
@ -392,7 +392,7 @@ void Page::navigation_history_forward()
request request
); );
navigation_update( navigation_reload(
false false
); );
} }

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

@ -114,7 +114,7 @@ namespace app::browser::main::tab
const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH, const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_HISTORY_BACK, 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_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_UPDATE const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_RELOAD
); );
// Actions // Actions
@ -133,7 +133,7 @@ namespace app::browser::main::tab
const double & PROGRESS_FRACTION const double & PROGRESS_FRACTION
); );
void navigation_update( void navigation_reload(
const bool & ADD_HISTORY const bool & ADD_HISTORY
); );

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

@ -3,7 +3,7 @@
#include "navigation/bookmark.hpp" #include "navigation/bookmark.hpp"
#include "navigation/history.hpp" #include "navigation/history.hpp"
#include "navigation/request.hpp" #include "navigation/request.hpp"
#include "navigation/update.hpp" #include "navigation/reload.hpp"
using namespace app::browser::main::tab::page; using namespace app::browser::main::tab::page;
@ -12,7 +12,7 @@ Navigation::Navigation(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH, const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_BACK, 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_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_UPDATE const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_RELOAD
) { ) {
// Init database // Init database
DB::SESSION::init( DB::SESSION::init(
@ -60,18 +60,18 @@ Navigation::Navigation(
* navigationHistory * navigationHistory
); );
navigationUpdate = Gtk::make_managed<navigation::Update>( navigationReload = Gtk::make_managed<navigation::Reload>(
ACTION__NAVIGATION_UPDATE ACTION__NAVIGATION_RELOAD
); );
append( append(
* navigationUpdate * navigationReload
); );
navigationRequest = Gtk::make_managed<navigation::Request>( navigationRequest = Gtk::make_managed<navigation::Request>(
db, db,
ACTION__REFRESH, ACTION__REFRESH,
ACTION__NAVIGATION_UPDATE ACTION__NAVIGATION_RELOAD
); );
append( append(
@ -98,7 +98,7 @@ void Navigation::update(
navigationHistory->update(); navigationHistory->update();
// Toggle update button sensibility // Toggle update button sensibility
navigationUpdate->update( navigationReload->update(
navigationRequest->get_text_length() > 0 navigationRequest->get_text_length() > 0
); );

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

@ -15,7 +15,7 @@ namespace app::browser::main::tab::page
class Base; class Base;
class Bookmark; class Bookmark;
class History; class History;
class Update; class Reload;
class Request; class Request;
} }
@ -68,8 +68,8 @@ namespace app::browser::main::tab::page
navigation::Base * navigationBase; navigation::Base * navigationBase;
navigation::Bookmark * navigationBookmark; navigation::Bookmark * navigationBookmark;
navigation::History * navigationHistory; navigation::History * navigationHistory;
navigation::Reload * navigationReload;
navigation::Request * navigationRequest; navigation::Request * navigationRequest;
navigation::Update * navigationUpdate;
// Defaults // Defaults
const int SPACING = 8; const int SPACING = 8;
@ -85,7 +85,7 @@ namespace app::browser::main::tab::page
const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH, const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_BACK, 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_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_UPDATE const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_RELOAD
); );
// Actions // Actions

16
src/app/browser/main/tab/page/navigation/update.cpp → src/app/browser/main/tab/page/navigation/reload.cpp

@ -1,12 +1,12 @@
#include "update.hpp" #include "reload.hpp"
using namespace app::browser::main::tab::page::navigation; using namespace app::browser::main::tab::page::navigation;
Update::Update( Reload::Reload(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE const Glib::RefPtr<Gio::SimpleAction> & ACTION__RELOAD
) { ) {
// Init actions // Init actions
action__update = ACTION__UPDATE; action__reload = ACTION__RELOAD;
// Init widget // Init widget
set_icon_name( set_icon_name(
@ -14,7 +14,7 @@ Update::Update(
); );
set_tooltip_text( set_tooltip_text(
_("Update") _("Reload")
); );
set_sensitive( set_sensitive(
@ -24,19 +24,19 @@ Update::Update(
signal_clicked().connect( signal_clicked().connect(
[this] [this]
{ {
action__update->activate(); action__reload->activate();
} }
); );
} }
void Update::update( void Reload::update(
const bool & ENABLED const bool & ENABLED
) { ) {
set_sensitive( set_sensitive(
ENABLED ENABLED
); );
action__update->set_enabled( action__reload->set_enabled(
ENABLED ENABLED
); );
} }

14
src/app/browser/main/tab/page/navigation/update.hpp → src/app/browser/main/tab/page/navigation/reload.hpp

@ -1,5 +1,5 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_UPDATE_HPP #ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_RELOAD_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_UPDATE_HPP #define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_RELOAD_HPP
#include <giomm/simpleaction.h> #include <giomm/simpleaction.h>
#include <glibmm/i18n.h> #include <glibmm/i18n.h>
@ -8,14 +8,14 @@
namespace app::browser::main::tab::page::navigation namespace app::browser::main::tab::page::navigation
{ {
class Update : public Gtk::Button class Reload : public Gtk::Button
{ {
Glib::RefPtr<Gio::SimpleAction> action__update; Glib::RefPtr<Gio::SimpleAction> action__reload;
public: public:
Update( Reload(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE const Glib::RefPtr<Gio::SimpleAction> & ACTION__RELOAD
); );
void update( void update(
@ -24,4 +24,4 @@ namespace app::browser::main::tab::page::navigation
}; };
} }
#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_UPDATE_HPP #endif // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_RELOAD_HPP
Loading…
Cancel
Save