Skip to content

feat(gui): Indicate unstabel dev version in main window title #2127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions common/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
# Version string regularyly used by the application and presented to users.
__version__ = '1.6.0-dev.0927479b'

# Version string ends with lower case ``rc`` and optionally with a number.
# e.g. "1.6.0rc", "1.6.0-rc", "1.6.0-rc2"
IS_RELEASE_CANDIDATE = bool(re.search(r'^.+rc\d*$', __version__))

def is_release_candidate() -> bool:
"""Test if the current version is a release candidate.

It is the case if the version string ends with lower case ``rc`` and
optionally with a number.
"""
return bool(re.search(r'^.+rc\d+$', __version__))
# Third version element (patch number) followed by anything than a number
# e.g. "1.6.0x", "1.6.0-dev", "1.6.0.1"
IS_UNSTABLE_DEV_VERSION = bool(re.match(r'^\d+\.\d+\.\d+\D', __version__))
2 changes: 1 addition & 1 deletion doc/manpages/backintime.1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ $XDG_CONFIG_HOME is ~/.config).

*--license* :: Show license

*--diagnostics* :: Show diagnistic information to support debugging.
*--diagnostics* :: Show diagnostic information to support debugging.

*--local-backup* :: Create backup files before changing local files. Only valid
with _restore_.
Expand Down
6 changes: 3 additions & 3 deletions qt/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def __init__(self, config, appInstance, qapp):
self.filesView.header().resizeSection(idx, width)

# Release Candidate
if version.is_release_candidate():
if version.IS_RELEASE_CANDIDATE:
last_vers = state_data.msg_release_candidate
if last_vers != version.__version__:
state_data.msg_release_candidate = version.__version__
Expand Down Expand Up @@ -635,7 +635,7 @@ def _create_actions(self):

# Release Candidate ?
self.act_help_release_candidate = None
if version.is_release_candidate():
if version.IS_RELEASE_CANDIDATE:
# pylint: disable=undefined-variable
action = QAction(icon.QUESTION, _('Release Candidate'), self)
action.triggered.connect(self.slot_help_release_candidate)
Expand Down Expand Up @@ -2495,7 +2495,7 @@ def load_state_data(cfg: config.Config) -> None:
cfg.PLUGIN_MANAGER.appStart()

logger.openlog()
qapp = qttools.createQApplication(cfg.APP_NAME)
qapp = qttools.createQApplication(bitbase.APP_NAME)
translator = qttools.initiate_translator(cfg.language())
qapp.installTranslator(translator)

Expand Down
6 changes: 5 additions & 1 deletion qt/qttools.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,14 @@ def createQApplication(app_name='Back In Time'):
f"Error reading QT QPA platform plugin or style: {repr(e)}")

# Release Candidate indicator
if version.is_release_candidate():
if version.IS_RELEASE_CANDIDATE:
app_name = f'{app_name} -- RELEASE CANDIDATE -- ' \
f'({version.__version__})'
elif version.IS_UNSTABLE_DEV_VERSION:
app_name = f'{app_name} -- UNSTABLE DEVELOPMENT ' \
f'VERSION -- ({version.__version__})'

# This will influence the main window title
qapp.setApplicationName(app_name)

try:
Expand Down