Browse Source

remove extra actions

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

9
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 // Getters
Glib::ustring Main::get_tab_page_title() Glib::ustring Main::get_tab_page_title()
{ {

4
src/app/browser/main.hpp

@ -105,10 +105,6 @@ namespace app::browser
void update(); void update();
void update(
const Glib::ustring & URI
);
// Getters // Getters
Glib::ustring get_tab_page_title(); Glib::ustring get_tab_page_title();
Glib::ustring get_tab_page_description(); Glib::ustring get_tab_page_description();

31
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( int Tab::append(
const Glib::ustring & LABEL_TEXT, const Glib::ustring & LABEL_TEXT,
const bool & IS_CURRENT const bool & IS_CURRENT

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

@ -124,11 +124,6 @@ namespace app::browser::main
const int & PAGE_NUMBER const int & PAGE_NUMBER
); );
void update(
const int & PAGE_NUMBER,
const Glib::ustring & URI
);
int restore( int restore(
const sqlite3_int64 & APP_BROWSER_MAIN__SESSION__ID const sqlite3_int64 & APP_BROWSER_MAIN__SESSION__ID
); // return sqlite3_finalize status code ); // return sqlite3_finalize status code

10
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( void Page::navigation_reload(
const bool & ADD_HISTORY const bool & ADD_HISTORY
) { ) {

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

@ -134,10 +134,6 @@ namespace app::browser::main::tab
void update(); void update();
void update(
const Glib::ustring & URI
);
void navigation_reload( void navigation_reload(
const bool & ADD_HISTORY const bool & ADD_HISTORY
); );

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

@ -90,54 +90,19 @@ Navigation::Navigation(
void Navigation::update( void Navigation::update(
const double & PROGRESS_FRACTION const double & PROGRESS_FRACTION
) { ) {
// Toggle base button sensibility // Update childs
GUri * uri = g_uri_parse(
navigationRequest->get_text().c_str(),
G_URI_FLAGS_NONE,
NULL // @TODO GError *
);
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
);
// 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( navigationBase->update(
REQUEST_TEXT navigationRequest->get_text()
); );
// Update history widget
navigationHistory->update(); navigationHistory->update();
// Toggle update button sensibility
navigationReload->update( navigationReload->update(
REQUEST_TEXT.length() > 0 navigationRequest->get_text()
); );
// Update request area (with progressbar)
navigationRequest->update( navigationRequest->update(
REQUEST_TEXT, PROGRESS_FRACTION
REQUEST_PROGRESS_FRACTION
); );
} }

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

@ -93,11 +93,6 @@ namespace app::browser::main::tab::page
const double & PROGRESS_FRACTION const double & PROGRESS_FRACTION
); );
void update(
const Glib::ustring & REQUEST_TEXT,
const double & REQUEST_PROGRESS_FRACTION
);
int restore( int restore(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID
); // return sqlite3_finalize status code ); // return sqlite3_finalize status code

6
src/app/browser/main/tab/page/navigation/reload.cpp

@ -30,13 +30,13 @@ Reload::Reload(
} }
void Reload::update( void Reload::update(
const bool & IS_ENABLED const Glib::ustring & REQUEST_TEXT
) { ) {
set_sensitive( set_sensitive(
IS_ENABLED !REQUEST_TEXT.empty()
); );
action__tab_page_navigation_reload->set_enabled( action__tab_page_navigation_reload->set_enabled(
IS_ENABLED !REQUEST_TEXT.empty()
); );
} }

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

@ -19,7 +19,7 @@ namespace app::browser::main::tab::page::navigation
); );
void update( void update(
const bool & IS_ENABLED const Glib::ustring & REQUEST_TEXT
); );
}; };
} }

13
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( int Request::restore(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID
) { ) {

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

@ -89,11 +89,6 @@ namespace app::browser::main::tab::page::navigation
const double & PROGRESS_FRACTION const double & PROGRESS_FRACTION
); );
void update(
const Glib::ustring & TEXT,
const double & PROGRESS_FRACTION
);
int restore( int restore(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID
); // return sqlite3_finalize status code ); // return sqlite3_finalize status code

Loading…
Cancel
Save