show() widgets explicitly in the MixerUI window, fix UI::just_hide_it(), so that...
[ardour.git] / gtk2_ardour / ardour_ui_dialogs.cc
index 15940c2e56f939dcce070ce6ebb351ab189cb10d..c6353df782d63c7d4881b454eb7d7d088609a55e 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 ();
 
@@ -156,13 +162,14 @@ ARDOUR_UI::connect_to_session (Session *s)
        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 ("");
@@ -198,7 +205,7 @@ ARDOUR_UI::unload_session ()
        }
 
        if (mixer) {
-               mixer->hide_all ();
+               mixer->hide ();
        }
 
        delete session;
@@ -206,7 +213,7 @@ ARDOUR_UI::unload_session ()
 
        update_buffer_load ();
 
-       return 0;
+       return true;
 }
 
 int
@@ -318,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 ();
                } 
        }
 }