Browse Source

implement separated restore action method

CPP-GTK4
yggverse 3 months ago
parent
commit
817c946270
  1. 25
      src/app/browser/main/tab.cpp
  2. 2
      src/app/browser/main/tab.hpp

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

@ -53,6 +53,21 @@ Tab::Tab( @@ -53,6 +53,21 @@ Tab::Tab(
[this]
{
// Restore session from DB
restore();
}
);
signal_switch_page().connect(
[this](Gtk::Widget*, guint)
{
// Refresh window elements, e.g. tab label to header bar
action__refresh->activate();
}
);
}
void Tab::restore()
{
sqlite3_stmt* statement;
const int PREPARE = ::sqlite3_prepare_v3(
@ -95,16 +110,6 @@ Tab::Tab( @@ -95,16 +110,6 @@ Tab::Tab(
sqlite3_finalize(
statement
);
}
);
signal_switch_page().connect(
[this](Gtk::Widget*, guint)
{
// Refresh window elements, e.g. tab label to header bar
action__refresh->activate();
}
);
}
void Tab::save()

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

@ -94,6 +94,8 @@ namespace app::browser::main @@ -94,6 +94,8 @@ namespace app::browser::main
const int & PAGE_NUMBER
);
void restore();
void save();
void shutdown();

Loading…
Cancel
Save