summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp17
-rw-r--r--src/mainwindow.h2
2 files changed, 17 insertions, 2 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 802adc24..401e3c8b 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -2461,9 +2461,24 @@ void MainWindow::displayModInformation(ModInfo::Ptr modInfo, unsigned int index,
connect(&dialog, SIGNAL(modOpenPrev()), this, SLOT(modOpenPrev()), Qt::QueuedConnection);
connect(&dialog, SIGNAL(originModified(int)), this, SLOT(originModified(int)));
connect(&dialog, SIGNAL(endorseMod(ModInfo::Ptr)), this, SLOT(endorseMod(ModInfo::Ptr)));
+
+ //Open the tab first if we want to use the standard indexes of the tabs.
+ if (tab != -1) {
+ dialog.openTab(tab);
+ }
- dialog.openTab(tab);
dialog.restoreTabState(m_OrganizerCore.settings().directInterface().value("mod_info_tabs").toByteArray());
+
+ //If no tab was specified use the first tab from the left based on the user order.
+ if (tab == -1) {
+ for (int i = 0; i < dialog.findChild<QTabWidget*>("tabWidget")->count(); ++i) {
+ if (dialog.findChild<QTabWidget*>("tabWidget")->isTabEnabled(i)) {
+ dialog.findChild<QTabWidget*>("tabWidget")->setCurrentIndex(i);
+ break;
+ }
+ }
+ }
+
dialog.exec();
m_OrganizerCore.settings().directInterface().setValue("mod_info_tabs", dialog.saveTabState());
diff --git a/src/mainwindow.h b/src/mainwindow.h
index d684dbc0..8faaa349 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -217,7 +217,7 @@ private:
QList<MOBase::IOrganizer::FileInfo> findFileInfos(const QString &path, const std::function<bool (const MOBase::IOrganizer::FileInfo &)> &filter) const;
bool modifyExecutablesDialog();
- void displayModInformation(int row, int tab = 0);
+ void displayModInformation(int row, int tab = -1);
void testExtractBSA(int modIndex);
void writeDataToFile(QFile &file, const QString &directory, const MOShared::DirectoryEntry &directoryEntry);