make that status-bar error change actually compile
[ardour.git] / gtk2_ardour / theme_manager.cc
index 8d4daf0a3d372d527db590f498cb1ca208d58bbd..9fdba15da8414dc940130309129c06eb9d7103a4 100644 (file)
@@ -26,6 +26,8 @@
 #include <gtkmm2ext/gtk_ui.h>
 #include <gtkmm/settings.h>
 
+#include <ardour/profile.h>
+
 #include "theme_manager.h"
 #include "rgb_macros.h"
 #include "ardour_ui.h"
@@ -42,7 +44,7 @@ sigc::signal<void> ColorsChanged;
 sigc::signal<void,uint32_t> ColorChanged;
 
 ThemeManager::ThemeManager()
-       : ArdourDialog ("ThemeManager"),
+       : ArdourDialog ("Theme Manager"),
        dark_button ("Dark Theme"),
        light_button ("Light Theme"),
        reset_button ("Restore Defaults")
@@ -191,12 +193,27 @@ 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;
-
-       ARDOUR_UI::config()->ui_rc_file.set("ardour2_ui_dark.rc");
+       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");
+       }
        load_rc_file (ARDOUR_UI::config()->ui_rc_file.get(), true);
 }
 
@@ -204,8 +221,11 @@ void
 ThemeManager::on_light_theme_button_toggled()
 {
        if (!light_button.get_active()) return;
-
-       ARDOUR_UI::config()->ui_rc_file.set("ardour2_ui_light.rc");
+       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");
+       }
        load_rc_file (ARDOUR_UI::config()->ui_rc_file.get(), true);
 }
 
@@ -242,9 +262,9 @@ ThemeManager::setup_theme ()
                rcfile = ARDOUR_UI::config()->ui_rc_file.get();
        }
 
-       if (rcfile == "ardour2_ui_dark.rc") {
+       if (rcfile == "ardour2_ui_dark.rc" || rcfile == "ardour2_ui_dark_sae.rc") {
                dark_button.set_active();
-       } else if (rcfile == "ardour2_ui_light.rc") {
+       } else if (rcfile == "ardour2_ui_light.rc" || "ardour2_ui_light_sae.rc") {
                light_button.set_active();
        }