From e2edbd11b66e828fce6c024765753a8fa2fcdf43 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 9 Oct 2017 11:50:30 +0200 Subject: [PATCH 01/17] Changed Crash Report layout and new information included - CURA-4195 --- cura/CrashHandler.py | 200 ++++++++++++++++++++++++++++--------------- cura_app.py | 5 +- 2 files changed, 135 insertions(+), 70 deletions(-) diff --git a/cura/CrashHandler.py b/cura/CrashHandler.py index 7008ba64d2..dbf931b37e 100644 --- a/cura/CrashHandler.py +++ b/cura/CrashHandler.py @@ -5,14 +5,15 @@ import webbrowser import faulthandler import tempfile import os -import urllib -from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, Qt, QCoreApplication -from PyQt5.QtGui import QPixmap -from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QHBoxLayout, QVBoxLayout, QLabel, QTextEdit +from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QCoreApplication +from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTextEdit, QGroupBox +from PyQt5.QtNetwork import QHttpMultiPart, QHttpPart, QNetworkRequest, QNetworkAccessManager, QNetworkReply from UM.Logger import Logger +from UM.View.GL.OpenGL import OpenGL from UM.i18n import i18nCatalog + catalog = i18nCatalog("cura") MYPY = False @@ -23,6 +24,7 @@ else: from cura.CuraVersion import CuraDebugMode except ImportError: CuraDebugMode = False # [CodeStyle: Reflecting imported value] +CuraDebugMode = True ## TODO Remove when done. Just for debug purposes # List of exceptions that should be considered "fatal" and abort the program. # These are primarily some exception types that we simply cannot really recover from @@ -35,83 +37,145 @@ fatal_exception_types = [ SystemError, ] -def show(exception_type, value, tb): - Logger.log("c", "An uncaught exception has occurred!") - for line in traceback.format_exception(exception_type, value, tb): - for part in line.rstrip("\n").split("\n"): - Logger.log("c", part) +class CrashHandler: - if not CuraDebugMode and exception_type not in fatal_exception_types: - return + def __init__(self, exception_type, value, tb): - application = QCoreApplication.instance() - if not application: - sys.exit(1) + self.exception_type = exception_type + self.value = value + self.traceback = tb - dialog = QDialog() - dialog.setMinimumWidth(640) - dialog.setMinimumHeight(640) - dialog.setWindowTitle(catalog.i18nc("@title:window", "Crash Report")) + Logger.log("c", "An uncaught exception has occurred!") + for line in traceback.format_exception(exception_type, value, tb): + for part in line.rstrip("\n").split("\n"): + Logger.log("c", part) - layout = QVBoxLayout(dialog) + if not CuraDebugMode and exception_type not in fatal_exception_types: + return - #label = QLabel(dialog) - #pixmap = QPixmap() - #try: - # data = urllib.request.urlopen("http://www.randomkittengenerator.com/cats/rotator.php").read() - # pixmap.loadFromData(data) - #except: - # try: - # from UM.Resources import Resources - # path = Resources.getPath(Resources.Images, "kitten.jpg") - # pixmap.load(path) - # except: - # pass - #pixmap = pixmap.scaled(150, 150) - #label.setPixmap(pixmap) - #label.setAlignment(Qt.AlignCenter) - #layout.addWidget(label) + application = QCoreApplication.instance() + if not application: + sys.exit(1) - label = QLabel(dialog) - layout.addWidget(label) + self._createDialog() - #label.setScaledContents(True) - label.setText(catalog.i18nc("@label", """

A fatal exception has occurred that we could not recover from!

-

Please use the information below to post a bug report at http://github.com/Ultimaker/Cura/issues

- """)) + ## Creates a modal dialog. + def _createDialog(self): - textarea = QTextEdit(dialog) - layout.addWidget(textarea) + self.dialog = QDialog() + self.dialog.setMinimumWidth(640) + self.dialog.setMinimumHeight(640) + self.dialog.setWindowTitle(catalog.i18nc("@title:window", "Crash Report")) - try: - from UM.Application import Application - version = Application.getInstance().getVersion() - except: - version = "Unknown" + layout = QVBoxLayout(self.dialog) - trace = "".join(traceback.format_exception(exception_type, value, tb)) + layout.addWidget(self._messageWidget()) + layout.addWidget(self._informationWidget()) + layout.addWidget(self._exceptionInfoWidget()) + layout.addWidget(self._logInfoWidget()) + layout.addWidget(self._userDescriptionWidget()) + layout.addWidget(self._buttonsWidget()) - crash_info = "Version: {0}\nPlatform: {1}\nQt: {2}\nPyQt: {3}\n\nException:\n{4}" - crash_info = crash_info.format(version, platform.platform(), QT_VERSION_STR, PYQT_VERSION_STR, trace) + def _messageWidget(self): + label = QLabel() + label.setText(catalog.i18nc("@label", """

A fatal exception has occurred that we could not recover from!

+

Please use the button below to post a bug report automatically to our servers

