diff --git a/AUTHORS.md b/AUTHORS.md
index 3cbe9b44b..2c77e522e 100644
--- a/AUTHORS.md
+++ b/AUTHORS.md
@@ -88,6 +88,7 @@ Programmers
Jacob Essex (Yacoby)
Jake Westrip (16bitint)
James Carty (MrTopCat)
+ James Moore (moore.work)
James Stephens (james-h-stephens)
Jan-Peter Nilsson (peppe)
Jan Borsodi (am0s)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f20ca90cd..2ad109160 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -252,6 +252,7 @@
Feature #5091: Human-readable light source duration
Feature #5094: Unix like console hotkeys
Feature #5098: Allow user controller bindings
+ Feature #5114: Refresh launcher mod list
Feature #5121: Handle NiTriStrips and NiTriStripsData
Feature #5122: Use magic glow for enchanted arrows
Feature #5131: Custom skeleton bones
diff --git a/apps/launcher/datafilespage.cpp b/apps/launcher/datafilespage.cpp
index e679392c4..81544b094 100644
--- a/apps/launcher/datafilespage.cpp
+++ b/apps/launcher/datafilespage.cpp
@@ -62,10 +62,13 @@ void Launcher::DataFilesPage::buildView()
{
ui.verticalLayout->insertWidget (0, mSelector->uiWidget());
+ QToolButton * refreshButton = mSelector->refreshButton();
+
//tool buttons
ui.newProfileButton->setToolTip ("Create a new Content List");
ui.cloneProfileButton->setToolTip ("Clone the current Content List");
ui.deleteProfileButton->setToolTip ("Delete an existing Content List");
+ refreshButton->setToolTip("Refresh Data Files");
//combo box
ui.profilesComboBox->addItem(mDefaultContentListName);
@@ -76,6 +79,7 @@ void Launcher::DataFilesPage::buildView()
ui.newProfileButton->setDefaultAction (ui.newProfileAction);
ui.cloneProfileButton->setDefaultAction (ui.cloneProfileAction);
ui.deleteProfileButton->setDefaultAction (ui.deleteProfileAction);
+ refreshButton->setDefaultAction(ui.refreshDataFilesAction);
//establish connections
connect (ui.profilesComboBox, SIGNAL (currentIndexChanged(int)),
@@ -86,6 +90,8 @@ void Launcher::DataFilesPage::buildView()
connect (ui.profilesComboBox, SIGNAL (signalProfileChanged(QString, QString)),
this, SLOT (slotProfileChangedByUser(QString, QString)));
+
+ connect(ui.refreshDataFilesAction, SIGNAL(triggered()),this, SLOT(slotRefreshButtonClicked()));
}
bool Launcher::DataFilesPage::loadSettings()
@@ -114,6 +120,8 @@ void Launcher::DataFilesPage::populateFileViews(const QString& contentModelName)
if (!mDataLocal.isEmpty())
paths.insert(0, mDataLocal);
+ mSelector->clearFiles();
+
for (const QString &path : paths)
mSelector->addFiles(path);
@@ -167,7 +175,16 @@ QStringList Launcher::DataFilesPage::selectedFilePaths()
QStringList filePaths;
for (const ContentSelectorModel::EsmFile *item : items)
{
- filePaths.append(item->filePath());
+ QFile file(item->filePath());
+
+ if(file.exists())
+ {
+ filePaths.append(item->filePath());
+ }
+ else
+ {
+ slotRefreshButtonClicked();
+ }
}
return filePaths;
}
@@ -221,6 +238,18 @@ void Launcher::DataFilesPage::slotProfileDeleted (const QString &item)
removeProfile (item);
}
+void Launcher::DataFilesPage:: refreshDataFilesView ()
+{
+ QString currentProfile = ui.profilesComboBox->currentText();
+ saveSettings(currentProfile);
+ populateFileViews(currentProfile);
+}
+
+void Launcher::DataFilesPage::slotRefreshButtonClicked ()
+{
+ refreshDataFilesView();
+}
+
void Launcher::DataFilesPage::slotProfileChangedByUser(const QString &previous, const QString ¤t)
{
setProfile(previous, current, true);
diff --git a/apps/launcher/datafilespage.hpp b/apps/launcher/datafilespage.hpp
index 36a0db616..af54fe75e 100644
--- a/apps/launcher/datafilespage.hpp
+++ b/apps/launcher/datafilespage.hpp
@@ -61,6 +61,7 @@ namespace Launcher
void slotProfileRenamed(const QString &previous, const QString ¤t);
void slotProfileDeleted(const QString &item);
void slotAddonDataChanged ();
+ void slotRefreshButtonClicked ();
void updateNewProfileOkButton(const QString &text);
void updateCloneProfileOkButton(const QString &text);
@@ -100,6 +101,7 @@ namespace Launcher
void checkForDefaultProfile();
void populateFileViews(const QString& contentModelName);
void reloadCells(QStringList selectedFiles);
+ void refreshDataFilesView ();
class PathIterator
{
diff --git a/components/contentselector/view/contentselector.hpp b/components/contentselector/view/contentselector.hpp
index bc47224e4..9c34e24fd 100644
--- a/components/contentselector/view/contentselector.hpp
+++ b/components/contentselector/view/contentselector.hpp
@@ -44,6 +44,9 @@ namespace ContentSelectorView
QWidget *uiWidget() const
{ return ui.contentGroupBox; }
+
+ QToolButton *refreshButton() const
+ { return ui.refreshButton; }
private:
diff --git a/files/ui/contentselector.ui b/files/ui/contentselector.ui
index 7832239b5..d13cb314e 100644
--- a/files/ui/contentselector.ui
+++ b/files/ui/contentselector.ui
@@ -20,7 +20,16 @@
Qt::DefaultContextMenu
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -33,10 +42,41 @@
3
-
-
-
- false
+
+
+ Qt::NoFocus
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ false
+
+
+
+ -
+
+
+ true
+
+
+ true
+
+
+
+
-
diff --git a/files/ui/datafilespage.ui b/files/ui/datafilespage.ui
index 8e42ee7cb..ccac5050e 100644
--- a/files/ui/datafilespage.ui
+++ b/files/ui/datafilespage.ui
@@ -159,6 +159,22 @@
Uncheck Selection
+
+
+
+
+
+
+
+ Refresh Data Files
+
+
+ Refresh Data Files
+
+
+ Ctrl+R
+
+