diff --git a/CMakeLists.txt b/CMakeLists.txt index deb4e63935..be6c9d938e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ if(CURA_DEBUGMODE) set(_cura_debugmode "ON") endif() +set(CURA_APP_NAME "cura" CACHE STRING "Short name of Cura, used for configuration folder") set(CURA_APP_DISPLAY_NAME "Ultimaker Cura" CACHE STRING "Display name of Cura") set(CURA_VERSION "master" CACHE STRING "Version name of Cura") set(CURA_BUILDTYPE "" CACHE STRING "Build type of Cura, eg. 'PPA'") diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 47cc94f972..bfc2c8bddc 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -128,8 +128,9 @@ if TYPE_CHECKING: numpy.seterr(all = "ignore") try: - from cura.CuraVersion import CuraAppDisplayName, CuraVersion, CuraBuildType, CuraDebugMode, CuraSDKVersion # type: ignore + from cura.CuraVersion import CuraAppName, CuraAppDisplayName, CuraVersion, CuraBuildType, CuraDebugMode, CuraSDKVersion # type: ignore except ImportError: + CuraAppName = "cura" CuraAppDisplayName = "Ultimaker Cura" CuraVersion = "master" # [CodeStyle: Reflecting imported value] CuraBuildType = "" @@ -161,7 +162,7 @@ class CuraApplication(QtApplication): Q_ENUMS(ResourceTypes) def __init__(self, *args, **kwargs): - super().__init__(name = "cura", + super().__init__(name = CuraAppName, app_display_name = CuraAppDisplayName, version = CuraVersion, api_version = CuraSDKVersion, diff --git a/cura/CuraVersion.py.in b/cura/CuraVersion.py.in index 7c6304231d..f4c02ee396 100644 --- a/cura/CuraVersion.py.in +++ b/cura/CuraVersion.py.in @@ -1,6 +1,7 @@ # Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. +CuraAppName = "@CURA_APP_NAME@" CuraAppDisplayName = "@CURA_APP_DISPLAY_NAME@" CuraVersion = "@CURA_VERSION@" CuraBuildType = "@CURA_BUILDTYPE@" diff --git a/cura_app.py b/cura_app.py index 164e32e738..fea47e5a8b 100755 --- a/cura_app.py +++ b/cura_app.py @@ -26,13 +26,18 @@ parser.add_argument("--trigger-early-crash", known_args = vars(parser.parse_known_args()[0]) if not known_args["debug"]: + try: + from cura.CuraVersion import CuraAppName # type: ignore + except ImportError: + CuraAppName = "cura" + def get_cura_dir_path(): if Platform.isWindows(): - return os.path.expanduser("~/AppData/Roaming/cura") + return os.path.expanduser("~/AppData/Roaming/" + CuraAppName) elif Platform.isLinux(): - return os.path.expanduser("~/.local/share/cura") + return os.path.expanduser("~/.local/share/" + CuraAppName) elif Platform.isOSX(): - return os.path.expanduser("~/Library/Logs/cura") + return os.path.expanduser("~/Library/Logs/" + CuraAppName) if hasattr(sys, "frozen"): dirpath = get_cura_dir_path()