draft children components save action delegation

This commit is contained in:
yggverse 2024-09-10 20:50:31 +03:00
parent 7e8aaef1c5
commit b1f2a1b893
7 changed files with 32 additions and 2 deletions

View File

@ -129,7 +129,7 @@ int Tab::save()
// Save current tab session
for (int page_number = 0; page_number < get_n_pages(); page_number++)
{
auto tabLabel = get_tabLabel(
const auto TAB_LABEL = get_tabLabel(
page_number
);
@ -151,12 +151,17 @@ int Tab::save()
)SQL",
page_number,
page_number == get_current_page() ? 1 : 0,
tabLabel->get_text()
TAB_LABEL->get_text()
).c_str(),
nullptr,
nullptr,
&error
);
// Delegate save action to the page component
get_tabPage(
page_number
)->save();
}
}

View File

@ -63,6 +63,13 @@ void Page::refresh()
);
}
int Page::save()
{
pageNavigation->save();
return 1; // @TODO SQL
}
void Page::update(
const enum MIME & MIME,
const Glib::ustring & TITLE,

View File

@ -70,6 +70,8 @@ namespace app::browser::main::tab
// Actions
void refresh();
int save();
void update(
const MIME & MIME,
const Glib::ustring & TITLE,

View File

@ -101,6 +101,13 @@ void Navigation::refresh(
);
}
int Navigation::save()
{
navigationRequest->save();
return 1; // @TODO SQL
}
void Navigation::history_add(
const Glib::ustring & REQUEST,
const bool & UPDATE_MEMORY_INDEX

View File

@ -45,6 +45,8 @@ namespace app::browser::main::tab::page
const double & PROGRESS_FRACTION
);
int save();
void history_add(
const Glib::ustring & REQUEST,
const bool & UPDATE_MEMORY_INDEX

View File

@ -78,6 +78,11 @@ void Request::refresh(
);
}
int Request::save()
{
return 1; // @TODO SQL
}
void Request::parse()
{
auto match = Glib::Regex::split_simple(

View File

@ -46,6 +46,8 @@ namespace app::browser::main::tab::page::navigation
const double & PROGRESS_FRACTION
);
int save();
// Getters
Glib::ustring get_scheme();
Glib::ustring get_host();