diff options
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index b576c318..dae91806 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -371,12 +371,7 @@ MainWindow::MainWindow(Settings& settings, OrganizerCore& organizerCore, ui->groupCombo->installEventFilter(noWheel); ui->profileBox->installEventFilter(noWheel); - if (organizerCore.managedGame()->sortMechanism() == - MOBase::IPluginGame::SortMechanism::NONE) { - ui->sortButton->setDisabled(true); - ui->sortButton->setToolTip(tr("There is no supported sort mechanism for this game. " - "You will probably have to use a third-party tool.")); - } + updateSortButton(); connect(&m_PluginContainer, SIGNAL(diagnosisUpdate()), this, SLOT(scheduleCheckForProblems())); @@ -399,6 +394,9 @@ MainWindow::MainWindow(Settings& settings, OrganizerCore& organizerCore, SLOT(updateAvailable())); connect(m_OrganizerCore.updater(), SIGNAL(motdAvailable(QString)), this, SLOT(motdReceived(QString))); + connect(&m_OrganizerCore, &OrganizerCore::refreshTriggered, this, [this]() { + updateSortButton(); + }); connect(&NexusInterface::instance(), SIGNAL(requestNXMDownload(QString)), &m_OrganizerCore, SLOT(downloadRequestedNXM(QString))); @@ -2766,6 +2764,8 @@ void MainWindow::on_actionSettings_triggered() m_OrganizerCore.refreshLists(); + updateSortButton(); + if (settings.paths().profiles() != oldProfilesDirectory) { refreshProfiles(); } @@ -3033,6 +3033,19 @@ void MainWindow::toggleUpdateAction() ui->actionUpdate->setVisible(s.checkForUpdates()); } +void MainWindow::updateSortButton() +{ + if (m_OrganizerCore.managedGame()->sortMechanism() != + IPluginGame::SortMechanism::NONE) { + ui->sortButton->setEnabled(true); + ui->sortButton->setToolTip(tr("Sort the plugins using LOOT.")); + } else { + ui->sortButton->setDisabled(true); + ui->sortButton->setToolTip(tr("There is no supported sort mechanism for this game. " + "You will probably have to use a third-party tool.")); + } +} + void MainWindow::nxmEndorsementsAvailable(QVariant userData, QVariant resultData, int) { QVariantList data = resultData.toList(); |
