diff options
| author | Al12rs <gabriel.cortesi@outlook.com> | 2018-04-16 18:38:54 +0200 |
|---|---|---|
| committer | Al12rs <gabriel.cortesi@outlook.com> | 2018-04-17 21:23:40 +0200 |
| commit | a14ed8fcd1f0cb06fb9353a3f672a70251394e2c (patch) | |
| tree | 56f26c9c9ecce05448a4eddc18ddd564a2003b9c /src | |
| parent | c669fed48ab11043c6773b64997d6a86427e40ff (diff) | |
Changed the modifodialog to open the first enabled left most tab, if no particular tab was specified by the function caller.
This will allow the users to choose what tab should be opened when opening the mod informations since the order of the tabs can be changed and is saved.
Diffstat (limited to 'src')
| -rw-r--r-- | src/mainwindow.cpp | 17 | ||||
| -rw-r--r-- | src/mainwindow.h | 2 |
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);
|
