fix VST plugin crash (from 35a9c63)
[ardour.git] / gtk2_ardour / theme_manager.cc
index 6a557399db36072341029cf11ed749eac491457b..1f1baa84f1734114e1c1354480f4f7f4a0ee4d40 100644 (file)
@@ -24,6 +24,8 @@
 
 #include "fix_carbon.h"
 
+#include <glib/gstdio.h>
+
 #include <gtkmm/stock.h>
 #include <gtkmm/settings.h>
 
@@ -112,7 +114,9 @@ ThemeManager::ThemeManager()
        theme_selection_hbox.pack_start (light_button);
 
        set_homogeneous (false);
+#if 0 // disable light/dark theme choice. until the 'light theme gets some attention.
        pack_start (theme_selection_hbox, PACK_SHRINK);
+#endif
        pack_start (reset_button, PACK_SHRINK);
 #ifndef __APPLE__
        pack_start (all_dialogs, PACK_SHRINK);
@@ -383,6 +387,19 @@ ThemeManager::set_ui_to_state()
 void
 ThemeManager::reset_canvas_colors()
 {
+       string cfile;
+       string basename;
+
+       basename = "my-";
+       basename += ARDOUR_UI::config()->get_color_file();
+       basename += ".colors";
+
+       if (find_file (ardour_config_search_path(), basename, cfile)) {
+               string backup = cfile + string (X_(".old"));
+               g_rename (cfile.c_str(), backup.c_str());
+               /* don't really care if it fails */
+       }
+
        ARDOUR_UI::config()->load_defaults();
        ARDOUR_UI::config()->save_state ();
        set_ui_to_state();