Merge branch 'master' of github.com:Ultimaker/Cura

This commit is contained in:
Jack Ha 2017-04-10 16:58:14 +02:00
commit e3f7c4ec8a
3 changed files with 17 additions and 16 deletions

View file

@ -200,7 +200,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
def _onAuthenticationRequired(self, reply, authenticator): def _onAuthenticationRequired(self, reply, authenticator):
if self._authentication_id is not None and self._authentication_key is not None: 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.setUser(self._authentication_id)
authenticator.setPassword(self._authentication_key) authenticator.setPassword(self._authentication_key)
else: else:
@ -1089,7 +1089,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
self._authentication_key = data["key"] self._authentication_key = data["key"]
self._authentication_id = data["id"] 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. # Check if the authentication is accepted.
self._checkAuthentication() self._checkAuthentication()

View file

@ -164,8 +164,8 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin):
else: else:
if self._printers[key].isConnected(): if self._printers[key].isConnected():
Logger.log("d", "Closing connection [%s]..." % key) Logger.log("d", "Closing connection [%s]..." % key)
self._printers[key].connectionStateChanged.disconnect(self._onPrinterConnectionStateChanged)
self._printers[key].close() 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. ## Because the model needs to be created in the same thread as the QMLEngine, we use a signal.
def addPrinter(self, name, address, properties): def addPrinter(self, name, address, properties):
@ -183,9 +183,9 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin):
printer = self._printers.pop(name, None) printer = self._printers.pop(name, None)
if printer: if printer:
if printer.isConnected(): if printer.isConnected():
printer.disconnect()
printer.connectionStateChanged.disconnect(self._onPrinterConnectionStateChanged) printer.connectionStateChanged.disconnect(self._onPrinterConnectionStateChanged)
Logger.log("d", "removePrinter, disconnecting [%s]..." % name) Logger.log("d", "removePrinter, disconnecting [%s]..." % name)
printer.disconnect()
self.printerListChanged.emit() self.printerListChanged.emit()
## Handler for when the connection state of one of the detected printers changes ## Handler for when the connection state of one of the detected printers changes

View file

@ -6,6 +6,7 @@ import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1 import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.1 import QtQuick.Dialogs 1.1
import QtQuick.Window 2.1
import UM 1.3 as UM import UM 1.3 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
@ -17,13 +18,13 @@ UM.Dialog
id: base id: base
title: catalog.i18nc("@title:window", "Open project file") title: catalog.i18nc("@title:window", "Open project file")
width: 420 width: 450 * Screen.devicePixelRatio
height: 140 height: 150 * Screen.devicePixelRatio
maximumHeight: height maximumHeight: height
maximumWidth: width maximumWidth: width
minimumHeight: height minimumHeight: maximumHeight
minimumWidth: width minimumWidth: maximumWidth
modality: UM.Application.platform == "linux" ? Qt.NonModal : Qt.WindowModal; modality: UM.Application.platform == "linux" ? Qt.NonModal : Qt.WindowModal;
@ -60,15 +61,16 @@ UM.Dialog
Column Column
{ {
anchors.fill: parent anchors.fill: parent
anchors.margins: UM.Theme.getSize("default_margin").width anchors.leftMargin: 20 * Screen.devicePixelRatio
anchors.left: parent.left anchors.rightMargin: 20 * Screen.devicePixelRatio
anchors.right: parent.right anchors.bottomMargin: 20 * Screen.devicePixelRatio
spacing: UM.Theme.getSize("default_margin").width spacing: 10 * Screen.devicePixelRatio
Label 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?") 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.margins: UM.Theme.getSize("default_margin").width anchors.left: parent.left
anchors.right: parent.right
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
@ -77,7 +79,6 @@ UM.Dialog
{ {
id: rememberChoiceCheckBox id: rememberChoiceCheckBox
text: catalog.i18nc("@text:window", "Remember my choice") 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" checked: UM.Preferences.getValue("cura/choice_on_open_project") != "always_ask"
} }
@ -93,7 +94,7 @@ UM.Dialog
id: openAsProjectButton id: openAsProjectButton
text: catalog.i18nc("@action:button", "Open as project"); text: catalog.i18nc("@action:button", "Open as project");
anchors.right: importModelsButton.left anchors.right: importModelsButton.left
anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.rightMargin: UM.Theme.getSize("default_margin").width * Screen.devicePixelRatio
isDefault: true isDefault: true
onClicked: onClicked:
{ {