New theme manager, with option to select between dark and light theme. Cleanups...
[ardour.git] / gtk2_ardour / ardour_ui_dialogs.cc
index 765eb53282eac390ca10c588522a5469c456af48..532b7ce76b3d6cb7db0d621f3c26f9d3a6a6bb01 100644 (file)
@@ -34,7 +34,7 @@
 #include "public_editor.h"
 #include "route_params_ui.h"
 #include "sfdb_ui.h"
-#include "color_manager.h"
+#include "theme_manager.h"
 
 #include "i18n.h"
 
@@ -126,6 +126,10 @@ ARDOUR_UI::connect_to_session (Session *s)
 
        solo_alert_button.set_active (session->soloing());
 
+       /* update autochange callback on dirty state changing */
+
+       session->DirtyChanged.connect (mem_fun(*this, &ARDOUR_UI::update_autosave));
+
        /* can't be auditioning here */
 
        primary_clock.set_session (s);
@@ -146,6 +150,8 @@ ARDOUR_UI::connect_to_session (Session *s)
 
        AudioClock::ModeChanged.connect (mem_fun (*this, &ARDOUR_UI::store_clock_modes));
 
+       Glib::signal_idle().connect (mem_fun (*this, &ARDOUR_UI::first_idle));
+
        start_clocking ();
        start_blinking ();
 
@@ -153,17 +159,17 @@ ARDOUR_UI::connect_to_session (Session *s)
 
        second_connection = Glib::signal_timeout().connect (mem_fun(*this, &ARDOUR_UI::every_second), 1000);
        point_one_second_connection = Glib::signal_timeout().connect (mem_fun(*this, &ARDOUR_UI::every_point_one_seconds), 100);
-       // point_oh_five_second_connection = Glib::signal_timeout().connect (mem_fun(*this, &ARDOUR_UI::every_point_oh_five_seconds), 50);
        point_zero_one_second_connection = Glib::signal_timeout().connect (mem_fun(*this, &ARDOUR_UI::every_point_zero_one_seconds), 40);
 }
 
-int
+bool
 ARDOUR_UI::unload_session ()
 {
        if (session && session->dirty()) {
                switch (ask_about_saving_session (_("close"))) {
                case -1:
-                       return 1;
+                       // cancel
+                       return false;
                        
                case 1:
                        session->save_state ("");
@@ -207,7 +213,7 @@ ARDOUR_UI::unload_session ()
 
        update_buffer_load ();
 
-       return 0;
+       return true;
 }
 
 int
@@ -319,17 +325,17 @@ ARDOUR_UI::toggle_location_window ()
 }
 
 void
-ARDOUR_UI::toggle_color_manager ()
+ARDOUR_UI::toggle_theme_manager ()
 {
-       RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleColorManager"));
+       RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleThemeManager"));
        if (act) {
                RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
        
                if (tact->get_active()) {
-                       color_manager->show_all ();
-                       color_manager->present ();
+                       theme_manager->show_all ();
+                       theme_manager->present ();
                } else {
-                       color_manager->hide ();
+                       theme_manager->hide ();
                } 
        }
 }