summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtAboutWidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Swift/QtUI/QtAboutWidget.cpp b/Swift/QtUI/QtAboutWidget.cpp
index 3bc124a..a2aa65c 100644
--- a/Swift/QtUI/QtAboutWidget.cpp
+++ b/Swift/QtUI/QtAboutWidget.cpp
@@ -125,61 +125,61 @@ void QtAboutWidget::handleChangelogClicked() {
void QtAboutWidget::handleChangeUpdateChannelClicked() {
auto feedSelectionDialog = new QtUpdateFeedSelectionDialog(settingsProvider_);
feedSelectionDialog->show();
}
void QtAboutWidget::openPlainTextWindow(const QString& path) {
QTextEdit* text = new QTextEdit();
text->setAttribute(Qt::WA_DeleteOnClose);
text->setReadOnly(true);
QFile file(path);
if (file.open(QIODevice::ReadOnly)) {
QTextStream in(&file);
in.setCodec("UTF-8");
text->setPlainText(in.readAll());
file.close();
text->resize(500, 600);
text->show();
text->activateWindow();
}
else {
SWIFT_LOG(error) << "Failed to open " << Q2PSTRING(path) << "." << std::endl;
}
}
void QtAboutWidget::updateUpdateInfo() {
updateChannelInfoLabel_->hide();
updateStateInfoLabel_->hide();
updateProgressBar_->hide();
// Currently auto updating is only supported on macOS.
#ifdef SWIFTEN_PLATFORM_MACOSX
- if (settingsProvider_->getSetting(QtUISettingConstants::ENABLE_SOFTWARE_UPDATES)) {
+ if (autoUpdater_ && settingsProvider_->getSetting(QtUISettingConstants::ENABLE_SOFTWARE_UPDATES)) {
if (!settingsProvider_->getSetting(QtUISettingConstants::SOFTWARE_UPDATE_CHANNEL).empty()) {
QString updateFeedDescription;
auto addUpdateFeedDialogLink = false;
if (settingsProvider_->getSetting(QtUISettingConstants::SOFTWARE_UPDATE_CHANNEL) == UpdateFeeds::StableChannel) {
updateFeedDescription = tr("You are receiving updates from the Stable update channel.");
addUpdateFeedDialogLink = true;
}
else if (settingsProvider_->getSetting(QtUISettingConstants::SOFTWARE_UPDATE_CHANNEL) == UpdateFeeds::DevelopmentChannel) {
updateFeedDescription = tr("You are receiving updates from the Development update channel.");
addUpdateFeedDialogLink = true;
}
else if (settingsProvider_->getSetting(QtUISettingConstants::SOFTWARE_UPDATE_CHANNEL) == UpdateFeeds::TestingChannel) {
updateFeedDescription = tr("You are receiving updates from the Testing update channel.");
addUpdateFeedDialogLink = true;
}
auto updateFeedDialogLink = QString( addUpdateFeedDialogLink ? "<a href=\"#\">%1</a>" : "" ).arg(tr("Change the update channel."));
updateChannelInfoLabel_->setText(QString("<center><font size='-1'>%1<br/>%2</font></center>").arg(updateFeedDescription, updateFeedDialogLink));
updateChannelInfoLabel_->show();
auto currentState = autoUpdater_->getCurrentState();
auto currentStateStringPattern = QString("<center><font size='-1'>%1</font></center>");
switch (currentState) {
case AutoUpdater::State::NotCheckedForUpdatesYet:
// Simply not showing any current state info.
break;
case AutoUpdater::State::CheckingForUpdate:
updateStateInfoLabel_->setText(currentStateStringPattern.arg(tr("Checking for updates…")));
updateStateInfoLabel_->show();
updateProgressBar_->show();
break;