diff --git a/REUSE.toml b/REUSE.toml index 31b48879..70e2cf7c 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -8,7 +8,7 @@ path = [ "docs/CNAME", "docs/assets/**", "src/tagstudio/qt/resources.json", - "src/tagstudio/resources/icon.*", + "src/tagstudio/resources/icon*.*", "src/tagstudio/resources/tagstudio.desktop", "src/tagstudio/resources/templates/ts_ignore_template.txt", "src/tagstudio/resources/templates/ts_ignore_template_blank.txt", diff --git a/src/tagstudio/core/constants.py b/src/tagstudio/core/constants.py index 047fb720..2013f4bf 100644 --- a/src/tagstudio/core/constants.py +++ b/src/tagstudio/core/constants.py @@ -3,8 +3,8 @@ from importlib.metadata import version -VERSION: str = version("tagstudio") # Major.Minor.Patch -VERSION_BRANCH: str = "" # Usually "" or "Pre-Release" +VERSION: str = version("tagstudio") +BUILD_TYPE: str = "" # Usually "", "app.nightly", or "app.pre_release" COPYRIGHT_YEARS: str = "2021-2026" COPYRIGHT: str = f"© {COPYRIGHT_YEARS} Travis Abendshien & TagStudio Contributors" COPYRIGHT_COMPACT: str = f"© {COPYRIGHT_YEARS} Travis Abendshien\n& TagStudio Contributors" diff --git a/src/tagstudio/main.py b/src/tagstudio/main.py index 23cd0f8b..bf98a849 100755 --- a/src/tagstudio/main.py +++ b/src/tagstudio/main.py @@ -10,7 +10,8 @@ import traceback import structlog -from tagstudio.core.constants import VERSION, VERSION_BRANCH +from tagstudio.core.constants import BUILD_TYPE, VERSION +from tagstudio.qt.translations import Translations from tagstudio.qt.ts_qt import QtDriver logger = structlog.get_logger(__name__) @@ -59,7 +60,7 @@ def main(): "--version", action="version", help="Displays TagStudio version information.", - version=f"TagStudio v{VERSION} {VERSION_BRANCH}", + version=f"TagStudio v{VERSION} {Translations[BUILD_TYPE] if BUILD_TYPE else ''}", ) args = parser.parse_args() diff --git a/src/tagstudio/qt/mixed/about_modal.py b/src/tagstudio/qt/mixed/about_modal.py index e9b52297..0aa45a6d 100644 --- a/src/tagstudio/qt/mixed/about_modal.py +++ b/src/tagstudio/qt/mixed/about_modal.py @@ -19,12 +19,12 @@ from PySide6.QtWidgets import ( ) from tagstudio.core.constants import ( + BUILD_TYPE, COPYRIGHT, DISCORD_URL, DOCS_URL, GITHUB_REPO_URL, VERSION, - VERSION_BRANCH, ) from tagstudio.core.ts_core import TagStudioCore from tagstudio.core.utils.ffmpeg_status import FfmpegStatus, FfprobeStatus @@ -42,7 +42,12 @@ from tagstudio.qt.views.stylesheets.stylesheets import form_content_style, heade class AboutModal(QWidget): """Modal window showing information about the TagStudio application.""" - VERSION_STR: str = f"{Translations['about.version']} {VERSION} {(' (' + VERSION_BRANCH + ')') if VERSION_BRANCH else ''}" # noqa: E501 + VERSION_STR: str = " ".join( + [ + f"{Translations['about.version']}", + f"{VERSION} {(' (' + Translations[BUILD_TYPE] + ')') if BUILD_TYPE else ''}", + ] + ) def __init__(self, config_path: Path | str): super().__init__() diff --git a/src/tagstudio/qt/ts_qt.py b/src/tagstudio/qt/ts_qt.py index f18ff1ac..c0a7de1c 100644 --- a/src/tagstudio/qt/ts_qt.py +++ b/src/tagstudio/qt/ts_qt.py @@ -40,7 +40,7 @@ from PySide6.QtGui import ( from PySide6.QtWidgets import QApplication, QFileDialog, QMessageBox, QPushButton, QScrollArea import tagstudio.qt.resources_rc # noqa: F401 # pyright: ignore[reportUnusedImport] -from tagstudio.core.constants import TAG_ARCHIVED, TAG_FAVORITE, VERSION, VERSION_BRANCH +from tagstudio.core.constants import BUILD_TYPE, TAG_ARCHIVED, TAG_FAVORITE, VERSION from tagstudio.core.driver import DriverMixin from tagstudio.core.enums import AppCacheItems, MacroID, ShowFilepathOption from tagstudio.core.library.alchemy.enums import BrowsingState, SortingModeEnum @@ -203,7 +203,7 @@ class QtDriver(DriverMixin, QObject): self.scrollbar_pos = 0 self.spacing = None - self.branch: str = (" (" + VERSION_BRANCH + ")") if VERSION_BRANCH else "" + self.branch: str = (" (" + Translations[BUILD_TYPE] + ")") if BUILD_TYPE else "" self.base_title: str = f"TagStudio Alpha {VERSION}{self.branch}" # self.title_text: str = self.base_title # self.buffer = {} diff --git a/src/tagstudio/qt/views/splash.py b/src/tagstudio/qt/views/splash.py index 8f63c78b..d6dcb637 100644 --- a/src/tagstudio/qt/views/splash.py +++ b/src/tagstudio/qt/views/splash.py @@ -10,7 +10,7 @@ from PySide6.QtCore import QRect, Qt from PySide6.QtGui import QColor, QFont, QPainter, QPen, QPixmap from PySide6.QtWidgets import QSplashScreen, QWidget -from tagstudio.core.constants import COPYRIGHT, COPYRIGHT_COMPACT, VERSION, VERSION_BRANCH +from tagstudio.core.constants import BUILD_TYPE, COPYRIGHT, COPYRIGHT_COMPACT, VERSION from tagstudio.qt.global_settings import Splash from tagstudio.qt.resource_manager import ResourceManager from tagstudio.qt.translations import Translations @@ -21,7 +21,12 @@ logger = structlog.get_logger(__name__) class SplashScreen: """The custom splash screen widget for TagStudio.""" - VERSION_STR: str = f"{Translations['about.version']} {VERSION} {(' (' + VERSION_BRANCH + ')') if VERSION_BRANCH else ''}" # noqa: E501 + VERSION_STR: str = " ".join( + [ + f"{Translations['about.version']}", + f"{VERSION} {(' (' + Translations[BUILD_TYPE] + ')') if BUILD_TYPE else ''}", + ] + ) DEFAULT_SPLASH = Splash.AURORA def __init__( diff --git a/src/tagstudio/resources/icon.ico b/src/tagstudio/resources/icon.ico index e011c3ac..cc639225 100644 Binary files a/src/tagstudio/resources/icon.ico and b/src/tagstudio/resources/icon.ico differ diff --git a/src/tagstudio/resources/icon_nightly.icns b/src/tagstudio/resources/icon_nightly.icns new file mode 100644 index 00000000..a804fa32 Binary files /dev/null and b/src/tagstudio/resources/icon_nightly.icns differ diff --git a/src/tagstudio/resources/icon_nightly.ico b/src/tagstudio/resources/icon_nightly.ico new file mode 100644 index 00000000..84901c49 Binary files /dev/null and b/src/tagstudio/resources/icon_nightly.ico differ diff --git a/src/tagstudio/resources/icon_nightly.png b/src/tagstudio/resources/icon_nightly.png new file mode 100644 index 00000000..fc804673 Binary files /dev/null and b/src/tagstudio/resources/icon_nightly.png differ diff --git a/src/tagstudio/resources/translations/en.json b/src/tagstudio/resources/translations/en.json index 0742b93d..8bee6514 100644 --- a/src/tagstudio/resources/translations/en.json +++ b/src/tagstudio/resources/translations/en.json @@ -10,6 +10,7 @@ "about.version.latest": "{built_version} (Latest Release: {latest_version})", "about.website": "Website", "app.git": "Git Commit", + "app.nightly": "Nightly", "app.pre_release": "Pre-Release", "app.title": "{base_title} - Library '{library_dir}'", "color_manager.title": "Manage Tag Colors",