Added Opencontrol panel functions

CL-541
This commit is contained in:
Jaime van Kessel 2017-11-27 14:13:30 +01:00
parent cdfdaec492
commit 7d9af8e345
2 changed files with 15 additions and 2 deletions

View file

@ -16,6 +16,7 @@ Component
property var emphasisColor: UM.Theme.getColor("setting_control_border_highlight") property var emphasisColor: UM.Theme.getColor("setting_control_border_highlight")
property var lineColor: "#DCDCDC" // TODO: Should be linked to theme. property var lineColor: "#DCDCDC" // TODO: Should be linked to theme.
property var cornerRadius: 4 * screenScaleFactor // TODO: Should be linked to theme. property var cornerRadius: 4 * screenScaleFactor // TODO: Should be linked to theme.
UM.I18nCatalog UM.I18nCatalog
{ {
id: catalog id: catalog
@ -93,10 +94,10 @@ Component
} }
} }
PrinterVideoStream /*PrinterVideoStream
{ {
visible: OutputDevice.selectedPrinterName != "" visible: OutputDevice.selectedPrinterName != ""
anchors.fill:parent anchors.fill:parent
} }*/
} }
} }

View file

@ -11,6 +11,8 @@ from cura.PrinterOutput.PrintJobOutputModel import PrintJobOutputModel
from cura.PrinterOutput.MaterialOutputModel import MaterialOutputModel from cura.PrinterOutput.MaterialOutputModel import MaterialOutputModel
from PyQt5.QtNetwork import QNetworkRequest, QNetworkReply from PyQt5.QtNetwork import QNetworkRequest, QNetworkReply
from PyQt5.QtGui import QDesktopServices
from PyQt5.QtCore import pyqtSlot, QUrl
import json import json
import os import os
@ -28,6 +30,16 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
self._monitor_view_qml_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "ClusterMonitorItem.qml") self._monitor_view_qml_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "ClusterMonitorItem.qml")
self._control_view_qml_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "ClusterControlItem.qml") self._control_view_qml_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "ClusterControlItem.qml")
@pyqtSlot()
def openPrintJobControlPanel(self):
Logger.log("d", "Opening print job control panel...")
QDesktopServices.openUrl(QUrl("http://" + self._address + "/print_jobs"))
@pyqtSlot()
def openPrinterControlPanel(self):
Logger.log("d", "Opening printer control panel...")
QDesktopServices.openUrl(QUrl("http://" + self._address + "/printers"))
def _update(self): def _update(self):
if not super()._update(): if not super()._update():
return return