Browse Source

draft children components save action delegation

CPP-GTK4
yggverse 3 months ago
parent
commit
b1f2a1b893
  1. 9
      src/app/browser/main/tab.cpp
  2. 7
      src/app/browser/main/tab/page.cpp
  3. 2
      src/app/browser/main/tab/page.hpp
  4. 7
      src/app/browser/main/tab/page/navigation.cpp
  5. 2
      src/app/browser/main/tab/page/navigation.hpp
  6. 5
      src/app/browser/main/tab/page/navigation/request.cpp
  7. 2
      src/app/browser/main/tab/page/navigation/request.hpp

9
src/app/browser/main/tab.cpp

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

7
src/app/browser/main/tab/page.cpp

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save