+ """)) - tmp_file_fd, tmp_file_path = tempfile.mkstemp(prefix = "cura-crash", text = True) - os.close(tmp_file_fd) - with open(tmp_file_path, "w") as f: - faulthandler.dump_traceback(f, all_threads=True) - with open(tmp_file_path, "r") as f: - data = f.read() + return label - msg = "-------------------------\n" - msg += data - crash_info += "\n\n" + msg + def _informationWidget(self): + group = QGroupBox() + group.setTitle("System information") + layout = QVBoxLayout() + label = QLabel() - textarea.setText(crash_info) + try: + from UM.Application import Application + version = Application.getInstance().getVersion() + except: + version = "Unknown" - buttons = QDialogButtonBox(QDialogButtonBox.Close, dialog) - layout.addWidget(buttons) - buttons.addButton(catalog.i18nc("@action:button", "Open Web Page"), QDialogButtonBox.HelpRole) - buttons.rejected.connect(dialog.close) - buttons.helpRequested.connect(lambda: webbrowser.open("http://github.com/Ultimaker/Cura/issues")) + crash_info = "Version: {0}
Platform: {1}
Qt: {2}
PyQt: {3}
OpenGL: {4}" + crash_info = crash_info.format(version, platform.platform(), QT_VERSION_STR, PYQT_VERSION_STR, self._getOpenGLInfo()) + label.setText(crash_info) - dialog.exec_() - sys.exit(1) + layout.addWidget(label) + group.setLayout(layout) + + return group + + def _exceptionInfoWidget(self): + group = QGroupBox() + group.setTitle("Exception traceback") + layout = QVBoxLayout() + + text_area = QTextEdit() + trace = "".join(traceback.format_exception(self.exception_type, self.value, self.traceback)) + text_area.setText(trace) + + layout.addWidget(text_area) + group.setLayout(layout) + + return group + + def _logInfoWidget(self): + group = QGroupBox() + group.setTitle("Logs") + layout = QVBoxLayout() + + text_area = QTextEdit() + tmp_file_fd, tmp_file_path = tempfile.mkstemp(prefix = "cura-crash", text = True) + os.close(tmp_file_fd) + with open(tmp_file_path, "w") as f: + faulthandler.dump_traceback(f, all_threads=True) + with open(tmp_file_path, "r") as f: + data = f.read() + + text_area.setText(data) + + layout.addWidget(text_area) + group.setLayout(layout) + + return group + + + def _userDescriptionWidget(self): + group = QGroupBox() + group.setTitle("User description") + layout = QVBoxLayout() + + text_area = QTextEdit() + + layout.addWidget(text_area) + group.setLayout(layout) + + return group + + def _buttonsWidget(self): + buttons = QDialogButtonBox() + buttons.addButton(QDialogButtonBox.Close) + buttons.addButton(catalog.i18nc("@action:button", "Send to developers"), QDialogButtonBox.AcceptRole) + buttons.rejected.connect(self.dialog.close) + buttons.accepted.connect(self._sendCrashReport) + + return buttons + + def _getOpenGLInfo(self): + info = "" + info = info.format(OpenGL.getInstance().getGPUVersion(), OpenGL.getInstance().getGPUVendorName(), OpenGL.getInstance().getGPUType()) + return info + + def _sendCrashReport(self): + print("Hello") + # _manager = QNetworkAccessManager() + # api_url = QUrl("url") + # put_request = QNetworkRequest(api_url) + # put_request.setHeader(QNetworkRequest.ContentTypeHeader, "text/plain") + # _manager.put(put_request, crash_info.encode()) + # + # sys.exit(1) + + def show(self): + self.dialog.exec_() + sys.exit(1) \ No newline at end of file diff --git a/cura_app.py b/cura_app.py index 6869fd2111..d725bc1200 100755 --- a/cura_app.py +++ b/cura_app.py @@ -41,8 +41,9 @@ if "PYTHONPATH" in os.environ.keys(): # If PYTHONPATH is u sys.path.insert(1, PATH_real) # Insert it at 1 after os.curdir, which is 0. def exceptHook(hook_type, value, traceback): - import cura.CrashHandler - cura.CrashHandler.show(hook_type, value, traceback) + from cura.CrashHandler import CrashHandler + _crash_handler = CrashHandler(hook_type, value, traceback) + _crash_handler.show() sys.excepthook = exceptHook From cf1f0ffaf11afc0272d799edd4434073a4614798 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 9 Oct 2017 16:05:37 +0200 Subject: [PATCH 02/17] Adding info to be sent as JSON and send when button is pressed - CURA-4195 --- cura/CrashHandler.py | 80 +++++++++++++++++++++++++++++++++----------- 1 file changed, 61 insertions(+), 19 deletions(-) diff --git a/cura/CrashHandler.py b/cura/CrashHandler.py index dbf931b37e..eb1f594c60 100644 --- a/cura/CrashHandler.py +++ b/cura/CrashHandler.py @@ -5,14 +5,19 @@ import webbrowser import faulthandler import tempfile import os +import time +import json +import ssl +import urllib.request +import urllib.error -from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QCoreApplication +from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QCoreApplication, Qt from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTextEdit, QGroupBox -from PyQt5.QtNetwork import QHttpMultiPart, QHttpPart, QNetworkRequest, QNetworkAccessManager, QNetworkReply from UM.Logger import Logger from UM.View.GL.OpenGL import OpenGL from UM.i18n import i18nCatalog +from UM.Platform import Platform catalog = i18nCatalog("cura") @@ -38,6 +43,7 @@ fatal_exception_types = [ ] class CrashHandler: + crash_url = "https://stats.ultimaker.com/api/cura" def __init__(self, exception_type, value, tb): @@ -45,6 +51,10 @@ class CrashHandler: self.value = value self.traceback = tb + # While we create the GUI, the information will be stored for sending afterwards + self.data = dict() + self.data["time_stamp"] = time.time() + Logger.log("c", "An uncaught exception has occurred!") for line in traceback.format_exception(exception_type, value, tb): for part in line.rstrip("\n").split("\n"): @@ -103,8 +113,21 @@ class CrashHandler: layout.addWidget(label) group.setLayout(layout) + self.data["cura_version"] = version + self.data["os"] = {"type": platform.system(), "version": platform.version()} + self.data["qt_version"] = QT_VERSION_STR + self.data["pyqt_version"] = PYQT_VERSION_STR + return group + def _getOpenGLInfo(self): + info = "" + info = info.format(OpenGL.getInstance().getGPUVersion(), OpenGL.getInstance().getGPUVendorName(), OpenGL.getInstance().getGPUType()) + + self.data["opengl"] = {"version": OpenGL.getInstance().getGPUVersion(), "vendor": OpenGL.getInstance().getGPUVendorName(), "type": OpenGL.getInstance().getGPUType()} + + return info + def _exceptionInfoWidget(self): group = QGroupBox() group.setTitle("Exception traceback") @@ -113,10 +136,13 @@ class CrashHandler: text_area = QTextEdit() trace = "".join(traceback.format_exception(self.exception_type, self.value, self.traceback)) text_area.setText(trace) + text_area.setReadOnly(True) layout.addWidget(text_area) group.setLayout(layout) + self.data["traceback"] = trace + return group def _logInfoWidget(self): @@ -130,13 +156,16 @@ class CrashHandler: with open(tmp_file_path, "w") as f: faulthandler.dump_traceback(f, all_threads=True) with open(tmp_file_path, "r") as f: - data = f.read() + logdata = f.read() - text_area.setText(data) + text_area.setText(logdata) + text_area.setReadOnly(True) layout.addWidget(text_area) group.setLayout(layout) + self.data["log"] = logdata + return group @@ -145,9 +174,11 @@ class CrashHandler: group.setTitle("User description") layout = QVBoxLayout() - text_area = QTextEdit() + # When sending the report, the user comments will be collected + self.user_description_text_area = QTextEdit() + self.user_description_text_area.setFocus(True) - layout.addWidget(text_area) + layout.addWidget(self.user_description_text_area) group.setLayout(layout) return group @@ -161,20 +192,31 @@ class CrashHandler: return buttons - def _getOpenGLInfo(self): - info = "" - info = info.format(OpenGL.getInstance().getGPUVersion(), OpenGL.getInstance().getGPUVendorName(), OpenGL.getInstance().getGPUType()) - return info - def _sendCrashReport(self): - print("Hello") - # _manager = QNetworkAccessManager() - # api_url = QUrl("url") - # put_request = QNetworkRequest(api_url) - # put_request.setHeader(QNetworkRequest.ContentTypeHeader, "text/plain") - # _manager.put(put_request, crash_info.encode()) - # - # sys.exit(1) + # Before sending data, the user comments are stored + self.data["user_info"] = self.user_description_text_area.toPlainText() + + # Convert data to bytes + binary_data = json.dumps(self.data).encode("utf-8") + + # Submit data + kwoptions = {"data": binary_data, "timeout": 5} + + if Platform.isOSX(): + kwoptions["context"] = ssl._create_unverified_context() + + Logger.log("i", "Sending crash report info to [%s]...", self.crash_url) + + try: + f = urllib.request.urlopen(self.crash_url, **kwoptions) + Logger.log("i", "Sent crash report info.") + f.close() + except urllib.error.HTTPError: + Logger.logException("e", "An HTTP error occurred while trying to send crash report") + except Exception: # We don't want any exception to cause problems + Logger.logException("e", "An exception occurred while trying to send crash report") + + sys.exit(1) def show(self): self.dialog.exec_() From 72ff384c48910dd96096186f948dd20cfb0152df Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 10 Oct 2017 14:35:44 +0200 Subject: [PATCH 03/17] Parsing traceback to get more information about the crash - CURA-4195 --- cura/CrashHandler.py | 66 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 58 insertions(+), 8 deletions(-) diff --git a/cura/CrashHandler.py b/cura/CrashHandler.py index eb1f594c60..f29efd1019 100644 --- a/cura/CrashHandler.py +++ b/cura/CrashHandler.py @@ -5,6 +5,7 @@ import webbrowser import faulthandler import tempfile import os +import os.path import time import json import ssl @@ -15,6 +16,8 @@ from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QCoreApplication, Qt from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTextEdit, QGroupBox from UM.Logger import Logger +from UM.PluginError import InvalidMetaDataError +from UM.PluginRegistry import PluginRegistry from UM.View.GL.OpenGL import OpenGL from UM.i18n import i18nCatalog from UM.Platform import Platform @@ -102,18 +105,18 @@ class CrashHandler: try: from UM.Application import Application - version = Application.getInstance().getVersion() + self.cura_version = Application.getInstance().getVersion() except: - version = "Unknown" + self.cura_version = "Unknown" crash_info = "Version: {0}
Platform: {1}
Qt: {2}
PyQt: {3}
OpenGL: {4}" - crash_info = crash_info.format(version, platform.platform(), QT_VERSION_STR, PYQT_VERSION_STR, self._getOpenGLInfo()) + crash_info = crash_info.format(self.cura_version, platform.platform(), QT_VERSION_STR, PYQT_VERSION_STR, self._getOpenGLInfo()) label.setText(crash_info) layout.addWidget(label) group.setLayout(layout) - self.data["cura_version"] = version + self.data["cura_version"] = self.cura_version self.data["os"] = {"type": platform.system(), "version": platform.version()} self.data["qt_version"] = QT_VERSION_STR self.data["pyqt_version"] = PYQT_VERSION_STR @@ -122,9 +125,9 @@ class CrashHandler: def _getOpenGLInfo(self): info = "
  • OpenGL Version: {0}
  • OpenGL Vendor: {1}
  • OpenGL Renderer: {2}
" - info = info.format(OpenGL.getInstance().getGPUVersion(), OpenGL.getInstance().getGPUVendorName(), OpenGL.getInstance().getGPUType()) + info = info.format(OpenGL.getInstance().getOpenGLVersion(), OpenGL.getInstance().getGPUVendorName(), OpenGL.getInstance().getGPUType()) - self.data["opengl"] = {"version": OpenGL.getInstance().getGPUVersion(), "vendor": OpenGL.getInstance().getGPUVendorName(), "type": OpenGL.getInstance().getGPUType()} + self.data["opengl"] = {"version": OpenGL.getInstance().getOpenGLVersion(), "vendor": OpenGL.getInstance().getGPUVendorName(), "type": OpenGL.getInstance().getGPUType()} return info @@ -134,14 +137,61 @@ class CrashHandler: layout = QVBoxLayout() text_area = QTextEdit() - trace = "".join(traceback.format_exception(self.exception_type, self.value, self.traceback)) + trace_dict = traceback.format_exception(self.exception_type, self.value, self.traceback) + trace = "".join(trace_dict) text_area.setText(trace) text_area.setReadOnly(True) layout.addWidget(text_area) group.setLayout(layout) - self.data["traceback"] = trace + # Parsing all the information to fill the dictionary + summary = trace_dict[len(trace_dict)-1].rstrip("\n") + module = trace_dict[len(trace_dict)-2].rstrip("\n").split("\n") + module_split = module[0].split(", ") + filepath = module_split[0].split("\"")[1] + directory, filename = os.path.split(filepath) + line = int(module_split[1].lstrip("line ")) + function = module_split[2].lstrip("in ") + code = module[1].lstrip(" ") + + # Using this workaround for a cross-platform path splitting + split_path = [] + folder_name = "" + # Split until reach folder "cura" + while folder_name != "cura": + directory, folder_name = os.path.split(directory) + if not folder_name: + break + split_path.append(folder_name) + + # Look for plugins. If it's not a plugin, the current cura version is set + isPlugin = False + module_version = self.cura_version + if split_path.__contains__("plugins"): + isPlugin = True + # Look backwards until plugin.json is found + directory, name = os.path.split(filepath) + while not os.listdir(directory).__contains__("plugin.json"): + directory, name = os.path.split(directory) + + json_metadata_file = os.path.join(directory, "plugin.json") + try: + with open(json_metadata_file, "r") as f: + try: + metadata = json.loads(f.read()) + module_version = metadata["version"] + except json.decoder.JSONDecodeError: + # Not through new exceptions + Logger.logException("e", "Failed to parse plugin.json for plugin %s", name) + except: + # Not through new exceptions + pass + + exception_dict = dict() + exception_dict["traceback"] = {"summary": summary, "full_trace": trace} + exception_dict["location"] = {"path": filepath, "file": filename, "function": function, "code": code, "line": line, "version": module_version, "is_plugin": isPlugin} + self.data["exception"] = exception_dict return group From de260683cfa11cc3c39a78c9fa882b853a9a3448 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Fri, 13 Oct 2017 10:43:58 +0200 Subject: [PATCH 04/17] CURA-4195 - Add module name to the crash report --- cura/CrashHandler.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cura/CrashHandler.py b/cura/CrashHandler.py index f29efd1019..bd5349f719 100644 --- a/cura/CrashHandler.py +++ b/cura/CrashHandler.py @@ -32,7 +32,6 @@ else: from cura.CuraVersion import CuraDebugMode except ImportError: CuraDebugMode = False # [CodeStyle: Reflecting imported value] -CuraDebugMode = True ## TODO Remove when done. Just for debug purposes # List of exceptions that should be considered "fatal" and abort the program. # These are primarily some exception types that we simply cannot really recover from @@ -168,6 +167,7 @@ class CrashHandler: # Look for plugins. If it's not a plugin, the current cura version is set isPlugin = False module_version = self.cura_version + module_name = "Cura" if split_path.__contains__("plugins"): isPlugin = True # Look backwards until plugin.json is found @@ -181,16 +181,18 @@ class CrashHandler: try: metadata = json.loads(f.read()) module_version = metadata["version"] + module_name = metadata["name"] except json.decoder.JSONDecodeError: - # Not through new exceptions + # Not throw new exceptions Logger.logException("e", "Failed to parse plugin.json for plugin %s", name) except: - # Not through new exceptions + # Not throw new exceptions pass exception_dict = dict() exception_dict["traceback"] = {"summary": summary, "full_trace": trace} - exception_dict["location"] = {"path": filepath, "file": filename, "function": function, "code": code, "line": line, "version": module_version, "is_plugin": isPlugin} + exception_dict["location"] = {"path": filepath, "file": filename, "function": function, "code": code, "line": line, + "module_name": module_name, "version": module_version, "is_plugin": isPlugin} self.data["exception"] = exception_dict return group From 74c37dfc65baaf10c39c6879959be81c46872332 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Fri, 13 Oct 2017 16:32:01 +0200 Subject: [PATCH 05/17] CURA-4195 Add strings for I18N --- cura/CrashHandler.py | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/cura/CrashHandler.py b/cura/CrashHandler.py index bd5349f719..249d509674 100644 --- a/cura/CrashHandler.py +++ b/cura/CrashHandler.py @@ -1,7 +1,9 @@ +# Copyright (c) 2017 Ultimaker B.V. +# Cura is released under the terms of the LGPLv3 or higher. + import sys import platform import traceback -import webbrowser import faulthandler import tempfile import os @@ -12,12 +14,10 @@ import ssl import urllib.request import urllib.error -from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QCoreApplication, Qt -from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTextEdit, QGroupBox +from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QCoreApplication +from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTextEdit, QGroupBox, QPushButton from UM.Logger import Logger -from UM.PluginError import InvalidMetaDataError -from UM.PluginRegistry import PluginRegistry from UM.View.GL.OpenGL import OpenGL from UM.i18n import i18nCatalog from UM.Platform import Platform @@ -90,7 +90,7 @@ class CrashHandler: def _messageWidget(self): label = QLabel() - label.setText(catalog.i18nc("@label", """

