remove extra actions

This commit is contained in:
yggverse 2024-09-15 13:21:15 +03:00
parent 39ed3edbb9
commit b522e6b2a0
12 changed files with 8 additions and 129 deletions

View File

@ -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()
{ {

View File

@ -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();

View File

@ -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

View File

@ -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

View File

@ -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
) { ) {

View File

@ -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
); );

View File

@ -90,57 +90,22 @@ 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( navigationBase->update(
navigationRequest->get_text().c_str(), navigationRequest->get_text()
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(); navigationHistory->update();
// Toggle update button sensibility
navigationReload->update( navigationReload->update(
navigationRequest->get_text_length() > 0 navigationRequest->get_text()
); );
// Update request area (with progressbar)
navigationRequest->update( navigationRequest->update(
PROGRESS_FRACTION 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( int Navigation::restore(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID
) { ) {

View File

@ -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

View File

@ -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()
); );
} }

View File

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

View File

@ -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
) { ) {

View File

@ -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