summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-10-29 20:07:00 +0000
committerCarl Hetherington <carl@carlh.net>2011-10-29 20:07:00 +0000
commit4d365d08c1f654289f3df5a3b2ef6079b1dcea28 (patch)
tree16c571e289b6c9762b3d561959a951357a9c8029 /gtk2_ardour/ardour_ui.cc
parent780cd2fabcf15e666fa219fc94720c8c67da204b (diff)
Use general VisibilityGroup class to manage visibility
of bits of the status bar. git-svn-id: svn://localhost/ardour2/branches/3.0@10340 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r--gtk2_ardour/ardour_ui.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 63ca764477..7319be632e 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -178,6 +178,8 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
, error_log_button (_("Errors"))
+ , _status_bar_visibility (X_("status-bar"))
+
{
using namespace Gtk::Menu_Helpers;
@@ -330,16 +332,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
starting.connect (sigc::mem_fun(*this, &ARDOUR_UI::startup));
stopping.connect (sigc::mem_fun(*this, &ARDOUR_UI::shutdown));
- {
- _status_bar_visiblity = (StatusBarComponent) (StatusCPULoad | StatusBufferLoad | StatusSampleRate | StatusFormat);
- XMLNode* n = Config->extra_xml (X_("UI"));
- if (n) {
- XMLProperty* p = n->property (X_("status-bar-visibility"));
- if (p) {
- _status_bar_visiblity = (StatusBarComponent) string_2_enum (p->value(), _status_bar_visiblity);
- }
- }
- }
}
/** @return true if a session was chosen and `apply' clicked, otherwise false if `cancel' was clicked */
@@ -420,6 +412,12 @@ ARDOUR_UI::post_engine ()
throw failed_constructor ();
}
+ /* Do this after setup_windows (), as that's when the _status_bar_visibility is created */
+ XMLNode* n = Config->extra_xml (X_("UI"));
+ if (n) {
+ _status_bar_visibility.set_state (*n);
+ }
+
check_memory_locking();
/* this is the first point at which all the keybindings are available */
@@ -726,7 +724,7 @@ ARDOUR_UI::startup ()
/* We have to do this here since goto_editor_window() ends up calling show_all() on the
* editor window, and we may want stuff to be hidden.
*/
- update_status_bar_visibility ();
+ _status_bar_visibility.update ();
BootMessage (string_compose (_("%1 is ready for use"), PROGRAM_NAME));
}