summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorJeremy Rimpo <jeremy.rimpo@servermonkey.com>2023-10-03 23:15:42 -0500
committerGitHub <noreply@github.com>2023-10-03 23:15:42 -0500
commitf8a3d5b86e4a6884953df6737a762c0f2e28aec3 (patch)
treed65cb8bd982d95ef0163028903f1327c957c76b4 /src/mainwindow.cpp
parentb5ba8522d81ddd6231ae6063c3f3181605d96898 (diff)
parenta705938ffdc8aa2422ea936b0e2d1f629e6f9d11 (diff)
Merge pull request #1894 from ModOrganizer2/loot_0_22
WIP: Plugin sorting updates
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp25
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();