A fatal exception has occurred that we could not recover from!

+ label.setText(catalog.i18nc("@label crash message", """

A fatal exception has occurred that we could not recover from!

Please use the button below to post a bug report automatically to our servers

""")) @@ -98,7 +98,7 @@ class CrashHandler: def _informationWidget(self): group = QGroupBox() - group.setTitle("System information") + group.setTitle(catalog.i18nc("@title:groupbox", "System information")) layout = QVBoxLayout() label = QLabel() @@ -106,10 +106,13 @@ class CrashHandler: from UM.Application import Application self.cura_version = Application.getInstance().getVersion() except: - self.cura_version = "Unknown" + self.cura_version = catalog.i18nc("@label unknown version of Cura", "Unknown") - crash_info = "Version: {0}
Platform: {1}
Qt: {2}
PyQt: {3}
OpenGL: {4}" - crash_info = crash_info.format(self.cura_version, platform.platform(), QT_VERSION_STR, PYQT_VERSION_STR, self._getOpenGLInfo()) + crash_info = catalog.i18nc("@label Cura version", "Cura version: {version}
").format(version = self.cura_version) + crash_info += catalog.i18nc("@label Platform", "Platform: {platform}
").format(platform = platform.platform()) + crash_info += catalog.i18nc("@label Qt version", "Qt version: {qt}
").format(qt = QT_VERSION_STR) + crash_info += catalog.i18nc("@label PyQt version", "PyQt version: {pyqt}
").format(pyqt = PYQT_VERSION_STR) + crash_info += catalog.i18nc("@label OpenGL", "OpenGL: {opengl}
").format(opengl = self._getOpenGLInfo()) label.setText(crash_info) layout.addWidget(label) @@ -123,8 +126,11 @@ class CrashHandler: return group def _getOpenGLInfo(self): - info = "
  • OpenGL Version: {0}
  • OpenGL Vendor: {1}
  • OpenGL Renderer: {2}
