Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cura
diff options
context:
space:
mode:
authorRemco Burema <r.burema@ultimaker.com>2020-12-20 23:55:13 +0300
committerRemco Burema <r.burema@ultimaker.com>2020-12-20 23:55:13 +0300
commit0fdcd208eeec9ab36a4e90e49c5ac5b589579afe (patch)
tree26658dc26a9ba5952c67986dcbe1f95ff2d67c21 /cura
parentbb0d2cad40fc17feb10223aab9838f7a2de8a8ba (diff)
Possible alternate non-numbered versions.
CURA-7932
Diffstat (limited to 'cura')
-rw-r--r--cura/ApplicationMetadata.py1
-rwxr-xr-xcura/CuraApplication.py6
-rw-r--r--cura/UI/CuraSplashScreen.py6
-rw-r--r--cura/UI/TextManager.py8
4 files changed, 14 insertions, 7 deletions
diff --git a/cura/ApplicationMetadata.py b/cura/ApplicationMetadata.py
index 2e15d60a93..6399e7a757 100644
--- a/cura/ApplicationMetadata.py
+++ b/cura/ApplicationMetadata.py
@@ -46,6 +46,7 @@ except ImportError:
# Various convenience flags indicating what kind of Cura build it is.
__ENTERPRISE_VERSION_TYPE = "enterprise"
IsEnterpriseVersion = CuraBuildType.lower() == __ENTERPRISE_VERSION_TYPE
+IsAlternateVersion = CuraBuildType.lower() not in [DEFAULT_CURA_BUILD_TYPE, __ENTERPRISE_VERSION_TYPE]
try:
from cura.CuraVersion import CuraAppDisplayName # type: ignore
diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py
index 76a54d1de6..8540f5986d 100755
--- a/cura/CuraApplication.py
+++ b/cura/CuraApplication.py
@@ -150,11 +150,11 @@ class CuraApplication(QtApplication):
def __init__(self, *args, **kwargs):
super().__init__(name = ApplicationMetadata.CuraAppName,
app_display_name = ApplicationMetadata.CuraAppDisplayName,
- version = ApplicationMetadata.CuraVersion,
+ version = ApplicationMetadata.CuraVersion if not ApplicationMetadata.IsAlternateVersion else ApplicationMetadata.CuraBuildType,
api_version = ApplicationMetadata.CuraSDKVersion,
build_type = ApplicationMetadata.CuraBuildType,
is_debug_mode = ApplicationMetadata.CuraDebugMode,
- tray_icon_name = "cura-icon-32.png",
+ tray_icon_name = "cura-icon-32.png" if not ApplicationMetadata.IsAlternateVersion else "cura-icon-32_wip.png",
**kwargs)
self.default_theme = "cura-light"
@@ -475,7 +475,7 @@ class CuraApplication(QtApplication):
if not self.getIsHeadLess():
try:
- self.setWindowIcon(QIcon(Resources.getPath(Resources.Images, "cura-icon.png")))
+ self.setWindowIcon(QIcon(Resources.getPath(Resources.Images, "cura-icon.png" if not ApplicationMetadata.IsAlternateVersion else "cura-icon_wip.png")))
except FileNotFoundError:
Logger.log("w", "Unable to find the window icon.")
diff --git a/cura/UI/CuraSplashScreen.py b/cura/UI/CuraSplashScreen.py
index d9caa207f4..4fa798247d 100644
--- a/cura/UI/CuraSplashScreen.py
+++ b/cura/UI/CuraSplashScreen.py
@@ -17,7 +17,9 @@ class CuraSplashScreen(QSplashScreen):
self._scale = 0.7
self._version_y_offset = 0 # when extra visual elements are in the background image, move version text down
- if ApplicationMetadata.IsEnterpriseVersion:
+ if ApplicationMetadata.IsAlternateVersion:
+ splash_image = QPixmap(Resources.getPath(Resources.Images, "cura_wip.png"))
+ elif ApplicationMetadata.IsEnterpriseVersion:
splash_image = QPixmap(Resources.getPath(Resources.Images, "cura_enterprise.png"))
self._version_y_offset = 26
else:
@@ -70,7 +72,7 @@ class CuraSplashScreen(QSplashScreen):
font = QFont() # Using system-default font here
font.setPixelSize(18)
painter.setFont(font)
- painter.drawText(60, 70 + self._version_y_offset, round(330 * self._scale), round(230 * self._scale), Qt.AlignLeft | Qt.AlignTop, version[0])
+ painter.drawText(60, 70 + self._version_y_offset, round(330 * self._scale), round(230 * self._scale), Qt.AlignLeft | Qt.AlignTop, version[0] if not ApplicationMetadata.IsAlternateVersion else ApplicationMetadata.CuraBuildType)
if len(version) > 1:
font.setPixelSize(16)
painter.setFont(font)
diff --git a/cura/UI/TextManager.py b/cura/UI/TextManager.py
index dbe7940f26..99c1a55d46 100644
--- a/cura/UI/TextManager.py
+++ b/cura/UI/TextManager.py
@@ -43,7 +43,9 @@ class TextManager(QObject):
line = line.replace("[", "")
line = line.replace("]", "")
open_version = Version(line)
- if open_version > Version([14, 99, 99]): # Bit of a hack: We released the 15.x.x versions before 2.x
+ if open_version < Version([0, 0, 1]): # Something went wrong with parsing, assume non-numerical alternate version that should be on top.
+ open_version = Version([99, 99, 99])
+ if Version([14, 99, 99]) < open_version < Version([16, 0, 0]): # Bit of a hack: We released the 15.x.x versions before 2.x
open_version = Version([0, open_version.getMinor(), open_version.getRevision(), open_version.getPostfixVersion()])
open_header = ""
change_logs_dict[open_version] = collections.OrderedDict()
@@ -61,7 +63,9 @@ class TextManager(QObject):
text_version = version
if version < Version([1, 0, 0]): # Bit of a hack: We released the 15.x.x versions before 2.x
text_version = Version([15, version.getMinor(), version.getRevision(), version.getPostfixVersion()])
- content += "<h1>" + str(text_version) + "</h1><br>"
+ if version > Version([99, 0, 0]): # Leave it out altogether if it was originally a non-numbered version.
+ text_version = ""
+ content += ("<h1>" + str(text_version) + "</h1><br>") if text_version else ""
content += ""
for change in change_logs_dict[version]:
if str(change) != "":