Browse Source

rename refresh action to update

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

4
src/app/browser/main.cpp

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

2
src/app/browser/main.hpp

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

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

@ -64,7 +64,7 @@ namespace app::browser::main @@ -64,7 +64,7 @@ namespace app::browser::main
sqlite3 * db;
// Actions
Glib::RefPtr<Gio::SimpleAction> action__refresh,
Glib::RefPtr<Gio::SimpleAction> action__update,
action__tab_close_active,
action__tab_close_all,
action__tab_page_navigation_history_back,
@ -82,7 +82,7 @@ namespace app::browser::main @@ -82,7 +82,7 @@ namespace app::browser::main
Tab(
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__MAIN_TAB_CLOSE_ALL,
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( @@ -9,7 +9,7 @@ Page::Page(
const MIME & MIME,
const Glib::ustring & TITLE,
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_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_RELOAD
@ -21,7 +21,7 @@ Page::Page( @@ -21,7 +21,7 @@ Page::Page(
progress_fraction = 0;
// Init actions
action__refresh = ACTION__REFRESH;
action__update = ACTION__UPDATE;
// Init database
DB::SESSION::init(
@ -31,7 +31,7 @@ Page::Page( @@ -31,7 +31,7 @@ Page::Page(
// Init components
pageNavigation = Gtk::make_managed<page::Navigation>(
this->db,
ACTION__REFRESH,
ACTION__UPDATE,
ACTION__PAGE_NAVIGATION_HISTORY_BACK,
ACTION__PAGE_NAVIGATION_HISTORY_FORWARD,
ACTION__PAGE_NAVIGATION_RELOAD
@ -56,8 +56,7 @@ Page::Page( @@ -56,8 +56,7 @@ Page::Page(
signal_realize().connect(
[this]
{
// Refresh parent window
action__refresh->activate();
action__update->activate();
}
);
}

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

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

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

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

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

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

Loading…
Cancel
Save