Changes to USB printer manager so its usable by other qml files

This commit is contained in:
Jaime van Kessel 2015-08-18 14:12:48 +02:00
parent c20b3bc2d5
commit c95cf5263b
4 changed files with 69 additions and 26 deletions

View file

@ -2,7 +2,7 @@
# Cura is released under the terms of the AGPLv3 or higher.
from . import USBPrinterManager
from PyQt5.QtQml import qmlRegisterType, qmlRegisterSingletonType
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("cura")
@ -19,4 +19,5 @@ def getMetaData():
}
def register(app):
return {"extension":USBPrinterManager.USBPrinterManager(),"output_device": USBPrinterManager.USBPrinterManager() }
qmlRegisterSingletonType(USBPrinterManager.USBPrinterManager, "UM", 1, 0, "USBPrinterManager", USBPrinterManager.USBPrinterManager.getInstance)
return {"extension":USBPrinterManager.USBPrinterManager.getInstance(),"output_device": USBPrinterManager.USBPrinterManager.getInstance() }