From 5270db4086b73ee56af3d79abb22c4bec89588d8 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 20 Nov 2008 17:01:42 +0000 Subject: [PATCH] fix crash caused by ARDOUR::Profile not existing when theme manager is created, and checking for sae-specific theme variation. hacked around for now, pending release git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4224 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/theme_manager.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/theme_manager.cc b/gtk2_ardour/theme_manager.cc index e0333df802..d69d356cff 100644 --- a/gtk2_ardour/theme_manager.cc +++ b/gtk2_ardour/theme_manager.cc @@ -193,11 +193,23 @@ load_rc_file (const string& filename, bool themechange) Gtkmm2ext::UI::instance()->load_rcfile (rcfile, themechange); } +/* hmm, this is a problem. the profile doesn't + exist when the theme manager is constructed + and toggles buttons during "normal" GTK setup. + + a better solution will be to make all Profile + methods static or something. + + XXX FIX ME +*/ + +#define HACK_PROFILE_IS_SAE() (getenv("ARDOUR_SAE")!=0) + void ThemeManager::on_dark_theme_button_toggled() { if (!dark_button.get_active()) return; - if (Profile->get_sae()) { + if (HACK_PROFILE_IS_SAE()){ ARDOUR_UI::config()->ui_rc_file.set("ardour2_ui_dark_sae.rc"); } else { ARDOUR_UI::config()->ui_rc_file.set("ardour2_ui_dark.rc"); @@ -209,7 +221,7 @@ void ThemeManager::on_light_theme_button_toggled() { if (!light_button.get_active()) return; - if (Profile->get_sae()) { + if (HACK_PROFILE_IS_SAE()){ ARDOUR_UI::config()->ui_rc_file.set("ardour2_ui_light_sae.rc"); } else { ARDOUR_UI::config()->ui_rc_file.set("ardour2_ui_light.rc");