summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-06-18 09:29:06 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-07-02 10:10:17 -0400
commitf8a037a409d1b6bbb2f34b237b8b66d454179f56 (patch)
tree3aa09e9f9f3802d889cb6fdaf45562c2f763ae5d
parenta13067602590f16484561b9ca23f15aa45089db8 (diff)
changed layout of esps tab, moved to modinfodialogesps.cpp/h
slightly offset next/previous images so they look better when shown next to each other vertically
-rw-r--r--src/CMakeLists.txt3
-rw-r--r--src/modinfodialog.cpp98
-rw-r--r--src/modinfodialog.h2
-rw-r--r--src/modinfodialog.ui268
-rw-r--r--src/modinfodialogesps.cpp287
-rw-r--r--src/modinfodialogesps.h26
-rw-r--r--src/modinfodialogimages.cpp2
-rw-r--r--src/resources/go-next_16.pngbin676 -> 719 bytes
-rw-r--r--src/resources/go-previous_16.pngbin655 -> 718 bytes
9 files changed, 483 insertions, 203 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c5018baf..aba922f9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -54,6 +54,7 @@ SET(organizer_SRCS
modlist.cpp
modidlineedit.cpp
modinfodialog.cpp
+ modinfodialogesps.cpp
modinfodialogimages.cpp
modinfodialogtextfiles.cpp
modinfo.cpp
@@ -156,6 +157,7 @@ SET(organizer_HDRS
modlist.h
modidlineedit.h
modinfodialog.h
+ modinfodialogesps.h
modinfodialogimages.h
modinfodialogtextfiles.h
modinfo.h
@@ -356,6 +358,7 @@ set(modinfo
modinfo
modinfobackup
modinfodialog
+ modinfodialogesps
modinfodialogimages
modinfodialogtextfiles
modinfoforeign
diff --git a/src/modinfodialog.cpp b/src/modinfodialog.cpp
index cc3140b6..a52f2031 100644
--- a/src/modinfodialog.cpp
+++ b/src/modinfodialog.cpp
@@ -40,6 +40,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "modinfodialogtextfiles.h"
#include "modinfodialogimages.h"
+#include "modinfodialogesps.h"
#include <QDir>
#include <QDirIterator>
@@ -70,6 +71,7 @@ std::vector<std::unique_ptr<ModInfoDialogTab>> ModInfoDialogTab::createTabs(
v.push_back(std::make_unique<TextFilesTab>(ui));
v.push_back(std::make_unique<IniFilesTab>(ui));
v.push_back(std::make_unique<ImagesTab>(ui));
+ v.push_back(std::make_unique<ESPsTab>(ui));
return v;
}
@@ -353,15 +355,16 @@ ModInfoDialog::ModInfoDialog(ModInfo::Ptr modInfo, const DirectoryEntry *directo
ui->tabWidget->setTabEnabled(TAB_TEXTFILES, false);
ui->tabWidget->setTabEnabled(TAB_INIFILES, false);
ui->tabWidget->setTabEnabled(TAB_IMAGES, false);
+ ui->tabWidget->setTabEnabled(TAB_ESPS, false);
ui->tabWidget->setTabEnabled(TAB_CATEGORIES, false);
ui->tabWidget->setTabEnabled(TAB_NEXUS, false);
ui->tabWidget->setTabEnabled(TAB_FILETREE, false);
ui->tabWidget->setTabEnabled(TAB_NOTES, false);
- ui->tabWidget->setTabEnabled(TAB_ESPS, false);
} else {
ui->tabWidget->setTabEnabled(TAB_TEXTFILES, true);
ui->tabWidget->setTabEnabled(TAB_INIFILES, true);
ui->tabWidget->setTabEnabled(TAB_IMAGES, true);
+ ui->tabWidget->setTabEnabled(TAB_ESPS, true);
initFiletree(modInfo);
addCategories(CategoryFactory::instance(), modInfo->getCategories(), ui->categoriesTree->invisibleRootItem(), 0);
@@ -848,10 +851,6 @@ void ModInfoDialog::refreshFiles()
tab->clear();
}
- ui->inactiveESPList->clear();
- ui->activeESPList->clear();
-
-
if (m_RootPath.length() > 0) {
QDirIterator dirIterator(m_RootPath, QDir::Files, QDirIterator::Subdirectories);
while (dirIterator.hasNext()) {
@@ -862,24 +861,8 @@ void ModInfoDialog::refreshFiles()
break;
}
}
-
- if (fileName.endsWith(".esp", Qt::CaseInsensitive) ||
- fileName.endsWith(".esm", Qt::CaseInsensitive) ||
- fileName.endsWith(".esl", Qt::CaseInsensitive)) {
- QString relativePath = fileName.mid(m_RootPath.length() + 1);
- if (relativePath.contains('/')) {
- QFileInfo fileInfo(fileName);
- QListWidgetItem *newItem = new QListWidgetItem(fileInfo.fileName());
- newItem->setData(Qt::UserRole, relativePath);
- ui->inactiveESPList->addItem(newItem);
- } else {
- ui->activeESPList->addItem(relativePath);
- }
- }
}
}
-
- ui->tabWidget->setTabEnabled(TAB_ESPS, (ui->inactiveESPList->count() != 0) || (ui->activeESPList->count() != 0));
}
void ModInfoDialog::addCategories(const CategoryFactory &factory, const std::set<int> &enabledCategories, QTreeWidgetItem *root, int rootLevel)
@@ -947,79 +930,6 @@ void ModInfoDialog::openTab(int tab)
}
}
-void ModInfoDialog::on_activateESP_clicked()
-{
- QListWidget *activeESPList = findChild<QListWidget*>("activeESPList");
- QListWidget *inactiveESPList = findChild<QListWidget*>("inactiveESPList");
-
- int selectedRow = inactiveESPList->currentRow();
- if (selectedRow < 0) {
- return;
- }
-
- QListWidgetItem *selectedItem = inactiveESPList->takeItem(selectedRow);
-
- QDir root(m_RootPath);
- bool renamed = false;
-
- while (root.exists(selectedItem->text())) {
- bool okClicked = false;
- QString newName = QInputDialog::getText(this, tr("File Exists"), tr("A file with that name exists, please enter a new one"), QLineEdit::Normal, selectedItem->text(), &okClicked);
- if (!okClicked) {
- inactiveESPList->insertItem(selectedRow, selectedItem);
- return;
- } else if (newName.size() > 0) {
- selectedItem->setText(newName);
- renamed = true;
- }
- }
-
- if (root.rename(selectedItem->data(Qt::UserRole).toString(), selectedItem->text())) {
- activeESPList->addItem(selectedItem);
- if (renamed) {
- selectedItem->setData(Qt::UserRole, QVariant());
- }
- } else {
- inactiveESPList->insertItem(selectedRow, selectedItem);
- reportError(tr("failed to move file"));
- }
-}
-
-
-void ModInfoDialog::on_deactivateESP_clicked()
-{
- QListWidget *activeESPList = findChild<QListWidget*>("activeESPList");
- QListWidget *inactiveESPList = findChild<QListWidget*>("inactiveESPList");
-
- int selectedRow = activeESPList->currentRow();
- if (selectedRow < 0) {
- return;
- }
-
- QDir root(m_RootPath);
-
- QListWidgetItem *selectedItem = activeESPList->takeItem(selectedRow);
-
- // if we moved the file from optional to active in this session, we move the file back to
- // where it came from. Otherwise, it is moved to the new folder "optional"
- if (selectedItem->data(Qt::UserRole).isNull()) {
- selectedItem->setData(Qt::UserRole, QString("optional/") + selectedItem->text());
- if (!root.exists("optional")) {
- if (!root.mkdir("optional")) {
- reportError(tr("failed to create directory \"optional\""));
- activeESPList->insertItem(selectedRow, selectedItem);
- return;
- }
- }
- }
-
- if (root.rename(selectedItem->text(), selectedItem->data(Qt::UserRole).toString())) {
- inactiveESPList->addItem(selectedItem);
- } else {
- activeESPList->insertItem(selectedRow, selectedItem);
- }
-}
-
void ModInfoDialog::on_visitNexusLabel_linkActivated(const QString &link)
{
emit linkActivated(link);
diff --git a/src/modinfodialog.h b/src/modinfodialog.h
index f3ef6e76..6ecf16bf 100644
--- a/src/modinfodialog.h
+++ b/src/modinfodialog.h
@@ -186,8 +186,6 @@ private slots:
void on_openInExplorerButton_clicked();
void on_closeButton_clicked();
- void on_activateESP_clicked();
- void on_deactivateESP_clicked();
void on_visitNexusLabel_linkActivated(const QString &link);
void on_modIDEdit_editingFinished();
void on_sourceGameEdit_currentIndexChanged(int);
diff --git a/src/modinfodialog.ui b/src/modinfodialog.ui
index c1dba1c7..f1212634 100644
--- a/src/modinfodialog.ui
+++ b/src/modinfodialog.ui
@@ -104,7 +104,7 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <widget class="QWidget" name="">
+ <widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="verticalLayout_5" stretch="0,0">
<property name="spacing">
<number>6</number>
@@ -128,7 +128,7 @@
</item>
</layout>
</widget>
- <widget class="QWidget" name="">
+ <widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="0">
<item>
<widget class="TextEditor" name="iniFileEditor">
@@ -180,7 +180,7 @@
<rect>
<x>0</x>
<y>0</y>
- <width>604</width>
+ <width>741</width>
<height>436</height>
</rect>
</property>
@@ -213,117 +213,175 @@
<attribute name="title">
<string>Optional ESPs</string>
</attribute>
- <layout class="QFormLayout" name="formLayout">
- <item row="1" column="1">
- <widget class="QListWidget" name="inactiveESPList">
- <property name="toolTip">
- <string>List of esps, esms, and esls that can not be loaded by the game.</string>
- </property>
- <property name="whatsThis">
- <string>List of esps, esms, and esls contained in this plugin that currently can not be loaded by the game. They will not even appear in the esp-list in the main MO-window.
-They usually contain optional functionality, see the readme.
-
-Most mods do not have optional esps, so chances are good you are looking at an empty list.</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>Optional ESPs</string>
+ <layout class="QVBoxLayout" name="verticalLayout_23">
+ <item>
+ <widget class="QSplitter" name="ESPsSplitter">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
</property>
- </widget>
- </item>
- <item row="2" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout_5">
- <item>
- <widget class="QToolButton" name="deactivateESP">
- <property name="minimumSize">
- <size>
- <width>96</width>
- <height>0</height>
- </size>
- </property>
- <property name="toolTip">
- <string>Make the selected mod in the lower list unavailable.</string>
- </property>
- <property name="whatsThis">
- <string>The selected esp (in the lower list) will be pushed into a subdirectory of the mod and will thus become &quot;invisible&quot; to the game. It can then no longer be activated.</string>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="icon">
- <iconset resource="resources.qrc">
- <normaloff>:/MO/gui/resources/go-up.png</normaloff>:/MO/gui/resources/go-up.png</iconset>
+ <widget class="QWidget" name="widget_9" native="true">
+ <layout class="QVBoxLayout" name="verticalLayout_20">
+ <property name="leftMargin">
+ <number>0</number>
</property>
- <property name="iconSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
+ <property name="topMargin">
+ <number>0</number>
</property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="activateESP">
- <property name="minimumSize">
- <size>
- <width>96</width>
- <height>0</height>
- </size>
+ <property name="rightMargin">
+ <number>0</number>
</property>
- <property name="toolTip">
- <string>Move a file to the data directory.</string>
+ <property name="bottomMargin">
+ <number>0</number>
</property>
- <property name="whatsThis">
- <string>This moves a esp to the esp directory so it can be enabled in the main window. Please note that the ESP merely becomes &quot;available&quot;, it will not necessarily be loaded! That is configured in the main window of omo.</string>
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Optional ESPs</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QListWidget" name="inactiveESPList1">
+ <property name="toolTip">
+ <string>List of esps, esms, and esls that can not be loaded by the game.</string>
+ </property>
+ <property name="whatsThis">
+ <string>List of esps, esms, and esls contained in this plugin that currently can not be loaded by the game. They will not even appear in the esp-list in the main MO-window.
+They usually contain optional functionality, see the readme.
+
+Most mods do not have optional esps, so chances are good you are looking at an empty list.</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="widget_11" native="true">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <property name="leftMargin">
+ <number>0</number>
</property>
- <property name="text">
- <string/>
+ <property name="topMargin">
+ <number>0</number>
</property>
- <property name="icon">
- <iconset resource="resources.qrc">
- <normaloff>:/MO/gui/resources/go-down.png</normaloff>:/MO/gui/resources/go-down.png</iconset>
+ <property name="rightMargin">
+ <number>0</number>
</property>
- <property name="iconSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
+ <property name="bottomMargin">
+ <number>0</number>
</property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="2" column="0">
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="3" column="1">
- <widget class="QListWidget" name="activeESPList">
- <property name="toolTip">
- <string>ESPs in the data directory and thus visible to the game.</string>
- </property>
- <property name="whatsThis">
- <string>These are the mod files that are in the (virtual) data directory of your game and will thus be selectable in the esp list in the main window.</string>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Available ESPs</string>
- </property>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_22">
+ <item>
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QToolButton" name="activateESP1">
+ <property name="toolTip">
+ <string>Move a file to the data directory.</string>
+ </property>
+ <property name="whatsThis">
+ <string>This moves a esp to the esp directory so it can be enabled in the main window. Please note that the ESP merely becomes &quot;available&quot;, it will not necessarily be loaded! That is configured in the main window of omo.</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/MO/gui/next</normaloff>:/MO/gui/next</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="deactivateESP1">
+ <property name="toolTip">
+ <string>Make the selected mod in the lower list unavailable.</string>
+ </property>
+ <property name="whatsThis">
+ <string>The selected esp (in the lower list) will be pushed into a subdirectory of the mod and will thus become &quot;invisible&quot; to the game. It can then no longer be activated.</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/MO/gui/previous</normaloff>:/MO/gui/previous</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QWidget" name="widget_10" native="true">
+ <layout class="QVBoxLayout" name="verticalLayout_21">
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Available ESPs</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QListWidget" name="activeESPList1">
+ <property name="toolTip">
+ <string>ESPs in the data directory and thus visible to the game.</string>
+ </property>
+ <property name="whatsThis">
+ <string>These are the mod files that are in the (virtual) data directory of your game and will thus be selectable in the esp list in the main window.</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
</widget>
</item>
</layout>
diff --git a/src/modinfodialogesps.cpp b/src/modinfodialogesps.cpp
new file mode 100644
index 00000000..32dcdb35
--- /dev/null
+++ b/src/modinfodialogesps.cpp
@@ -0,0 +1,287 @@
+#include "modinfodialogesps.h"
+#include "ui_modinfodialog.h"
+#include <report.h>
+
+using MOBase::reportError;
+
+
+class ESP
+{
+public:
+ ESP(QString rootPath, QString relativePath)
+ : m_rootPath(std::move(rootPath)), m_active(false)
+ {
+ if (relativePath.contains('/')) {
+ m_inactivePath = relativePath;
+ } else {
+ m_activePath = relativePath;
+ m_active = true;
+ }
+ }
+
+ const QString& rootPath() const
+ {
+ return m_rootPath;
+ }
+
+ const QString& relativePath() const
+ {
+ if (m_active) {
+ return m_activePath;
+ } else {
+ return m_inactivePath;
+ }
+ }
+
+ const QString& activePath() const
+ {
+ return m_activePath;
+ }
+
+ const QString& inactivePath() const
+ {
+ return m_inactivePath;
+ }
+
+ QFileInfo fileInfo() const
+ {
+ return m_rootPath + QDir::separator() + relativePath();
+ }
+
+ bool isActive() const
+ {
+ return m_active;
+ }
+
+ bool activate(const QString& newName)
+ {
+ QDir root(m_rootPath);
+
+ if (root.rename(m_inactivePath, newName)) {
+ m_active = true;
+ m_activePath = newName;
+
+ if (QFileInfo(m_inactivePath).fileName() != newName) {
+ // file was renamed
+ m_inactivePath = QFileInfo(m_inactivePath).path() + QDir::separator() + newName;
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ bool deactivate(const QString& newName)
+ {
+ QDir root(m_rootPath);
+
+ if (root.rename(m_activePath, newName)) {
+ m_active = false;
+ m_inactivePath = newName;
+ return true;
+ }
+
+ return false;
+ }
+
+private:
+ QString m_rootPath;
+ QString m_activePath;
+ QString m_inactivePath;
+ bool m_active;
+};
+
+
+class ESPItem : public QListWidgetItem
+{
+public:
+ ESPItem(ESP esp)
+ : m_esp(std::move(esp))
+ {
+ updateText();
+ }
+
+ const ESP& esp() const
+ {
+ return m_esp;
+ }
+
+ void setESP(ESP esp)
+ {
+ m_esp = esp;
+ updateText();
+ }
+
+private:
+ ESP m_esp;
+
+ void updateText()
+ {
+ setText(m_esp.fileInfo().fileName());
+ }
+};
+
+
+ESPsTab::ESPsTab(Ui::ModInfoDialog* ui)
+ : ui(ui)
+{
+ QObject::connect(
+ ui->activateESP1, &QToolButton::clicked, [&]{ onActivate(); });
+
+ QObject::connect(
+ ui->deactivateESP1, &QToolButton::clicked, [&]{ onDeactivate(); });
+}
+
+void ESPsTab::clear()
+{
+ ui->inactiveESPList1->clear();
+ ui->activeESPList1->clear();
+}
+
+bool ESPsTab::feedFile(const QString& rootPath, const QString& fullPath)
+{
+ static constexpr const char* extensions[] = {
+ ".esp", ".esm", ".esl"
+ };
+
+ for (const auto* e : extensions) {
+ if (fullPath.endsWith(e, Qt::CaseInsensitive)) {
+ QString relativePath = fullPath.mid(rootPath.length() + 1);
+
+ auto* item = new ESPItem({rootPath, relativePath});
+
+ if (item->esp().isActive()) {
+ ui->activeESPList1->addItem(item);
+ } else {
+ ui->inactiveESPList1->addItem(item);
+ }
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void ESPsTab::onActivate()
+{
+ auto* item = selectedInactive();
+ if (!item) {
+ qWarning("ESPsTab::onActivate(): no selection");
+ return;
+ }
+
+ ESP esp = item->esp();
+
+ if (esp.isActive()) {
+ qWarning("ESPsTab::onActive(): item is already active");
+ return;
+ }
+
+ QDir root(esp.rootPath());
+ const QFileInfo file(esp.fileInfo());
+
+ QString newName = file.fileName();
+
+ while (root.exists(newName)) {
+ bool okClicked = false;
+
+ newName = QInputDialog::getText(
+ ui->tabESPs,
+ QObject::tr("File Exists"),
+ QObject::tr("A file with that name exists, please enter a new one"),
+ QLineEdit::Normal, file.fileName(), &okClicked);
+
+ if (!okClicked) {
+ return;
+ }
+
+ if (newName.isEmpty()) {
+ newName = file.fileName();
+ }
+ }
+
+ if (esp.activate(newName)) {
+ ui->inactiveESPList1->takeItem(ui->inactiveESPList1->row(item));
+ ui->activeESPList1->addItem(item);
+ item->setESP(esp);
+ } else {
+ reportError(QObject::tr("Failed to move file"));
+ }
+}
+
+void ESPsTab::onDeactivate()
+{
+ auto* item = selectedActive();
+ if (!item) {
+ qWarning("ESPsTab::onDeactivate(): no selection");
+ return;
+ }
+
+ ESP esp = item->esp();
+
+ if (!esp.isActive()) {
+ qWarning("ESPsTab::onDeactivate(): item is already inactive");
+ return;
+ }
+
+ QDir root(esp.rootPath());
+
+ // if we moved the file from optional to active in this session, we move the
+ // file back to where it came from. Otherwise, it is moved to the new folder
+ // "optional"
+
+ QString newName = esp.inactivePath();
+
+ if (newName.isEmpty()) {
+ if (!root.exists("optional")) {
+ if (!root.mkdir("optional")) {
+ reportError(QObject::tr("Failed to create directory \"optional\""));
+ return;
+ }
+ }
+
+ newName = QString("optional") + QDir::separator() + esp.fileInfo().fileName();
+ }
+
+ if (esp.deactivate(newName)) {
+ ui->activeESPList1->takeItem(ui->activeESPList1->row(item));
+ ui->inactiveESPList1->addItem(item);
+ item->setESP(esp);
+ } else {
+ reportError(QObject::tr("Failed to move file"));
+ }
+}
+
+ESPItem* ESPsTab::selectedInactive()
+{
+ auto* item = ui->inactiveESPList1->currentItem();
+ if (!item) {
+ return nullptr;
+ }
+
+ auto* esp = dynamic_cast<ESPItem*>(item);
+ if (!esp) {
+ qCritical("ESPsTab: inactive item is not an ESPItem");
+ return nullptr;
+ }
+
+ return esp;
+}
+
+ESPItem* ESPsTab::selectedActive()
+{
+ auto* item = ui->activeESPList1->currentItem();
+ if (!item) {
+ return nullptr;
+ }
+
+ auto* esp = dynamic_cast<ESPItem*>(item);
+ if (!esp) {
+ qCritical("ESPsTab: active item is not an ESPItem");
+ return nullptr;
+ }
+
+ return esp;
+}
diff --git a/src/modinfodialogesps.h b/src/modinfodialogesps.h
new file mode 100644
index 00000000..a46677cb
--- /dev/null
+++ b/src/modinfodialogesps.h
@@ -0,0 +1,26 @@
+#ifndef MODINFODIALOGESPS_H
+#define MODINFODIALOGESPS_H
+
+#include "modinfodialog.h"
+
+class ESPItem;
+
+class ESPsTab : public ModInfoDialogTab
+{
+public:
+ ESPsTab(Ui::ModInfoDialog* ui);
+
+ void clear() override;
+ bool feedFile(const QString& rootPath, const QString& fullPath) override;
+
+private:
+ Ui::ModInfoDialog* ui;
+
+ void onActivate();
+ void onDeactivate();
+
+ ESPItem* selectedInactive();
+ ESPItem* selectedActive();
+};
+
+#endif // MODINFODIALOGESPS_H
diff --git a/src/modinfodialogimages.cpp b/src/modinfodialogimages.cpp
index fb2ad1fe..1659bed3 100644
--- a/src/modinfodialogimages.cpp
+++ b/src/modinfodialogimages.cpp
@@ -52,8 +52,6 @@ void ScalableImage::paintEvent(QPaintEvent* e)
static_cast<int>(std::round(m_original.height() * ratio)));
if (m_scaled.isNull() || m_scaled.size() != scaledSize) {
- qDebug() << "scaled to " << scaledSize;
-
m_scaled = m_original.scaled(
scaledSize.width(), scaledSize.height(),
Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
diff --git a/src/resources/go-next_16.png b/src/resources/go-next_16.png
index 6ef8de76..58742d39 100644
--- a/src/resources/go-next_16.png
+++ b/src/resources/go-next_16.png
Binary files differ
diff --git a/src/resources/go-previous_16.png b/src/resources/go-previous_16.png
index 659cd90d..b4b22d04 100644
--- a/src/resources/go-previous_16.png
+++ b/src/resources/go-previous_16.png
Binary files differ