From a9bf0497930c9b904154a9e622cd1aefbb67cff6 Mon Sep 17 00:00:00 2001 From: Rello Date: Wed, 21 Jan 2026 22:30:11 +0700 Subject: [PATCH 1/4] fix: Enhance update status message for valid subscriptions ### Motivation - Inform users in the General Settings info box that the update channel cannot be changed when connected to enterprise systems so the status reflects the hidden channel selector. ### Description - Append an enterprise subscription notice to the updater status text in `GeneralSettings::slotUpdateInfo` in `src/gui/generalsettings.cpp` for `OCUpdater` using an HTML line break when the status is HTML. - Do the same for `SparkleUpdater`, choosing a separator based on `Qt::mightBeRichText` so the message works for both rich-text and plain-text status strings. Signed-off-by: Rello --- src/gui/generalsettings.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp index 3dfbf927148fe..837a192bacb06 100644 --- a/src/gui/generalsettings.cpp +++ b/src/gui/generalsettings.cpp @@ -439,6 +439,15 @@ void GeneralSettings::slotUpdateInfo() connect(_ui->restartButton, &QAbstractButton::clicked, ocupdater, &OCUpdater::slotStartInstaller, Qt::UniqueConnection); auto status = ocupdater->statusString(OCUpdater::UpdateStatusStringFormat::Html); + if (config.serverHasValidSubscription()) { + auto currentChannel = updateChannelToLocalized(config.currentUpdateChannel()); + if (currentChannel.isEmpty()) { + currentChannel = config.currentUpdateChannel(); + } + status.append(QStringLiteral("
%1") + .arg(tr("Connected to an enterprise system. Update channel cannot be changed (current: %1).") + .arg(currentChannel))); + } Theme::replaceLinkColorStringBackgroundAware(status); _ui->updateStateLabel->setOpenExternalLinks(false); @@ -454,7 +463,18 @@ void GeneralSettings::slotUpdateInfo() #if defined(Q_OS_MACOS) && defined(HAVE_SPARKLE) else if (const auto sparkleUpdater = qobject_cast(updater)) { connect(sparkleUpdater, &SparkleUpdater::statusChanged, this, &GeneralSettings::slotUpdateInfo, Qt::UniqueConnection); - _ui->updateStateLabel->setText(sparkleUpdater->statusString()); + auto status = sparkleUpdater->statusString(); + if (config.serverHasValidSubscription()) { + auto currentChannel = updateChannelToLocalized(config.currentUpdateChannel()); + if (currentChannel.isEmpty()) { + currentChannel = config.currentUpdateChannel(); + } + const auto separator = Qt::mightBeRichText(status) ? QStringLiteral("
") : QStringLiteral("\n"); + status.append(separator) + .append(tr("Connected to an enterprise system. Update channel cannot be changed (current: %1).") + .arg(currentChannel)); + } + _ui->updateStateLabel->setText(status); _ui->restartButton->setVisible(false); const auto updaterState = sparkleUpdater->state(); From bb590a72deb61ada9edea08679a00022115f0791 Mon Sep 17 00:00:00 2001 From: Rello Date: Thu, 22 Jan 2026 10:33:19 +0700 Subject: [PATCH 2/4] Update generalsettings.cpp Signed-off-by: Rello --- src/gui/generalsettings.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp index 837a192bacb06..425af4a2ffe04 100644 --- a/src/gui/generalsettings.cpp +++ b/src/gui/generalsettings.cpp @@ -445,7 +445,7 @@ void GeneralSettings::slotUpdateInfo() currentChannel = config.currentUpdateChannel(); } status.append(QStringLiteral("
%1") - .arg(tr("Connected to an enterprise system. Update channel cannot be changed (current: %1).") + .arg(tr("Connected to an enterprise system. Update channel cannot be changed.
(current: %1)") .arg(currentChannel))); } Theme::replaceLinkColorStringBackgroundAware(status); @@ -471,7 +471,10 @@ void GeneralSettings::slotUpdateInfo() } const auto separator = Qt::mightBeRichText(status) ? QStringLiteral("
") : QStringLiteral("\n"); status.append(separator) - .append(tr("Connected to an enterprise system. Update channel cannot be changed (current: %1).") + .append(isRichText + ? tr("Connected to an enterprise system. Update channel cannot be changed.
(current: %1)") + .arg(currentChannel) + : tr("Connected to an enterprise system. Update channel cannot be changed.\n(current: %1)") .arg(currentChannel)); } _ui->updateStateLabel->setText(status); From 8c9a6088fdb64195b1c2ac0019694a31d0298d47 Mon Sep 17 00:00:00 2001 From: Rello Date: Thu, 22 Jan 2026 16:39:39 +0700 Subject: [PATCH 3/4] string concatenation issue Signed-off-by: Rello --- src/gui/generalsettings.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp index 425af4a2ffe04..45d95fd1de15e 100644 --- a/src/gui/generalsettings.cpp +++ b/src/gui/generalsettings.cpp @@ -465,17 +465,16 @@ void GeneralSettings::slotUpdateInfo() connect(sparkleUpdater, &SparkleUpdater::statusChanged, this, &GeneralSettings::slotUpdateInfo, Qt::UniqueConnection); auto status = sparkleUpdater->statusString(); if (config.serverHasValidSubscription()) { - auto currentChannel = updateChannelToLocalized(config.currentUpdateChannel()); - if (currentChannel.isEmpty()) { - currentChannel = config.currentUpdateChannel(); + const auto currentChannel = config.currentUpdateChannel(); + if (Qt::mightBeRichText(status)) { + status.append(QStringLiteral("
")) + .append(tr("Connected to an enterprise system. Update channel cannot be changed.
(current: %1)") + .arg(currentChannel)); + } else { + status.append(QStringLiteral("\n")) + .append(tr("Connected to an enterprise system. Update channel cannot be changed.\n(current: %1)") + .arg(currentChannel)); } - const auto separator = Qt::mightBeRichText(status) ? QStringLiteral("
") : QStringLiteral("\n"); - status.append(separator) - .append(isRichText - ? tr("Connected to an enterprise system. Update channel cannot be changed.
(current: %1)") - .arg(currentChannel) - : tr("Connected to an enterprise system. Update channel cannot be changed.\n(current: %1)") - .arg(currentChannel)); } _ui->updateStateLabel->setText(status); _ui->restartButton->setVisible(false); From 8c52b4c7eed29bd68a1391dab30451e8722d96d8 Mon Sep 17 00:00:00 2001 From: Rello Date: Fri, 30 Jan 2026 09:53:10 +0100 Subject: [PATCH 4/4] adjust update text Signed-off-by: Rello --- src/gui/generalsettings.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp index 45d95fd1de15e..f79a80988468a 100644 --- a/src/gui/generalsettings.cpp +++ b/src/gui/generalsettings.cpp @@ -445,7 +445,7 @@ void GeneralSettings::slotUpdateInfo() currentChannel = config.currentUpdateChannel(); } status.append(QStringLiteral("
%1") - .arg(tr("Connected to an enterprise system. Update channel cannot be changed.
(current: %1)") + .arg(tr("Connected to an enterprise system. Update channel (%1) cannot be changed.") .arg(currentChannel))); } Theme::replaceLinkColorStringBackgroundAware(status); @@ -467,14 +467,12 @@ void GeneralSettings::slotUpdateInfo() if (config.serverHasValidSubscription()) { const auto currentChannel = config.currentUpdateChannel(); if (Qt::mightBeRichText(status)) { - status.append(QStringLiteral("
")) - .append(tr("Connected to an enterprise system. Update channel cannot be changed.
(current: %1)") - .arg(currentChannel)); + status.append(QStringLiteral("
")); } else { - status.append(QStringLiteral("\n")) - .append(tr("Connected to an enterprise system. Update channel cannot be changed.\n(current: %1)") - .arg(currentChannel)); + status.append(QStringLiteral("\n")); } + status.append(tr("Connected to an enterprise system. Update channel (%1) cannot be changed.") + .arg(currentChannel)); } _ui->updateStateLabel->setText(status); _ui->restartButton->setVisible(false);