size-based scrolling and right-click pages for editor notebook
[ardour.git] / gtk2_ardour / ardour_ui_dialogs.cc
index aa06e25ad5ada30adb59052b50e5bac6d7a60f7e..1a0ba6618f6f8361a241fd132082f138c61e9dd4 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <ardour/session.h>
 
+#include "actions.h"
 #include "ardour_ui.h"
 #include "connection_editor.h"
 #include "location_ui.h"
 #include "public_editor.h"
 #include "route_params_ui.h"
 #include "sfdb_ui.h"
-#include "actions.h"
 
 #include "i18n.h"
 
 using namespace ARDOUR;
+using namespace Glib;
 using namespace Gtk;
 using namespace Gtkmm2ext;
 
@@ -180,13 +181,12 @@ int
 ARDOUR_UI::create_connection_editor ()
 {
        if (connection_editor == 0) {
-               // GTK2FIX
-               // connection_editor = new ConnectionEditor ();
-               // connection_editor->signal_unmap().connect (mem_fun(*this, &ARDOUR_UI::connection_editor_hiding));
+//             connection_editor = new ConnectionEditor ();
+//             connection_editor->signal_unmap().connect (sigc::bind (ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleConnections")));
        }
 
        if (session) {
-               // connection_editor->set_session (session);
+//             connection_editor->set_session (session);
        }
 
        return 0;
@@ -210,26 +210,13 @@ ARDOUR_UI::toggle_connection_editor ()
 #endif
 }
 
-void
-ARDOUR_UI::connection_editor_hiding()
-{
-       //GTK2FIX
-       // connection_editor_check->set_active(false);
-}
-
-void
-ARDOUR_UI::big_clock_hiding()
-{
-       // GTK2FIX
-       // big_clock_check->set_active(false);
-}
-
 void
 ARDOUR_UI::toggle_big_clock_window ()
 {
        if (big_clock_window->is_visible()) {
                big_clock_window->hide ();
        } else {
+               big_clock_window->show_all ();
                big_clock_window->present ();
        }
 }
@@ -239,7 +226,7 @@ ARDOUR_UI::toggle_options_window ()
 {
        if (option_editor == 0) {
                option_editor = new OptionEditor (*this, *editor, *mixer);
-               option_editor->signal_unmap().connect(mem_fun(*this, &ARDOUR_UI::option_hiding));
+               option_editor->signal_unmap().connect(sigc::bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleOptionsEditor")));
                option_editor->set_session (session);
        } 
 
@@ -250,13 +237,6 @@ ARDOUR_UI::toggle_options_window ()
        }
 }
 
-void
-ARDOUR_UI::option_hiding ()
-{
-       // GTK2FIX
-       // options_window_check->set_active(false);
-}
-
 void
 ARDOUR_UI::toggle_auto_input ()
 
@@ -272,8 +252,8 @@ ARDOUR_UI::create_location_ui ()
        if (location_ui == 0) {
                location_ui = new LocationUI ();
                location_ui->set_session (session);
-               location_ui->signal_unmap().connect (mem_fun(*this, &ARDOUR_UI::location_ui_hiding));
-       } 
+               location_ui->signal_unmap().connect (sigc::bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleLocations")));
+       }
        return 0;
 }
 
@@ -291,20 +271,13 @@ ARDOUR_UI::toggle_location_window ()
        }
 }
 
-void
-ARDOUR_UI::location_ui_hiding()
-{
-       // GTK2FIX
-       // locations_dialog_check->set_active(false);
-}
-
 int
 ARDOUR_UI::create_route_params ()
 {
        if (route_params == 0) {
                route_params = new RouteParams_UI (*engine);
                route_params->set_session (session);
-               route_params->signal_unmap().connect (mem_fun(*this, &ARDOUR_UI::route_params_hiding));
+               route_params->signal_unmap().connect (sigc::bind(sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleInspector")));
        }
        return 0;
 }
@@ -322,24 +295,33 @@ ARDOUR_UI::toggle_route_params_window ()
                route_params->present ();
        }
 }
-       
-void
-ARDOUR_UI::route_params_hiding ()
+
+int
+ARDOUR_UI::create_sound_file_browser ()
 {
-       // GTK2FIX
-       // route_params_check->set_active (false);
+       if (sfdb == 0) {
+               sfdb = new SoundFileBrowser (_("Sound File Browser"));
+               sfdb->set_session (session);
+               sfdb->signal_unmap().connect (sigc::bind(sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleSoundFileBrowser")));
+       }
+       return 0;
 }
-
+       
 void
 ARDOUR_UI::toggle_sound_file_browser ()
 {
-       // GTK2FIX
-       // if (sfdb_check->get_active()) {
-       // SoundFileBrowser sfdb(_("Sound File Browser"));
-
-       // sfdb_check->signal_toggled().connect (bind (mem_fun (sfdb, &Gtk::Dialog::response), Gtk::RESPONSE_CANCEL));
-       // sfdb.run();
-       // sfdb_check->set_active(false);
-       // }
-}
+       if (create_sound_file_browser()) {
+               return;
+       }
 
+       RefPtr<Action> act = ActionManager::ui_manager->get_action (X_("<Actions>/Common/ToggleSoundFileBrowser"));
+       if (act) {
+               RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
+       
+               if (tact->get_active()) {
+                       sfdb->present();
+               } else {
+                       sfdb->hide ();
+               }
+       }
+}