Skip to content
Merged
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
22 changes: 21 additions & 1 deletion src/gui/generalsettings.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/*
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2014 ownCloud GmbH
Expand Down Expand Up @@ -439,6 +439,15 @@
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("<br/>%1")
.arg(tr("Connected to an enterprise system. Update channel (%1) cannot be changed.")
.arg(currentChannel)));
}
Theme::replaceLinkColorStringBackgroundAware(status);

_ui->updateStateLabel->setOpenExternalLinks(false);
Expand All @@ -454,7 +463,18 @@
#if defined(Q_OS_MACOS) && defined(HAVE_SPARKLE)
else if (const auto sparkleUpdater = qobject_cast<SparkleUpdater *>(updater)) {
connect(sparkleUpdater, &SparkleUpdater::statusChanged, this, &GeneralSettings::slotUpdateInfo, Qt::UniqueConnection);
_ui->updateStateLabel->setText(sparkleUpdater->statusString());
auto status = sparkleUpdater->statusString();
if (config.serverHasValidSubscription()) {
const auto currentChannel = config.currentUpdateChannel();
if (Qt::mightBeRichText(status)) {
status.append(QStringLiteral("<br/>"));
} else {
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);

const auto updaterState = sparkleUpdater->state();
Expand Down
Loading