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.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mainwindow.h') 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.h') 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 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.h') 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 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.h') 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 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.h') 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 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.h') 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 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.h') 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 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.h') 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