From b522e6b2a0cbed412bddb43878083ca5f74f9d17 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 15 Sep 2024 13:21:15 +0300 Subject: [PATCH] remove extra actions --- src/app/browser/main.cpp | 9 ---- src/app/browser/main.hpp | 4 -- src/app/browser/main/tab.cpp | 31 ------------- src/app/browser/main/tab.hpp | 5 --- src/app/browser/main/tab/page.cpp | 10 ----- src/app/browser/main/tab/page.hpp | 4 -- src/app/browser/main/tab/page/navigation.cpp | 43 ++----------------- src/app/browser/main/tab/page/navigation.hpp | 5 --- .../main/tab/page/navigation/reload.cpp | 6 +-- .../main/tab/page/navigation/reload.hpp | 2 +- .../main/tab/page/navigation/request.cpp | 13 ------ .../main/tab/page/navigation/request.hpp | 5 --- 12 files changed, 8 insertions(+), 129 deletions(-) diff --git a/src/app/browser/main.cpp b/src/app/browser/main.cpp index 205cec16..58bc4ac0 100644 --- a/src/app/browser/main.cpp +++ b/src/app/browser/main.cpp @@ -168,15 +168,6 @@ void Main::update() ); }; -void Main::update( - const Glib::ustring & URI -) { - mainTab->update( - mainTab->get_current_page(), - URI - ); -}; - // Getters Glib::ustring Main::get_tab_page_title() { diff --git a/src/app/browser/main.hpp b/src/app/browser/main.hpp index 997fe735..cceba734 100644 --- a/src/app/browser/main.hpp +++ b/src/app/browser/main.hpp @@ -105,10 +105,6 @@ namespace app::browser void update(); - void update( - const Glib::ustring & URI - ); - // Getters Glib::ustring get_tab_page_title(); Glib::ustring get_tab_page_description(); diff --git a/src/app/browser/main/tab.cpp b/src/app/browser/main/tab.cpp index 9cdb480b..5dda5c12 100644 --- a/src/app/browser/main/tab.cpp +++ b/src/app/browser/main/tab.cpp @@ -166,37 +166,6 @@ void Tab::update( ); } -void Tab::update( - const int & PAGE_NUMBER, - const Glib::ustring & URI -) { - // Get tab page - const auto TAB_PAGE = get_tabPage( - PAGE_NUMBER - ); - - // Update tab page component - TAB_PAGE->update( - URI - ); - - // Update tab label component - get_tabLabel( - PAGE_NUMBER - )->set_label( - TAB_PAGE->get_title() - ); - - // Update tab actions status - action__tab_close->set_enabled( - get_n_pages() > 0 - ); - - action__tab_close_all->set_enabled( - get_n_pages() > 0 - ); -} - int Tab::append( const Glib::ustring & LABEL_TEXT, const bool & IS_CURRENT diff --git a/src/app/browser/main/tab.hpp b/src/app/browser/main/tab.hpp index 37327ee4..29a7edf2 100644 --- a/src/app/browser/main/tab.hpp +++ b/src/app/browser/main/tab.hpp @@ -124,11 +124,6 @@ namespace app::browser::main const int & PAGE_NUMBER ); - void update( - const int & PAGE_NUMBER, - const Glib::ustring & URI - ); - int restore( const sqlite3_int64 & APP_BROWSER_MAIN__SESSION__ID ); // return sqlite3_finalize status code diff --git a/src/app/browser/main/tab/page.cpp b/src/app/browser/main/tab/page.cpp index 0a6d636f..32b08c13 100644 --- a/src/app/browser/main/tab/page.cpp +++ b/src/app/browser/main/tab/page.cpp @@ -184,16 +184,6 @@ void Page::update() ); } -void Page::update( - const Glib::ustring & URI -) { - // Update children components - pageNavigation->update( - URI, - progress_fraction - ); -} - void Page::navigation_reload( const bool & ADD_HISTORY ) { diff --git a/src/app/browser/main/tab/page.hpp b/src/app/browser/main/tab/page.hpp index bacc904a..31b25199 100644 --- a/src/app/browser/main/tab/page.hpp +++ b/src/app/browser/main/tab/page.hpp @@ -134,10 +134,6 @@ namespace app::browser::main::tab void update(); - void update( - const Glib::ustring & URI - ); - void navigation_reload( const bool & ADD_HISTORY ); diff --git a/src/app/browser/main/tab/page/navigation.cpp b/src/app/browser/main/tab/page/navigation.cpp index db0b3e0b..4d5dc08c 100644 --- a/src/app/browser/main/tab/page/navigation.cpp +++ b/src/app/browser/main/tab/page/navigation.cpp @@ -90,57 +90,22 @@ Navigation::Navigation( void Navigation::update( const double & PROGRESS_FRACTION ) { - // Toggle base button sensibility - GUri * uri = g_uri_parse( - navigationRequest->get_text().c_str(), - G_URI_FLAGS_NONE, - NULL // @TODO GError * + // Update childs + navigationBase->update( + navigationRequest->get_text() ); - navigationBase->set_sensitive( - NULL != uri && - NULL != g_uri_get_host(uri) && - NULL != g_uri_get_path(uri) - ); - - // Update history widget navigationHistory->update(); - // Toggle update button sensibility navigationReload->update( - navigationRequest->get_text_length() > 0 + navigationRequest->get_text() ); - // Update request area (with progressbar) navigationRequest->update( PROGRESS_FRACTION ); } -void Navigation::update( - const Glib::ustring & REQUEST_TEXT, - const double & REQUEST_PROGRESS_FRACTION -) { - // Update base widget - navigationBase->update( - REQUEST_TEXT - ); - - // Update history widget - navigationHistory->update(); - - // Toggle update button sensibility - navigationReload->update( - REQUEST_TEXT.length() > 0 - ); - - // Update request area (with progressbar) - navigationRequest->update( - REQUEST_TEXT, - REQUEST_PROGRESS_FRACTION - ); -} - int Navigation::restore( const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID ) { diff --git a/src/app/browser/main/tab/page/navigation.hpp b/src/app/browser/main/tab/page/navigation.hpp index cb11bda3..7462d24b 100644 --- a/src/app/browser/main/tab/page/navigation.hpp +++ b/src/app/browser/main/tab/page/navigation.hpp @@ -93,11 +93,6 @@ namespace app::browser::main::tab::page const double & PROGRESS_FRACTION ); - void update( - const Glib::ustring & REQUEST_TEXT, - const double & REQUEST_PROGRESS_FRACTION - ); - int restore( const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID ); // return sqlite3_finalize status code diff --git a/src/app/browser/main/tab/page/navigation/reload.cpp b/src/app/browser/main/tab/page/navigation/reload.cpp index 197906cf..33b99630 100644 --- a/src/app/browser/main/tab/page/navigation/reload.cpp +++ b/src/app/browser/main/tab/page/navigation/reload.cpp @@ -30,13 +30,13 @@ Reload::Reload( } void Reload::update( - const bool & IS_ENABLED + const Glib::ustring & REQUEST_TEXT ) { set_sensitive( - IS_ENABLED + !REQUEST_TEXT.empty() ); action__tab_page_navigation_reload->set_enabled( - IS_ENABLED + !REQUEST_TEXT.empty() ); } \ No newline at end of file diff --git a/src/app/browser/main/tab/page/navigation/reload.hpp b/src/app/browser/main/tab/page/navigation/reload.hpp index c45782a4..5728b114 100644 --- a/src/app/browser/main/tab/page/navigation/reload.hpp +++ b/src/app/browser/main/tab/page/navigation/reload.hpp @@ -19,7 +19,7 @@ namespace app::browser::main::tab::page::navigation ); void update( - const bool & IS_ENABLED + const Glib::ustring & REQUEST_TEXT ); }; } diff --git a/src/app/browser/main/tab/page/navigation/request.cpp b/src/app/browser/main/tab/page/navigation/request.cpp index 3e92a1c2..54a165e7 100644 --- a/src/app/browser/main/tab/page/navigation/request.cpp +++ b/src/app/browser/main/tab/page/navigation/request.cpp @@ -89,19 +89,6 @@ void Request::update( ); } -void Request::update( - const Glib::ustring & TEXT, - const double & PROGRESS_FRACTION -) { - set_text( - TEXT - ); - - update( - PROGRESS_FRACTION - ); -} - int Request::restore( const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID ) { diff --git a/src/app/browser/main/tab/page/navigation/request.hpp b/src/app/browser/main/tab/page/navigation/request.hpp index dffffb60..f4b64c62 100644 --- a/src/app/browser/main/tab/page/navigation/request.hpp +++ b/src/app/browser/main/tab/page/navigation/request.hpp @@ -89,11 +89,6 @@ namespace app::browser::main::tab::page::navigation const double & PROGRESS_FRACTION ); - void update( - const Glib::ustring & TEXT, - const double & PROGRESS_FRACTION - ); - int restore( const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID ); // return sqlite3_finalize status code