From c669fed48ab11043c6773b64997d6a86427e40ff Mon Sep 17 00:00:00 2001 From: Al12rs Date: Tue, 17 Apr 2018 21:22:46 +0200 Subject: Fixed inconsistency in line endings. --- src/modinfo.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/modinfo.h b/src/modinfo.h index 07dccafd..9e9f8971 100644 --- a/src/modinfo.h +++ b/src/modinfo.h @@ -265,13 +265,13 @@ public: * @brief change the notes (manually set information) for this mod * @param notes new notes */ - virtual void setNotes(const QString ¬es) = 0; - - /** - * @brief set/change the source game of this mod - * - * @param gameName the source game shortName - */ + virtual void setNotes(const QString ¬es) = 0; + + /** + * @brief set/change the source game of this mod + * + * @param gameName the source game shortName + */ virtual void setGameName(QString gameName) = 0; /** -- cgit v1.3.1 From a14ed8fcd1f0cb06fb9353a3f672a70251394e2c Mon Sep 17 00:00:00 2001 From: Al12rs Date: Mon, 16 Apr 2018 18:38:54 +0200 Subject: 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. --- src/mainwindow.cpp | 17 ++++++++++++++++- src/mainwindow.h | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'src') 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("tabWidget")->count(); ++i) { + if (dialog.findChild("tabWidget")->isTabEnabled(i)) { + dialog.findChild("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 findFileInfos(const QString &path, const std::function &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); -- cgit v1.3.1 From a2d7ce67aa236fe52d6e860a27950dc7e3a34bd8 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Mon, 16 Apr 2018 20:40:14 +0200 Subject: Merged the new open in explorer button with Silarn's code. --- src/modinfodialog.cpp | 8 ++++++-- src/modinfodialog.h | 1 + src/modinfodialog.ui | 36 +++++++++++++++++++++++++++++++++--- 3 files changed, 40 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/modinfodialog.cpp b/src/modinfodialog.cpp index e2da6a2c..705f0019 100644 --- a/src/modinfodialog.cpp +++ b/src/modinfodialog.cpp @@ -721,7 +721,6 @@ void ModInfoDialog::on_deactivateESP_clicked() void ModInfoDialog::on_visitNexusLabel_linkActivated(const QString &link) { - this->close(); emit nexusLinkActivated(link); } @@ -730,7 +729,7 @@ void ModInfoDialog::linkClicked(const QUrl &url) //Ideally we'd ask the mod for the game and the web service then pass the game //and URL to the web service if (NexusInterface::instance(m_PluginContainer)->isURLGameRelated(url)) { - this->close(); + emit nexusLinkActivated(url.toString()); } else { ::ShellExecuteW(nullptr, L"open", ToWString(url.toString()).c_str(), nullptr, nullptr, SW_SHOWNORMAL); @@ -958,6 +957,11 @@ bool ModInfoDialog::recursiveDelete(const QModelIndex &index) } +void ModInfoDialog::on_openInExplorerButton_clicked() +{ + ::ShellExecuteW(nullptr, L"explore", ToWString(m_ModInfo->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL); +} + void ModInfoDialog::deleteFile(const QModelIndex &index) { diff --git a/src/modinfodialog.h b/src/modinfodialog.h index 52db5654..b5cc12a8 100644 --- a/src/modinfodialog.h +++ b/src/modinfodialog.h @@ -172,6 +172,7 @@ private slots: void hideTriggered(); void unhideTriggered(); + void on_openInExplorerButton_clicked(); void on_closeButton_clicked(); void on_saveButton_clicked(); void on_activateESP_clicked(); diff --git a/src/modinfodialog.ui b/src/modinfodialog.ui index 20eb7c30..4352ba4e 100644 --- a/src/modinfodialog.ui +++ b/src/modinfodialog.ui @@ -20,7 +20,7 @@ QTabWidget::Rounded - 0 + 8 true @@ -723,8 +723,8 @@ p, li { white-space: pre-wrap; } - - + + about:blank @@ -779,6 +779,36 @@ p, li { white-space: pre-wrap; } Filetree + + + + + + + 0 + 0 + + + + Open Mod in Explorer + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + -- cgit v1.3.1 From fc46a6a782108576ee43776109aceffbcb9668b1 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Mon, 16 Apr 2018 21:14:06 +0200 Subject: Disabled Hide inactive plugins checkbox in settings as it didn't work. --- src/settingsdialog.ui | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index 3c47d226..85688cb8 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -890,6 +890,9 @@ tl;dr-version: If Nexus-features don't work, insert the current version number o + + false + Enforces that inactive ESPs and ESMs are never loaded. -- cgit v1.3.1 From 62dc387de644a0a47156079f78f7e0ab174abdaa Mon Sep 17 00:00:00 2001 From: Al12rs Date: Tue, 17 Apr 2018 01:32:03 +0200 Subject: Added key shourtcuts to open in explorer a selected mo by pressing Enter or Return. Needs support for overwrte --- src/mainwindow.cpp | 18 ++++++++++++++++++ src/mainwindow.h | 4 ++++ 2 files changed, 22 insertions(+) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 401e3c8b..3eb7244a 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -150,6 +150,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #include #include @@ -369,6 +370,9 @@ MainWindow::MainWindow(QSettings &initSettings connect(ui->espList->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), this, SLOT(esplistSelectionsChanged(QItemSelection))); connect(ui->modList->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), this, SLOT(modlistSelectionsChanged(QItemSelection))); + new QShortcut(QKeySequence(Qt::Key_Enter), this, SLOT(openExplorer_activated())); + new QShortcut(QKeySequence(Qt::Key_Return), this, SLOT(openExplorer_activated())); + m_UpdateProblemsTimer.setSingleShot(true); connect(&m_UpdateProblemsTimer, SIGNAL(timeout()), this, SLOT(updateProblemsButton())); @@ -2615,6 +2619,20 @@ void MainWindow::openExplorer_clicked() ::ShellExecuteW(nullptr, L"explore", ToWString(modInfo->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL); } +void MainWindow::openExplorer_activated() +{ + QItemSelectionModel *selection = ui->modList->selectionModel(); + if (selection->hasSelection() && selection->selectedRows().count() == 1 && ui->modList->hasFocus()) { + + QModelIndex idx = selection->currentIndex(); + ModInfo::Ptr modInfo = ModInfo::getByIndex(idx.data(Qt::UserRole + 1).toInt()); + if (modInfo->isRegular()) { + ::ShellExecuteW(nullptr, L"explore", ToWString(modInfo->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL); + } + + } +} + void MainWindow::information_clicked() { try { diff --git a/src/mainwindow.h b/src/mainwindow.h index 8faaa349..31c52bc0 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -386,6 +386,7 @@ private slots: void showMessage(const QString &message); void showError(const QString &message); + // main window actions void helpTriggered(); void issueTriggered(); @@ -393,6 +394,9 @@ private slots: void tutorialTriggered(); void extractBSATriggered(); + //modlist shortcuts + void openExplorer_activated(); + // modlist context menu void installMod_clicked(); void createEmptyMod_clicked(); -- cgit v1.3.1 From b1329c18cde91c9e245f59475ae3b32c2c663a8c Mon Sep 17 00:00:00 2001 From: Al12rs Date: Tue, 17 Apr 2018 09:26:56 +0200 Subject: Added Enter shortcut support for ovewrite as well to open the Explorer window. --- src/mainwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 3eb7244a..0d9ca4a9 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2626,7 +2626,9 @@ void MainWindow::openExplorer_activated() QModelIndex idx = selection->currentIndex(); ModInfo::Ptr modInfo = ModInfo::getByIndex(idx.data(Qt::UserRole + 1).toInt()); - if (modInfo->isRegular()) { + std::vector flags = modInfo->getFlags(); + + if (modInfo->isRegular() || (std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end())) { ::ShellExecuteW(nullptr, L"explore", ToWString(modInfo->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL); } -- cgit v1.3.1 From b64fd1ed4d68fc64ac061b0f126af54cf7147462 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Tue, 17 Apr 2018 16:13:43 +0200 Subject: Enter shourcut will now open the mod containing the selected plugin if the ESPList has the focus. Added F5 shourcut to refresh the profile. Removed a redundant variable I saw by chance. --- src/mainwindow.cpp | 50 ++++++++++++++++++++++++++++++++++++++++---------- src/mainwindow.h | 1 + src/modlist.cpp | 1 - 3 files changed, 41 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 0d9ca4a9..2d6ccc94 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -372,6 +372,9 @@ MainWindow::MainWindow(QSettings &initSettings new QShortcut(QKeySequence(Qt::Key_Enter), this, SLOT(openExplorer_activated())); new QShortcut(QKeySequence(Qt::Key_Return), this, SLOT(openExplorer_activated())); + + new QShortcut(QKeySequence::Refresh, this, SLOT(refreshProfile_activated())); + m_UpdateProblemsTimer.setSingleShot(true); connect(&m_UpdateProblemsTimer, SIGNAL(timeout()), this, SLOT(updateProblemsButton())); @@ -2621,20 +2624,47 @@ void MainWindow::openExplorer_clicked() void MainWindow::openExplorer_activated() { - QItemSelectionModel *selection = ui->modList->selectionModel(); - if (selection->hasSelection() && selection->selectedRows().count() == 1 && ui->modList->hasFocus()) { - - QModelIndex idx = selection->currentIndex(); - ModInfo::Ptr modInfo = ModInfo::getByIndex(idx.data(Qt::UserRole + 1).toInt()); - std::vector flags = modInfo->getFlags(); - - if (modInfo->isRegular() || (std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end())) { - ::ShellExecuteW(nullptr, L"explore", ToWString(modInfo->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL); + if (ui->modList->hasFocus()) { + QItemSelectionModel *selection = ui->modList->selectionModel(); + if (selection->hasSelection() && selection->selectedRows().count() == 1 ) { + + QModelIndex idx = selection->currentIndex(); + ModInfo::Ptr modInfo = ModInfo::getByIndex(idx.data(Qt::UserRole + 1).toInt()); + std::vector flags = modInfo->getFlags(); + + if (modInfo->isRegular() || (std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end())) { + ::ShellExecuteW(nullptr, L"explore", ToWString(modInfo->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL); + } + } + } + + if (ui->espList->hasFocus()) { + QItemSelectionModel *selection = ui->espList->selectionModel(); + + if (selection->hasSelection() && selection->selectedRows().count() == 1) { + + QModelIndex idx = selection->currentIndex(); + QString fileName = idx.data().toString(); + + + ModInfo::Ptr modInfo = ModInfo::getByIndex(ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName))); + std::vector flags = modInfo->getFlags(); + + if (modInfo->isRegular() || (std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end())) { + ::ShellExecuteW(nullptr, L"explore", ToWString(modInfo->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL); + } + + } } } +void MainWindow::refreshProfile_activated() +{ + m_OrganizerCore.profileRefresh(); +} + void MainWindow::information_clicked() { try { @@ -4557,7 +4587,7 @@ void MainWindow::on_espList_customContextMenuRequested(const QPoint &pos) menu.addAction(tr("Unlock load order"), this, SLOT(unlockESPIndex())); } if (hasUnlocked) { - menu.addAction(tr("Lock load order"), this, SLOT(lockESPIndex())); + menu.addAction(tr("Lock load order"), this, SLOT(f())); } try { diff --git a/src/mainwindow.h b/src/mainwindow.h index 31c52bc0..3d093131 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -396,6 +396,7 @@ private slots: //modlist shortcuts void openExplorer_activated(); + void refreshProfile_activated(); // modlist context menu void installMod_clicked(); diff --git a/src/modlist.cpp b/src/modlist.cpp index c8fd4b3e..3f9a732a 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -724,7 +724,6 @@ void ModList::highlightMods(const QItemSelection &selected, const MOShared::Dire const MOShared::FileEntry::Ptr fileEntry = directoryEntry.findFile(modName.toStdWString()); if (fileEntry.get() != nullptr) { - QString fileName; bool archive = false; std::vector> origins; { -- cgit v1.3.1 From f2762035171f60fdd0b16052c07f67a0f79d60a8 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Tue, 17 Apr 2018 21:16:44 +0200 Subject: Changed mod Information dialog "Next" and "Previous" buttons to remember the currently viewed tab. --- src/mainwindow.cpp | 16 ++++++++-------- src/mainwindow.h | 4 ++-- src/modinfodialog.cpp | 14 ++++++++++---- src/modinfodialog.h | 4 ++-- 4 files changed, 22 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2d6ccc94..00c7895e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2464,8 +2464,8 @@ void MainWindow::displayModInformation(ModInfo::Ptr modInfo, unsigned int index, connect(&dialog, SIGNAL(nexusLinkActivated(QString)), this, SLOT(nexusLinkActivated(QString))); connect(&dialog, SIGNAL(downloadRequest(QString)), &m_OrganizerCore, SLOT(downloadRequestedNXM(QString))); connect(&dialog, SIGNAL(modOpen(QString, int)), this, SLOT(displayModInformation(QString, int)), Qt::QueuedConnection); - connect(&dialog, SIGNAL(modOpenNext()), this, SLOT(modOpenNext()), Qt::QueuedConnection); - connect(&dialog, SIGNAL(modOpenPrev()), this, SLOT(modOpenPrev()), Qt::QueuedConnection); + connect(&dialog, SIGNAL(modOpenNext(int)), this, SLOT(modOpenNext(int)), Qt::QueuedConnection); + connect(&dialog, SIGNAL(modOpenPrev(int)), this, SLOT(modOpenPrev(int)), Qt::QueuedConnection); connect(&dialog, SIGNAL(originModified(int)), this, SLOT(originModified(int))); connect(&dialog, SIGNAL(endorseMod(ModInfo::Ptr)), this, SLOT(endorseMod(ModInfo::Ptr))); @@ -2526,7 +2526,7 @@ void MainWindow::setWindowEnabled(bool enabled) } -void MainWindow::modOpenNext() +void MainWindow::modOpenNext(int tab) { QModelIndex index = m_ModListSortProxy->mapFromSource(m_OrganizerCore.modList()->index(m_ContextRow, 0)); index = m_ModListSortProxy->index((index.row() + 1) % m_ModListSortProxy->rowCount(), 0); @@ -2537,13 +2537,13 @@ void MainWindow::modOpenNext() if ((std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end()) || (std::find(flags.begin(), flags.end(), ModInfo::FLAG_BACKUP) != flags.end())) { // skip overwrite and backups - modOpenNext(); + modOpenNext(tab); } else { - displayModInformation(m_ContextRow); + displayModInformation(m_ContextRow,tab); } } -void MainWindow::modOpenPrev() +void MainWindow::modOpenPrev(int tab) { QModelIndex index = m_ModListSortProxy->mapFromSource(m_OrganizerCore.modList()->index(m_ContextRow, 0)); int row = index.row() - 1; @@ -2557,9 +2557,9 @@ void MainWindow::modOpenPrev() if ((std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end()) || (std::find(flags.begin(), flags.end(), ModInfo::FLAG_BACKUP) != flags.end())) { // skip overwrite and backups - modOpenPrev(); + modOpenPrev(tab); } else { - displayModInformation(m_ContextRow); + displayModInformation(m_ContextRow,tab); } } diff --git a/src/mainwindow.h b/src/mainwindow.h index 3d093131..b06da353 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -474,8 +474,8 @@ private slots: void deselectFilters(); void displayModInformation(const QString &modName, int tab); - void modOpenNext(); - void modOpenPrev(); + void modOpenNext(int tab=-1); + void modOpenPrev(int tab=-1); void modRenamed(const QString &oldName, const QString &newName); void modRemoved(const QString &fileName); diff --git a/src/modinfodialog.cpp b/src/modinfodialog.cpp index 705f0019..c25041f2 100644 --- a/src/modinfodialog.cpp +++ b/src/modinfodialog.cpp @@ -1448,14 +1448,20 @@ void ModInfoDialog::on_endorseBtn_clicked() void ModInfoDialog::on_nextButton_clicked() { - emit modOpenNext(); - this->accept(); + int currentTab = ui->tabWidget->currentIndex(); + int tab = m_RealTabPos[currentTab]; + + emit modOpenNext(tab); + this->accept(); } void ModInfoDialog::on_prevButton_clicked() { - emit modOpenPrev(); - this->accept(); + int currentTab = ui->tabWidget->currentIndex(); + int tab = m_RealTabPos[currentTab]; + + emit modOpenPrev(tab); + this->accept(); } diff --git a/src/modinfodialog.h b/src/modinfodialog.h index b5cc12a8..ddd72f4d 100644 --- a/src/modinfodialog.h +++ b/src/modinfodialog.h @@ -112,8 +112,8 @@ signals: void nexusLinkActivated(const QString &link); void downloadRequest(const QString &link); void modOpen(const QString &modName, int tab); - void modOpenNext(); - void modOpenPrev(); + void modOpenNext(int tab=-1); + void modOpenPrev(int tab=-1); void originModified(int originID); void endorseMod(ModInfo::Ptr nexusID); -- cgit v1.3.1