" - info = info.format(OpenGL.getInstance().getOpenGLVersion(), OpenGL.getInstance().getGPUVendorName(), OpenGL.getInstance().getGPUType()) + info = "
    " + info += catalog.i18nc("@label OpenGL version", "
  • OpenGL Version: {version}
  • ").format(version = OpenGL.getInstance().getOpenGLVersion()) + info += catalog.i18nc("@label OpenGL vendor", "
  • OpenGL Vendor: {vendor}
  • ").format(vendor = OpenGL.getInstance().getGPUVendorName()) + info += catalog.i18nc("@label OpenGL renderer", "
  • OpenGL Renderer: {renderer}
  • ").format(renderer = OpenGL.getInstance().getGPUType()) + info += "
" self.data["opengl"] = {"version": OpenGL.getInstance().getOpenGLVersion(), "vendor": OpenGL.getInstance().getGPUVendorName(), "type": OpenGL.getInstance().getGPUType()} @@ -132,7 +138,7 @@ class CrashHandler: def _exceptionInfoWidget(self): group = QGroupBox() - group.setTitle("Exception traceback") + group.setTitle(catalog.i18nc("@title:groupbox", "Exception traceback")) layout = QVBoxLayout() text_area = QTextEdit() @@ -199,7 +205,7 @@ class CrashHandler: def _logInfoWidget(self): group = QGroupBox() - group.setTitle("Logs") + group.setTitle(catalog.i18nc("@title:groupbox", "Logs")) layout = QVBoxLayout() text_area = QTextEdit() @@ -223,7 +229,7 @@ class CrashHandler: def _userDescriptionWidget(self): group = QGroupBox() - group.setTitle("User description") + group.setTitle(catalog.i18nc("@title:groupbox", "User description")) layout = QVBoxLayout() # When sending the report, the user comments will be collected @@ -268,8 +274,8 @@ class CrashHandler: except Exception: # We don't want any exception to cause problems Logger.logException("e", "An exception occurred while trying to send crash report") - sys.exit(1) + os._exit(1) def show(self): self.dialog.exec_() - sys.exit(1) \ No newline at end of file + os._exit(1) \ No newline at end of file From ad1c0046d92a17c4a9a2ac91d039a285f740eb17 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Sun, 15 Oct 2017 11:54:49 +0200 Subject: [PATCH 06/17] Fix crash when exiting Machine Settings fixes #2609 --- plugins/MachineSettingsAction/MachineSettingsAction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/MachineSettingsAction/MachineSettingsAction.py b/plugins/MachineSettingsAction/MachineSettingsAction.py index 80258ef548..4343c2c780 100755 --- a/plugins/MachineSettingsAction/MachineSettingsAction.py +++ b/plugins/MachineSettingsAction/MachineSettingsAction.py @@ -79,7 +79,7 @@ class MachineSettingsAction(MachineAction): @pyqtSlot() def onFinishAction(self): # Restore autoslicing when the machineaction is dismissed - if self._backend.determineAutoSlicing(): + if self._backend and self._backend.determineAutoSlicing(): self._backend.tickle() def _onActiveExtruderStackChanged(self): From 464cf139a88f4eb176c1d95f5b6ec48f88acd133 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Sat, 14 Oct 2017 11:42:58 +0200 Subject: [PATCH 07/17] Change renderType for TextInput elements Unlike Label elements, which are defined to use Text.NativeRendering, TextInput uses Qt text rendering by default. This can lead to differences in font rendering between input fields and other texts. --- resources/qml/PrintMonitor.qml | 1 + resources/qml/Settings/SettingTextField.qml | 1 + 2 files changed, 2 insertions(+) diff --git a/resources/qml/PrintMonitor.qml b/resources/qml/PrintMonitor.qml index 4bf4b44aed..a2626e53de 100644 --- a/resources/qml/PrintMonitor.qml +++ b/resources/qml/PrintMonitor.qml @@ -442,6 +442,7 @@ Column anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter + renderType: Text.NativeRendering Component.onCompleted: { diff --git a/resources/qml/Settings/SettingTextField.qml b/resources/qml/Settings/SettingTextField.qml index ffc169af1a..7c2317af63 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -102,6 +102,7 @@ SettingItem right: parent.right verticalCenter: parent.verticalCenter } + renderType: Text.NativeRendering Keys.onTabPressed: { From d4e83ceba8ff7a0700ad6b8277c35b0d0941949c Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Sat, 14 Oct 2017 11:49:27 +0200 Subject: [PATCH 08/17] Fix one more fractional pixel offset affecting text placement --- resources/qml/Sidebar.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index 475e36d2dc..338eabffa2 100755 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -152,7 +152,7 @@ Rectangle Button { height: settingsModeSelection.height anchors.left: parent.left - anchors.leftMargin: model.index * (settingsModeSelection.width / 2) + anchors.leftMargin: model.index * Math.floor(settingsModeSelection.width / 2) anchors.verticalCenter: parent.verticalCenter width: Math.floor(0.5 * parent.width) text: model.text From 639f22a9868423d29bb471aa769c137c960ee702 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 16 Oct 2017 10:32:52 +0200 Subject: [PATCH 09/17] Fix broken string freeze with plugin browser menu item This is getting annoying. Contributes to issue CURA-4341. --- resources/i18n/cura.pot | 5 +++++ resources/i18n/de_DE/cura.po | 5 +++++ resources/i18n/es_ES/cura.po | 5 +++++ resources/i18n/fi_FI/cura.po | 5 +++++ resources/i18n/fr_FR/cura.po | 5 +++++ resources/i18n/it_IT/cura.po | 5 +++++ resources/i18n/nl_NL/cura.po | 5 +++++ resources/i18n/pl_PL/cura.po | 5 +++++ resources/i18n/pt_BR/cura.po | 5 +++++ resources/i18n/ru_RU/cura.po | 5 +++++ resources/i18n/tr_TR/cura.po | 5 +++++ resources/i18n/zh_CN/cura.po | 5 +++++ 12 files changed, 60 insertions(+) diff --git a/resources/i18n/cura.pot b/resources/i18n/cura.pot index 9135cfc381..520bdc10a9 100644 --- a/resources/i18n/cura.pot +++ b/resources/i18n/cura.pot @@ -63,6 +63,11 @@ msgctxt "@info:status" msgid "Print finished" msgstr "" +#: Manually added for resources/Cura/Cura.qml +msgctxt "@title:menu menubar:toplevel" +msgid "P&lugins" +msgstr "" + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/de_DE/cura.po b/resources/i18n/de_DE/cura.po index a18361802b..b5ff336387 100644 --- a/resources/i18n/de_DE/cura.po +++ b/resources/i18n/de_DE/cura.po @@ -61,6 +61,11 @@ msgctxt "@info:status" msgid "Print finished" msgstr "Druck vollendet" +#: Manually added for resources/Cura/Cura.qml +msgctxt "@title:menu menubar:toplevel" +msgid "P&lugins" +msgstr "&Plugins" + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/es_ES/cura.po b/resources/i18n/es_ES/cura.po index fe88603c5e..53472d079f 100644 --- a/resources/i18n/es_ES/cura.po +++ b/resources/i18n/es_ES/cura.po @@ -61,6 +61,11 @@ msgctxt "@info:status" msgid "Print finished" msgstr "Impresión terminada" +#: Manually added for resources/Cura/Cura.qml +msgctxt "@title:menu menubar:toplevel" +msgid "P&lugins" +msgstr "&Complementos" + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/fi_FI/cura.po b/resources/i18n/fi_FI/cura.po index 6c4dc4fdc8..269e904125 100644 --- a/resources/i18n/fi_FI/cura.po +++ b/resources/i18n/fi_FI/cura.po @@ -61,6 +61,11 @@ msgctxt "@info:status" msgid "Print finished" msgstr "Tulosta valmis" +#: Manually added for resources/Cura/Cura.qml +msgctxt "@title:menu menubar:toplevel" +msgid "P&lugins" +msgstr "&Lisäosat" + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/fr_FR/cura.po b/resources/i18n/fr_FR/cura.po index 5724cb3192..bbb5cb0b0f 100644 --- a/resources/i18n/fr_FR/cura.po +++ b/resources/i18n/fr_FR/cura.po @@ -61,6 +61,11 @@ msgctxt "@info:status" msgid "Print finished" msgstr "Impression terminée" +#: Manually added for resources/Cura/Cura.qml +msgctxt "@title:menu menubar:toplevel" +msgid "P&lugins" +msgstr "&Plug-ins" + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/it_IT/cura.po b/resources/i18n/it_IT/cura.po index ec85f0c2c8..6657437bef 100644 --- a/resources/i18n/it_IT/cura.po +++ b/resources/i18n/it_IT/cura.po @@ -61,6 +61,11 @@ msgctxt "@info:status" msgid "Print finished" msgstr "Stampa finita" +#: Manually added for resources/Cura/Cura.qml +msgctxt "@title:menu menubar:toplevel" +msgid "P&lugins" +msgstr "&Plugin" + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/nl_NL/cura.po b/resources/i18n/nl_NL/cura.po index c43d557c71..bd6ddaf356 100644 --- a/resources/i18n/nl_NL/cura.po +++ b/resources/i18n/nl_NL/cura.po @@ -61,6 +61,11 @@ msgctxt "@info:status" msgid "Print finished" msgstr "Print klaar" +#: Manually added for resources/Cura/Cura.qml +msgctxt "@title:menu menubar:toplevel" +msgid "P&lugins" +msgstr "&Plugins" + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/pl_PL/cura.po b/resources/i18n/pl_PL/cura.po index 9021cbcdde..c455ae48ca 100644 --- a/resources/i18n/pl_PL/cura.po +++ b/resources/i18n/pl_PL/cura.po @@ -63,6 +63,11 @@ msgctxt "@info:status" msgid "Print finished" msgstr "Drukowanie zakończone" +#: Manually added for resources/Cura/Cura.qml +msgctxt "@title:menu menubar:toplevel" +msgid "P&lugins" +msgstr "W&tyczki" + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/pt_BR/cura.po b/resources/i18n/pt_BR/cura.po index 868fe5e552..cb6dc4ef50 100644 --- a/resources/i18n/pt_BR/cura.po +++ b/resources/i18n/pt_BR/cura.po @@ -62,6 +62,11 @@ msgctxt "@info:status" msgid "Print finished" msgstr "Impressão Concluída" +#: Manually added for resources/Cura/Cura.qml +msgctxt "@title:menu menubar:toplevel" +msgid "P&lugins" +msgstr "&Complementos" + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/ru_RU/cura.po b/resources/i18n/ru_RU/cura.po index 7fe9e17073..4129648cf6 100755 --- a/resources/i18n/ru_RU/cura.po +++ b/resources/i18n/ru_RU/cura.po @@ -63,6 +63,11 @@ msgctxt "@info:status" msgid "Print finished" msgstr "Печать завершена" +#: Manually added for resources/Cura/Cura.qml +msgctxt "@title:menu menubar:toplevel" +msgid "P&lugins" +msgstr "Плагины" + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/tr_TR/cura.po b/resources/i18n/tr_TR/cura.po index dca9e1ce86..db339db866 100644 --- a/resources/i18n/tr_TR/cura.po +++ b/resources/i18n/tr_TR/cura.po @@ -61,6 +61,11 @@ msgctxt "@info:status" msgid "Print finished" msgstr "Baskı tamamlandı" +#: Manually added for resources/Cura/Cura.qml +msgctxt "@title:menu menubar:toplevel" +msgid "P&lugins" +msgstr "&Eklentiler" + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/zh_CN/cura.po b/resources/i18n/zh_CN/cura.po index 98357b94dc..91f1297dbe 100644 --- a/resources/i18n/zh_CN/cura.po +++ b/resources/i18n/zh_CN/cura.po @@ -63,6 +63,11 @@ msgctxt "@info:status" msgid "Print finished" msgstr "打印完成" +#: Manually added for resources/Cura/Cura.qml +msgctxt "@title:menu menubar:toplevel" +msgid "P&lugins" +msgstr "插件" + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" From 5a221a31d9d729aaf43aeefc3195a0c1c370f954 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 16 Oct 2017 10:42:02 +0200 Subject: [PATCH 10/17] Fix another broken string freeze with plugin browser menu item This is getting annoying. Contributes to issue CURA-4341. --- resources/i18n/cura.pot | 5 +++++ resources/i18n/de_DE/cura.po | 5 +++++ resources/i18n/es_ES/cura.po | 5 +++++ resources/i18n/fi_FI/cura.po | 5 +++++ resources/i18n/fr_FR/cura.po | 5 +++++ resources/i18n/it_IT/cura.po | 5 +++++ resources/i18n/nl_NL/cura.po | 5 +++++ resources/i18n/pl_PL/cura.po | 5 +++++ resources/i18n/pt_BR/cura.po | 5 +++++ resources/i18n/ru_RU/cura.po | 5 +++++ resources/i18n/tr_TR/cura.po | 5 +++++ resources/i18n/zh_CN/cura.po | 5 +++++ 12 files changed, 60 insertions(+) diff --git a/resources/i18n/cura.pot b/resources/i18n/cura.pot index 520bdc10a9..ed299dd5f7 100644 --- a/resources/i18n/cura.pot +++ b/resources/i18n/cura.pot @@ -68,6 +68,11 @@ msgctxt "@title:menu menubar:toplevel" msgid "P&lugins" msgstr "" +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Browse plugins..." +msgstr "" + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/de_DE/cura.po b/resources/i18n/de_DE/cura.po index b5ff336387..6431ae8a46 100644 --- a/resources/i18n/de_DE/cura.po +++ b/resources/i18n/de_DE/cura.po @@ -66,6 +66,11 @@ msgctxt "@title:menu menubar:toplevel" msgid "P&lugins" msgstr "&Plugins" +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Browse plugins..." +msgstr "Plugins durchsuchen..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/es_ES/cura.po b/resources/i18n/es_ES/cura.po index 53472d079f..0293020746 100644 --- a/resources/i18n/es_ES/cura.po +++ b/resources/i18n/es_ES/cura.po @@ -66,6 +66,11 @@ msgctxt "@title:menu menubar:toplevel" msgid "P&lugins" msgstr "&Complementos" +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Browse plugins..." +msgstr "Examinar complementos..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/fi_FI/cura.po b/resources/i18n/fi_FI/cura.po index 269e904125..d42db18103 100644 --- a/resources/i18n/fi_FI/cura.po +++ b/resources/i18n/fi_FI/cura.po @@ -66,6 +66,11 @@ msgctxt "@title:menu menubar:toplevel" msgid "P&lugins" msgstr "&Lisäosat" +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Browse plugins..." +msgstr "Selaa lisäosia..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/fr_FR/cura.po b/resources/i18n/fr_FR/cura.po index bbb5cb0b0f..8ceec834ce 100644 --- a/resources/i18n/fr_FR/cura.po +++ b/resources/i18n/fr_FR/cura.po @@ -66,6 +66,11 @@ msgctxt "@title:menu menubar:toplevel" msgid "P&lugins" msgstr "&Plug-ins" +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Browse plugins..." +msgstr "Parcourir les plug-ins..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/it_IT/cura.po b/resources/i18n/it_IT/cura.po index 6657437bef..80ddac85b3 100644 --- a/resources/i18n/it_IT/cura.po +++ b/resources/i18n/it_IT/cura.po @@ -66,6 +66,11 @@ msgctxt "@title:menu menubar:toplevel" msgid "P&lugins" msgstr "&Plugin" +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Browse plugins..." +msgstr "Sfoglia plugin..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/nl_NL/cura.po b/resources/i18n/nl_NL/cura.po index bd6ddaf356..4b4e17175b 100644 --- a/resources/i18n/nl_NL/cura.po +++ b/resources/i18n/nl_NL/cura.po @@ -66,6 +66,11 @@ msgctxt "@title:menu menubar:toplevel" msgid "P&lugins" msgstr "&Plugins" +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Browse plugins..." +msgstr "Door invoegtoepassingen bladeren..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/pl_PL/cura.po b/resources/i18n/pl_PL/cura.po index c455ae48ca..82cf15b631 100644 --- a/resources/i18n/pl_PL/cura.po +++ b/resources/i18n/pl_PL/cura.po @@ -68,6 +68,11 @@ msgctxt "@title:menu menubar:toplevel" msgid "P&lugins" msgstr "W&tyczki" +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Browse plugins..." +msgstr "Przeglądaj wtyczki..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/pt_BR/cura.po b/resources/i18n/pt_BR/cura.po index cb6dc4ef50..f7ce739731 100644 --- a/resources/i18n/pt_BR/cura.po +++ b/resources/i18n/pt_BR/cura.po @@ -67,6 +67,11 @@ msgctxt "@title:menu menubar:toplevel" msgid "P&lugins" msgstr "&Complementos" +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Browse plugins..." +msgstr "Navegar complementos..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/ru_RU/cura.po b/resources/i18n/ru_RU/cura.po index 4129648cf6..108534f5b5 100755 --- a/resources/i18n/ru_RU/cura.po +++ b/resources/i18n/ru_RU/cura.po @@ -68,6 +68,11 @@ msgctxt "@title:menu menubar:toplevel" msgid "P&lugins" msgstr "Плагины" +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Browse plugins..." +msgstr "Просмотр плагинов..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/tr_TR/cura.po b/resources/i18n/tr_TR/cura.po index db339db866..15df3b18d5 100644 --- a/resources/i18n/tr_TR/cura.po +++ b/resources/i18n/tr_TR/cura.po @@ -66,6 +66,11 @@ msgctxt "@title:menu menubar:toplevel" msgid "P&lugins" msgstr "&Eklentiler" +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Browse plugins..." +msgstr "Eklentilere göz at" + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/zh_CN/cura.po b/resources/i18n/zh_CN/cura.po index 91f1297dbe..93272fd725 100644 --- a/resources/i18n/zh_CN/cura.po +++ b/resources/i18n/zh_CN/cura.po @@ -68,6 +68,11 @@ msgctxt "@title:menu menubar:toplevel" msgid "P&lugins" msgstr "插件" +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Browse plugins..." +msgstr "浏览插件..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" From fb5aa97641a88449a4d48747873f50dc35935a4f Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 16 Oct 2017 10:47:11 +0200 Subject: [PATCH 11/17] Forgot ellipses Contributes to issue CURA-4341. --- resources/i18n/tr_TR/cura.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/i18n/tr_TR/cura.po b/resources/i18n/tr_TR/cura.po index 15df3b18d5..bea5ab0107 100644 --- a/resources/i18n/tr_TR/cura.po +++ b/resources/i18n/tr_TR/cura.po @@ -69,7 +69,7 @@ msgstr "&Eklentiler" #: Manually added for resources/Cura/Actions.qml msgctxt "@action:menu" msgid "Browse plugins..." -msgstr "Eklentilere göz at" +msgstr "Eklentilere göz at..." #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" From a10390dbf140d93801ffa2ac6967d84de7299ae8 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 16 Oct 2017 11:00:38 +0200 Subject: [PATCH 12/17] Fix ANOTHER broken string freeze with plugin browser menu item This is annoying. Contributes to issue CURA-4341. --- resources/i18n/cura.pot | 5 +++++ resources/i18n/de_DE/cura.po | 5 +++++ resources/i18n/es_ES/cura.po | 5 +++++ resources/i18n/fi_FI/cura.po | 5 +++++ resources/i18n/fr_FR/cura.po | 5 +++++ resources/i18n/it_IT/cura.po | 5 +++++ resources/i18n/nl_NL/cura.po | 5 +++++ resources/i18n/pl_PL/cura.po | 5 +++++ resources/i18n/pt_BR/cura.po | 5 +++++ resources/i18n/ru_RU/cura.po | 5 +++++ resources/i18n/tr_TR/cura.po | 5 +++++ resources/i18n/zh_CN/cura.po | 5 +++++ 12 files changed, 60 insertions(+) diff --git a/resources/i18n/cura.pot b/resources/i18n/cura.pot index ed299dd5f7..fb4b9ed0d6 100644 --- a/resources/i18n/cura.pot +++ b/resources/i18n/cura.pot @@ -73,6 +73,11 @@ msgctxt "@action:menu" msgid "Browse plugins..." msgstr "" +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Installed plugins..." +msgstr "" + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/de_DE/cura.po b/resources/i18n/de_DE/cura.po index 6431ae8a46..6bb71a5ae0 100644 --- a/resources/i18n/de_DE/cura.po +++ b/resources/i18n/de_DE/cura.po @@ -71,6 +71,11 @@ msgctxt "@action:menu" msgid "Browse plugins..." msgstr "Plugins durchsuchen..." +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Installed plugins..." +msgstr "Installierte plugins..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/es_ES/cura.po b/resources/i18n/es_ES/cura.po index 0293020746..f8f379d3d9 100644 --- a/resources/i18n/es_ES/cura.po +++ b/resources/i18n/es_ES/cura.po @@ -71,6 +71,11 @@ msgctxt "@action:menu" msgid "Browse plugins..." msgstr "Examinar complementos..." +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Installed plugins..." +msgstr "Complementos instalados..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/fi_FI/cura.po b/resources/i18n/fi_FI/cura.po index d42db18103..ae60ff98c6 100644 --- a/resources/i18n/fi_FI/cura.po +++ b/resources/i18n/fi_FI/cura.po @@ -71,6 +71,11 @@ msgctxt "@action:menu" msgid "Browse plugins..." msgstr "Selaa lisäosia..." +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Installed plugins..." +msgstr "Asennetut lisäoset..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/fr_FR/cura.po b/resources/i18n/fr_FR/cura.po index 8ceec834ce..76ad2ae4a6 100644 --- a/resources/i18n/fr_FR/cura.po +++ b/resources/i18n/fr_FR/cura.po @@ -71,6 +71,11 @@ msgctxt "@action:menu" msgid "Browse plugins..." msgstr "Parcourir les plug-ins..." +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Installed plugins..." +msgstr "Plug-ins installés..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/it_IT/cura.po b/resources/i18n/it_IT/cura.po index 80ddac85b3..7354379afa 100644 --- a/resources/i18n/it_IT/cura.po +++ b/resources/i18n/it_IT/cura.po @@ -71,6 +71,11 @@ msgctxt "@action:menu" msgid "Browse plugins..." msgstr "Sfoglia plugin..." +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Installed plugins..." +msgstr "Plugin installati..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/nl_NL/cura.po b/resources/i18n/nl_NL/cura.po index 4b4e17175b..680106d321 100644 --- a/resources/i18n/nl_NL/cura.po +++ b/resources/i18n/nl_NL/cura.po @@ -71,6 +71,11 @@ msgctxt "@action:menu" msgid "Browse plugins..." msgstr "Door invoegtoepassingen bladeren..." +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Installed plugins..." +msgstr "Geïnstalleerde plugins..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/pl_PL/cura.po b/resources/i18n/pl_PL/cura.po index 82cf15b631..fd840d9fc2 100644 --- a/resources/i18n/pl_PL/cura.po +++ b/resources/i18n/pl_PL/cura.po @@ -73,6 +73,11 @@ msgctxt "@action:menu" msgid "Browse plugins..." msgstr "Przeglądaj wtyczki..." +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Installed plugins..." +msgstr "Zainstalowane wtyczki..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/pt_BR/cura.po b/resources/i18n/pt_BR/cura.po index f7ce739731..db4aa72f0b 100644 --- a/resources/i18n/pt_BR/cura.po +++ b/resources/i18n/pt_BR/cura.po @@ -72,6 +72,11 @@ msgctxt "@action:menu" msgid "Browse plugins..." msgstr "Navegar complementos..." +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Installed plugins..." +msgstr "Complementos instalados..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/ru_RU/cura.po b/resources/i18n/ru_RU/cura.po index 108534f5b5..34f7262a1f 100755 --- a/resources/i18n/ru_RU/cura.po +++ b/resources/i18n/ru_RU/cura.po @@ -73,6 +73,11 @@ msgctxt "@action:menu" msgid "Browse plugins..." msgstr "Просмотр плагинов..." +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Installed plugins..." +msgstr "Установленные плагины..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/tr_TR/cura.po b/resources/i18n/tr_TR/cura.po index bea5ab0107..129c2bbe6b 100644 --- a/resources/i18n/tr_TR/cura.po +++ b/resources/i18n/tr_TR/cura.po @@ -71,6 +71,11 @@ msgctxt "@action:menu" msgid "Browse plugins..." msgstr "Eklentilere göz at..." +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Installed plugins..." +msgstr "Yüklü eklentiler..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" diff --git a/resources/i18n/zh_CN/cura.po b/resources/i18n/zh_CN/cura.po index 93272fd725..092ce5120b 100644 --- a/resources/i18n/zh_CN/cura.po +++ b/resources/i18n/zh_CN/cura.po @@ -73,6 +73,11 @@ msgctxt "@action:menu" msgid "Browse plugins..." msgstr "浏览插件..." +#: Manually added for resources/Cura/Actions.qml +msgctxt "@action:menu" +msgid "Installed plugins..." +msgstr "已安装插件..." + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" From 997be094933c8f19e12fd9426b29827c71fbb94c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 16 Oct 2017 11:16:53 +0200 Subject: [PATCH 13/17] Ignore Siemens NX plug-in --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5a077bd6b2..570c932d28 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,7 @@ plugins/FlatProfileExporter plugins/ProfileFlattener plugins/cura-god-mode-plugin plugins/cura-big-flame-graph +plugins/cura-siemensnx-plugin #Build stuff CMakeCache.txt From 58562d59a05e7b8565408716640117c8cddf82ba Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 16 Oct 2017 11:17:50 +0200 Subject: [PATCH 14/17] Remove unused import --- cura/Settings/ExtrudersModel.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cura/Settings/ExtrudersModel.py b/cura/Settings/ExtrudersModel.py index ab91e79789..b13e51723b 100644 --- a/cura/Settings/ExtrudersModel.py +++ b/cura/Settings/ExtrudersModel.py @@ -10,7 +10,6 @@ from UM.Application import Application import UM.FlameProfiler from cura.Settings.ExtruderManager import ExtruderManager from cura.Settings.ExtruderStack import ExtruderStack #To listen to changes on the extruders. -from cura.Settings.MachineManager import MachineManager #To listen to changes on the extruders of the currently active machine. catalog = i18nCatalog("cura") From b32f3f9f77453f774d3a2578941e673d040a296c Mon Sep 17 00:00:00 2001 From: "A.Sasin" Date: Mon, 16 Oct 2017 13:42:29 +0200 Subject: [PATCH 15/17] Adjusted Crash report message title CURA-4195 --- cura/CrashHandler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cura/CrashHandler.py b/cura/CrashHandler.py index 249d509674..04f04a1c37 100644 --- a/cura/CrashHandler.py +++ b/cura/CrashHandler.py @@ -90,8 +90,8 @@ class CrashHandler: def _messageWidget(self): label = QLabel() - label.setText(catalog.i18nc("@label crash message", """

