summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-10-04 06:30:15 -0400
committerGitHub <noreply@github.com>2019-10-04 06:30:15 -0400
commit2fe50f2ff366ea850eb70a85c6ea7d6c936bf08a (patch)
tree77041dd84568817e0e359381e7fb78f6a1f2dd2a /src/mainwindow.cpp
parente6a47bf8b70be2c480f77c68c08480a33e71dce3 (diff)
parent239cfbe6854f727b5dd3e6922cacc17587361cf5 (diff)
Merge pull request #842 from isanae/dialog-settings
Dialog settings
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 91da786c..8ab28d22 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -263,6 +263,7 @@ MainWindow::MainWindow(Settings &settings
setupToolbar();
toggleMO2EndorseState();
+ toggleUpdateAction();
TaskProgressManager::instance().tryCreateTaskbar();
@@ -5009,6 +5010,7 @@ void MainWindow::on_actionSettings_triggered()
bool oldDisplayForeign(settings.interface().displayForeign());
bool proxy = settings.network().useProxy();
DownloadManager *dlManager = m_OrganizerCore.downloadManager();
+ const bool oldCheckForUpdates = settings.checkForUpdates();
SettingsDialog dialog(&m_PluginContainer, settings, this);
@@ -5086,6 +5088,14 @@ void MainWindow::on_actionSettings_triggered()
m_OrganizerCore.cycleDiagnostics();
toggleMO2EndorseState();
+
+ if (oldCheckForUpdates != settings.checkForUpdates()) {
+ toggleUpdateAction();
+
+ if (settings.checkForUpdates()) {
+ m_OrganizerCore.checkForUpdates();
+ }
+ }
}
void MainWindow::on_actionNexus_triggered()
@@ -5598,6 +5608,12 @@ void MainWindow::toggleMO2EndorseState()
ui->actionEndorseMO->setStatusTip(text);
}
+void MainWindow::toggleUpdateAction()
+{
+ const auto& s = m_OrganizerCore.settings();
+ ui->actionUpdate->setVisible(s.checkForUpdates());
+}
+
void MainWindow::nxmEndorsementsAvailable(QVariant userData, QVariant resultData, int)
{
QVariantList data = resultData.toList();