Browse Source

rename update button and action to reload

CPP-GTK4
yggverse 4 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\ @@ -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/back.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/update.cpp\
src/app/browser/main/tab/label.cpp
OBJS = $(SRCS:.cpp=.o)

2
po/POTFILES.in

@ -20,6 +20,6 @@ src/app/browser/main/tab/page/navigation/bookmark.cpp @@ -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/back.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/update.cpp
src/app/browser/main/tab/label.cpp

14
src/app/browser.cpp

@ -116,20 +116,20 @@ Browser::Browser( @@ -116,20 +116,20 @@ Browser::Browser(
false
);
const auto ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE = add_action(
"main_tab_page_navigation_update",
const auto ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD = add_action(
"main_tab_page_navigation_reload",
[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
);
APP->set_accel_for_action(
"win.main_tab_page_navigation_update",
"win.main_tab_page_navigation_reload",
"<Primary>r"
);
@ -201,7 +201,7 @@ Browser::Browser( @@ -201,7 +201,7 @@ Browser::Browser(
ACTION__MAIN_TAB_CLOSE_ALL,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE
ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD
);
set_titlebar(
@ -215,7 +215,7 @@ Browser::Browser( @@ -215,7 +215,7 @@ Browser::Browser(
ACTION__MAIN_TAB_CLOSE_ALL,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE
ACTION__MAIN_TAB_PAGE_NAVIGATION_RELOAD
);
set_child(

4
src/app/browser/header.cpp

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

2
src/app/browser/header.hpp

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

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

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

8
src/app/browser/main.cpp

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

4
src/app/browser/main.hpp

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

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

@ -11,7 +11,7 @@ Tab::Tab( @@ -11,7 +11,7 @@ Tab::Tab(
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_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_UPDATE
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
) {
// Init database
DB::SESSION::init(
@ -24,7 +24,7 @@ Tab::Tab( @@ -24,7 +24,7 @@ Tab::Tab(
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_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
set_scrollable(
@ -193,7 +193,7 @@ int Tab::append( @@ -193,7 +193,7 @@ int Tab::append(
action__refresh,
action__tab_page_navigation_history_back,
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
@ -252,13 +252,13 @@ void Tab::close_all() @@ -252,13 +252,13 @@ void Tab::close_all()
}
}
void Tab::page_navigation_update(
void Tab::page_navigation_reload(
const int & PAGE_NUMBER,
const bool & ADD_HISTORY
) {
get_tabPage(
PAGE_NUMBER
)->navigation_update(
)->navigation_reload(
ADD_HISTORY
);
}

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

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

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

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

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

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

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

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

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

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

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

@ -1,12 +1,12 @@ @@ -1,12 +1,12 @@
#include "update.hpp"
#include "reload.hpp"
using namespace app::browser::main::tab::page::navigation;
Update::Update(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE
Reload::Reload(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__RELOAD
) {
// Init actions
action__update = ACTION__UPDATE;
action__reload = ACTION__RELOAD;
// Init widget
set_icon_name(
@ -14,7 +14,7 @@ Update::Update( @@ -14,7 +14,7 @@ Update::Update(
);
set_tooltip_text(
_("Update")
_("Reload")
);
set_sensitive(
@ -24,19 +24,19 @@ Update::Update( @@ -24,19 +24,19 @@ Update::Update(
signal_clicked().connect(
[this]
{
action__update->activate();
action__reload->activate();
}
);
}
void Update::update(
void Reload::update(
const bool & ENABLED
) {
set_sensitive(
ENABLED
);
action__update->set_enabled(
action__reload->set_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 @@ @@ -1,5 +1,5 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_UPDATE_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_UPDATE_HPP
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_RELOAD_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_RELOAD_HPP
#include <giomm/simpleaction.h>
#include <glibmm/i18n.h>
@ -8,14 +8,14 @@ @@ -8,14 +8,14 @@
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:
Update(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE
Reload(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__RELOAD
);
void update(
@ -24,4 +24,4 @@ namespace app::browser::main::tab::page::navigation @@ -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