Browse Source

rename refresh action to update

CPP-GTK4
yggverse 2 months ago
parent
commit
6cf3977a9f
  1. 6
      src/app/browser.cpp
  2. 4
      src/app/browser/main.cpp
  3. 2
      src/app/browser/main.hpp
  4. 10
      src/app/browser/main/tab.cpp
  5. 4
      src/app/browser/main/tab.hpp
  6. 9
      src/app/browser/main/tab/page.cpp
  7. 4
      src/app/browser/main/tab/page.hpp
  8. 8
      src/app/browser/main/tab/page/navigation.cpp
  9. 2
      src/app/browser/main/tab/page/navigation.hpp
  10. 12
      src/app/browser/main/tab/page/navigation/request.cpp
  11. 8
      src/app/browser/main/tab/page/navigation/request.hpp

6
src/app/browser.cpp

@ -9,8 +9,8 @@ Browser::Browser(
const Glib::RefPtr<Gtk::Application> & APP const Glib::RefPtr<Gtk::Application> & APP
) { ) {
// Init window actions // Init window actions
const auto ACTION__REFRESH = add_action( const auto ACTION__UPDATE = add_action(
"refresh", "update",
[this] [this]
{ {
browserMain->update(); browserMain->update();
@ -210,7 +210,7 @@ Browser::Browser(
browserMain = Gtk::make_managed<browser::Main>( browserMain = Gtk::make_managed<browser::Main>(
db, db,
ACTION__REFRESH, ACTION__UPDATE,
ACTION__MAIN_TAB_CLOSE_ACTIVE, ACTION__MAIN_TAB_CLOSE_ACTIVE,
ACTION__MAIN_TAB_CLOSE_ALL, ACTION__MAIN_TAB_CLOSE_ALL,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK,

4
src/app/browser/main.cpp

@ -5,7 +5,7 @@ using namespace app::browser;
Main::Main( Main::Main(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH, 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_ACTIVE,
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,
@ -24,7 +24,7 @@ Main::Main(
// Init components // Init components
mainTab = Gtk::make_managed<main::Tab>( mainTab = Gtk::make_managed<main::Tab>(
db, db,
ACTION__REFRESH, ACTION__UPDATE,
ACTION__MAIN_TAB_CLOSE_ACTIVE, ACTION__MAIN_TAB_CLOSE_ACTIVE,
ACTION__MAIN_TAB_CLOSE_ALL, ACTION__MAIN_TAB_CLOSE_ALL,
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK,

2
src/app/browser/main.hpp

@ -28,7 +28,7 @@ namespace app::browser
Main( Main(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH, 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_ACTIVE,
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,

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

@ -6,7 +6,7 @@ using namespace app::browser::main;
Tab::Tab( Tab::Tab(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH, const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE_ACTIVE, 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__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,
@ -19,7 +19,7 @@ Tab::Tab(
); );
// Init actions // Init actions
action__refresh = ACTION__REFRESH; action__update = ACTION__UPDATE;
action__tab_close_active = ACTION__TAB_CLOSE_ACTIVE; action__tab_close_active = ACTION__TAB_CLOSE_ACTIVE;
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;
@ -42,8 +42,8 @@ Tab::Tab(
signal_switch_page().connect( signal_switch_page().connect(
[this](Gtk::Widget*, guint) [this](Gtk::Widget*, guint)
{ {
// Refresh window elements, e.g. tab label to header bar // Update window elements, e.g. tab label to header bar
action__refresh->activate(); action__update->activate();
} }
); );
} }
@ -190,7 +190,7 @@ int Tab::append(
LABEL_TEXT, LABEL_TEXT,
"", // @TODO restore feature "", // @TODO restore feature
action__refresh, action__update,
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

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

@ -64,7 +64,7 @@ namespace app::browser::main
sqlite3 * db; sqlite3 * db;
// Actions // Actions
Glib::RefPtr<Gio::SimpleAction> action__refresh, Glib::RefPtr<Gio::SimpleAction> action__update,
action__tab_close_active, action__tab_close_active,
action__tab_close_all, action__tab_close_all,
action__tab_page_navigation_history_back, action__tab_page_navigation_history_back,
@ -82,7 +82,7 @@ namespace app::browser::main
Tab( Tab(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH, const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE_ACTIVE, 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__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,

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

@ -9,7 +9,7 @@ Page::Page(
const MIME & MIME, const MIME & MIME,
const Glib::ustring & TITLE, const Glib::ustring & TITLE,
const Glib::ustring & DESCRIPTION, const Glib::ustring & DESCRIPTION,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH, 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_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_RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_RELOAD
@ -21,7 +21,7 @@ Page::Page(
progress_fraction = 0; progress_fraction = 0;
// Init actions // Init actions
action__refresh = ACTION__REFRESH; action__update = ACTION__UPDATE;
// Init database // Init database
DB::SESSION::init( DB::SESSION::init(
@ -31,7 +31,7 @@ Page::Page(
// Init components // Init components
pageNavigation = Gtk::make_managed<page::Navigation>( pageNavigation = Gtk::make_managed<page::Navigation>(
this->db, this->db,
ACTION__REFRESH, ACTION__UPDATE,
ACTION__PAGE_NAVIGATION_HISTORY_BACK, ACTION__PAGE_NAVIGATION_HISTORY_BACK,
ACTION__PAGE_NAVIGATION_HISTORY_FORWARD, ACTION__PAGE_NAVIGATION_HISTORY_FORWARD,
ACTION__PAGE_NAVIGATION_RELOAD ACTION__PAGE_NAVIGATION_RELOAD
@ -56,8 +56,7 @@ Page::Page(
signal_realize().connect( signal_realize().connect(
[this] [this]
{ {
// Refresh parent window action__update->activate();
action__refresh->activate();
} }
); );
} }

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

@ -86,7 +86,7 @@ namespace app::browser::main::tab
double progress_fraction; double progress_fraction;
// Actions // Actions
Glib::RefPtr<Gio::SimpleAction> action__refresh; Glib::RefPtr<Gio::SimpleAction> action__update;
// Database // Database
sqlite3 * db; sqlite3 * db;
@ -111,7 +111,7 @@ namespace app::browser::main::tab
const MIME & MIME, const MIME & MIME,
const Glib::ustring & TITLE, const Glib::ustring & TITLE,
const Glib::ustring & DESCRIPTION, const Glib::ustring & DESCRIPTION,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH, 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_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_RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_RELOAD

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

@ -9,7 +9,7 @@ using namespace app::browser::main::tab::page;
Navigation::Navigation( Navigation::Navigation(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH, const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
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_RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_RELOAD
@ -70,7 +70,7 @@ Navigation::Navigation(
navigationRequest = Gtk::make_managed<navigation::Request>( navigationRequest = Gtk::make_managed<navigation::Request>(
db, db,
ACTION__REFRESH, ACTION__UPDATE,
ACTION__NAVIGATION_RELOAD ACTION__NAVIGATION_RELOAD
); );
@ -94,7 +94,7 @@ void Navigation::update(
!navigationRequest->get_host().empty() && !navigationRequest->get_path().empty() !navigationRequest->get_host().empty() && !navigationRequest->get_path().empty()
); );
// Refresh history widget // Update history widget
navigationHistory->update(); navigationHistory->update();
// Toggle update button sensibility // Toggle update button sensibility
@ -102,7 +102,7 @@ void Navigation::update(
navigationRequest->get_text_length() > 0 navigationRequest->get_text_length() > 0
); );
// Refresh request area (with progressbar) // Update request area (with progressbar)
navigationRequest->update( navigationRequest->update(
PROGRESS_FRACTION PROGRESS_FRACTION
); );

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

@ -82,7 +82,7 @@ namespace app::browser::main::tab::page
Navigation( Navigation(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH, const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
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_RELOAD const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_RELOAD

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

@ -5,8 +5,8 @@ using namespace app::browser::main::tab::page::navigation;
// Construct // Construct
Request::Request( Request::Request(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH, const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE const Glib::RefPtr<Gio::SimpleAction> & ACTION__RELOAD
) { ) {
// Init database // Init database
DB::SESSION::init( DB::SESSION::init(
@ -14,8 +14,8 @@ Request::Request(
); );
// Init actions // Init actions
action__refresh = ACTION__REFRESH; action__update = ACTION__UPDATE;
action__update = ACTION__UPDATE; action__reload = ACTION__RELOAD;
// Init widget // Init widget
set_placeholder_text( set_placeholder_text(
@ -36,7 +36,7 @@ Request::Request(
{ {
parse(); parse();
action__refresh->activate(); action__update->activate();
} }
); );
@ -45,7 +45,7 @@ Request::Request(
{ {
parse(); parse();
action__update->activate(); action__reload->activate();
} }
); );
} }

8
src/app/browser/main/tab/page/navigation/request.hpp

@ -60,8 +60,8 @@ namespace app::browser::main::tab::page::navigation
sqlite3 * db; sqlite3 * db;
// Actions // Actions
Glib::RefPtr<Gio::SimpleAction> action__refresh, Glib::RefPtr<Gio::SimpleAction> action__update,
action__update; action__reload;
// Extras // Extras
double progress_fraction; double progress_fraction;
@ -87,8 +87,8 @@ namespace app::browser::main::tab::page::navigation
Request( Request(
sqlite3 * db, sqlite3 * db,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH, const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE const Glib::RefPtr<Gio::SimpleAction> & ACTION__RELOAD
); );
// Actions // Actions

Loading…
Cancel
Save