+
+void
+Editor::lock ()
+{
+ if (!lock_dialog) {
+ lock_dialog = new Gtk::Dialog (string_compose (_("%1: Locked"), PROGRAM_NAME), true);
+
+ Gtk::Image* padlock = manage (new Gtk::Image (ARDOUR_UI_UTILS::get_icon ("padlock_closed")));
+ lock_dialog->get_vbox()->pack_start (*padlock);
+
+ ArdourButton* b = manage (new ArdourButton);
+ b->set_name ("lock button");
+ b->set_text (_("Click 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);
+ }
+
+#ifdef __APPLE__
+ /* The global menu bar continues to be accessible to applications
+ with modal dialogs, which means that we need to desensitize
+ all items in the menu bar. Since those items are really just
+ proxies for actions, that means disabling all actions.
+ */
+ ActionManager::disable_all_actions ();
+#endif
+ lock_dialog->present ();
+}
+
+void
+Editor::unlock ()
+{
+ lock_dialog->hide ();
+
+#ifdef __APPLE__
+ ActionManager::pop_action_state ();
+#endif
+
+ if (ARDOUR_UI::config()->get_lock_gui_after_seconds()) {
+ start_lock_event_timing ();
+ }
+}
+
+void
+Editor::bring_in_callback (Gtk::Label* label, uint32_t n, uint32_t total, string name)
+{
+ Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&Editor::update_bring_in_message, this, label, n, total, name));
+}
+
+void
+Editor::update_bring_in_message (Gtk::Label* label, uint32_t n, uint32_t total, string name)
+{
+ label->set_text (string_compose ("Copying %1, %2 of %3", name, n, total));
+ Gtkmm2ext::UI::instance()->flush_pending ();
+}
+
+void
+Editor::bring_all_sources_into_session ()
+{
+ if (!_session) {
+ return;
+ }
+
+ Gtk::Label msg;
+ ArdourDialog w (_("Moving embedded files into session folder"));
+ w.get_vbox()->pack_start (msg);
+ w.present ();
+
+ /* flush all pending GUI events because we're about to start copying
+ * files
+ */
+
+ Gtkmm2ext::UI::instance()->flush_pending ();
+
+ cerr << " Do it\n";
+
+ _session->bring_all_sources_into_session (boost::bind (&Editor::bring_in_callback, this, &msg, _1, _2, _3));
+}