followup to the previous tempo-dragging commit: use argument to Drag::aborted() to...
[ardour.git] / gtk2_ardour / bundle_manager.cc
index 9916f805810f65741e3e59a7befdff44608e27e7..3d0a0e3a37537f337a2b85102ab60dbee7508692 100644 (file)
@@ -59,7 +59,7 @@ BundleEditorMatrix::setup_ports (int dim)
                /* when we gather, allow the matrix to contain bundles with duplicate port sets,
                   otherwise in some cases the basic system IO ports may be hidden, making
                   the bundle editor useless */
-               
+
                _ports[OTHER].gather (_session, DataType::NIL, _bundle->ports_are_inputs(), true);
                _ports[OTHER].remove_bundle (_bundle);
                _ports[OTHER].resume_signals ();
@@ -82,11 +82,15 @@ BundleEditorMatrix::set_state (BundleChannel c[2], bool s)
 PortMatrixNode::State
 BundleEditorMatrix::get_state (BundleChannel c[2]) const
 {
+       if (c[0].bundle->nchannels() == ChanCount::ZERO || c[1].bundle->nchannels() == ChanCount::ZERO) {
+               return PortMatrixNode::NOT_ASSOCIATED;
+       }
+
        Bundle::PortList const& pl = c[OTHER].bundle->channel_ports (c[OTHER].channel);
        if (pl.empty ()) {
                return PortMatrixNode::NOT_ASSOCIATED;
        }
-       
+
        for (Bundle::PortList::const_iterator i = pl.begin(); i != pl.end(); ++i) {
                if (!c[OURS].bundle->port_attached_to_channel (c[OURS].channel, *i)) {
                        return PortMatrixNode::NOT_ASSOCIATED;
@@ -306,6 +310,9 @@ BundleManager::BundleManager (Session* session)
                sigc::mem_fun (*this, &BundleManager::row_activated)
                );
 
+       Gtk::Button* close_but = add_button (Gtk::Stock::CLOSE, Gtk::RESPONSE_ACCEPT);
+       close_but->signal_clicked ().connect (sigc::mem_fun (*this, &Gtk::Window::hide));
+
        set_button_sensitivity ();
 
        show_all ();
@@ -401,7 +408,7 @@ BundleManager::row_activated (Gtk::TreeModel::Path const & p, Gtk::TreeViewColum
        if (!i) {
                return;
        }
-       
+
        boost::shared_ptr<UserBundle> b = (*i)[_list_model_columns.bundle];
        BundleEditor e (_session, b);
        e.run ();