A fatal exception has occurred that we could not recover from!

-

Please use the button below to post a bug report automatically to our servers

+ label.setText(catalog.i18nc("@label crash message", """

A fatal exception has occurred. Please send us this Crash Report to fix the problem

+

Please use the "Send report" button to post a bug report automatically to our servers

""")) return label @@ -244,7 +244,7 @@ class CrashHandler: def _buttonsWidget(self): buttons = QDialogButtonBox() buttons.addButton(QDialogButtonBox.Close) - buttons.addButton(catalog.i18nc("@action:button", "Send to developers"), QDialogButtonBox.AcceptRole) + buttons.addButton(catalog.i18nc("@action:button", "Send report"), QDialogButtonBox.AcceptRole) buttons.rejected.connect(self.dialog.close) buttons.accepted.connect(self._sendCrashReport) From aa7b456594e266e7f464f5205931129a3c96ce71 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 16 Oct 2017 13:59:20 +0200 Subject: [PATCH 16/17] Fix custom quality profile upgrade for UM2 family The custom quality profiles for the UM2 family used to be saved as profiles for "fdmprinter". They now should be updated to set for "ultimaker2". --- .../VersionUpgrade27to30.py | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/plugins/VersionUpgrade/VersionUpgrade27to30/VersionUpgrade27to30.py b/plugins/VersionUpgrade/VersionUpgrade27to30/VersionUpgrade27to30.py index d0b78168b4..98bbcf5120 100644 --- a/plugins/VersionUpgrade/VersionUpgrade27to30/VersionUpgrade27to30.py +++ b/plugins/VersionUpgrade/VersionUpgrade27to30/VersionUpgrade27to30.py @@ -118,24 +118,23 @@ class VersionUpgrade27to30(VersionUpgrade): if not parser.has_section("general"): parser.add_section("general") - # Need to exclude the following names: - # - ultimaker2_plus - # - ultimaker2_go - # - ultimaker2_extended - # - ultimaker2_extended_plus - exclude_prefix_list = ["ultimaker2_plus_", - "ultimaker2_go_", - "ultimaker2_extended_", - "ultimaker2_extended_plus_"] + # The ultimaker 2 family + ultimaker2_prefix_list = ["ultimaker2_extended_", + "ultimaker2_go_", + "ultimaker2_"] + # ultimaker 2+ is a different family, so don't do anything with those + exclude_prefix_list = ["ultimaker2_extended_plus_", + "ultimaker2_plus_"] + + # set machine definition to "ultimaker2" for the custom quality profiles that can be for the ultimaker 2 family file_base_name = os.path.basename(filename) - if file_base_name.startswith("ultimaker2_"): - skip_this = False - for exclude_prefix in exclude_prefix_list: - if file_base_name.startswith(exclude_prefix): - skip_this = True - break - if not skip_this: - parser["general"]["definition"] = "ultimaker2" + is_ultimaker2_family = not any(file_base_name.startswith(ep) for ep in exclude_prefix_list) + if not is_ultimaker2_family: + is_ultimaker2_family = any(file_base_name.startswith(ep) for ep in ultimaker2_prefix_list) + + # ultimaker2 family quality profiles used to set as "fdmprinter" profiles + if is_ultimaker2_family and parser["general"]["definition"] == "fdmprinter": + parser["general"]["definition"] = "ultimaker2" # Update version numbers parser["general"]["version"] = "2" From 8ef918829f6bfa7e46b2c3638cfe2e73b1e71b86 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 16 Oct 2017 15:00:29 +0200 Subject: [PATCH 17/17] Fix quality profile upgrade for UM2 family --- .../VersionUpgrade27to30/VersionUpgrade27to30.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/VersionUpgrade/VersionUpgrade27to30/VersionUpgrade27to30.py b/plugins/VersionUpgrade/VersionUpgrade27to30/VersionUpgrade27to30.py index 98bbcf5120..972d238921 100644 --- a/plugins/VersionUpgrade/VersionUpgrade27to30/VersionUpgrade27to30.py +++ b/plugins/VersionUpgrade/VersionUpgrade27to30/VersionUpgrade27to30.py @@ -128,8 +128,8 @@ class VersionUpgrade27to30(VersionUpgrade): # set machine definition to "ultimaker2" for the custom quality profiles that can be for the ultimaker 2 family file_base_name = os.path.basename(filename) - is_ultimaker2_family = not any(file_base_name.startswith(ep) for ep in exclude_prefix_list) - if not is_ultimaker2_family: + is_ultimaker2_family = False + if not any(file_base_name.startswith(ep) for ep in exclude_prefix_list): is_ultimaker2_family = any(file_base_name.startswith(ep) for ep in ultimaker2_prefix_list) # ultimaker2 family quality profiles used to set as "fdmprinter" profiles