Merge branch '15.10' of https://github.com/Ultimaker/Cura into 15.10

This commit is contained in:
Jaime van Kessel 2015-09-08 15:31:36 +02:00
commit 77bda1a7b1
19 changed files with 47 additions and 44 deletions

View File

@ -6,6 +6,7 @@ import webbrowser
from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QCoreApplication from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QCoreApplication
from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTextEdit from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTextEdit
from UM.i18n import i18nCatalog from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura")
def show(type, value, tb): def show(type, value, tb):
if not hasattr(sys, "frozen"): if not hasattr(sys, "frozen"):
@ -16,13 +17,13 @@ def show(type, value, tb):
sys.exit(1) sys.exit(1)
dialog = QDialog() dialog = QDialog()
dialog.setWindowTitle(self._i18n_catalog.i18nc("@title:errormessage", "Oops!")) dialog.setWindowTitle(catalog.i18nc("@title:window", "Oops!"))
layout = QVBoxLayout(dialog) layout = QVBoxLayout(dialog)
label = QLabel(dialog) label = QLabel(dialog)
layout.addWidget(label) layout.addWidget(label)
label.setText(self._i18n_catalog.i18nc("@info:errormessage", "<p>An uncaught exception has occurred!</p><p>Please use the information below to post a bug report at <a href=\"http://github.com/Ultimaker/Cura/issues\">http://github.com/Ultimaker/Cura/issues</a></p>")) label.setText(catalog.i18nc("@info", "<p>An uncaught exception has occurred!</p><p>Please use the information below to post a bug report at <a href=\"http://github.com/Ultimaker/Cura/issues\">http://github.com/Ultimaker/Cura/issues</a></p>"))
textarea = QTextEdit(dialog) textarea = QTextEdit(dialog)
layout.addWidget(textarea) layout.addWidget(textarea)

View File

@ -132,7 +132,7 @@ class CuraApplication(QtApplication):
"message": "font color=UM.Theme.colors.message_text;", "message": "font color=UM.Theme.colors.message_text;",
}) })
self.showSplashMessage(self._i18n_catalog.i18nc("@info:splashscreen", "Setting up scene...")) self.showSplashMessage(self._i18n_catalog.i18nc("@info:progress", "Setting up scene..."))
controller = self.getController() controller = self.getController()
@ -166,7 +166,7 @@ class CuraApplication(QtApplication):
controller.getScene().setActiveCamera("3d") controller.getScene().setActiveCamera("3d")
self.showSplashMessage(self._i18n_catalog.i18nc("@info:splashscreen", "Loading interface...")) self.showSplashMessage(self._i18n_catalog.i18nc("@info:progress", "Loading interface..."))
self.setMainQml(Resources.getPath(self.ResourceTypes.QmlFiles, "Cura.qml")) self.setMainQml(Resources.getPath(self.ResourceTypes.QmlFiles, "Cura.qml"))
self.initializeEngine() self.initializeEngine()

View File

@ -9,15 +9,15 @@ from . import ThreeMFReader
def getMetaData(): def getMetaData():
return { return {
"plugin": { "plugin": {
"name": "3MF Reader", "name": catalog.i18nc("@label", "3MF Reader"),
"author": "Ultimaker", "author": "Ultimaker",
"version": "1.0", "version": "1.0",
"description": catalog.i18nc("3MF Reader plugin description", "Provides support for reading 3MF files."), "description": catalog.i18nc("@info:whatsthis", "Provides support for reading 3MF files."),
"api": 2 "api": 2
}, },
"mesh_reader": { "mesh_reader": {
"extension": "3mf", "extension": "3mf",
"description": catalog.i18nc("3MF Reader plugin file type", "3MF File") "description": catalog.i18nc("@item:inlistbox", "3MF File")
} }
} }

View File

@ -22,7 +22,6 @@ UM.Dialog
text: manager.getChangeLogString() text: manager.getChangeLogString()
width:base.width - 35 width:base.width - 35
wrapMode: Text.Wrap; wrapMode: Text.Wrap;
//Component.onCompleted: console.log()
} }
} }
} }

View File

@ -1,18 +1,18 @@
# Copyright (c) 2015 Ultimaker B.V. # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher. # Cura is released under the terms of the AGPLv3 or higher.
from UM.i18n import i18nCatalog
from . import ChangeLog from . import ChangeLog
from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura") catalog = i18nCatalog("cura")
def getMetaData(): def getMetaData():
return { return {
"plugin": { "plugin": {
"name": "Change log", "name": catalog.i18nc("@label", "Change Log"),
"author": "Ultimaker", "author": "Ultimaker",
"version": "1.0", "version": "1.0",
"description": catalog.i18nc("Change log plugin description", "Shows changes since latest checked version"), "description": catalog.i18nc("@info:whatsthis", "Shows changes since latest checked version"),
"api": 2 "api": 2
} }
} }

