summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/PatchPortModule.cpp6
-rw-r--r--src/gui/PatchPortModule.hpp1
-rw-r--r--src/gui/PortMenu.cpp26
3 files changed, 16 insertions, 17 deletions
diff --git a/src/gui/PatchPortModule.cpp b/src/gui/PatchPortModule.cpp
index 851f694b..4c2b321b 100644
--- a/src/gui/PatchPortModule.cpp
+++ b/src/gui/PatchPortModule.cpp
@@ -73,10 +73,8 @@ PatchPortModule::create(PatchCanvas& canvas,
bool
PatchPortModule::show_menu(GdkEventButton* ev)
{
- WidgetFactory::get_widget_derived("object_menu", _menu);
- _menu->init(_model, true);
- _menu->popup(ev->button, ev->time);
- return true;
+ std::cout << "PPM SHOW MENU" << std::endl;
+ return _port->show_menu(ev);
}
void
diff --git a/src/gui/PatchPortModule.hpp b/src/gui/PatchPortModule.hpp
index b96d5dcb..655e6bfc 100644
--- a/src/gui/PatchPortModule.hpp
+++ b/src/gui/PatchPortModule.hpp
@@ -74,7 +74,6 @@ protected:
SharedPtr<const PortModel> _model;
Port* _port;
- PortMenu* _menu;
};
} // namespace GUI
diff --git a/src/gui/PortMenu.cpp b/src/gui/PortMenu.cpp
index d958b278..c496d675 100644
--- a/src/gui/PortMenu.cpp
+++ b/src/gui/PortMenu.cpp
@@ -57,25 +57,27 @@ PortMenu::init(SharedPtr<const PortModel> port, bool patch_port)
if ( ! PtrCast<PatchModel>(port->parent()) ) {
_polyphonic_menuitem->set_sensitive(false);
- _rename_menuitem->hide();
- _destroy_menuitem->hide();
+ _rename_menuitem->set_sensitive(false);
+ _destroy_menuitem->set_sensitive(false);
}
if (port->is_a(PortType::EVENTS))
_polyphonic_menuitem->hide();
- _port_menu->remove(*_reset_range_menuitem);
- _port_menu->remove(*_set_min_menuitem);
- _port_menu->remove(*_set_max_menuitem);
- if (App::instance().can_control(port.get()) && port->is_numeric()) {
- _learn_menuitem->show();
- _unlearn_menuitem->show();
+ items().push_back(
+ Gtk::Menu_Helpers::MenuElem(
+ "Disconnect All", sigc::mem_fun(this, &PortMenu::on_menu_disconnect)));
+
+ const bool is_control = App::instance().can_control(port.get())
+ && port->is_numeric();
- items().push_front(Gtk::Menu_Helpers::SeparatorElem());
+ _reset_range_menuitem->set_sensitive(is_control);
+ _set_max_menuitem->set_sensitive(is_control);
+ _set_min_menuitem->set_sensitive(is_control);
- insert(*_reset_range_menuitem, 0);
- insert(*_set_max_menuitem, 0);
- insert(*_set_min_menuitem, 0);
+ if (is_control) {
+ _learn_menuitem->show();
+ _unlearn_menuitem->show();
}
_enable_signal = true;