Merge branch '3.0'

This commit is contained in:
Ghostkeeper 2017-10-06 10:00:19 +02:00
commit 7e00914e38
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75
6 changed files with 82 additions and 24 deletions

View file

@ -754,17 +754,6 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
)
return
# Check if we're already writing
if not self._write_finished:
self._error_message = Message(
i18n_catalog.i18nc("@info:status",
"Sending new jobs (temporarily) blocked, still sending the previous print job."))
self._error_message.show()
return
# Indicate we're starting a new write action, is set back to True in the startPrint() method
self._write_finished = False
self.startPrint()
def _configurationMismatchMessageCallback(self, button):
@ -855,6 +844,18 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
# This function can fail to actually start a print due to not being authenticated or another print already
# being in progress.
def startPrint(self):
# Check if we're already writing
if not self._write_finished:
self._error_message = Message(
i18n_catalog.i18nc("@info:status",
"Sending new jobs (temporarily) blocked, still sending the previous print job."))
self._error_message.show()
return
# Indicate we're starting a new write action, is set back to True at the end of this method
self._write_finished = False
try:
self._send_gcode_start = time()
self._progress_message = Message(i18n_catalog.i18nc("@info:status", "Sending data to printer"), 0, False, -1, i18n_catalog.i18nc("@info:title", "Sending Data"))

View file

@ -3,6 +3,7 @@
import configparser #To parse preference files.
import io #To serialise the preference files afterwards.
import os
from UM.VersionUpgrade import VersionUpgrade #We're inheriting from this.
@ -93,6 +94,41 @@ class VersionUpgrade27to30(VersionUpgrade):
parser.write(output)
return [filename], [output.getvalue()]
## Upgrades the given quality changes container file from version 2.7 to 3.0.
#
# \param serialised The serialised form of the container file.
# \param filename The name of the file to upgrade.
def upgradeQualityChangesContainer(self, serialised, filename):
parser = configparser.ConfigParser(interpolation=None)
parser.read_string(serialised)
# Update the skin pre-shrink settings:
# - Remove the old ones
# - Do not add the new ones. The default values will be used for them.
if parser.has_section("values"):
for remove_key in ["expand_skins_into_infill", "expand_upper_skins", "expand_lower_skins"]:
if remove_key in parser["values"]:
del parser["values"][remove_key]
for each_section in ("general", "metadata"):
if not parser.has_section(each_section):
parser.add_section(each_section)
# Set the definition to "ultimaker2" for Ultimaker 2 quality changes
if not parser.has_section("general"):
parser.add_section("general")
if os.path.basename(filename).startswith("ultimaker2_"):
parser["general"]["definition"] = "ultimaker2"
# Update version numbers
parser["general"]["version"] = "2"
parser["metadata"]["setting_version"] = "3"
# Re-serialise the file.
output = io.StringIO()
parser.write(output)
return [filename], [output.getvalue()]
## Upgrades the given instance container file from version 2.7 to 3.0.
#
# \param serialised The serialised form of the container file.

View file

@ -14,7 +14,7 @@ def getMetaData():
("machine_stack", 3000002): ("machine_stack", 3000003, upgrade.upgradeStack),
("extruder_train", 3000002): ("extruder_train", 3000003, upgrade.upgradeStack),
("quality_changes", 2000002): ("quality_changes", 2000003, upgrade.upgradeOtherContainer),
("quality_changes", 2000002): ("quality_changes", 2000003, upgrade.upgradeQualityChangesContainer),
("user", 2000002): ("user", 2000003, upgrade.upgradeOtherContainer),
("quality", 2000002): ("quality", 2000003, upgrade.upgradeOtherContainer),
("definition_changes", 2000002): ("definition_changes", 2000003, upgrade.upgradeOtherContainer),