View File

@ -27,7 +27,7 @@ class ProcessSlicedObjectListJob(Job):
def run(self): def run(self):
if Application.getInstance().getController().getActiveView().getPluginId() == "LayerView": if Application.getInstance().getController().getActiveView().getPluginId() == "LayerView":
self._progress = Message(catalog.i18nc("Layers View mode", "Layers"), 0, False, 0) self._progress = Message(catalog.i18nc("@info", "Layers"), 0, False, 0)
self._progress.show() self._progress.show()
Application.getInstance().getController().activeViewChanged.connect(self._onActiveViewChanged) Application.getInstance().getController().activeViewChanged.connect(self._onActiveViewChanged)

View File

@ -10,9 +10,9 @@ catalog = i18nCatalog("cura")
def getMetaData(): def getMetaData():
return { return {
"plugin": { "plugin": {
"name": "CuraEngine Backend", "name": catalog.i18nc("@label", "CuraEngine Backend"),
"author": "Ultimaker", "author": "Ultimaker",
"description": catalog.i18nc("CuraEngine backend plugin description", "Provides the link to the CuraEngine slicing backend"), "description": catalog.i18nc("@info:whatsthis", "Provides the link to the CuraEngine slicing backend"),
"api": 2 "api": 2
} }
} }

View File

