permit sends to show up in processor box, by handling delete event and sending Finished from IOSelectorWindow

git-svn-id: svn://localhost/ardour2/branches/3.0@5659 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2009-09-13 02:03:04 +00:00
parent 265cf739b5
commit 3023d53d7d
3 changed files with 32 additions and 5 deletions

View File

@ -165,9 +165,18 @@ IOSelectorWindow::IOSelectorWindow (ARDOUR::Session& session, boost::shared_ptr<
show_all ();
signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), this));
signal_delete_event().connect (mem_fun (*this, &IOSelectorWindow::wm_delete));
}
bool
IOSelectorWindow::wm_delete (GdkEventAny* /*event*/)
{
_selector.Finished (IOSelector::Accepted);
hide ();
return true;
}
void
IOSelectorWindow::on_map ()
{
@ -256,11 +265,18 @@ PortInsertWindow::PortInsertWindow (ARDOUR::Session& sess, boost::shared_ptr<ARD
ok_button.signal_clicked().connect (mem_fun (*this, &PortInsertWindow::accept));
cancel_button.signal_clicked().connect (mem_fun (*this, &PortInsertWindow::cancel));
signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), reinterpret_cast<Window *> (this)));
signal_delete_event().connect (mem_fun (*this, &PortInsertWindow::wm_delete), false);
going_away_connection = pi->GoingAway.connect (mem_fun (*this, &PortInsertWindow::plugin_going_away));
}
bool
PortInsertWindow::wm_delete (GdkEventAny* /*event*/)
{
accept ();
return true;
}
void
PortInsertWindow::plugin_going_away ()
{

View File

@ -85,6 +85,7 @@ class IOSelectorWindow : public Gtk::Window
IOSelector _selector;
void io_name_changed (void *src);
bool wm_delete (GdkEventAny*);
};
@ -122,6 +123,8 @@ class PortInsertWindow : public ArdourDialog
void plugin_going_away ();
sigc::connection going_away_connection;
bool wm_delete (GdkEventAny*);
};

View File

@ -672,17 +672,25 @@ ProcessorBox::choose_send ()
return;
}
/* let the user adjust the IO setup before creation */
/* let the user adjust the IO setup before creation.
Note: this dialog is NOT modal - we just leave it to run and it will
return when its Finished signal is emitted - typically when the window
is closed.
*/
IOSelectorWindow *ios = new IOSelectorWindow (_session, send->output(), true);
ios->show_all ();
/* keep a reference to the send so it doesn't get deleted while
the IOSelectorWindow is doing its stuff */
the IOSelectorWindow is doing its stuff
*/
_processor_being_created = send;
ios->selector().Finished.connect (bind (
mem_fun(*this, &ProcessorBox::send_io_finished),
boost::weak_ptr<Processor>(send), ios));
}
void