From 1965b02fdfa1d3c47778de26ee952e5e6a265e3b Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 6 Apr 2017 14:28:42 +0200 Subject: [PATCH 1/5] Fix size problem for open project dialog CURA-3642 --- .../qml/AskOpenAsProjectOrModelsDialog.qml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/resources/qml/AskOpenAsProjectOrModelsDialog.qml b/resources/qml/AskOpenAsProjectOrModelsDialog.qml index e298ccb64f..d85019983e 100644 --- a/resources/qml/AskOpenAsProjectOrModelsDialog.qml +++ b/resources/qml/AskOpenAsProjectOrModelsDialog.qml @@ -6,6 +6,7 @@ import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 import QtQuick.Layouts 1.1 import QtQuick.Dialogs 1.1 +import QtQuick.Window 2.1 import UM 1.3 as UM import Cura 1.0 as Cura @@ -17,13 +18,13 @@ UM.Dialog id: base title: catalog.i18nc("@title:window", "Open project file") - width: 420 - height: 140 + width: 420 * Screen.devicePixelRatio + height: 140 * Screen.devicePixelRatio maximumHeight: height maximumWidth: width - minimumHeight: height - minimumWidth: width + minimumHeight: maximumHeight + minimumWidth: maximumWidth modality: UM.Application.platform == "linux" ? Qt.NonModal : Qt.WindowModal; @@ -60,10 +61,8 @@ UM.Dialog Column { anchors.fill: parent - anchors.margins: UM.Theme.getSize("default_margin").width - anchors.left: parent.left - anchors.right: parent.right - spacing: UM.Theme.getSize("default_margin").width + anchors.margins: 20 * Screen.devicePixelRatio + spacing: 10 * Screen.devicePixelRatio Label { @@ -93,7 +92,7 @@ UM.Dialog id: openAsProjectButton text: catalog.i18nc("@action:button", "Open as project"); anchors.right: importModelsButton.left - anchors.rightMargin: UM.Theme.getSize("default_margin").width + anchors.rightMargin: UM.Theme.getSize("default_margin").width * Screen.devicePixelRatio isDefault: true onClicked: { From abe70c3a924fb8a6db8bccfaab5c7a12692c65dd Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 10 Apr 2017 13:12:14 +0200 Subject: [PATCH 2/5] Fixed broken logging --- plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index 7c58f2bb66..21e23ead93 100755 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -1089,7 +1089,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): self._authentication_key = data["key"] self._authentication_id = data["id"] - Logger.log("i", "Got a new authentication ID (%s) and KEY (%S). Waiting for authorization.", self._authentication_id, self._getSafeAuthKey()) + Logger.log("i", "Got a new authentication ID (%s) and KEY (%s). Waiting for authorization.", self._authentication_id, self._getSafeAuthKey()) # Check if the authentication is accepted. self._checkAuthentication() From f5785662f258d11874b38a4fd77562e2acdc109c Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 10 Apr 2017 13:19:05 +0200 Subject: [PATCH 3/5] Fixed another broken logging --- plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index 21e23ead93..0dd31652ce 100755 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -200,7 +200,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): def _onAuthenticationRequired(self, reply, authenticator): if self._authentication_id is not None and self._authentication_key is not None: - Logger.log("d", "Authentication was required. Setting up authenticator with ID %s and key", self._authentication_id, self._getSafeAuthKey()) + Logger.log("d", "Authentication was required. Setting up authenticator with ID %s and key %s", self._authentication_id, self._getSafeAuthKey()) authenticator.setUser(self._authentication_id) authenticator.setPassword(self._authentication_key) else: From d02aa7f6a39881373b9d26c106354ba0cbab9de5 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 10 Apr 2017 13:32:37 +0200 Subject: [PATCH 4/5] Fixed order of close & disconnect This would cause the state change caused by close to not be sent to the printer. Fixes CURA-3668 --- .../UM3NetworkPrinting/NetworkPrinterOutputDevicePlugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevicePlugin.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevicePlugin.py index f39d921fff..9f450f21ab 100644 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevicePlugin.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevicePlugin.py @@ -164,8 +164,8 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin): else: if self._printers[key].isConnected(): Logger.log("d", "Closing connection [%s]..." % key) - self._printers[key].connectionStateChanged.disconnect(self._onPrinterConnectionStateChanged) self._printers[key].close() + self._printers[key].connectionStateChanged.disconnect(self._onPrinterConnectionStateChanged) ## Because the model needs to be created in the same thread as the QMLEngine, we use a signal. def addPrinter(self, name, address, properties): @@ -183,9 +183,9 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin): printer = self._printers.pop(name, None) if printer: if printer.isConnected(): + printer.disconnect() printer.connectionStateChanged.disconnect(self._onPrinterConnectionStateChanged) Logger.log("d", "removePrinter, disconnecting [%s]..." % name) - printer.disconnect() self.printerListChanged.emit() ## Handler for when the connection state of one of the detected printers changes From bc78bf94ab75ee961551ef8edd1243820e9997e5 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 10 Apr 2017 14:06:10 +0200 Subject: [PATCH 5/5] Fixed buttons not visible on my screen CURA-3642 --- resources/qml/AskOpenAsProjectOrModelsDialog.qml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/resources/qml/AskOpenAsProjectOrModelsDialog.qml b/resources/qml/AskOpenAsProjectOrModelsDialog.qml index d85019983e..a3879bb8ac 100644 --- a/resources/qml/AskOpenAsProjectOrModelsDialog.qml +++ b/resources/qml/AskOpenAsProjectOrModelsDialog.qml @@ -18,8 +18,8 @@ UM.Dialog id: base title: catalog.i18nc("@title:window", "Open project file") - width: 420 * Screen.devicePixelRatio - height: 140 * Screen.devicePixelRatio + width: 450 * Screen.devicePixelRatio + height: 150 * Screen.devicePixelRatio maximumHeight: height maximumWidth: width @@ -61,13 +61,16 @@ UM.Dialog Column { anchors.fill: parent - anchors.margins: 20 * Screen.devicePixelRatio + anchors.leftMargin: 20 * Screen.devicePixelRatio + anchors.rightMargin: 20 * Screen.devicePixelRatio + anchors.bottomMargin: 20 * Screen.devicePixelRatio spacing: 10 * Screen.devicePixelRatio Label { - text: catalog.i18nc("@text:window", "This is a Cura project file. Would you like to open it as a project\nor import the models from it?") - anchors.margins: UM.Theme.getSize("default_margin").width + text: catalog.i18nc("@text:window", "This is a Cura project file. Would you like to open it as a project or import the models from it?") + anchors.left: parent.left + anchors.right: parent.right font: UM.Theme.getFont("default") wrapMode: Text.WordWrap } @@ -76,7 +79,6 @@ UM.Dialog { id: rememberChoiceCheckBox text: catalog.i18nc("@text:window", "Remember my choice") - anchors.margins: UM.Theme.getSize("default_margin").width checked: UM.Preferences.getValue("cura/choice_on_open_project") != "always_ask" }