@ -9,17 +9,17 @@ catalog = i18nCatalog("cura")
def getMetaData(): def getMetaData():
return { return {
"plugin": { "plugin": {
"name": "GCode Writer", "name": catalog.i18nc("@label", "GCode Writer"),
"author": "Ultimaker", "author": "Ultimaker",
"version": "1.0", "version": "1.0",
"description": catalog.i18nc("GCode Writer Plugin Description", "Writes GCode to a file"), "description": catalog.i18nc("@info:whatsthis", "Writes GCode to a file"),
"api": 2 "api": 2
}, },
"mesh_writer": { "mesh_writer": {
"output": [{ "output": [{
"extension": "gcode", "extension": "gcode",
"description": catalog.i18nc("GCode Writer File Description", "GCode File"), "description": catalog.i18nc("@item:inlistbox", "GCode File"),
"mime_type": "text/x-gcode", "mime_type": "text/x-gcode",
"mode": GCodeWriter.GCodeWriter.OutputMode.TextMode "mode": GCodeWriter.GCodeWriter.OutputMode.TextMode
}] }]

View File

@ -10,14 +10,14 @@ catalog = i18nCatalog("cura")
def getMetaData(): def getMetaData():
return { return {
"plugin": { "plugin": {
"name": "Layer View", "name": catalog.i18nc("@label", "Layer View"),
"author": "Ultimaker", "author": "Ultimaker",
"version": "1.0", "version": "1.0",
"description": catalog.i18nc("Layer View plugin description", "Provides the Layer view."), "description": catalog.i18nc("@info:whatsthis", "Provides the Layer view."),
"api": 2 "api": 2
}, },
"view": { "view": {
"name": catalog.i18nc("Layers View mode", "Layers"), "name": catalog.i18nc("@item:inlistbox", "Layers"),
"view_panel": "LayerView.qml" "view_panel": "LayerView.qml"
} }
} }

View File

@ -10,7 +10,7 @@ from UM.OutputDevice.OutputDevice import OutputDevice
from UM.OutputDevice import OutputDeviceError from UM.OutputDevice import OutputDeviceError
from UM.i18n import i18nCatalog from UM.i18n import i18nCatalog
catalog = i18nCatalog("uranium") catalog = i18nCatalog("cura")
class RemovableDriveOutputDevice(OutputDevice): class RemovableDriveOutputDevice(OutputDevice):
def __init__(self, device_id, device_name): def __init__(self, device_id, device_name):
@ -18,7 +18,7 @@ class RemovableDriveOutputDevice(OutputDevice):
self.setName(device_name) self.setName(device_name)
self.setShortDescription(catalog.i18nc("@action:button", "Save to Removable Drive")) self.setShortDescription(catalog.i18nc("@action:button", "Save to Removable Drive"))
self.setDescription(catalog.i18nc("@info:tooltip", "Save to Removable Drive {0}").format(device_name)) self.setDescription(catalog.i18nc("@item:inlistbox", "Save to Removable Drive {0}").format(device_name))
self.setIconName("save_sd") self.setIconName("save_sd")
self.setPriority(1) self.setPriority(1)
@ -49,7 +49,7 @@ class RemovableDriveOutputDevice(OutputDevice):
job.progress.connect(self._onProgress) job.progress.connect(self._onProgress)
job.finished.connect(self._onFinished) job.finished.connect(self._onFinished)
message = Message(catalog.i18nc("@info:status", "Saving to Removable Drive <filename>{0}</filename>").format(self.getName()), 0, False, -1) message = Message(catalog.i18nc("@info:progress", "Saving to Removable Drive <filename>{0}</filename>").format(self.getName()), 0, False, -1)
message.show() message.show()
job._message = message job._message = message
@ -70,13 +70,13 @@ class RemovableDriveOutputDevice(OutputDevice):
job._message = None job._message = None
self.writeFinished.emit(self) self.writeFinished.emit(self)
if job.getResult(): if job.getResult():
message = Message(catalog.i18nc("", "Saved to Removable Drive {0} as {1}").format(self.getName(), os.path.basename(job.getFileName()))) message = Message(catalog.i18nc("@info:status", "Saved to Removable Drive {0} as {1}").format(self.getName(), os.path.basename(job.getFileName())))
message.addAction("eject", catalog.i18nc("", "Eject"), "eject", catalog.i18nc("", "Eject removable device {0}").format(self.getName())) message.addAction("eject", catalog.i18nc("@action:button", "Eject"), "eject", catalog.i18nc("@action", "Eject removable device {0}").format(self.getName()))
message.actionTriggered.connect(self._onActionTriggered) message.actionTriggered.connect(self._onActionTriggered)
message.show() message.show()
self.writeSuccess.emit(self) self.writeSuccess.emit(self)
else: else:
message = Message(catalog.i18nc("", "Could not save to removable drive {0}: {1}").format(self.getName(), str(job.getError()))) message = Message(catalog.i18nc("@info:status", "Could not save to removable drive {0}: {1}").format(self.getName(), str(job.getError())))
message.show() message.show()
self.writeError.emit(self) self.writeError.emit(self)
job.getStream().close() job.getStream().close()

View File

@ -11,7 +11,7 @@ from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
from . import RemovableDriveOutputDevice from . import RemovableDriveOutputDevice
from UM.i18n import i18nCatalog from UM.i18n import i18nCatalog
catalog = i18nCatalog("uranium") catalog = i18nCatalog("cura")
class RemovableDrivePlugin(OutputDevicePlugin): class RemovableDrivePlugin(OutputDevicePlugin):
def __init__(self): def __init__(self):
@ -39,10 +39,10 @@ class RemovableDrivePlugin(OutputDevicePlugin):
def ejectDevice(self, device): def ejectDevice(self, device):
result = self.performEjectDevice(device) result = self.performEjectDevice(device)
if result: if result:
message = Message(catalog.i18n("Ejected {0}. You can now safely remove the drive.").format(device.getName())) message = Message(catalog.i18n("@info:status", "Ejected {0}. You can now safely remove the drive.").format(device.getName()))
message.show() message.show()
else: else:
message = Message(catalog.i18n("Failed to eject {0}. Maybe it is still in use?").format(device.getName())) message = Message(catalog.i18n("@info:status", "Failed to eject {0}. Maybe it is still in use?").format(device.getName()))
message.show() message.show()
def performEjectDevice(self, device): def performEjectDevice(self, device):

View File

@ -16,7 +16,7 @@ import os
import subprocess import subprocess
from UM.i18n import i18nCatalog from UM.i18n import i18nCatalog
catalog = i18nCatalog("uranium") catalog = i18nCatalog("cura")
# WinAPI Constants that we need # WinAPI Constants that we need
# Hardcoded here due to stupid WinDLL stuff that does not give us access to these values. # Hardcoded here due to stupid WinDLL stuff that does not give us access to these values.
@ -55,7 +55,7 @@ class WindowsRemovableDrivePlugin(RemovableDrivePlugin.RemovableDrivePlugin):
volume_name = name_buffer.value volume_name = name_buffer.value
if not volume_name: if not volume_name:
volume_name = catalog.i18nc("Default name for removable device", "Removable Drive") volume_name = catalog.i18nc("@item:intext", "Removable Drive")
# Certain readers will report themselves as a volume even when there is no card inserted, but will show an # Certain readers will report themselves as a volume even when there is no card inserted, but will show an
# "No volume in drive" warning when trying to call GetDiskFreeSpace. However, they will not report a valid # "No volume in drive" warning when trying to call GetDiskFreeSpace. However, they will not report a valid

View File

@ -9,9 +9,9 @@ catalog = i18nCatalog("uranium")
def getMetaData(): def getMetaData():
return { return {
"plugin": { "plugin": {
"name": catalog.i18nc("Removable Drive Output Device Plugin name", "Removable Drive Output Device Plugin"), "name": catalog.i18nc("@label", "Removable Drive Output Device Plugin"),
"author": "Ultimaker B.V.", "author": "Ultimaker B.V.",
"description": catalog.i18nc("Removable Drive Output Device Plugin description", "Provides removable drive hotplugging and writing support"), "description": catalog.i18nc("@info:whatsthis", "Provides removable drive hotplugging and writing support"),
"version": "1.0", "version": "1.0",
"api": 2 "api": 2
} }

View File

@ -32,8 +32,8 @@ class SliceInfo(Extension):
Preferences.getInstance().addPreference("info/asked_send_slice_info", False) Preferences.getInstance().addPreference("info/asked_send_slice_info", False)
if not Preferences.getInstance().getValue("info/asked_send_slice_info"): if not Preferences.getInstance().getValue("info/asked_send_slice_info"):
self.send_slice_info_message = Message(catalog.i18nc("", "Cura automatically sends slice info. You can disable this in preferences"), lifetime = 0, dismissable = False) self.send_slice_info_message = Message(catalog.i18nc("@info", "Cura automatically sends slice info. You can disable this in preferences"), lifetime = 0, dismissable = False)
self.send_slice_info_message.addAction("Dismiss","Dismiss", None, "Dismiss") self.send_slice_info_message.addAction("Dismiss", catalog.i18nc("@action:button", "Dismiss"), None, catalog.i18nc("@action", "Dismiss"))
self.send_slice_info_message.actionTriggered.connect(self.messageActionTriggered) self.send_slice_info_message.actionTriggered.connect(self.messageActionTriggered)
self.send_slice_info_message.show() self.send_slice_info_message.show()

View File

@ -7,10 +7,10 @@ catalog = i18nCatalog("cura")
def getMetaData(): def getMetaData():
return { return {
"plugin": { "plugin": {
"name": "Slice Info", "name": catalog.i18nc("@label", "Slice info"),
"author": "Ultimaker", "author": "Ultimaker",
"version": "1.0", "version": "1.0",
"description": catalog.i18nc("Slice Info plugin description", "Submits anonymous slice info. Can be disabled through preferences."), "description": catalog.i18nc("@info:whatsthis", "Submits anonymous slice info. Can be disabled through preferences."),
"api": 2 "api": 2
} }
} }

View File

@ -75,7 +75,7 @@ UM.Dialog
rightButtons: [ rightButtons: [
Button Button
{ {
text: "Close"; text: catalog.i18nc("@action:button","Close");
enabled: manager.progress >= 100; enabled: manager.progress >= 100;
onClicked: base.visible = false; onClicked: base.visible = false;
} }

View File

@ -24,7 +24,6 @@ from UM.Extension import Extension
from PyQt5.QtQuick import QQuickView from PyQt5.QtQuick import QQuickView
from PyQt5.QtQml import QQmlComponent, QQmlContext from PyQt5.QtQml import QQmlComponent, QQmlContext
from PyQt5.QtCore import QUrl, QObject, pyqtSlot, pyqtProperty, pyqtSignal, Qt from PyQt5.QtCore import QUrl, QObject, pyqtSlot, pyqtProperty, pyqtSignal, Qt
from UM.i18n import i18nCatalog from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("cura") i18n_catalog = i18nCatalog("cura")
@ -44,8 +43,12 @@ class USBPrinterManager(QObject, SignalEmitter, OutputDevicePlugin, Extension):
self._firmware_view = None self._firmware_view = None
## Add menu item to top menu of the application. ## Add menu item to top menu of the application.
self.setMenuName("Firmware") #self.setMenuName(self._i18n_catalog.i18n("@title:menu", "Firmware"))
self.addMenuItem(i18n_catalog.i18n("Update Firmware"), self.updateAllFirmware) #self.addMenuItem(self._i18n_catalog.i18n("@item:inmenu", "Update Firmware"), self.updateAllFirmware)
#self.setMenuName("Firmware")
self.setMenuName(i18n_catalog.i18nc("@title:menu","Firmware"))
self.addMenuItem(i18n_catalog.i18nc("@item:inmenu", "Update Firmware"), self.updateAllFirmware)
Application.getInstance().applicationShuttingDown.connect(self.stop) Application.getInstance().applicationShuttingDown.connect(self.stop)
self.addConnectionSignal.connect(self.addConnection) #Because the model needs to be created in the same thread as the QMLEngine, we use a signal. self.addConnectionSignal.connect(self.addConnection) #Because the model needs to be created in the same thread as the QMLEngine, we use a signal.

View File

@ -10,11 +10,11 @@ def getMetaData():
return { return {
"type": "extension", "type": "extension",
"plugin": { "plugin": {
"name": "USB printing", "name": i18n_catalog.i18nc("@label", "USB printing"),
"author": "Ultimaker", "author": "Ultimaker",
"version": "1.0", "version": "1.0",
"api": 2, "api": 2,
"description": i18n_catalog.i18nc("USB Printing plugin description","Accepts G-Code and sends them to a printer. Plugin can also update firmware") "description": i18n_catalog.i18nc("@info:whatsthis","Accepts G-Code and sends them to a printer. Plugin can also update firmware.")
} }
} }