mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 10:45:54 +08:00
Merge branch 'master' into ui_rework_4_0
This commit is contained in:
commit
8bae9fa667
@ -20,8 +20,9 @@ Dependencies
|
|||||||
------------
|
------------
|
||||||
* [Uranium](https://github.com/Ultimaker/Uranium) Cura is built on top of the Uranium framework.
|
* [Uranium](https://github.com/Ultimaker/Uranium) Cura is built on top of the Uranium framework.
|
||||||
* [CuraEngine](https://github.com/Ultimaker/CuraEngine) This will be needed at runtime to perform the actual slicing.
|
* [CuraEngine](https://github.com/Ultimaker/CuraEngine) This will be needed at runtime to perform the actual slicing.
|
||||||
|
* [fdm_materials](https://github.com/Ultimaker/fdm_materials) Required to load a printer that has swappable material profiles.
|
||||||
* [PySerial](https://github.com/pyserial/pyserial) Only required for USB printing support.
|
* [PySerial](https://github.com/pyserial/pyserial) Only required for USB printing support.
|
||||||
* [python-zeroconf](https://github.com/jstasiak/python-zeroconf) Only required to detect mDNS-enabled printers
|
* [python-zeroconf](https://github.com/jstasiak/python-zeroconf) Only required to detect mDNS-enabled printers.
|
||||||
|
|
||||||
Build scripts
|
Build scripts
|
||||||
-------------
|
-------------
|
||||||
|
@ -13,6 +13,6 @@ TryExec=@CMAKE_INSTALL_FULL_BINDIR@/cura
|
|||||||
Icon=cura-icon
|
Icon=cura-icon
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Type=Application
|
Type=Application
|
||||||
MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;image/bmp;image/gif;image/jpeg;image/png;model/x3d+xml;
|
MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;image/bmp;image/gif;image/jpeg;image/png;model/x3d+xml;text/x-gcode;
|
||||||
Categories=Graphics;
|
Categories=Graphics;
|
||||||
Keywords=3D;Printing;Slicer;
|
Keywords=3D;Printing;Slicer;
|
||||||
|
@ -19,4 +19,12 @@
|
|||||||
<glob-deleteall/>
|
<glob-deleteall/>
|
||||||
<glob pattern="*.obj"/>
|
<glob pattern="*.obj"/>
|
||||||
</mime-type>
|
</mime-type>
|
||||||
|
<mime-type type="text/x-gcode">
|
||||||
|
<sub-class-of type="text/plain"/>
|
||||||
|
<comment>Gcode file</comment>
|
||||||
|
<icon name="unknown"/>
|
||||||
|
<glob-deleteall/>
|
||||||
|
<glob pattern="*.gcode"/>
|
||||||
|
<glob pattern="*.g"/>
|
||||||
|
</mime-type>
|
||||||
</mime-info>
|
</mime-info>
|
@ -46,12 +46,13 @@ class Backup:
|
|||||||
|
|
||||||
# We copy the preferences file to the user data directory in Linux as it's in a different location there.
|
# We copy the preferences file to the user data directory in Linux as it's in a different location there.
|
||||||
# When restoring a backup on Linux, we move it back.
|
# When restoring a backup on Linux, we move it back.
|
||||||
if Platform.isLinux():
|
if Platform.isLinux(): #TODO: This should check for the config directory not being the same as the data directory, rather than hard-coding that to Linux systems.
|
||||||
preferences_file_name = self._application.getApplicationName()
|
preferences_file_name = self._application.getApplicationName()
|
||||||
preferences_file = Resources.getPath(Resources.Preferences, "{}.cfg".format(preferences_file_name))
|
preferences_file = Resources.getPath(Resources.Preferences, "{}.cfg".format(preferences_file_name))
|
||||||
backup_preferences_file = os.path.join(version_data_dir, "{}.cfg".format(preferences_file_name))
|
backup_preferences_file = os.path.join(version_data_dir, "{}.cfg".format(preferences_file_name))
|
||||||
Logger.log("d", "Copying preferences file from %s to %s", preferences_file, backup_preferences_file)
|
if os.path.exists(preferences_file) and (not os.path.exists(backup_preferences_file) or not os.path.samefile(preferences_file, backup_preferences_file)):
|
||||||
shutil.copyfile(preferences_file, backup_preferences_file)
|
Logger.log("d", "Copying preferences file from %s to %s", preferences_file, backup_preferences_file)
|
||||||
|
shutil.copyfile(preferences_file, backup_preferences_file)
|
||||||
|
|
||||||
# Create an empty buffer and write the archive to it.
|
# Create an empty buffer and write the archive to it.
|
||||||
buffer = io.BytesIO()
|
buffer = io.BytesIO()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Copyright (c) 2017 Ultimaker B.V.
|
# Copyright (c) 2018 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
|
from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
|
||||||
@ -325,13 +325,12 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||||||
|
|
||||||
## Handler for zeroConf detection.
|
## Handler for zeroConf detection.
|
||||||
# Return True or False indicating if the process succeeded.
|
# Return True or False indicating if the process succeeded.
|
||||||
# Note that this function can take over 3 seconds to complete. Be carefull calling it from the main thread.
|
# Note that this function can take over 3 seconds to complete. Be careful
|
||||||
|
# calling it from the main thread.
|
||||||
def _onServiceChanged(self, zero_conf, service_type, name, state_change):
|
def _onServiceChanged(self, zero_conf, service_type, name, state_change):
|
||||||
if state_change == ServiceStateChange.Added:
|
if state_change == ServiceStateChange.Added:
|
||||||
Logger.log("d", "Bonjour service added: %s" % name)
|
|
||||||
|
|
||||||
# First try getting info from zero-conf cache
|
# First try getting info from zero-conf cache
|
||||||
info = ServiceInfo(service_type, name, properties={})
|
info = ServiceInfo(service_type, name, properties = {})
|
||||||
for record in zero_conf.cache.entries_with_name(name.lower()):
|
for record in zero_conf.cache.entries_with_name(name.lower()):
|
||||||
info.update_record(zero_conf, time(), record)
|
info.update_record(zero_conf, time(), record)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user