mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
Merge branch '3.4'
This commit is contained in:
commit
4b581d09e7
43
cura_app.py
43
cura_app.py
@ -3,29 +3,42 @@
|
|||||||
# Copyright (c) 2018 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.
|
||||||
|
|
||||||
|
import argparse
|
||||||
import faulthandler
|
import faulthandler
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from UM.Platform import Platform
|
from UM.Platform import Platform
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(prog = "cura",
|
||||||
|
add_help = False)
|
||||||
|
parser.add_argument('--debug',
|
||||||
|
action='store_true',
|
||||||
|
default = False,
|
||||||
|
help = "Turn on the debug mode by setting this option."
|
||||||
|
)
|
||||||
|
parser.add_argument('--trigger-early-crash',
|
||||||
|
dest = 'trigger_early_crash',
|
||||||
|
action = 'store_true',
|
||||||
|
default = False,
|
||||||
|
help = "FOR TESTING ONLY. Trigger an early crash to show the crash dialog."
|
||||||
|
)
|
||||||
|
known_args = vars(parser.parse_known_args()[0])
|
||||||
|
|
||||||
# Gets the directory for stdout and stderr
|
if not known_args["debug"]:
|
||||||
def get_cura_dir_for_stdoutputs() -> str:
|
def get_cura_dir_path():
|
||||||
if Platform.isWindows():
|
if Platform.isWindows():
|
||||||
return os.path.expanduser("~/AppData/Roaming/cura/")
|
return os.path.expanduser("~/AppData/Roaming/cura")
|
||||||
elif Platform.isLinux():
|
elif Platform.isLinux():
|
||||||
return os.path.expanduser("~/.local/share/cura")
|
return os.path.expanduser("~/.local/share/cura")
|
||||||
elif Platform.isOSX():
|
elif Platform.isOSX():
|
||||||
return os.path.expanduser("~/Library/Logs/cura")
|
return os.path.expanduser("~/Library/Logs/cura")
|
||||||
|
|
||||||
|
if hasattr(sys, "frozen"):
|
||||||
# Change stdout and stderr to files if Cura is running as a packaged application.
|
dirpath = get_cura_dir_path()
|
||||||
if hasattr(sys, "frozen"):
|
os.makedirs(dirpath, exist_ok = True)
|
||||||
dir_path = get_cura_dir_for_stdoutputs()
|
sys.stdout = open(os.path.join(dirpath, "stdout.log"), "w", encoding = "utf-8")
|
||||||
os.makedirs(dir_path, exist_ok = True)
|
sys.stderr = open(os.path.join(dirpath, "stderr.log"), "w", encoding = "utf-8")
|
||||||
sys.stdout = open(os.path.join(dir_path, "stdout.log"), "w", encoding = "utf-8")
|
|
||||||
sys.stderr = open(os.path.join(dir_path, "stderr.log"), "w", encoding = "utf-8")
|
|
||||||
|
|
||||||
|
|
||||||
# WORKAROUND: GITHUB-88 GITHUB-385 GITHUB-612
|
# WORKAROUND: GITHUB-88 GITHUB-385 GITHUB-612
|
||||||
|
@ -148,9 +148,22 @@ UM.Dialog
|
|||||||
{
|
{
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
width: parent.width
|
width: parent.width
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@action:label", "Extruder %1").arg(modelData)
|
text: {
|
||||||
|
var extruder = Number(modelData)
|
||||||
|
var extruder_id = ""
|
||||||
|
if(!isNaN(extruder))
|
||||||
|
{
|
||||||
|
extruder_id = extruder + 1 // The extruder counter start from One and not Zero
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
extruder_id = modelData
|
||||||
|
}
|
||||||
|
|
||||||
|
return catalog.i18nc("@action:label", "Extruder %1").arg(extruder_id)
|
||||||
|
}
|
||||||
font.bold: true
|
font.bold: true
|
||||||
}
|
}
|
||||||
Row
|
Row
|
||||||
|
@ -34,6 +34,7 @@ retraction_hop_enabled
|
|||||||
|
|
||||||
[cooling]
|
[cooling]
|
||||||
cool_fan_enabled
|
cool_fan_enabled
|
||||||
|
cool_fan_speed
|
||||||
|
|
||||||
[support]
|
[support]
|
||||||
support_enable
|
support_enable
|
||||||
|
Loading…
x
Reference in New Issue
Block a user