|
|
@ -15,9 +15,9 @@ Tab::Tab() |
|
|
|
signal_switch_page().connect( |
|
|
|
signal_switch_page().connect( |
|
|
|
[this](Gtk::Widget * page, guint page_num) |
|
|
|
[this](Gtk::Widget * page, guint page_num) |
|
|
|
{ |
|
|
|
{ |
|
|
|
on_switch( |
|
|
|
// Refresh window elements, e.g. tab label to header bar
|
|
|
|
page, |
|
|
|
activate_action( |
|
|
|
page_num |
|
|
|
"win.refresh" |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
); |
|
|
@ -25,6 +25,26 @@ Tab::Tab() |
|
|
|
|
|
|
|
|
|
|
|
Tab::~Tab() = default; |
|
|
|
Tab::~Tab() = default; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Getters
|
|
|
|
|
|
|
|
Glib::ustring Tab::get_label_text( |
|
|
|
|
|
|
|
int page_number |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
auto page = get_nth_page( |
|
|
|
|
|
|
|
page_number |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (page != nullptr) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return get_tab_label_text( |
|
|
|
|
|
|
|
* get_nth_page( |
|
|
|
|
|
|
|
page_number |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ""; // @TODO
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// Actions
|
|
|
|
// Actions
|
|
|
|
void Tab::append( |
|
|
|
void Tab::append( |
|
|
|
const char * request, |
|
|
|
const char * request, |
|
|
@ -92,22 +112,17 @@ void Tab::close_all() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Tab::update( |
|
|
|
void Tab::update( |
|
|
|
int number |
|
|
|
int page_number |
|
|
|
) { |
|
|
|
) { |
|
|
|
auto page = get_nth_page( |
|
|
|
auto page = get_nth_page( |
|
|
|
number |
|
|
|
page_number |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (page != nullptr) |
|
|
|
|
|
|
|
{ |
|
|
|
page->activate_action( |
|
|
|
page->activate_action( |
|
|
|
"page.update" |
|
|
|
"page.update" |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} // @TODO
|
|
|
|
} // @TODO
|
|
|
|
|
|
|
|
|
|
|
|
// Events
|
|
|
|
|
|
|
|
void Tab::on_switch( |
|
|
|
|
|
|
|
Gtk::Widget * page, |
|
|
|
|
|
|
|
guint page_num |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
// @TODO update header text
|
|
|
|
|
|
|
|
} |
|
|
|
|