From e15f768a1538e558f95914d7786635eaf58847ad Mon Sep 17 00:00:00 2001 From: Al12rs Date: Thu, 13 Dec 2018 21:18:35 +0100 Subject: Fixed opening multiple modinfodialog from Open Origin info. --- src/mainwindow.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 931fa2af..9f9dc0fb 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3227,7 +3227,9 @@ void MainWindow::openOriginInformation_clicked() { try { QItemSelectionModel *selection = ui->espList->selectionModel(); - if (selection->hasSelection() && selection->selectedRows().count() > 0) { + //we don't want to open multiple modinfodialogs. + /*if (selection->hasSelection() && selection->selectedRows().count() > 0) { + for (QModelIndex idx : selection->selectedRows()) { QString fileName = idx.data().toString(); ModInfo::Ptr modInfo = ModInfo::getByIndex(ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName))); @@ -3238,16 +3240,15 @@ void MainWindow::openOriginInformation_clicked() } } } - else { - QModelIndex idx = selection->currentIndex(); - QString fileName = idx.data().toString(); + else {}*/ + 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(); + 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())) { - displayModInformation(ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName))); - } + if (modInfo->isRegular() || (std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end())) { + displayModInformation(ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName))); } } catch (const std::exception &e) { -- cgit v1.3.1 From ff51aa10c27ce09ddacccc84e09105f333a36abc Mon Sep 17 00:00:00 2001 From: Al12rs Date: Tue, 18 Dec 2018 00:10:37 +0100 Subject: Fixed performance issue of Data tab. --- src/mainwindow.cpp | 26 +++++++++++++++++--------- src/mainwindow.h | 2 +- 2 files changed, 18 insertions(+), 10 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 9f9dc0fb..3e35ebec 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1198,9 +1198,11 @@ void MainWindow::on_profileBox_currentIndexChanged(int index) } } -void MainWindow::updateTo(QTreeWidgetItem *subTree, const std::wstring &directorySoFar, const DirectoryEntry &directoryEntry, bool conflictsOnly) +void MainWindow::updateTo(QTreeWidgetItem *subTree, const std::wstring &directorySoFar, const DirectoryEntry &directoryEntry, bool conflictsOnly, QIcon *fileIcon, QIcon *folderIcon) { bool isDirectory = true; + //QIcon folderIcon = (new QFileIconProvider())->icon(QFileIconProvider::Folder); + //QIcon fileIcon = (new QFileIconProvider())->icon(QFileIconProvider::File); std::wostringstream temp; temp << directorySoFar << "\\" << directoryEntry.getName(); @@ -1213,11 +1215,11 @@ void MainWindow::updateTo(QTreeWidgetItem *subTree, const std::wstring &director columns.append(""); if (!(*current)->isEmpty()) { QTreeWidgetItem *directoryChild = new QTreeWidgetItem(columns); - directoryChild->setData(0, Qt::DecorationRole, (new QFileIconProvider())->icon(QFileIconProvider::Folder)); + directoryChild->setData(0, Qt::DecorationRole, *folderIcon); directoryChild->setData(0, Qt::UserRole + 3, isDirectory); if (conflictsOnly) { - updateTo(directoryChild, temp.str(), **current, conflictsOnly); + updateTo(directoryChild, temp.str(), **current, conflictsOnly, fileIcon, folderIcon); if (directoryChild->childCount() != 0) { subTree->addChild(directoryChild); } @@ -1236,7 +1238,7 @@ void MainWindow::updateTo(QTreeWidgetItem *subTree, const std::wstring &director } else { QTreeWidgetItem *directoryChild = new QTreeWidgetItem(columns); - directoryChild->setData(0, Qt::DecorationRole, (new QFileIconProvider())->icon(QFileIconProvider::Folder)); + directoryChild->setData(0, Qt::DecorationRole, *folderIcon); directoryChild->setData(0, Qt::UserRole + 3, isDirectory); subTree->addChild(directoryChild); } @@ -1281,7 +1283,7 @@ void MainWindow::updateTo(QTreeWidgetItem *subTree, const std::wstring &director fileChild->setFont(1, font); } fileChild->setData(0, Qt::UserRole, ToQString(current->getFullPath())); - fileChild->setData(0, Qt::DecorationRole, (new QFileIconProvider())->icon(QFileIconProvider::File)); + fileChild->setData(0, Qt::DecorationRole, *fileIcon); fileChild->setData(0, Qt::UserRole + 3, isDirectory); fileChild->setData(0, Qt::UserRole + 1, isArchive); fileChild->setData(1, Qt::UserRole, source); @@ -1322,6 +1324,7 @@ void MainWindow::delayedRemove() void MainWindow::expandDataTreeItem(QTreeWidgetItem *item) { + if ((item->childCount() == 1) && (item->child(0)->data(0, Qt::UserRole).toString() == "__loaded_on_demand__")) { // read the data we need from the sub-item, then dispose of it QTreeWidgetItem *onDemandDataItem = item->child(0); @@ -1331,7 +1334,9 @@ void MainWindow::expandDataTreeItem(QTreeWidgetItem *item) std::wstring virtualPath = (path + L"\\").substr(6) + ToWString(item->text(0)); DirectoryEntry *dir = m_OrganizerCore.directoryStructure()->findSubDirectoryRecursive(virtualPath); if (dir != nullptr) { - updateTo(item, path, *dir, conflictsOnly); + QIcon folderIcon = (new QFileIconProvider())->icon(QFileIconProvider::Folder); + QIcon fileIcon = (new QFileIconProvider())->icon(QFileIconProvider::File); + updateTo(item, path, *dir, conflictsOnly, &fileIcon, &folderIcon); } else { qWarning("failed to update view of %ls", path.c_str()); } @@ -1406,12 +1411,14 @@ void MainWindow::refreshDataTree() { QCheckBox *conflictsBox = findChild("conflictsCheckBox"); QTreeWidget *tree = findChild("dataTree"); + QIcon folderIcon = (new QFileIconProvider())->icon(QFileIconProvider::Folder); + QIcon fileIcon = (new QFileIconProvider())->icon(QFileIconProvider::File); tree->clear(); QStringList columns("data"); columns.append(""); QTreeWidgetItem *subTree = new QTreeWidgetItem(columns); subTree->setData(0, Qt::DecorationRole, (new QFileIconProvider())->icon(QFileIconProvider::Folder)); - updateTo(subTree, L"", *m_OrganizerCore.directoryStructure(), conflictsBox->isChecked()); + updateTo(subTree, L"", *m_OrganizerCore.directoryStructure(), conflictsBox->isChecked(), &fileIcon, &folderIcon); tree->insertTopLevelItem(0, subTree); subTree->setExpanded(true); } @@ -1420,7 +1427,8 @@ void MainWindow::refreshDataTreeKeepExpandedNodes() { QCheckBox *conflictsBox = findChild("conflictsCheckBox"); QTreeWidget *tree = findChild("dataTree"); - + QIcon folderIcon = (new QFileIconProvider())->icon(QFileIconProvider::Folder); + QIcon fileIcon = (new QFileIconProvider())->icon(QFileIconProvider::File); QStringList expandedNodes; QTreeWidgetItemIterator it1(tree, QTreeWidgetItemIterator::NotHidden | QTreeWidgetItemIterator::HasChildren); while (*it1) { @@ -1436,7 +1444,7 @@ void MainWindow::refreshDataTreeKeepExpandedNodes() columns.append(""); QTreeWidgetItem *subTree = new QTreeWidgetItem(columns); subTree->setData(0, Qt::DecorationRole, (new QFileIconProvider())->icon(QFileIconProvider::Folder)); - updateTo(subTree, L"", *m_OrganizerCore.directoryStructure(), conflictsBox->isChecked()); + updateTo(subTree, L"", *m_OrganizerCore.directoryStructure(), conflictsBox->isChecked(), &fileIcon, &folderIcon); tree->insertTopLevelItem(0, subTree); subTree->setExpanded(true); QTreeWidgetItemIterator it2(tree, QTreeWidgetItemIterator::HasChildren); diff --git a/src/mainwindow.h b/src/mainwindow.h index 69d08337..cd7e6f43 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -211,7 +211,7 @@ private: void startSteam(); - void updateTo(QTreeWidgetItem *subTree, const std::wstring &directorySoFar, const MOShared::DirectoryEntry &directoryEntry, bool conflictsOnly); + void updateTo(QTreeWidgetItem *subTree, const std::wstring &directorySoFar, const MOShared::DirectoryEntry &directoryEntry, bool conflictsOnly, QIcon *fileIcon, QIcon *folderIcon); bool refreshProfiles(bool selectProfile = true); void refreshExecutablesList(); void installMod(QString fileName = ""); -- cgit v1.3.1 From 9a33dc148054443cb0efd5916ff758fca5bc09e3 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Thu, 20 Dec 2018 19:12:11 +0100 Subject: *Added "Open INIs Folder" option. *Changed "Open Instance Folder" to open the Appdata or MO2 install instead of the baseDirectory. --- src/mainwindow.cpp | 19 ++++++++++++++++++- src/mainwindow.h | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 3e35ebec..954c88c6 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3639,7 +3639,11 @@ void MainWindow::disableVisibleMods() void MainWindow::openInstanceFolder() { - ::ShellExecuteW(nullptr, L"explore", ToWString(m_OrganizerCore.settings().getBaseDirectory()).c_str(), nullptr, nullptr, SW_SHOWNORMAL); + QString dataPath = qApp->property("dataPath").toString(); + ::ShellExecuteW(nullptr, L"explore", ToWString(dataPath).c_str(), nullptr, nullptr, SW_SHOWNORMAL); + + //opens BaseDirectory instead + //::ShellExecuteW(nullptr, L"explore", ToWString(m_OrganizerCore.settings().getBaseDirectory()).c_str(), nullptr, nullptr, SW_SHOWNORMAL); } void MainWindow::openLogsFolder() @@ -3665,6 +3669,17 @@ void MainWindow::openProfileFolder() ::ShellExecuteW(nullptr, L"explore", ToWString(m_OrganizerCore.currentProfile()->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL); } +void MainWindow::openIniFolder() +{ + if (m_OrganizerCore.currentProfile()->localSettingsEnabled()) + { + ::ShellExecuteW(nullptr, L"explore", ToWString(m_OrganizerCore.currentProfile()->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL); + } + else { + ::ShellExecuteW(nullptr, L"explore", ToWString(m_OrganizerCore.managedGame()->documentsDirectory().absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL); + } +} + void MainWindow::openDownloadsFolder() { ::ShellExecuteW(nullptr, L"explore", ToWString(m_OrganizerCore.settings().getDownloadDirectory()).c_str(), nullptr, nullptr, SW_SHOWNORMAL); @@ -3864,6 +3879,8 @@ QMenu *MainWindow::openFolderMenu() FolderMenu->addAction(tr("Open MyGames folder"), this, SLOT(openMyGamesFolder())); + FolderMenu->addAction(tr("Open INIs folder"), this, SLOT(openIniFolder())); + FolderMenu->addSeparator(); FolderMenu->addAction(tr("Open Instance folder"), this, SLOT(openInstanceFolder())); diff --git a/src/mainwindow.h b/src/mainwindow.h index cd7e6f43..e799a64a 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -529,6 +529,7 @@ private slots: void openDownloadsFolder(); void openModsFolder(); void openProfileFolder(); + void openIniFolder(); void openGameFolder(); void openMyGamesFolder(); void startExeAction(); -- cgit v1.3.1 From 3161bdb9a5b07ca73ab5c216920ddd420f5b4738 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Fri, 21 Dec 2018 01:05:30 +0100 Subject: Made doubleclick open relevant info tab --- src/mainwindow.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 954c88c6..2e795c90 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3215,7 +3215,17 @@ void MainWindow::on_modList_doubleClicked(const QModelIndex &index) else { try { m_ContextRow = m_ModListSortProxy->mapToSource(index).row(); - displayModInformation(sourceIdx.row()); + sourceIdx.column(); + int tab = -1; + switch (sourceIdx.column()) { + case ModList::COL_NOTES: tab = ModInfoDialog::TAB_NOTES; break; + case ModList::COL_VERSION: tab = ModInfoDialog::TAB_NEXUS; break; + case ModList::COL_MODID: tab = ModInfoDialog::TAB_NEXUS; break; + case ModList::COL_GAME: tab = ModInfoDialog::TAB_NEXUS; break; + case ModList::COL_CATEGORY: tab = ModInfoDialog::TAB_CATEGORIES; break; + default: tab = -1; + } + displayModInformation(sourceIdx.row(), tab); // workaround to cancel the editor that might have opened because of // selection-click ui->modList->closePersistentEditor(index); -- cgit v1.3.1 From afdd21440aa761e023f0ed991a75e318ad8298b7 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Thu, 20 Dec 2018 20:55:03 -0600 Subject: Catch and report exceptions in the MainWindow deconstructor --- src/mainwindow.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2e795c90..3b7fa917 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -460,12 +460,18 @@ MainWindow::MainWindow(QSettings &initSettings MainWindow::~MainWindow() { - cleanup(); + try { + cleanup(); - m_PluginContainer.setUserInterface(nullptr, nullptr); - m_OrganizerCore.setUserInterface(nullptr, nullptr); - m_IntegratedBrowser.close(); - delete ui; + m_PluginContainer.setUserInterface(nullptr, nullptr); + m_OrganizerCore.setUserInterface(nullptr, nullptr); + m_IntegratedBrowser.close(); + delete ui; + } catch (std::exception &e) { + QMessageBox::critical(nullptr, tr("Crash on exit"), + tr("MO crashed while exiting. Some settings may not be saved.\n\nError: %1").arg(e.what()), + QMessageBox::Ok); + } } @@ -1324,7 +1330,6 @@ void MainWindow::delayedRemove() void MainWindow::expandDataTreeItem(QTreeWidgetItem *item) { - if ((item->childCount() == 1) && (item->child(0)->data(0, Qt::UserRole).toString() == "__loaded_on_demand__")) { // read the data we need from the sub-item, then dispose of it QTreeWidgetItem *onDemandDataItem = item->child(0); -- cgit v1.3.1 From 70ddfaadbfdf3999eea0fe50f7cdac3675e5f019 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Fri, 14 Dec 2018 17:26:37 -0600 Subject: Expand mod list search edit to work on categories, nexus IDs, and notes --- src/mainwindow.cpp | 15 ++++++++++--- src/mainwindow.h | 1 + src/mainwindow.ui | 8 +++---- src/modlistsortproxy.cpp | 58 +++++++++++++++++++++++++++++++++++++++++++----- src/modlistsortproxy.h | 8 +++++++ 5 files changed, 77 insertions(+), 13 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 3b7fa917..44381864 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -285,14 +285,17 @@ MainWindow::MainWindow(QSettings &initSettings ui->modList->setItemDelegateForColumn(ModList::COL_FLAGS, new ModFlagIconDelegate(ui->modList)); ui->modList->setItemDelegateForColumn(ModList::COL_CONTENT, contentDelegate); ui->modList->header()->installEventFilter(m_OrganizerCore.modList()); + connect(ui->modList->header(), SIGNAL(sectionResized(int, int, int)), this, SLOT(modListSectionResized(int, int, int))); bool modListAdjusted = registerWidgetState(ui->modList->objectName(), ui->modList->header(), "mod_list_state"); if (modListAdjusted) { // hack: force the resize-signal to be triggered because restoreState doesn't seem to do that - int sectionSize = ui->modList->header()->sectionSize(ModList::COL_CONTENT); - ui->modList->header()->resizeSection(ModList::COL_CONTENT, sectionSize + 1); - ui->modList->header()->resizeSection(ModList::COL_CONTENT, sectionSize); + for (int column = 0; column <= ModList::COL_LASTCOLUMN; ++column) { + int sectionSize = ui->modList->header()->sectionSize(column); + ui->modList->header()->resizeSection(column, sectionSize + 1); + ui->modList->header()->resizeSection(column, sectionSize); + } } else { // hide these columns by default ui->modList->header()->setSectionHidden(ModList::COL_CONTENT, true); @@ -2474,6 +2477,12 @@ void MainWindow::modListSortIndicatorChanged(int, Qt::SortOrder) ui->modList->verticalScrollBar()->repaint(); } +void MainWindow::modListSectionResized(int logicalIndex, int oldSize, int newSize) +{ + bool enabled = (newSize != 0); + qobject_cast(ui->modList->model())->setColumnVisible(logicalIndex, enabled); +} + void MainWindow::removeMod_clicked() { try { diff --git a/src/mainwindow.h b/src/mainwindow.h index e799a64a..f66ea5e7 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -577,6 +577,7 @@ private slots: void modlistSelectionChanged(const QModelIndex ¤t, const QModelIndex &previous); void modListSortIndicatorChanged(int column, Qt::SortOrder order); + void modListSectionResized(int logicalIndex, int oldSize, int newSize); void modlistSelectionsChanged(const QItemSelection ¤t); void esplistSelectionsChanged(const QItemSelection ¤t); diff --git a/src/mainwindow.ui b/src/mainwindow.ui index e42bed27..7e94000d 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -448,7 +448,7 @@ p, li { white-space: pre-wrap; } false - 20 + 35 true @@ -612,7 +612,7 @@ p, li { white-space: pre-wrap; } - Namefilter + Filter @@ -999,7 +999,7 @@ p, li { white-space: pre-wrap; } - Namefilter + Filter @@ -1338,7 +1338,7 @@ p, li { white-space: pre-wrap; } - Namefilter + Filter diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp index 9adaa511..b5f1ee5c 100644 --- a/src/modlistsortproxy.cpp +++ b/src/modlistsortproxy.cpp @@ -39,10 +39,6 @@ ModListSortProxy::ModListSortProxy(Profile* profile, QObject *parent) , m_FilterActive(false) , m_FilterMode(FILTER_AND) { - m_EnabledColumns.set(ModList::COL_FLAGS); - m_EnabledColumns.set(ModList::COL_NAME); - m_EnabledColumns.set(ModList::COL_VERSION); - m_EnabledColumns.set(ModList::COL_PRIORITY); setDynamicSortFilter(true); // this seems to work without dynamicsortfilter // but I don't know why. This should be necessary } @@ -340,8 +336,53 @@ bool ModListSortProxy::filterMatchesModOr(ModInfo::Ptr info, bool enabled) const bool ModListSortProxy::filterMatchesMod(ModInfo::Ptr info, bool enabled) const { - if (!m_CurrentFilter.isEmpty() && - !info->name().contains(m_CurrentFilter, Qt::CaseInsensitive)) { + bool display = true; + if (!m_CurrentFilter.isEmpty()) { + display = false; + + // Search by name + if (!display && + m_EnabledColumns[ModList::COL_NAME] && + info->name().contains(m_CurrentFilter, Qt::CaseInsensitive)) { + display = true; + } + + // Search by notes + if (!display && + m_EnabledColumns[ModList::COL_NOTES] && + info->comments().contains(m_CurrentFilter, Qt::CaseInsensitive)) { + display = true; + } + + // Search by Nexus ID + if (!display && + m_EnabledColumns[ModList::COL_MODID]) { + bool ok; + int filterID = m_CurrentFilter.toInt(&ok); + if (ok) { + int modID = info->getNexusID(); + while (modID > 0) { + if (modID == filterID) { + display = true; + break; + } + modID = (int)(modID / 10); + } + } + } + + // Search by categories + if (!display && + m_EnabledColumns[ModList::COL_CATEGORY]) { + for (auto category : info->categories()) { + if (category.contains(m_CurrentFilter, Qt::CaseInsensitive)) { + display = true; + break; + } + } + } + } + if (!display) { return false; } @@ -352,6 +393,11 @@ bool ModListSortProxy::filterMatchesMod(ModInfo::Ptr info, bool enabled) const } } +void ModListSortProxy::setColumnVisible(int column, bool visible) +{ + m_EnabledColumns[column] = visible; +} + void ModListSortProxy::setFilterMode(ModListSortProxy::FilterMode mode) { if (m_FilterMode != mode) { diff --git a/src/modlistsortproxy.h b/src/modlistsortproxy.h index b3c01fea..5fe8d9d6 100644 --- a/src/modlistsortproxy.h +++ b/src/modlistsortproxy.h @@ -60,6 +60,7 @@ public: virtual void setSourceModel(QAbstractItemModel *sourceModel) override; + /** * @brief enable all mods visible under the current filter **/ @@ -94,6 +95,13 @@ public: return rowCount(parent) > 0; } + /** + * @brief sets whether a column is visible + * @param column the index of the column + * @param visible the visibility of the column + */ + void setColumnVisible(int column, bool visible); + public slots: void updateFilter(const QString &filter); -- cgit v1.3.1 From 9bc15eb6f7ab73b01a1e500c16473c4b2730c44e Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Fri, 14 Dec 2018 21:29:49 -0600 Subject: Add hotkeys for download filter and allow ESC to clear filter more often --- src/mainwindow.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 44381864..f2f190ff 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2964,23 +2964,33 @@ void MainWindow::search_activated() ui->modFilterEdit->setSelection(0, INT_MAX); } - if (ui->espList->hasFocus() || ui->espFilterEdit->hasFocus()) { + else if (ui->espList->hasFocus() || ui->espFilterEdit->hasFocus()) { ui->espFilterEdit->setFocus(); ui->espFilterEdit->setSelection(0, INT_MAX); } + + else if (ui->downloadView->hasFocus() || ui->downloadFilterEdit->hasFocus()) { + ui->downloadFilterEdit->setFocus(); + ui->downloadFilterEdit->setSelection(0, INT_MAX); + } } void MainWindow::searchClear_activated() { - if (ui->modFilterEdit->hasFocus()) { + if (ui->modList->hasFocus() || ui->modFilterEdit->hasFocus()) { ui->modFilterEdit->clear(); ui->modList->setFocus(); } - if (ui->espFilterEdit->hasFocus()) { + else if (ui->espList->hasFocus() || ui->espFilterEdit->hasFocus()) { ui->espFilterEdit->clear(); ui->espList->setFocus(); } + + else if (ui->downloadView->hasFocus() || ui->downloadFilterEdit->hasFocus()) { + ui->downloadFilterEdit->clear(); + ui->downloadView->setFocus(); + } } void MainWindow::information_clicked() -- cgit v1.3.1 From 127fbda849847cfd854cb86cd8fa2a2216020845 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Sat, 22 Dec 2018 14:54:45 +0100 Subject: Fixed unignreUpdate option from not showing up. --- src/mainwindow.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index f2f190ff..bb136364 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -4058,14 +4058,14 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos) menu->addAction(tr("Change versioning scheme"), this, SLOT(changeVersioningScheme())); } - if (info->updateAvailable() || info->downgradeAvailable()) { - if (info->updateIgnored()) { - menu->addAction(tr("Un-ignore update"), this, SLOT(unignoreUpdate())); - } else { - menu->addAction(tr("Ignore update"), this, SLOT(ignoreUpdate())); + if (info->updateIgnored()) { + menu->addAction(tr("Un-ignore update"), this, SLOT(unignoreUpdate())); + } + else { + if (info->updateAvailable() || info->downgradeAvailable()) { + menu->addAction(tr("Ignore update"), this, SLOT(ignoreUpdate())); } } - menu->addSeparator(); menu->addAction(tr("Enable selected"), this, SLOT(enableSelectedMods_clicked())); -- cgit v1.3.1 From d28ddcfbb52394a2a7ac793ad376ea8fd7b514fe Mon Sep 17 00:00:00 2001 From: Al Date: Mon, 24 Dec 2018 17:29:16 +0100 Subject: Added Active Plugins and Active Mods counters --- src/mainwindow.cpp | 12 ++++++++++++ src/mainwindow.h | 1 + src/mainwindow.ui | 22 +++++++++++++++++++++- src/organizercore.cpp | 4 ++++ src/pluginlist.cpp | 1 + 5 files changed, 39 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index bb136364..74374c2b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -458,6 +458,12 @@ MainWindow::MainWindow(QSettings &initSettings // set the name of the widget to the name of the action to allow styling ui->toolBar->widgetForAction(action)->setObjectName(action->objectName()); } + ui->activePluginsCounter->display(m_OrganizerCore.pluginList()->enabledCount()); + ui->activeModsCounter->display((int)m_OrganizerCore.currentProfile()->getActiveMods().size()); + qDebug("Plugin enabledCount: %d", m_OrganizerCore.pluginList()->enabledCount()); + qDebug("Mods enabledCount: %d", (int)m_OrganizerCore.currentProfile()->getActiveMods().size()); + + } @@ -2186,6 +2192,11 @@ void MainWindow::directory_refreshed() statusBar()->hide(); } +void MainWindow::esplist_changed() +{ + ui->activePluginsCounter->display(m_OrganizerCore.pluginList()->enabledCount()); +} + void MainWindow::modorder_changed() { for (unsigned int i = 0; i < m_OrganizerCore.currentProfile()->numMods(); ++i) { @@ -2443,6 +2454,7 @@ void MainWindow::restoreBackup_clicked() void MainWindow::modlistChanged(const QModelIndex&, int) { m_OrganizerCore.currentProfile()->writeModlist(); + ui->activeModsCounter->display((int)m_OrganizerCore.currentProfile()->getActiveMods().size()); } void MainWindow::modlistSelectionChanged(const QModelIndex ¤t, const QModelIndex&) diff --git a/src/mainwindow.h b/src/mainwindow.h index f66ea5e7..61113b8c 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -162,6 +162,7 @@ public slots: void displayColumnSelection(const QPoint &pos); void modorder_changed(); + void esplist_changed(); void refresher_progress(int percent); void directory_refreshed(); diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 7e94000d..067cd4d0 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -179,7 +179,7 @@ 2 - + @@ -224,6 +224,16 @@ p, li { white-space: pre-wrap; } + + + + Active: + + + + + + @@ -853,6 +863,16 @@ p, li { white-space: pre-wrap; } + + + + Active: + + + + + + diff --git a/src/organizercore.cpp b/src/organizercore.cpp index d52ef40b..1f4e3434 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -560,6 +560,10 @@ void OrganizerCore::setUserInterface(IUserInterface *userInterface, SLOT(fileMoved(QString, QString, QString))); connect(&m_ModList, SIGNAL(modorder_changed()), widget, SLOT(modorder_changed())); + connect(&m_PluginList, SIGNAL(writePluginsList()), widget, + SLOT(esplist_changed())); + connect(&m_PluginList, SIGNAL(esplist_changed()), widget, + SLOT(esplist_changed())); connect(&m_DownloadManager, SIGNAL(showMessage(QString)), widget, SLOT(showMessage(QString))); } diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index b0f59e1e..fcb05979 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -846,6 +846,7 @@ void PluginList::generatePluginIndexes() m_ESPs[i].m_Index = QString("%1").arg(l - numESLs - numSkipped, 2, 16, QChar('0')).toUpper(); } } + emit esplist_changed(); } -- cgit v1.3.1 From 23cf8e60fd7144294ee1ffc013f76d4917518a76 Mon Sep 17 00:00:00 2001 From: Al Date: Mon, 24 Dec 2018 21:22:48 +0100 Subject: Changed ui of active mod counters --- src/mainwindow.cpp | 5 ++--- src/mainwindow.ui | 60 ++++++++++++++++++++++++++++++++++++------------------ 2 files changed, 42 insertions(+), 23 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 74374c2b..657f89bd 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -460,9 +460,8 @@ MainWindow::MainWindow(QSettings &initSettings } ui->activePluginsCounter->display(m_OrganizerCore.pluginList()->enabledCount()); ui->activeModsCounter->display((int)m_OrganizerCore.currentProfile()->getActiveMods().size()); - qDebug("Plugin enabledCount: %d", m_OrganizerCore.pluginList()->enabledCount()); - qDebug("Mods enabledCount: %d", (int)m_OrganizerCore.currentProfile()->getActiveMods().size()); - + + } diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 067cd4d0..1c2a5aed 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -224,16 +224,6 @@ p, li { white-space: pre-wrap; } - - - - Active: - - - - - - @@ -305,6 +295,26 @@ p, li { white-space: pre-wrap; } + + + + Active: + + + + + + + QFrame::Sunken + + + 5 + + + QLCDNumber::Flat + + + @@ -863,16 +873,6 @@ p, li { white-space: pre-wrap; } - - - - Active: - - - - - - @@ -907,6 +907,26 @@ p, li { white-space: pre-wrap; } + + + + Active: + + + + + + + QFrame::Sunken + + + 3 + + + QLCDNumber::Outline + + + -- cgit v1.3.1 From 7fa230411e3615e923f39fe85d9ccb985e3d4e5d Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Mon, 24 Dec 2018 19:46:31 -0600 Subject: Improvements to the plugin and mod counters * Fix style * Add whatsThis * Add tooltips with additional statistics * Don't count mods like overwrite, unmanaged, DLC, etc. --- src/mainwindow.cpp | 106 +++++++++++++++++++++++++++++++++++++++++++++++++---- src/mainwindow.h | 3 ++ src/mainwindow.ui | 10 ++++- 3 files changed, 110 insertions(+), 9 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 657f89bd..e3f12e39 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -458,11 +458,8 @@ MainWindow::MainWindow(QSettings &initSettings // set the name of the widget to the name of the action to allow styling ui->toolBar->widgetForAction(action)->setObjectName(action->objectName()); } - ui->activePluginsCounter->display(m_OrganizerCore.pluginList()->enabledCount()); - ui->activeModsCounter->display((int)m_OrganizerCore.currentProfile()->getActiveMods().size()); - - - + emit updatePluginCount(); + emit updateModCount(); } @@ -2193,7 +2190,7 @@ void MainWindow::directory_refreshed() void MainWindow::esplist_changed() { - ui->activePluginsCounter->display(m_OrganizerCore.pluginList()->enabledCount()); + emit updatePluginCount(); } void MainWindow::modorder_changed() @@ -2453,7 +2450,7 @@ void MainWindow::restoreBackup_clicked() void MainWindow::modlistChanged(const QModelIndex&, int) { m_OrganizerCore.currentProfile()->writeModlist(); - ui->activeModsCounter->display((int)m_OrganizerCore.currentProfile()->getActiveMods().size()); + emit updateModCount(); } void MainWindow::modlistSelectionChanged(const QModelIndex ¤t, const QModelIndex&) @@ -3004,6 +3001,101 @@ void MainWindow::searchClear_activated() } } +void MainWindow::updateModCount() +{ + int activeCount = 0; + int backupCount = 0; + int foreignCount = 0; + int separatorCount = 0; + int regularCount = 0; + + QStringList allMods = m_OrganizerCore.modList()->allMods(); + + auto hasFlag = [](std::vector flags, ModInfo::EFlag filter) { + return std::find(flags.begin(), flags.end(), filter) != flags.end(); + }; + + for (QString mod : allMods) { + int modIndex = ModInfo::getIndex(mod); + ModInfo::Ptr modInfo = ModInfo::getByIndex(modIndex); + std::vector modFlags = modInfo->getFlags(); + for (auto flag : modFlags) { + switch (flag) { + case ModInfo::FLAG_BACKUP: backupCount++; break; + case ModInfo::FLAG_FOREIGN: foreignCount++; break; + case ModInfo::FLAG_SEPARATOR: separatorCount++; break; + } + } + + if (!hasFlag(modFlags, ModInfo::FLAG_BACKUP) && + !hasFlag(modFlags, ModInfo::FLAG_FOREIGN) && + !hasFlag(modFlags, ModInfo::FLAG_SEPARATOR) && + !hasFlag(modFlags, ModInfo::FLAG_OVERWRITE)) { + if (m_OrganizerCore.currentProfile()->modEnabled(modIndex)) + activeCount++; + regularCount++; + } + } + + ui->activeModsCounter->display(activeCount); + ui->activeModsCounter->setToolTip(tr("" + "" + "" + "" + "" + "
Active mods: %1 of %2
Unmanaged mods/DLC: %3
Mod backups: %4
Separators: %5
") + .arg(activeCount) + .arg(regularCount) + .arg(foreignCount) + .arg(backupCount) + .arg(separatorCount) + ); +} + +void MainWindow::updatePluginCount() +{ + int activeMasterCount = 0; + int activeLightMasterCount = 0; + int activeRegularCount = 0; + int masterCount = 0; + int lightMasterCount = 0; + int regularCount = 0; + + PluginList *list = m_OrganizerCore.pluginList(); + + for (QString plugin : list->pluginNames()) { + bool active = list->isEnabled(plugin); + if (list->isMaster(plugin)) { + masterCount++; + activeMasterCount += active; + } else if (list->isLight(plugin) || list->isLightFlagged(plugin)) { + lightMasterCount++; + activeLightMasterCount += active; + } else { + regularCount++; + activeRegularCount += active; + } + } + + int activeCount = activeMasterCount + activeLightMasterCount + activeRegularCount; + int totalCount = masterCount + lightMasterCount + regularCount; + + ui->activePluginsCounter->display(activeCount); + ui->activePluginsCounter->setToolTip(tr("" + "" + "" + "" + "" + "" + "
Active plugins: %1 of %2
Active ESMs: %3 of %4
Active ESLs: %5 of %6
Active ESPs: %7 of %8
Active ESMs+ESPs: %9 of %10
") + .arg(activeCount).arg(totalCount) + .arg(activeMasterCount).arg(masterCount) + .arg(activeLightMasterCount).arg(lightMasterCount) + .arg(activeRegularCount).arg(regularCount) + .arg(activeMasterCount+activeRegularCount).arg(masterCount+regularCount) + ); +} + void MainWindow::information_clicked() { try { diff --git a/src/mainwindow.h b/src/mainwindow.h index 61113b8c..654a11d5 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -586,6 +586,9 @@ private slots: void search_activated(); void searchClear_activated(); + void updateModCount(); + void updatePluginCount(); + private slots: // ui slots // actions void on_actionAdd_Profile_triggered(); diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 1c2a5aed..1180dee0 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -304,6 +304,9 @@ p, li { white-space: pre-wrap; }
+ + This provides statistics about the mod list. The total number of active mod is normally displayed. Other statistics may be accessed with the tooltip of this counter. + QFrame::Sunken @@ -916,14 +919,17 @@ p, li { white-space: pre-wrap; } + + This provides statistics about the plugin list. The total number of active plugins is normally displayed. Other statistics may be accessed with the tooltip of this counter. + QFrame::Sunken - 3 + 4 - QLCDNumber::Outline + QLCDNumber::Flat -- cgit v1.3.1 From 5f06da756e6d03dde85da6ddad5d8177f7410860 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Mon, 24 Dec 2018 20:52:56 -0600 Subject: Allow "visit on Nexus" for multiple mods --- src/mainwindow.cpp | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index e3f12e39..de12cf05 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2865,12 +2865,33 @@ void MainWindow::markConverted_clicked() void MainWindow::visitOnNexus_clicked() { - int modID = m_OrganizerCore.modList()->data(m_OrganizerCore.modList()->index(m_ContextRow, 0), Qt::UserRole).toInt(); - QString gameName = m_OrganizerCore.modList()->data(m_OrganizerCore.modList()->index(m_ContextRow, 0), Qt::UserRole + 4).toString(); - if (modID > 0) { - linkClicked(NexusInterface::instance(&m_PluginContainer)->getModURL(modID, gameName)); - } else { - MessageDialog::showMessage(tr("Nexus ID for this Mod is unknown"), this); + QItemSelectionModel *selection = ui->modList->selectionModel(); + if (selection->hasSelection() && selection->selectedRows().count() > 1) { + int count = selection->selectedRows().count(); + if (count > 10) { + if (QMessageBox::question(this, tr("Opening Nexus Links"), + tr("You are trying to open %1 links to Nexus Mods. Are you sure you want to do this?").arg(count), + QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) { + return; + } + } + + for (QModelIndex idx : selection->selectedRows()) { + int modID = m_OrganizerCore.modList()->data(m_OrganizerCore.modList()->index(idx.data(Qt::UserRole + 1).toInt(), 0), Qt::UserRole).toInt(); + QString gameName = m_OrganizerCore.modList()->data(m_OrganizerCore.modList()->index(idx.data(Qt::UserRole + 1).toInt(), 0), Qt::UserRole + 4).toString(); + if (modID > 0) { + linkClicked(NexusInterface::instance(&m_PluginContainer)->getModURL(modID, gameName)); + } + } + } + else { + int modID = m_OrganizerCore.modList()->data(m_OrganizerCore.modList()->index(m_ContextRow, 0), Qt::UserRole).toInt(); + QString gameName = m_OrganizerCore.modList()->data(m_OrganizerCore.modList()->index(m_ContextRow, 0), Qt::UserRole + 4).toString(); + if (modID > 0) { + linkClicked(NexusInterface::instance(&m_PluginContainer)->getModURL(modID, gameName)); + } else { + MessageDialog::showMessage(tr("Nexus ID for this Mod is unknown"), this); + } } } -- cgit v1.3.1 From d021011cfa1f9276dc9c3dd7c2fcd395e3a78260 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Mon, 24 Dec 2018 21:05:29 -0600 Subject: Allow "endorse", "unendorse", and "won't endorse" for multiple mods --- src/mainwindow.cpp | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++--- src/mainwindow.h | 1 + 2 files changed, 68 insertions(+), 3 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index de12cf05..47fe4308 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2607,16 +2607,49 @@ void MainWindow::endorseMod(ModInfo::Ptr mod) void MainWindow::endorse_clicked() { - endorseMod(ModInfo::getByIndex(m_ContextRow)); + QItemSelectionModel *selection = ui->modList->selectionModel(); + if (selection->hasSelection() && selection->selectedRows().count() > 1) { + if (NexusInterface::instance(&m_PluginContainer)->getAccessManager()->loggedIn()) { + MessageDialog::showMessage(tr("Endorsing multiple mods will take a while. Please wait..."), this); + for (QModelIndex idx : selection->selectedRows()) { + ModInfo::getByIndex(idx.data(Qt::UserRole + 1).toInt())->endorse(true); + } + } + else { + QString username, password; + if (m_OrganizerCore.settings().getNexusLogin(username, password)) { + MessageDialog::showMessage(tr("Endorsing multiple mods will take a while. Please wait..."), this); + for (QModelIndex idx : selection->selectedRows()) { + ModInfo::Ptr modInfo = ModInfo::getByIndex(idx.data(Qt::UserRole + 1).toInt()); + m_OrganizerCore.doAfterLogin(boost::bind(&MainWindow::endorseMod, this, modInfo)); + } + NexusInterface::instance(&m_PluginContainer)->getAccessManager()->login(username, password); + } else { + MessageDialog::showMessage(tr("You need to be logged in with Nexus to endorse"), this); + return; + } + } + } + else { + endorseMod(ModInfo::getByIndex(m_ContextRow)); + } } void MainWindow::dontendorse_clicked() { - ModInfo::getByIndex(m_ContextRow)->setNeverEndorse(); + QItemSelectionModel *selection = ui->modList->selectionModel(); + if (selection->hasSelection() && selection->selectedRows().count() > 1) { + for (QModelIndex idx : selection->selectedRows()) { + ModInfo::getByIndex(idx.data(Qt::UserRole + 1).toInt())->setNeverEndorse(); + } + } + else { + ModInfo::getByIndex(m_ContextRow)->setNeverEndorse(); + } } -void MainWindow::unendorse_clicked() +void MainWindow::unendorseMod(ModInfo::Ptr mod) { QString username, password; if (NexusInterface::instance(&m_PluginContainer)->getAccessManager()->loggedIn()) { @@ -2631,6 +2664,37 @@ void MainWindow::unendorse_clicked() } } + +void MainWindow::unendorse_clicked() +{ + QItemSelectionModel *selection = ui->modList->selectionModel(); + if (selection->hasSelection() && selection->selectedRows().count() > 1) { + if (NexusInterface::instance(&m_PluginContainer)->getAccessManager()->loggedIn()) { + MessageDialog::showMessage(tr("Unendorsing multiple mods will take a while. Please wait..."), this); + for (QModelIndex idx : selection->selectedRows()) { + ModInfo::getByIndex(idx.data(Qt::UserRole + 1).toInt())->endorse(false); + } + } + else { + QString username, password; + if (m_OrganizerCore.settings().getNexusLogin(username, password)) { + MessageDialog::showMessage(tr("Unendorsing multiple mods will take a while. Please wait..."), this); + for (QModelIndex idx : selection->selectedRows()) { + ModInfo::Ptr modInfo = ModInfo::getByIndex(idx.data(Qt::UserRole + 1).toInt()); + m_OrganizerCore.doAfterLogin(boost::bind(&MainWindow::unendorseMod, this, modInfo)); + } + NexusInterface::instance(&m_PluginContainer)->getAccessManager()->login(username, password); + } else { + MessageDialog::showMessage(tr("You need to be logged in with Nexus to endorse"), this); + return; + } + } + } + else { + unendorseMod(ModInfo::getByIndex(m_ContextRow)); + } +} + void MainWindow::loginFailed(const QString &error) { qDebug("login failed: %s", qPrintable(error)); diff --git a/src/mainwindow.h b/src/mainwindow.h index 654a11d5..3bf0397a 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -515,6 +515,7 @@ private slots: void resumeDownload(int downloadIndex); void endorseMod(ModInfo::Ptr mod); + void unendorseMod(ModInfo::Ptr mod); void cancelModListEditor(); void lockESPIndex(); -- cgit v1.3.1 From 40a3e93c4698f31494df6483ff964a535342e177 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Mon, 24 Dec 2018 21:43:57 -0600 Subject: Add an option to disable endorsements --- src/mainwindow.cpp | 7 +++--- src/modinfodialog.cpp | 2 +- src/modinforegular.cpp | 5 +++- src/settings.cpp | 8 +++++++ src/settings.h | 6 +++++ src/settingsdialog.ui | 64 ++++++++++++++++++++++++++++++-------------------- 6 files changed, 61 insertions(+), 31 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 47fe4308..10b91c7c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -4270,7 +4270,7 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos) menu->addSeparator(); - if (info->getNexusID() > 0) { + if (info->getNexusID() > 0 && Settings::instance().endorsementIntegration()) { switch (info->endorsedState()) { case ModInfo::ENDORSED_TRUE: { menu->addAction(tr("Un-Endorse"), this, SLOT(unendorse_clicked())); @@ -5143,7 +5143,7 @@ void MainWindow::nxmUpdatesAvailable(const std::vector &modIDs, QVariant us if (game && result["id"].toInt() == game->nexusModOrganizerID() && result["game_id"].toInt() == game->nexusGameID()) { - if (!result["voted_by_user"].toBool()) { + if (!result["voted_by_user"].toBool() && Settings::instance().endorsementIntegration()) { ui->actionEndorseMO->setVisible(true); } } else { @@ -5167,7 +5167,8 @@ void MainWindow::nxmUpdatesAvailable(const std::vector &modIDs, QVariant us (*iter)->setNewestVersion(result["version"].toString()); (*iter)->setNexusDescription(result["description"].toString()); if (NexusInterface::instance(&m_PluginContainer)->getAccessManager()->loggedIn() && - result.contains("voted_by_user")) { + result.contains("voted_by_user") && + Settings::instance().endorsementIntegration()) { // don't use endorsement info if we're not logged in or if the response doesn't contain it (*iter)->setIsEndorsed(result["voted_by_user"].toBool()); } diff --git a/src/modinfodialog.cpp b/src/modinfodialog.cpp index 6d894237..c8e0fb9e 100644 --- a/src/modinfodialog.cpp +++ b/src/modinfodialog.cpp @@ -171,8 +171,8 @@ ModInfoDialog::ModInfoDialog(ModInfo::Ptr modInfo, const DirectoryEntry *directo ui->tabWidget->setTabEnabled(TAB_CONFLICTS, m_Origin != nullptr); - + ui->endorseBtn->setVisible(Settings::instance().endorsementIntegration()); ui->endorseBtn->setEnabled((m_ModInfo->endorsedState() == ModInfo::ENDORSED_FALSE) || (m_ModInfo->endorsedState() == ModInfo::ENDORSED_NEVER)); diff --git a/src/modinforegular.cpp b/src/modinforegular.cpp index 6a52d3df..548e3178 100644 --- a/src/modinforegular.cpp +++ b/src/modinforegular.cpp @@ -4,6 +4,7 @@ #include "messagedialog.h" #include "report.h" #include "scriptextender.h" +#include "settings.h" #include #include @@ -466,7 +467,9 @@ void ModInfoRegular::ignoreUpdate(bool ignore) std::vector ModInfoRegular::getFlags() const { std::vector result = ModInfoWithConflictInfo::getFlags(); - if ((m_NexusID > 0) && (endorsedState() == ENDORSED_FALSE)) { + if ((m_NexusID > 0) && + (endorsedState() == ENDORSED_FALSE) && + Settings::instance().endorsementIntegration()) { result.push_back(ModInfo::FLAG_NOTENDORSED); } if (!isValid() && !m_Validated) { diff --git a/src/settings.cpp b/src/settings.cpp index 18e893cb..42bf1357 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -459,6 +459,11 @@ bool Settings::useProxy() const return m_Settings.value("Settings/use_proxy", false).toBool(); } +bool Settings::endorsementIntegration() const +{ + return m_Settings.value("Settings/endorsement_integration", true).toBool(); +} + bool Settings::displayForeign() const { return m_Settings.value("Settings/display_foreign", true).toBool(); @@ -941,6 +946,7 @@ Settings::NexusTab::NexusTab(Settings *parent, SettingsDialog &dialog) , m_knownServersList(dialog.findChild("knownServersList")) , m_preferredServersList( dialog.findChild("preferredServersList")) + , m_endorsementBox(dialog.findChild("endorsementBox")) { if (parent->automaticLoginEnabled()) { m_loginCheckBox->setChecked(true); @@ -950,6 +956,7 @@ Settings::NexusTab::NexusTab(Settings *parent, SettingsDialog &dialog) m_offlineBox->setChecked(parent->offlineMode()); m_proxyBox->setChecked(parent->useProxy()); + m_endorsementBox->setChecked(parent->endorsementIntegration()); // display server preferences m_Settings.beginGroup("Servers"); @@ -991,6 +998,7 @@ void Settings::NexusTab::update() } m_Settings.setValue("Settings/offline_mode", m_offlineBox->isChecked()); m_Settings.setValue("Settings/use_proxy", m_proxyBox->isChecked()); + m_Settings.setValue("Settings/endorsement_integration", m_endorsementBox->isChecked()); // store server preference m_Settings.beginGroup("Servers"); diff --git a/src/settings.h b/src/settings.h index 912864e2..25f22911 100644 --- a/src/settings.h +++ b/src/settings.h @@ -270,6 +270,11 @@ public: */ bool useProxy() const; + /** + * @return true if endorsement integration is enabled + */ + bool endorsementIntegration() const; + /** * @return true if the user wants to see non-official plugins installed outside MO in his mod list */ @@ -470,6 +475,7 @@ private: QCheckBox *m_proxyBox; QListWidget *m_knownServersList; QListWidget *m_preferredServersList; + QCheckBox *m_endorsementBox; }; /** Display/store the configuration in the 'steam' tab of the settings dialogue */ diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index 0412fc10..d9fa92d8 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -537,30 +537,44 @@ p, li { white-space: pre-wrap; } - - - Disable automatic internet features - - - Disable automatic internet features. This does not affect features that are explicitly invoked by the user (like checking mods for updates, endorsing, opening the web browser) - - - Offline Mode - - - - - - - Use a proxy for network connections. - - - Use a proxy for network connections. This uses the system-wide settings which can be configured in Internet Explorer. Please note that MO will start up a few seconds slower on some systems when using a proxy. - - - Use HTTP Proxy (Uses System Settings) - - + + + + + Disable automatic internet features + + + Disable automatic internet features. This does not affect features that are explicitly invoked by the user (like checking mods for updates, endorsing, opening the web browser) + + + Offline Mode + + + + + + + Use a proxy for network connections. + + + Use a proxy for network connections. This uses the system-wide settings which can be configured in Internet Explorer. Please note that MO will start up a few seconds slower on some systems when using a proxy. + + + Use HTTP Proxy (Uses System Settings) + + + + + + + Endorsement Integration + + + true + + + + @@ -1347,8 +1361,6 @@ programs you are intentionally running.
usernameEdit passwordEdit clearCacheButton - offlineBox - proxyBox associateButton knownServersList preferredServersList -- cgit v1.3.1 From 22f40072cf7782e6f3484a58347381310b40c6cc Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Mon, 24 Dec 2018 22:37:32 -0600 Subject: Allow user to "won't endorse" MO itself --- src/mainwindow.cpp | 40 ++- src/mainwindow.h | 2 + src/organizer_en.ts | 877 ++++++++++++++++++++++++++-------------------------- 3 files changed, 475 insertions(+), 444 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 10b91c7c..3e8323e5 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -245,8 +245,6 @@ MainWindow::MainWindow(QSettings &initSettings statusBar()->clearMessage(); statusBar()->hide(); - ui->actionEndorseMO->setVisible(false); - updateProblemsButton(); // Setup toolbar @@ -262,6 +260,10 @@ MainWindow::MainWindow(QSettings &initSettings actionToToolButton(ui->actionHelp); createHelpWidget(); + actionToToolButton(ui->actionEndorseMO); + createEndorseWidget(); + ui->actionEndorseMO->setVisible(false); + for (QAction *action : ui->toolBar->actions()) { if (action->isSeparator()) { // insert spacers @@ -707,6 +709,25 @@ void MainWindow::about() } +void MainWindow::createEndorseWidget() +{ + QToolButton *toolBtn = qobject_cast(ui->toolBar->widgetForAction(ui->actionEndorseMO)); + QMenu *buttonMenu = toolBtn->menu(); + if (buttonMenu == nullptr) { + return; + } + buttonMenu->clear(); + + QAction *endorseAction = new QAction(tr("Endorse"), buttonMenu); + connect(endorseAction, SIGNAL(triggered()), this, SLOT(on_actionEndorseMO_triggered())); + buttonMenu->addAction(endorseAction); + + QAction *wontEndorseAction = new QAction(tr("Won't Endorse"), buttonMenu); + connect(wontEndorseAction, SIGNAL(triggered()), this, SLOT(on_actionWontEndorseMO_triggered())); + buttonMenu->addAction(wontEndorseAction); +} + + void MainWindow::createHelpWidget() { QToolButton *toolBtn = qobject_cast(ui->toolBar->widgetForAction(ui->actionHelp)); @@ -5012,7 +5033,9 @@ void MainWindow::motdReceived(const QString &motd) void MainWindow::notEndorsedYet() { - ui->actionEndorseMO->setVisible(true); + if (!Settings::instance().directInterface().value("wont_endorse_MO", false).toBool()) { + ui->actionEndorseMO->setVisible(true); + } } @@ -5077,6 +5100,13 @@ void MainWindow::on_actionEndorseMO_triggered() } +void MainWindow::on_actionWontEndorseMO_triggered() +{ + Settings::instance().directInterface().setValue("wont_endorse_MO", true); + ui->actionEndorseMO->setVisible(false); +} + + void MainWindow::updateDownloadListDelegate() { if (m_OrganizerCore.settings().compactDownloads()) { @@ -5143,7 +5173,9 @@ void MainWindow::nxmUpdatesAvailable(const std::vector &modIDs, QVariant us if (game && result["id"].toInt() == game->nexusModOrganizerID() && result["game_id"].toInt() == game->nexusGameID()) { - if (!result["voted_by_user"].toBool() && Settings::instance().endorsementIntegration()) { + if (!result["voted_by_user"].toBool() && + Settings::instance().endorsementIntegration() && + !Settings::instance().directInterface().value("wont_endorse_MO", false).toBool()) { ui->actionEndorseMO->setVisible(true); } } else { diff --git a/src/mainwindow.h b/src/mainwindow.h index 3bf0397a..b041b65e 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -251,6 +251,7 @@ private: // remove invalid category-references from mods void fixCategories(); + void createEndorseWidget(); void createHelpWidget(); bool extractProgress(QProgressDialog &extractProgress, int percentage, std::string fileName); @@ -600,6 +601,7 @@ private slots: // ui slots void on_actionSettings_triggered(); void on_actionUpdate_triggered(); void on_actionEndorseMO_triggered(); + void on_actionWontEndorseMO_triggered(); void on_bsaList_customContextMenuRequested(const QPoint &pos); void on_clearFiltersButton_clicked(); diff --git a/src/organizer_en.ts b/src/organizer_en.ts index 59125574..9b2d82ae 100644 --- a/src/organizer_en.ts +++ b/src/organizer_en.ts @@ -1547,7 +1547,7 @@ This is likely due to a corrupted or incompatible download or unrecognized archi MainWindow - + Categories @@ -1613,66 +1613,63 @@ p, li { white-space: pre-wrap; } - + Restore Backup... - - + + Create Backup - + + + Active: + + + + List of available mods. - + This is a list of installed mods. Use the checkboxes to activate/deactivate mods and drag & drop mods to change their "installation" orders. - - - - + + + + Filter - + Clear all Filters - + No groups - + Nexus IDs - - - - - Filter - Namefilter - - - - + Pick a program to run. - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -1682,12 +1679,12 @@ p, li { white-space: pre-wrap; } - + Run program - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -1696,17 +1693,17 @@ p, li { white-space: pre-wrap; } - + Run - + Create a shortcut in your start menu or on the desktop to the specified program - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -1715,27 +1712,27 @@ p, li { white-space: pre-wrap; } - + Shortcut - + Plugins - + Sort - + List of available esp/esm files - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -1744,27 +1741,27 @@ p, li { white-space: pre-wrap; } - + Archives - + <html><head/><body><p>BSAs / BA2s are bundles of game assets (textures, scripts, etc.). By default, the engine loads these bundles in a separate step from loose files. <p>Their load order is specified by the priority of the corresponding plugin (right pane, plugins tab).</p><p>If there is a matching plugin, the game will load them no matter what.</p></body></html> - + <html><head/><body><p>Currently detected archives. (<a href="#"><span style=" text-decoration: underline; color:#0000ff;">What is an archive?</span></a>)</p></body></html> - + List of available BS Archives. Archives not checked here are not managed by MO and ignore installation order. - + BSA files are archives (comparable to .zip files) that contain data assets (meshes, textures, ...) to be used by the game. As such they "compete" with loose files in your data directory over which is loaded. By default, BSAs that share their base name with an enabled ESP (i.e. plugin.esp and plugin.bsa) are automatically loaded and will have precedence over all loose files, the installation order you set up to the left is then ignored! @@ -1772,61 +1769,61 @@ p, li { white-space: pre-wrap; } - + Data - + refresh data-directory overview - + Refresh the overview. This may take a moment. - - - - + + + + Refresh - + This is an overview of your data directory as visible to the game (and tools). - + File - + Mod - - + + Filter the above list so that only conflicts are displayed. - + Show only conflicts - + Saves - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -1837,160 +1834,160 @@ p, li { white-space: pre-wrap; } - + Downloads - + Refresh downloads view - + This is a list of mods you downloaded from Nexus. Double click one to install it. You can also drag an archive into here. - + Show Hidden - + Tool Bar - + Install Mod - + Install &Mod - + Install a new mod from an archive - + Ctrl+M - + Profiles - + &Profiles - + Configure Profiles - + Ctrl+P - + Executables - + &Executables - + Configure the executables that can be started through Mod Organizer - + Ctrl+E - - + + Tools - + &Tools - + Ctrl+I - + Settings - + &Settings - + Configure settings and workarounds - + Ctrl+S - + Nexus - + Search nexus network for more mods - + Ctrl+N - - + + Update - + Mod Organizer is up-to-date - - + + No Problems - + This button will be highlighted if MO discovered potential problems in your setup and provide tips on how to fix them. !Work in progress! @@ -1998,39 +1995,39 @@ Right now this has very limited functionality - - + + Help - + Ctrl+H - + Endorse MO - - + + Endorse Mod Organizer - + Copy Log to Clipboard - + Change Game - + Open the Instance selection dialog to manage a different Game @@ -2055,790 +2052,790 @@ Right now this has very limited functionality - + Crash on exit - + MO crashed while exiting. Some settings may not be saved. Error: %1 - + Problems - + There are potential problems with your setup - + Everything seems to be in order - + Help on UI - + Documentation Wiki - + Report Issue - + Tutorials - + About - + About Qt - + Name - + Please enter a name for the new profile - + failed to create profile: %1 - + Show tutorial? - + You are starting Mod Organizer for the first time. Do you want to show a tutorial of its basic features? If you choose no you can always start the tutorial from the "Help"-menu. - + Downloads in progress - + There are still downloads in progress, do you really want to quit? - + Plugin "%1" failed: %2 - + Plugin "%1" failed - + Browse Mod Page - + Also in: <br> - + No conflict - + <Edit...> - + This bsa is enabled in the ini file so it may be required! - + Activating Network Proxy - + Notice: Your current MO version (%1) is lower than the previous version (%2).<br>The GUI may not downgrade gracefully, so you may experience oddities.<br>However, there should be no serious issues. - + Choose Mod - + Mod Archive - + Start Tutorial? - + You're about to start a tutorial. For technical reasons it's not possible to end the tutorial early. Continue? - + failed to spawn notepad.exe: %1 - + failed to change origin name: %1 - + failed to move "%1" from mod "%2" to "%3": %4 - + <Contains %1> - + <Checked> - + <Unchecked> - + <Update> - + <Mod Backup> - + <Managed by MO> - + <Managed outside MO> - + <No category> - + <Conflicted> - + <Not Endorsed> - + failed to rename mod: %1 - + Overwrite? - + This will replace the existing mod "%1". Continue? - + failed to remove mod "%1" - - - + + + failed to rename "%1" to "%2" - - - - + + + + Confirm - + Remove the following mods?<br><ul>%1</ul> - + failed to remove mod: %1 - - - + + + Failed - + Installation file no longer exists - + Mods installed with old versions of MO can't be reinstalled in this way. - + Failed to create backup. - + You need to be logged in with Nexus to resume a download - - + + You need to be logged in with Nexus to endorse - + Failed to display overwrite dialog: %1 - + Nexus ID for this Mod is unknown - + Web page for this mod is unknown - - - + + + Create Mod... - + This will create an empty mod. Please enter a name: - - + + A mod with this name already exists - + Create Separator... - + This will create a new separator. Please enter a name: - + A separator with this name already exists - + This will move all files from overwrite into a new, regular mod. Please enter a name: - - + + Are you sure? - + About to recursively delete: - + Not logged in, endorsement information will be wrong - + Continue? - + The versioning scheme decides which version is considered newer than another. This function will guess the versioning scheme under the assumption that the installed version is outdated. - - + + Sorry - + I don't know a versioning scheme where %1 is newer than %2. - + Really enable all visible mods? - + Really disable all visible mods? - + Export to csv - + CSV (Comma Separated Values) is a format that can be imported in programs like Excel to create a spreadsheet. You can also use online editors and converters instead. - + Select what mods you want export: - + All installed mods - + Only active (checked) mods from your current profile - + All currently visible mods in the mod list - + Choose what Columns to export: - + Mod_Priority - + Mod_Name - + Mod_Status - + Primary_Category - + Nexus_ID - + Mod_Nexus_URL - + Mod_Version - + Install_Date - + Download_File_Name - + export failed: %1 - + Open Game folder - + Open MyGames folder - + Open INIs folder - + Open Instance folder - + Open Mods folder - + Open Profile folder - + Open Downloads folder - + Open MO2 Install folder - + Open MO2 Plugins folder - + Open MO2 Logs folder - + Install Mod... - + Create empty mod - + Create Separator - + Enable all visible - + Disable all visible - + Check all for update - + Export to csv... - - + + Send to - - + + Top - - + + Bottom - - + + Priority... - + Separator... - + All Mods - + Sync to Mods... - + Clear Overwrite... - - + + Open in Explorer - + Restore Backup - + Remove Backup... - - + + Change Categories - - + + Primary Category - + Rename Separator... - + Remove Separator... - + Select Color... - + Reset Color - + Change versioning scheme - + Un-ignore update - + Ignore update - - + + Enable selected - - + + Disable selected - + Rename Mod... - + Reinstall Mod - + Remove Mod... - + Un-Endorse - - + + Endorse - + Won't endorse - + Endorsement state unknown - + Ignore missing data - + Mark as converted/working - + Visit on Nexus - + Visit web page - + Information... - - + + Exception: - - + + Unknown exception - + <All> - + <Multiple> - + %1 more - + Are you sure you want to remove the following %n save(s)?<br><ul>%1</ul><br>Removed saves will be sent to the Recycle Bin. @@ -2846,12 +2843,12 @@ You can also use online editors and converters instead. - + Enable Mods... - + Delete %n save(s) @@ -2859,22 +2856,22 @@ You can also use online editors and converters instead. - + failed to remove %1 - + failed to create %1 - + Restarting MO - + Changing the managed game directory requires restarting MO. Any pending downloads will be paused. @@ -2882,335 +2879,335 @@ Click OK to restart MO now. - + Can't change download directory while downloads are in progress! - + failed to write to file %1 - + %1 written - + Select binary - + Binary - + Enter Name - + Please enter a name for the executable - + Not an executable - + This is not a recognized executable. - - + + Replace file? - + There already is a hidden version of this file. Replace it? - - + + File operation failed - - + + Failed to remove "%1". Maybe you lack the required file permissions? - + There already is a visible version of this file. Replace it? - - + + Set Priority - + Set the priority of the selected plugins - + file not found: %1 - + failed to generate preview for %1 - + Sorry, can't preview anything. This function currently does not support extracting from bsas. - + Update available - + Open/Execute - + Add as Executable - + Preview - + Un-Hide - + Hide - + Write To File... - + Do you want to endorse Mod Organizer on %1 now? - + Thank you! - + Thank you for your endorsement! - + Request to Nexus failed: %1 - - + + failed to read %1: %2 - - + + Error - + failed to extract %1 (errorcode %2) - + Extract BSA - + This archive contains invalid hashes. Some files may be broken. - + Extract... - + This will restart MO, continue? - + Edit Categories... - + Deselect filter - + Remove - + Enable all - + Disable all - + Unlock load order - + Lock load order - + Open Origin in Explorer - + Open Origin Info... - + depends on missing "%1" - + incompatible with "%1" - + Please wait while LOOT is running - + loot failed. Exit code was: %1 - + failed to start loot - + failed to run loot: %1 - + Errors occured - + Backup of load order created - + Choose backup to restore - + No Backups - + There are no backups to restore - - + + Restore failed - - + + Failed to restore the backup. Errorcode: %1 - + Backup of modlist created - + A file with the same name has already been downloaded. What would you like to do? - + Overwrite - + Rename new file - + Ignore file - + Set the priority of the selected mods @@ -4079,7 +4076,7 @@ p, li { white-space: pre-wrap; } - Alternate game source + This mod targets a different game @@ -4118,123 +4115,123 @@ p, li { white-space: pre-wrap; } - + drag&drop failed: %1 - + Confirm - + Are you sure you want to remove "%1"? - + Flags - + Content - + Mod Name - + Version - + Priority - + Category - + Source Game - + Nexus ID - + Installation - + Notes - - + + unknown - + Name of your mods - + Version of the mod (if available) - + Installation priority of your mod. The higher, the more "important" it is and thus overwrites files from mods with lower priority. - + Category of the mod. - + The source game which was the origin of this mod. - + Id of the mod as used on Nexus. - + Emblemes to highlight things that might require attention. - + Depicts the content of the mod:<br><table cellspacing=7><tr><td><img src=":/MO/gui/content/plugin" width=32/></td><td>Game plugins (esp/esm/esl)</td></tr><tr><td><img src=":/MO/gui/content/interface" width=32/></td><td>Interface</td></tr><tr><td><img src=":/MO/gui/content/mesh" width=32/></td><td>Meshes</td></tr><tr><td><img src=":/MO/gui/content/bsa" width=32/></td><td>BSA</td></tr><tr><td><img src=":/MO/gui/content/texture" width=32/></td><td>Textures</td></tr><tr><td><img src=":/MO/gui/content/sound" width=32/></td><td>Sounds</td></tr><tr><td><img src=":/MO/gui/content/music" width=32/></td><td>Music</td></tr><tr><td><img src=":/MO/gui/content/string" width=32/></td><td>Strings</td></tr><tr><td><img src=":/MO/gui/content/script" width=32/></td><td>Scripts (Papyrus)</td></tr><tr><td><img src=":/MO/gui/content/skse" width=32/></td><td>Script Extender plugins</td></tr><tr><td><img src=":/MO/gui/content/skyproc" width=32/></td><td>SkyProc Patcher</td></tr><tr><td><img src=":/MO/gui/content/menu" width=32/></td><td>Mod Configuration Menu</td></tr><tr><td><img src=":/MO/gui/content/inifile" width=32/></td><td>INI files</td></tr><tr><td><img src=":/MO/gui/content/modgroup" width=32/></td><td>ModGroup files</td></tr></table> - + Time this mod was installed - + User notes about the mod @@ -4242,7 +4239,7 @@ p, li { white-space: pre-wrap; } ModListSortProxy - + Drag&Drop is only supported when sorting by priority @@ -4361,182 +4358,182 @@ p, li { white-space: pre-wrap; } - - + + Download started - + Download failed - - + + Installation successful - - + + Configure Mod - - + + This mod contains ini tweaks. Do you want to configure them now? - - + + mod "%1" not found - - + + Installation cancelled - - + + The mod was not installed completely. - + Executable "%1" not found - + Start Steam? - + Steam is required to be running already to correctly start the game. Should MO try to start steam now? - + Error - + Windows Event Log Error - + The Windows Event Log service is disabled and/or not running. This prevents USVFS from running properly. Your mods may not be working in the executable that you are launching. Note that you may have to restart MO and/or your PC after the service is fixed. Continue launching %1? - + Blacklisted Executable - + The executable you are attempted to launch is blacklisted in the virtual file system. This will likely prevent the executable, and any executables that are launched by this one, from seeing any mods. This could extend to INI files, save games and any other virtualized files. Continue launching %1? - + No profile set - + Failed to refresh list of esps: %1 - + Multiple esps/esls activated, please check that they don't conflict. - + Download? - + A download has been started but no installed page plugin recognizes it. If you download anyway no information (i.e. version) will be associated with the download. Continue? - + failed to update mod list: %1 - - + + login successful - + Login failed - + Login failed, try again? - + login failed: %1. Download will not be associated with an account - + login failed: %1 - + login failed: %1. You need to log-in with Nexus to update MO. - + MO1 "Script Extender" load mechanism has left hook.dll in your game folder - - + + Description missing - + <a href="%1">hook.dll</a> has been found in your game folder (right click to copy the full path). This is most likely a leftover of setting the ModOrganizer 1 load mechanism to "Script Extender", in which case you must remove this file either by changing the load mechanism in ModOrganizer 1 or manually removing the file, otherwise the game is likely to crash and burn. - + failed to save load order: %1 - + The designated write target "%1" is not enabled. @@ -4714,63 +4711,63 @@ Continue? - - + + <b>Origin</b>: %1 - + <br><b><i>This plugin can't be disabled (enforced by the game).</i></b> - + Author - + Description - + Missing Masters - + Enabled Masters - + Loads Archives - + There are Archives connected to this plugin. Their assets will be added to your game, overwriting in case of conflicts following the plugin order. Loose files will always overwrite assets from Archives. (This flag only checks for Archives from the same mod as the plugin) - + Loads INI settings - + There is an ini file connected to this plugin. Its settings will be added to your game settings, overwriting in case of conflicts. - + This ESP is flagged as an ESL. It will adhere to the ESP load order but the records will be loaded in ESL space. - + failed to restore load order for %1 @@ -5170,7 +5167,7 @@ p, li { white-space: pre-wrap; } - + Error @@ -5490,7 +5487,7 @@ If the folder was still in use, restart MO and try again. - + Failed to create "%1". Your user account probably lacks permission. @@ -5547,18 +5544,18 @@ If the folder was still in use, restart MO and try again. - + Please use "Help" from the toolbar to get usage instructions to all elements - - + + <Manage...> - + failed to parse profile %1: %2 -- cgit v1.3.1 From fecb66f66b651daf6bc9b092e5e14c3efd2a82cc Mon Sep 17 00:00:00 2001 From: Al Date: Wed, 26 Dec 2018 15:49:00 +0100 Subject: Added "Visible" counters for modlist. Improved counters tool tip view. --- src/mainwindow.cpp | 62 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 15 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 3e8323e5..1e51977f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -367,6 +367,7 @@ MainWindow::MainWindow(QSettings &initSettings connect(ui->modList->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(modlistSelectionChanged(QModelIndex,QModelIndex))); connect(m_ModListSortProxy, SIGNAL(filterActive(bool)), this, SLOT(modFilterActive(bool))); + connect(m_ModListSortProxy, SIGNAL(layoutChanged()), this, SLOT(updateModCount())); connect(ui->modFilterEdit, SIGNAL(textChanged(QString)), m_ModListSortProxy, SLOT(updateFilter(QString))); connect(ui->espFilterEdit, SIGNAL(textChanged(QString)), m_PluginListSortProxy, SLOT(updateFilter(QString))); @@ -3110,10 +3111,15 @@ void MainWindow::searchClear_activated() void MainWindow::updateModCount() { int activeCount = 0; + int visActiveCount = 0; int backupCount = 0; + int visBackupCount = 0; int foreignCount = 0; + int visForeignCount = 0; int separatorCount = 0; + int visSeparatorCount = 0; int regularCount = 0; + int visRegularCount = 0; QStringList allMods = m_OrganizerCore.modList()->allMods(); @@ -3121,15 +3127,29 @@ void MainWindow::updateModCount() return std::find(flags.begin(), flags.end(), filter) != flags.end(); }; + bool isEnabled; + bool isVisible; for (QString mod : allMods) { int modIndex = ModInfo::getIndex(mod); ModInfo::Ptr modInfo = ModInfo::getByIndex(modIndex); std::vector modFlags = modInfo->getFlags(); + isEnabled = m_OrganizerCore.currentProfile()->modEnabled(modIndex); + isVisible = m_ModListSortProxy->filterMatchesMod(modInfo, isEnabled); + for (auto flag : modFlags) { switch (flag) { - case ModInfo::FLAG_BACKUP: backupCount++; break; - case ModInfo::FLAG_FOREIGN: foreignCount++; break; - case ModInfo::FLAG_SEPARATOR: separatorCount++; break; + case ModInfo::FLAG_BACKUP: backupCount++; + if (isVisible) + visBackupCount++; + break; + case ModInfo::FLAG_FOREIGN: foreignCount++; + if (isVisible) + visForeignCount++; + break; + case ModInfo::FLAG_SEPARATOR: separatorCount++; + if (isVisible) + visSeparatorCount++; + break; } } @@ -3137,24 +3157,35 @@ void MainWindow::updateModCount() !hasFlag(modFlags, ModInfo::FLAG_FOREIGN) && !hasFlag(modFlags, ModInfo::FLAG_SEPARATOR) && !hasFlag(modFlags, ModInfo::FLAG_OVERWRITE)) { - if (m_OrganizerCore.currentProfile()->modEnabled(modIndex)) + if (isEnabled) { activeCount++; + if (isVisible) + visActiveCount++; + } + if (isVisible) + visRegularCount++; regularCount++; } } ui->activeModsCounter->display(activeCount); - ui->activeModsCounter->setToolTip(tr("" - "" - "" - "" - "" + ui->activeModsCounter->setToolTip(tr("
Active mods: %1 of %2
Unmanaged mods/DLC: %3
Mod backups: %4
Separators: %5
" + "" + "" + "" + "" + "" "
TypeAllVisible
Enabled mods: %1 / %2%3 / %4
Unmanaged/DLCs: %5%6
Mod backups: %7%8
Separators: %9%10
") .arg(activeCount) .arg(regularCount) + .arg(visActiveCount) + .arg(visRegularCount) .arg(foreignCount) + .arg(visForeignCount) .arg(backupCount) + .arg(visBackupCount) .arg(separatorCount) + .arg(visSeparatorCount) ); } @@ -3187,12 +3218,13 @@ void MainWindow::updatePluginCount() int totalCount = masterCount + lightMasterCount + regularCount; ui->activePluginsCounter->display(activeCount); - ui->activePluginsCounter->setToolTip(tr("" - "" - "" - "" - "" - "" + ui->activePluginsCounter->setToolTip(tr("
Active plugins: %1 of %2
Active ESMs: %3 of %4
Active ESLs: %5 of %6
Active ESPs: %7 of %8
Active ESMs+ESPs: %9 of %10
" + "" + "" + "" + "" + "" + "" "
TypeActiveTotal
Active plugins:%1%2
Active ESMs:%3%4
Active ESPs:%7%8
Active ESMs+ESPs:%9%10
Active ESLs:%5%6
") .arg(activeCount).arg(totalCount) .arg(activeMasterCount).arg(masterCount) -- cgit v1.3.1 From bbed72c6a358c2cab807ad8e01839a5381ba85c1 Mon Sep 17 00:00:00 2001 From: Al Date: Thu, 27 Dec 2018 01:07:08 +0100 Subject: *Made clear Filters button clear also the nameEdit filter --- src/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 1e51977f..9969c0d5 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -795,6 +795,7 @@ void MainWindow::createHelpWidget() void MainWindow::modFilterActive(bool filterActive) { + ui->clearFiltersButton->setVisible(filterActive); if (filterActive) { // m_OrganizerCore.modList()->setOverwriteMarkers(std::set(), std::set()); ui->modList->setStyleSheet("QTreeView { border: 2px ridge #f00; }"); @@ -4400,8 +4401,6 @@ void MainWindow::on_categoriesList_itemSelectionChanged() m_ModListSortProxy->setCategoryFilter(categories); m_ModListSortProxy->setContentFilter(content); ui->clickBlankButton->setEnabled(categories.size() > 0 || content.size() >0); - //ui->clearFiltersButton->setStyleSheet("border:5px solid #ff0000;"); - ui->clearFiltersButton->setVisible(categories.size() > 0 || content.size() > 0); if (indices.count() == 0) { ui->currentCategoryLabel->setText(QString("(%1)").arg(tr(""))); @@ -6190,6 +6189,7 @@ void MainWindow::on_clickBlankButton_clicked() void MainWindow::on_clearFiltersButton_clicked() { + ui->modFilterEdit->clear(); deselectFilters(); } -- cgit v1.3.1 From 4cc371ab8443b620fd05740eeec9e25ab2cec4d5 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Thu, 27 Dec 2018 02:50:04 -0600 Subject: Modify active counters based on filters --- src/mainwindow.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 9969c0d5..c4c007f8 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -799,10 +799,13 @@ void MainWindow::modFilterActive(bool filterActive) if (filterActive) { // m_OrganizerCore.modList()->setOverwriteMarkers(std::set(), std::set()); ui->modList->setStyleSheet("QTreeView { border: 2px ridge #f00; }"); + ui->activeModsCounter->setStyleSheet("QLCDNumber { border: 2px ridge #f00; }"); } else if (ui->groupCombo->currentIndex() != 0) { ui->modList->setStyleSheet("QTreeView { border: 2px ridge #337733; }"); + ui->activeModsCounter->setStyleSheet(""); } else { ui->modList->setStyleSheet(""); + ui->activeModsCounter->setStyleSheet(""); } } @@ -810,9 +813,12 @@ void MainWindow::espFilterChanged(const QString &filter) { if (!filter.isEmpty()) { ui->espList->setStyleSheet("QTreeView { border: 2px ridge #f00; }"); + ui->activePluginsCounter->setStyleSheet("QLCDNumber { border: 2px ridge #f00; }"); } else { ui->espList->setStyleSheet(""); + ui->activePluginsCounter->setStyleSheet(""); } + updatePluginCount(); } void MainWindow::downloadFilterChanged(const QString &filter) @@ -3169,7 +3175,11 @@ void MainWindow::updateModCount() } } - ui->activeModsCounter->display(activeCount); + if (m_ModListSortProxy->isFilterActive()) { + ui->activeModsCounter->display(visActiveCount); + } else { + ui->activeModsCounter->display(activeCount); + } ui->activeModsCounter->setToolTip(tr("" "" "" @@ -3198,27 +3208,37 @@ void MainWindow::updatePluginCount() int masterCount = 0; int lightMasterCount = 0; int regularCount = 0; + int activeVisibleCount = 0; PluginList *list = m_OrganizerCore.pluginList(); + QString filter = ui->espFilterEdit->text(); for (QString plugin : list->pluginNames()) { bool active = list->isEnabled(plugin); + bool visible = plugin.contains(filter, Qt::CaseInsensitive); if (list->isMaster(plugin)) { masterCount++; activeMasterCount += active; + activeVisibleCount += visible && active; } else if (list->isLight(plugin) || list->isLightFlagged(plugin)) { lightMasterCount++; activeLightMasterCount += active; + activeVisibleCount += visible && active; } else { regularCount++; activeRegularCount += active; + activeVisibleCount += visible && active; } } int activeCount = activeMasterCount + activeLightMasterCount + activeRegularCount; int totalCount = masterCount + lightMasterCount + regularCount; - ui->activePluginsCounter->display(activeCount); + if (!filter.isEmpty()) { + ui->activePluginsCounter->display(activeVisibleCount); + } else { + ui->activePluginsCounter->display(activeCount); + } ui->activePluginsCounter->setToolTip(tr("
TypeAllVisible
Enabled mods: %1 / %2%3 / %4
" "" "" -- cgit v1.3.1 From b397e0bc5d16de286075b09f2c95b3d059f9368b Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Thu, 27 Dec 2018 04:37:23 -0600 Subject: Simplify code for visible counter changes --- src/mainwindow.cpp | 14 +++----------- src/pluginlistsortproxy.cpp | 10 ++++++++-- src/pluginlistsortproxy.h | 2 ++ 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index c4c007f8..d11bf4b4 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3175,11 +3175,7 @@ void MainWindow::updateModCount() } } - if (m_ModListSortProxy->isFilterActive()) { - ui->activeModsCounter->display(visActiveCount); - } else { - ui->activeModsCounter->display(activeCount); - } + ui->activeModsCounter->display(visActiveCount); ui->activeModsCounter->setToolTip(tr("
TypeActiveTotal
Active plugins:%1%2
" "" "" @@ -3215,7 +3211,7 @@ void MainWindow::updatePluginCount() for (QString plugin : list->pluginNames()) { bool active = list->isEnabled(plugin); - bool visible = plugin.contains(filter, Qt::CaseInsensitive); + bool visible = m_PluginListSortProxy->filterMatchesPlugin(plugin); if (list->isMaster(plugin)) { masterCount++; activeMasterCount += active; @@ -3234,11 +3230,7 @@ void MainWindow::updatePluginCount() int activeCount = activeMasterCount + activeLightMasterCount + activeRegularCount; int totalCount = masterCount + lightMasterCount + regularCount; - if (!filter.isEmpty()) { - ui->activePluginsCounter->display(activeVisibleCount); - } else { - ui->activePluginsCounter->display(activeCount); - } + ui->activePluginsCounter->display(activeVisibleCount); ui->activePluginsCounter->setToolTip(tr("
TypeAllVisible
Enabled mods: %1 / %2%3 / %4
" "" "" diff --git a/src/pluginlistsortproxy.cpp b/src/pluginlistsortproxy.cpp index e09e64a5..1e131c4d 100644 --- a/src/pluginlistsortproxy.cpp +++ b/src/pluginlistsortproxy.cpp @@ -72,8 +72,7 @@ void PluginListSortProxy::updateFilter(const QString &filter) bool PluginListSortProxy::filterAcceptsRow(int row, const QModelIndex&) const { - return m_CurrentFilter.isEmpty() || - sourceModel()->data(sourceModel()->index(row, 0)).toString().contains(m_CurrentFilter, Qt::CaseInsensitive); + return filterMatchesPlugin(sourceModel()->data(sourceModel()->index(row, 0)).toString()); } @@ -137,3 +136,10 @@ bool PluginListSortProxy::dropMimeData(const QMimeData *data, Qt::DropAction act sourceIndex.parent()); } + +bool PluginListSortProxy::filterMatchesPlugin(const QString &plugin) const +{ + return m_CurrentFilter.isEmpty() || + plugin.contains(m_CurrentFilter, Qt::CaseInsensitive); +} + diff --git a/src/pluginlistsortproxy.h b/src/pluginlistsortproxy.h index 89f60e70..03b079e2 100644 --- a/src/pluginlistsortproxy.h +++ b/src/pluginlistsortproxy.h @@ -46,6 +46,8 @@ public: virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent); + bool filterMatchesPlugin(const QString &plugin) const; + public slots: void updateFilter(const QString &filter); -- cgit v1.3.1 From 66bf2ab5373e91c353a60ac13e0e24228d1aacd7 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Fri, 28 Dec 2018 01:04:44 -0600 Subject: Stop warning about missing English translations --- src/mainwindow.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d11bf4b4..d6f874f3 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -4679,11 +4679,9 @@ void MainWindow::installTranslator(const QString &name) QTranslator *translator = new QTranslator(this); QString fileName = name + "_" + m_CurrentLanguage; if (!translator->load(fileName, qApp->applicationDirPath() + "/translations")) { - if ((m_CurrentLanguage != "en-US") - && (m_CurrentLanguage != "en_US") - && (m_CurrentLanguage != "en-GB")) { + if (m_CurrentLanguage.compare("en", Qt::CaseInsensitive)) { qDebug("localization file %s not found", qPrintable(fileName)); - } // we don't actually expect localization files for english + } // we don't actually expect localization files for English } qApp->installTranslator(translator); -- cgit v1.3.1 From b82677fab1994a461e49787441aaa1e6c8eb49bd Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Fri, 28 Dec 2018 01:10:16 -0600 Subject: Fix warning about missing signal --- src/mainwindow.cpp | 16 ++++++++-------- src/mainwindow.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d6f874f3..5d8002bd 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -724,7 +724,7 @@ void MainWindow::createEndorseWidget() buttonMenu->addAction(endorseAction); QAction *wontEndorseAction = new QAction(tr("Won't Endorse"), buttonMenu); - connect(wontEndorseAction, SIGNAL(triggered()), this, SLOT(on_actionWontEndorseMO_triggered())); + connect(wontEndorseAction, SIGNAL(triggered()), this, SLOT(wontEndorse())); buttonMenu->addAction(wontEndorseAction); } @@ -5080,6 +5080,13 @@ void MainWindow::notEndorsedYet() } +void MainWindow::wontEndorse() +{ + Settings::instance().directInterface().setValue("wont_endorse_MO", true); + ui->actionEndorseMO->setVisible(false); +} + + void MainWindow::on_dataTree_customContextMenuRequested(const QPoint &pos) { QTreeWidget *dataTree = findChild("dataTree"); @@ -5141,13 +5148,6 @@ void MainWindow::on_actionEndorseMO_triggered() } -void MainWindow::on_actionWontEndorseMO_triggered() -{ - Settings::instance().directInterface().setValue("wont_endorse_MO", true); - ui->actionEndorseMO->setVisible(false); -} - - void MainWindow::updateDownloadListDelegate() { if (m_OrganizerCore.settings().compactDownloads()) { diff --git a/src/mainwindow.h b/src/mainwindow.h index b041b65e..d19cd6a4 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -483,6 +483,7 @@ private slots: void motdReceived(const QString &motd); void notEndorsedYet(); + void wontEndorse(); void originModified(int originID); @@ -601,7 +602,6 @@ private slots: // ui slots void on_actionSettings_triggered(); void on_actionUpdate_triggered(); void on_actionEndorseMO_triggered(); - void on_actionWontEndorseMO_triggered(); void on_bsaList_customContextMenuRequested(const QPoint &pos); void on_clearFiltersButton_clicked(); -- cgit v1.3.1 From eb50d0b44773f17fd8edccd557b7a2135c2cdb76 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Fri, 28 Dec 2018 20:13:31 -0600 Subject: Update counters when changing profiles --- src/mainwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5d8002bd..27ffc71e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1194,6 +1194,8 @@ void MainWindow::activateSelectedProfile() refreshSaveList(); m_OrganizerCore.refreshModList(); + updateModCount(); + updatePluginCount(); } void MainWindow::on_profileBox_currentIndexChanged(int index) -- cgit v1.3.1
TypeActiveTotal
Active plugins:%1%2