add a modal lock dialog for better testing (and someone might find it useful, too)

This commit is contained in:
Paul Davis 2014-06-24 10:14:07 -04:00
parent f147846863
commit a12f43fa46
3 changed files with 13 additions and 0 deletions

View File

@ -301,6 +301,7 @@ Editor::Editor ()
last_update_frame = 0;
pre_press_cursor = 0;
_drags = new DragManager (this);
lock_dialog = 0;
current_mixer_strip = 0;
tempo_lines = 0;

View File

@ -1358,6 +1358,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void escape ();
void lock ();
void unlock ();
ArdourDialog* lock_dialog;
Gtk::Menu fade_context_menu;

View File

@ -7121,11 +7121,22 @@ Editor::toggle_midi_input_active (bool flip_others)
void
Editor::lock ()
{
if (!lock_dialog) {
lock_dialog = new ArdourDialog (string_compose (_("%1 is Locked"), PROGRAM_NAME), true);
Gtk::Button* b = manage (new Gtk::Button (_("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 ();
}
ActionManager::disable_all_actions ();
lock_dialog->present ();
}
void
Editor::unlock ()
{
lock_dialog->hide ();
ActionManager::pop_action_state ();
}