mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
Add an Add Machine dialog
This commit is contained in:
parent
1c329427ff
commit
f1d6bb9472
3 changed files with 94 additions and 4 deletions
|
@ -12,7 +12,7 @@ from UM.Scene.Selection import Selection
|
|||
from PlatformPhysics import PlatformPhysics
|
||||
from BuildVolume import BuildVolume
|
||||
|
||||
from PyQt5.QtCore import pyqtSlot, QUrl, Qt
|
||||
from PyQt5.QtCore import pyqtSlot, QUrl, Qt, pyqtSignal
|
||||
from PyQt5.QtGui import QColor
|
||||
|
||||
import os.path
|
||||
|
@ -66,13 +66,17 @@ class PrinterApplication(QtApplication):
|
|||
|
||||
controller.getScene().setActiveCamera('3d')
|
||||
|
||||
self.setActiveMachine(self.getMachines()[0])
|
||||
|
||||
self.showSplashMessage('Loading interface...')
|
||||
|
||||
self.setMainQml(os.path.dirname(__file__) + "/Printer.qml")
|
||||
self.initializeEngine()
|
||||
|
||||
|
||||
#TODO: Add support for active machine preference
|
||||
if self.getMachines():
|
||||
self.setActiveMachine(self.getMachines()[0])
|
||||
else:
|
||||
self.requestAddPrinter.emit()
|
||||
|
||||
if self._engine.rootObjects:
|
||||
self.closeSplash()
|
||||
self.exec_()
|
||||
|
@ -102,6 +106,8 @@ class PrinterApplication(QtApplication):
|
|||
with open(file.toLocalFile(), 'w') as f:
|
||||
f.write(gcode)
|
||||
|
||||
requestAddPrinter = pyqtSignal()
|
||||
|
||||
def _onActiveMachineChanged(self):
|
||||
machine = self.getActiveMachine()
|
||||
if machine:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue