diff --git a/nymea-app/ui/components/BrowserContextMenu.qml b/nymea-app/ui/components/BrowserContextMenu.qml index 4b3aa555..318a952a 100644 --- a/nymea-app/ui/components/BrowserContextMenu.qml +++ b/nymea-app/ui/components/BrowserContextMenu.qml @@ -36,8 +36,6 @@ import "../delegates" MeaDialog { id: root - x: (parent.width - width) / 2 - y: (parent.height - height / 2) property Device device property string itemId @@ -76,7 +74,12 @@ MeaDialog { var params = [] root.activated(actionType.id, params) + root.accept() + // In case the action removes the item from the browser, our closed handler might be deleted + // before being called and that would keep the popup open + // explicitly destroy the popup to make sure it'll always go away + root.destroy() } } } @@ -110,9 +113,7 @@ MeaDialog { visible: stackView.depth > 1 onClicked: { var params = [] - print("k", stackView.currentItem.count) for (var i = 0; i < stackView.currentItem.count; i++) { - print("juhu", i) var param = {} param["paramTypeId"] = stackView.currentItem.itemAt(i).paramType.id param["value"] = stackView.currentItem.itemAt(i).value diff --git a/nymea-app/ui/delegates/BrowserItemDelegate.qml b/nymea-app/ui/delegates/BrowserItemDelegate.qml index 0b21fd72..71dc725d 100644 --- a/nymea-app/ui/delegates/BrowserItemDelegate.qml +++ b/nymea-app/ui/delegates/BrowserItemDelegate.qml @@ -61,7 +61,7 @@ NymeaListItemDelegate { } var actionDialogComponent = Qt.createComponent(Qt.resolvedUrl("../components/BrowserContextMenu.qml")); - var popup = actionDialogComponent.createObject(root.parent, + var popup = actionDialogComponent.createObject(app, { device: root.device, title: model.displayName, diff --git a/nymea-app/ui/devicepages/DeviceBrowserPage.qml b/nymea-app/ui/devicepages/DeviceBrowserPage.qml index f20ad237..60dcf62b 100644 --- a/nymea-app/ui/devicepages/DeviceBrowserPage.qml +++ b/nymea-app/ui/devicepages/DeviceBrowserPage.qml @@ -70,11 +70,9 @@ Page { onExecuteBrowserItemActionReply: actionExecuted(params) } function actionExecuted(params) { - print("Execute Action reply:", params, params.id, params["id"], d.pendingBrowserItemId) if (params.id === d.pendingBrowserItemId) { d.pendingBrowserItemId = -1; d.pendingItemId = "" - print("yep finished") if (params.status !== "success") { header.showInfo(params.error, true); } else if (params.params.deviceError !== "DeviceErrorNoError") {