a bit more styling for that lock dialog
[ardour.git] / gtk2_ardour / editor_ops.cc
index e7618d916807c4676322414eeccfc806f0e3d373..759c795e3852fd0b47bcc5c194d4b569bccff7bf 100644 (file)
@@ -57,6 +57,7 @@
 
 #include "canvas/canvas.h"
 
+#include "actions.h"
 #include "ardour_ui.h"
 #include "audio_region_view.h"
 #include "audio_streamview.h"
@@ -7116,3 +7117,33 @@ Editor::toggle_midi_input_active (bool flip_others)
        
        _session->set_exclusive_input_active (rl, onoff, flip_others);
 }
+
+void
+Editor::lock ()
+{
+       if (!lock_dialog) {
+               lock_dialog = new ArdourDialog (string_compose (_("%1: Locked"), PROGRAM_NAME), true);
+
+               Gtk::Image* padlock = manage (new Gtk::Image (::get_icon ("padlock_closed")));
+               lock_dialog->get_vbox()->pack_start (*padlock);
+
+               ArdourButton* b = manage (new ArdourButton);
+               b->set_name ("lock button");
+               b->set_markup (string_compose ("<span size=\"large\" weight=\"bold\">%1</span>", _("Click me to unlock")));
+               b->signal_clicked.connect (sigc::mem_fun (*this, &Editor::unlock));
+               lock_dialog->get_vbox()->pack_start (*b);
+               
+               lock_dialog->get_vbox()->show_all ();
+               lock_dialog->set_size_request (200, 200);
+       }
+       
+       ActionManager::disable_all_actions ();
+       lock_dialog->present ();
+}
+
+void
+Editor::unlock ()
+{
+       lock_dialog->hide ();
+       ActionManager::pop_action_state ();
+}