Merge branch 'master' of github.com:Ultimaker/Cura

This commit is contained in:
Jack Ha 2016-12-08 17:24:36 +01:00
commit 10375a57f2
12 changed files with 52 additions and 14 deletions

View file

@ -2,9 +2,11 @@ import sys
import platform
import traceback
import webbrowser
import urllib
from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QCoreApplication
from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTextEdit
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 UM.Logger import Logger
from UM.i18n import i18nCatalog
@ -22,9 +24,7 @@ fatal_exception_types = [
]
def show(exception_type, value, tb):
debug_mode = False
if QCoreApplication.instance():
debug_mode = QCoreApplication.instance().getCommandLineOption("debug-mode", False)
debug_mode = True
Logger.log("c", "An uncaught exception has occurred!")
for line in traceback.format_exception(exception_type, value, tb):
@ -38,14 +38,42 @@ def show(exception_type, value, tb):
if not application:
sys.exit(1)
dialog = QDialog()
dialog.setMinimumWidth(640)
dialog.setMinimumHeight(640)
dialog.setWindowTitle(catalog.i18nc("@title:window", "Oops!"))
layout = QVBoxLayout(dialog)
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)
label.setText(catalog.i18nc("@label", "<p>A fatal exception has occurred that we could not recover from!</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 = QLabel(dialog)
layout.addWidget(label)
#label.setScaledContents(True)
label.setText(catalog.i18nc("@label", """
<p>A fatal exception has occurred that we could not recover from!</p>
<p>We hope this picture of a kitten helps you recover from the shock.</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)
layout.addWidget(textarea)

View file

@ -407,7 +407,6 @@ class CuraApplication(QtApplication):
def addCommandLineOptions(self, parser):
super().addCommandLineOptions(parser)
parser.add_argument("file", nargs="*", help="Files to load after starting the application.")
parser.add_argument("--debug", dest="debug-mode", action="store_true", default=False, help="Enable detailed crash reports.")
def run(self):
self.showSplashMessage(self._i18n_catalog.i18nc("@info:progress", "Setting up scene..."))

View file

@ -351,7 +351,7 @@ Item {
{
if(text != "")
{
listview.model.filter = {"settable_per_mesh": true, "label": "*" + text}
listview.model.filter = {"settable_per_mesh": true, "i18n_label": "*" + text}
}
else
{

View file

@ -1018,9 +1018,9 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
def materialHotendChangedMessage(self, callback):
Application.getInstance().messageBox(i18n_catalog.i18nc("@window:title", "Changes on the Printer"),
i18n_catalog.i18nc("@label",
"Would you like to update your current printer configuration into Cura?"),
"Would you like to use your current printer configuration in Cura?"),
i18n_catalog.i18nc("@label",
"The PrintCores and/or materials on your printer were changed. For the best result, always slice for the PrintCores and materials that are inserted in your printer."),
"The PrintCores and/or materials on your printer differ from those within your current project. For the best result, always slice for the PrintCores and materials that are inserted in your printer."),
buttons=QMessageBox.Yes + QMessageBox.No,
icon=QMessageBox.Question,
callback=callback

View file

@ -2,6 +2,7 @@
# Cura is released under the terms of the AGPLv3 or higher.
import configparser #To get version numbers from config files.
import os
import os.path
import io

BIN
resources/images/kitten.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

View file

@ -127,7 +127,7 @@ UM.ManagementPage
{
text: catalog.i18nc("@action:button", "Activate");
iconName: "list-activate";
enabled: base.currentItem != null && base.currentItem.id != Cura.MachineManager.activeMaterialId
enabled: base.currentItem != null && base.currentItem.id != Cura.MachineManager.activeMaterialId && Cura.MachineManager.hasMaterials
onClicked: Cura.MachineManager.setActiveMaterial(base.currentItem.id)
},
Button
@ -144,8 +144,10 @@ UM.ManagementPage
{
return
}
Cura.MachineManager.setActiveMaterial(material_id)
if(Cura.MachineManager.hasMaterials)
{
Cura.MachineManager.setActiveMaterial(material_id)
}
}
},
Button

View file

@ -90,7 +90,7 @@ UM.PreferencesPage
placeholderText: catalog.i18nc("@label:textbox", "Filter...")
onTextChanged: definitionsModel.filter = {"label": "*" + text}
onTextChanged: definitionsModel.filter = {"i18n_label": "*" + text}
}
ScrollView

View file

@ -16,6 +16,8 @@ cool_min_speed = 10
infill_line_width = =round(line_width * 0.5 / 0.4, 2)
line_width = =machine_nozzle_size
material_print_temperature = =default_material_print_temperature + 10
material_initial_print_temperature = =material_print_temperature - 5
material_final_print_temperature = =material_print_temperature - 10
material_standby_temperature = 100
ooze_shield_angle = 40
prime_tower_enable = False

View file

@ -16,6 +16,8 @@ cool_min_speed = 10
infill_line_width = =round(line_width * 0.5 / 0.4, 2)
line_width = =machine_nozzle_size
material_print_temperature = =default_material_print_temperature + 5
material_initial_print_temperature = =material_print_temperature - 5
material_final_print_temperature = =material_print_temperature - 10
material_standby_temperature = 100
ooze_shield_angle = 40
prime_tower_enable = False

View file

@ -15,6 +15,8 @@ cool_min_layer_time_fan_speed_max = 20
cool_min_speed = 15
infill_line_width = =round(line_width * 0.5 / 0.4, 2)
line_width = =machine_nozzle_size
material_initial_print_temperature = =material_print_temperature - 5
material_final_print_temperature = =material_print_temperature - 10
material_standby_temperature = 100
ooze_shield_angle = 40
prime_tower_enable = False

View file

@ -15,6 +15,8 @@ cool_min_layer_time_fan_speed_max = 20
cool_min_speed = 12
infill_line_width = =round(line_width * 0.5 / 0.4, 2)
line_width = =machine_nozzle_size
material_initial_print_temperature = =material_print_temperature - 5
material_final_print_temperature = =material_print_temperature - 10
material_standby_temperature = 100
ooze_shield_angle = 40
prime_tower_enable = False