From a959d83144eddeb470e24aa5c02f1ed4ef3e2c47 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 2 Feb 2014 15:17:55 +0000 Subject: [PATCH] Implement showing built-in dialog via canvas --- source/carla | 3 +++ source/carla_host.py | 3 +++ source/carla_patchbay.py | 12 +++++++++++- source/carla_rack.py | 10 ++++++++++ source/patchcanvas.py | 8 ++++---- 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/source/carla b/source/carla index e4ed369f3..bb1e606df 100755 --- a/source/carla +++ b/source/carla @@ -147,6 +147,9 @@ class CarlaMultiW(QTabWidget): self.fPatchbay.saveSettings(settings) #self.fParent.saveSettings(settings) + def showEditDialog(self, pluginId): + self.fRack.showEditDialog(pluginId) + # ----------------------------------------------------------------- def fixCanvasPreviewSize(self): diff --git a/source/carla_host.py b/source/carla_host.py index 527d53ebd..273e4887a 100644 --- a/source/carla_host.py +++ b/source/carla_host.py @@ -97,6 +97,9 @@ class CarlaDummyW(object): def saveSettings(self, settings): pass + def showEditDialog(self, pluginId): + pass + # ------------------------------------------------------------------------------------------------------------ # Host Window diff --git a/source/carla_patchbay.py b/source/carla_patchbay.py index 2f551f03b..8fcf59893 100644 --- a/source/carla_patchbay.py +++ b/source/carla_patchbay.py @@ -264,6 +264,16 @@ class CarlaPatchbayW(QFrame): settings.setValue("HorizontalScrollBarValue", self.fView.horizontalScrollBar().value()) settings.setValue("VerticalScrollBarValue", self.fView.verticalScrollBar().value()) + def showEditDialog(self, pluginId): + if pluginId >= self.fPluginCount: + return + + pitem = self.fPluginList[pluginId] + if pitem is None: + return + + pitem.show() + # ----------------------------------------------------------------- # called by PluginEdit, ignored here @@ -890,7 +900,7 @@ def canvasCallback(action, value1, value2, valueStr): elif action == patchcanvas.ACTION_PLUGIN_EDIT: pluginId = value1 - # TODO + Carla.gui.fContainer.showEditDialog(pluginId) elif action == patchcanvas.ACTION_PLUGIN_RENAME: pluginId = value1 diff --git a/source/carla_rack.py b/source/carla_rack.py index 941615d95..62b8db5ed 100644 --- a/source/carla_rack.py +++ b/source/carla_rack.py @@ -232,6 +232,16 @@ class CarlaRackW(QListWidget): def saveSettings(self, settings): pass + def showEditDialog(self, pluginId): + if pluginId >= self.fPluginCount: + return + + pitem = self.fPluginList[pluginId] + if pitem is None: + return + + pitem.widget.slot_showEditDialog(True) + # ----------------------------------------------------------------- @pyqtSlot() diff --git a/source/patchcanvas.py b/source/patchcanvas.py index 49a59a1d3..3b7116809 100644 --- a/source/patchcanvas.py +++ b/source/patchcanvas.py @@ -2451,9 +2451,6 @@ class CanvasBox(QGraphicsItem): act_p_rename = menu.addAction("&Rename...") act_p_remove = menu.addAction("Re&move") - # TODO - act_p_edit.setVisible(False) - if not self.m_plugin_ui: act_p_ui.setVisible(False) @@ -2475,7 +2472,10 @@ class CanvasBox(QGraphicsItem): act_selected = menu.exec_(event.screenPos()) - if act_selected == act_x_disc_all: + if act_selected is None: + pass + + elif act_selected == act_x_disc_all: for port_id in port_con_list: canvas.callback(ACTION_PORTS_DISCONNECT, port_id, 0, "")