Compare commits

...
31 Commits
Author SHA1 Message Date
Brian Munro 2232bdfc77 Merge pull request #497 from Modorganizer2/Develop
Fix possible crash during write to disk error
2018-08-22 06:38:34 +02:00
LostDragonist 258bddb6b7 Fix possible crash during write to disk error 2018-08-21 15:59:22 -05:00
Brian Munro 364289db72 Merge pull request #495 from Modorganizer2/Develop
Release 2.1.5
2018-08-21 12:23:47 +02:00
LostDragonist ef771fd8ca Fix disabled menu item styling in Paper Dark theme 2018-08-20 00:55:18 -05:00
LostDragonist 2060df1585 Detect errors when writing downloads to disk and cancel download 2018-08-19 16:33:34 -05:00
LostDragonist 9a973ccf5f Center profile deletion dialog on parent 2018-08-19 13:02:54 -05:00
LostDragonist a2eb3e0266 Prevent user from deleting currently active profile 2018-08-19 13:02:30 -05:00
LostDragonist d65031c814 Allow user to cancel VFS mapping 2018-08-16 22:40:17 -05:00
LostDragonist c27e718fbd Add "enable/disable selected" to mod list context menu 2018-08-16 14:32:28 -05:00
LostDragonist 43b2df9077 Add "enable/disable selected" to plugin list context menu 2018-08-16 13:58:44 -05:00
LostDragonist 79b2e52a58 Fix another instance of "Open in Explorer" 2018-08-16 08:35:19 -05:00
LostDragonist 16a7ef78d3 Change version to 2.1.5 2018-08-16 08:19:05 -05:00
LostDragonist 74202cc743 Dracula theme: Make disabled widgets darker than enabled widgets
Fix by Kob, author of the Paper themes.
2018-08-16 01:29:01 -05:00
LostDragonist 8f86130759 Correct file category when manually querying info
The Nexus API appears to have been changed back in July 2018 to match what MO was expecting without the conversion.
2018-08-15 11:53:33 -05:00
LostDragonist 17e4ec7b13 Fix selecting the active profile when opening the profiles dialog 2018-08-12 19:59:54 -05:00
LostDragonist 9a426a2474 Revert "Improve robustness of endorsement checks"
This reverts commit fc8a6b358f.
2018-08-12 12:33:22 -05:00
LostDragonist 80594d6e1a Set toolbar widget names later to catch the problems and update widgets 2018-08-12 12:13:47 -05:00
Al12rs 56473e0ec8 Updated "Thanks". 2018-08-07 19:57:23 +02:00
LostDragonist 71988e386c Modify dark and dracula stylesheets to allow text colors on download widgets 2018-08-06 21:40:59 -05:00
LostDragonist 5e7c0fddf0 Update Paper themes by 6788-00 to version 3.0.1 2018-08-06 21:37:05 -05:00
Al12rs b0c15c9cfb Added Open File option to downloads tab. 2018-08-06 20:17:57 +02:00
Al12rs f92027bea6 Merge PR 2018-08-06 19:54:45 +02:00
Al a31b5495b8 Merge pull request #469 from Freso/minor-fixups
A couple of minor fixes
2018-08-06 16:13:18 +02:00
Frederik “Freso” S. Olesen fc19486f53 Fix capitalisation of "Explorer"
1. Explorer is a specific program, so it should be treated as a proper
   noun, and thus capitalised.
2. Other menu items in the same menu are Title Cases, so it looks out of
   place that this item is not.
2018-08-06 15:17:23 +02:00
Frederik “Freso” S. Olesen 232bbfb23b Fix DownloadManager::openInDownloadsFolder error message 2018-08-06 13:23:28 +02:00
Frederik “Freso” S. Olesen 2af99f2170 Clean up DownloadManager::openFile 2018-08-06 13:21:08 +02:00
Frederik “Freso” S. Olesen 796224d733 Add new "Open File" right-click dialog for Downloads
This enables the user to directly open the downloaded archived/file
which can be useful for e.g., inspection of what's inside or if they
need to copy files from inside the archive to somewhere else. Saves a
step compared to "Show in Folder" and then opening the file.
2018-08-06 12:21:02 +02:00
LostDragonist 1e4b5d2436 Set the names of the toolbar widgets to allow styling
QToolButton#foo where foo is one of:
  actionChange_Game
  actionInstallMod
  actionNexus
  actionAdd_Profile
  actionModify_Executables
  actionTool
  actionSettings
  seperator
  actionEndorseMO
  actionProblems
  actionUpdate
  actionHelp
2018-08-05 15:56:39 -05:00
LostDragonist 94ef8dffbc List load order backups from most recent to oldest 2018-08-04 22:16:39 -05:00
LePresidente 7b1821a518 Reverted bad commit, should of removed VS_FF_PRERELEASE 2018-08-04 11:24:49 +02:00
LePresidente fb0d4d5e5a use VER_FILEVERSION_STR instead of VER_FILEVERSION so pre-alpha is not shown 2018-08-04 10:35:56 +02:00
24 changed files with 855 additions and 528 deletions
+6 -1
View File
@@ -189,6 +189,11 @@
<property name="text">
<string notr="true">Silarn</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">LostDragonist</string>
</property>
</item>
</widget>
</item>
@@ -208,7 +213,7 @@
</property>
<item>
<property name="text">
<string notr="true">AnyOldName3 (Python Plugins)</string>
<string notr="true">AnyOldName3</string>
</property>
</item>
</widget>
+6
View File
@@ -272,6 +272,11 @@ void DownloadListWidgetDelegate::issueVisitOnNexus()
emit visitOnNexus(m_ContextRow);
}
void DownloadListWidgetDelegate::issueOpenFile()
{
emit openFile(m_ContextRow);
}
void DownloadListWidgetDelegate::issueOpenInDownloadsFolder()
{
emit openInDownloadsFolder(m_ContextRow);
@@ -375,6 +380,7 @@ bool DownloadListWidgetDelegate::editorEvent(QEvent *event, QAbstractItemModel *
menu.addAction(tr("Visit on Nexus"), this,SLOT(issueVisitOnNexus()));
}
menu.addAction(tr("Open File"), this, SLOT(issueOpenFile()));
menu.addAction(tr("Show in Folder"), this, SLOT(issueOpenInDownloadsFolder()));
menu.addSeparator();
+2
View File
@@ -72,6 +72,7 @@ signals:
void pauseDownload(int index);
void resumeDownload(int index);
void visitOnNexus(int index);
void openFile(int index);
void openInDownloadsFolder(int index);
protected:
@@ -93,6 +94,7 @@ private slots:
void issueRestoreToView();
void issueRestoreToViewAll();
void issueVisitOnNexus();
void issueOpenFile();
void issueOpenInDownloadsFolder();
void issueCancel();
void issuePause();
+6
View File
@@ -247,6 +247,11 @@ void DownloadListWidgetCompactDelegate::issueVisitOnNexus()
emit visitOnNexus(m_ContextIndex.row());
}
void DownloadListWidgetCompactDelegate::issueOpenFile()
{
emit openFile(m_ContextIndex.row());
}
void DownloadListWidgetCompactDelegate::issueOpenInDownloadsFolder()
{
emit openInDownloadsFolder(m_ContextIndex.row());
@@ -361,6 +366,7 @@ bool DownloadListWidgetCompactDelegate::editorEvent(QEvent *event, QAbstractItem
}else {
menu.addAction(tr("Visit on Nexus"), this, SLOT(issueVisitOnNexus()));
}
menu.addAction(tr("Open File"), this, SLOT(issueOpenFile()));
menu.addAction(tr("Show in Folder"), this, SLOT(issueOpenInDownloadsFolder()));
menu.addSeparator();
menu.addAction(tr("Delete"), this, SLOT(issueDelete()));
+2
View File
@@ -70,6 +70,7 @@ signals:
void pauseDownload(int index);
void resumeDownload(int index);
void visitOnNexus(int index);
void openFile(int index);
void openInDownloadsFolder(int index);
protected:
@@ -92,6 +93,7 @@ private slots:
void issueRestoreToView();
void issueRestoreToViewAll();
void issueVisitOnNexus();
void issueOpenFile();
void issueOpenInDownloadsFolder();
void issueCancel();
void issuePause();
+41 -22
View File
@@ -703,7 +703,7 @@ void DownloadManager::removeDownload(int index, bool deleteFile)
DownloadState minState;
if (index == -3) {
minState = STATE_UNINSTALLED;
}
}
else
minState = index == -1 ? STATE_READY : STATE_INSTALLED;
@@ -804,8 +804,10 @@ void DownloadManager::resumeDownloadInt(int index)
if (info->isPausedState() || info->m_State == STATE_PAUSING) {
if (info->m_State == STATE_PAUSING) {
if (info->m_Output.isOpen()) {
info->m_Output.write(info->m_Reply->readAll());
setState(info, STATE_PAUSED);
writeData(info);
if (info->m_State == STATE_PAUSING) {
setState(info, STATE_PAUSED);
}
}
}
if ((info->m_Urls.size() == 0)
@@ -927,10 +929,27 @@ void DownloadManager::visitOnNexus(int index)
}
}
void DownloadManager::openFile(int index)
{
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
reportError(tr("OpenFile: invalid download index %1").arg(index));
return;
}
QDir path = QDir(m_OutputDirectory);
if (path.exists(getFileName(index))) {
::ShellExecuteW(nullptr, L"open", ToWString(QDir::toNativeSeparators(getFilePath(index))).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
return;
}
::ShellExecuteW(nullptr, L"explore", ToWString(QDir::toNativeSeparators(m_OutputDirectory)).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
return;
}
void DownloadManager::openInDownloadsFolder(int index)
{
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
reportError(tr("VisitNexus: invalid download index %1").arg(index));
reportError(tr("OpenFileInDownloadsFolder: invalid download index %1").arg(index));
return;
}
QString params = "/select,\"";
@@ -1345,10 +1364,7 @@ void DownloadManager::downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
void DownloadManager::downloadReadyRead()
{
try {
DownloadInfo *info = findDownload(this->sender());
if (info != nullptr) {
info->m_Output.write(info->m_Reply->readAll());
}
writeData(findDownload(this->sender()));
} catch (const std::bad_alloc&) {
reportError(tr("Memory allocation error (in processing downloaded data)."));
}
@@ -1428,18 +1444,6 @@ QDateTime DownloadManager::matchDate(const QString &timeString)
}
static EFileCategory convertFileCategory(int id)
{
// TODO: need to handle file categories in the mod page plugin
switch (id) {
case 0: return TYPE_MAIN;
case 1: return TYPE_UPDATE;
case 2: return TYPE_OPTION;
default: return TYPE_MAIN;
}
}
void DownloadManager::nxmFilesAvailable(QString, int, QVariant userData, QVariant resultData, int requestID)
{
std::set<int>::iterator idIter = m_RequestIDs.find(requestID);
@@ -1476,7 +1480,7 @@ void DownloadManager::nxmFilesAvailable(QString, int, QVariant userData, QVarian
if (!info->m_FileInfo->version.isValid()) {
info->m_FileInfo->version = info->m_FileInfo->newestVersion;
}
info->m_FileInfo->fileCategory = convertFileCategory(fileInfo["category_id"].toInt());
info->m_FileInfo->fileCategory = fileInfo["category_id"].toInt();
info->m_FileInfo->fileTime = matchDate(fileInfo["date"].toString());
info->m_FileInfo->fileID = fileInfo["id"].toInt();
info->m_FileInfo->fileName = fileInfo["uri"].toString();
@@ -1501,7 +1505,7 @@ void DownloadManager::nxmFilesAvailable(QString, int, QVariant userData, QVarian
QVariantMap fileInfo = selection.getChoiceData().toMap();
info->m_FileInfo->name = fileInfo["name"].toString();
info->m_FileInfo->version.parse(fileInfo["version"].toString());
info->m_FileInfo->fileCategory = convertFileCategory(fileInfo["category_id"].toInt());
info->m_FileInfo->fileCategory = fileInfo["category_id"].toInt();
info->m_FileInfo->fileID = fileInfo["id"].toInt();
} else {
emit showMessage(tr("No matching file found on Nexus! Maybe this file is no longer available or it was renamed?"));
@@ -1835,3 +1839,18 @@ void DownloadManager::checkDownloadTimeout()
}
}
}
void DownloadManager::writeData(DownloadInfo *info)
{
if (info != nullptr) {
qint64 ret = info->m_Output.write(info->m_Reply->readAll());
if (ret < info->m_Reply->size()) {
QString fileName = info->m_FileName; // m_FileName may be destroyed after setState
setState(info, DownloadState::STATE_CANCELED);
qCritical(QString("Unable to write download \"%2\" to drive (return %1)").arg(ret).arg(info->m_FileName).toLocal8Bit());
reportError(tr("Unable to write download to drive (return %1).\n"
"Check the drive's available storage.\n\n"
"Canceling download \"%2\"...").arg(ret).arg(fileName));
}
}
}
+4
View File
@@ -445,6 +445,8 @@ public slots:
void visitOnNexus(int index);
void openFile(int index);
void openInDownloadsFolder(int index);
void nxmDescriptionAvailable(QString gameName, int modID, QVariant userData, QVariant resultData, int requestID);
@@ -522,6 +524,8 @@ private:
static QString getFileTypeString(int fileType);
void writeData(DownloadInfo *info);
private:
static const int AUTOMATIC_RETRIES = 3;
+54 -11
View File
@@ -162,6 +162,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <boost/algorithm/string.hpp>
#include <boost/bind.hpp>
#include <boost/assign.hpp>
#include <boost/range/adaptor/reversed.hpp>
#endif
#include <shlobj.h>
@@ -440,6 +441,11 @@ MainWindow::MainWindow(QSettings &initSettings
refreshExecutablesList();
updateToolBar();
for (QAction *action : ui->toolBar->actions()) {
// set the name of the widget to the name of the action to allow styling
ui->toolBar->widgetForAction(action)->setObjectName(action->objectName());
}
}
@@ -1955,8 +1961,7 @@ void MainWindow::on_actionInstallMod_triggered()
void MainWindow::on_actionAdd_Profile_triggered()
{
for (;;) {
//Note: Calling this with an invalid profile name. Not quite sure why
ProfilesDialog profilesDialog(m_OrganizerCore.managedGame()->gameDirectory().absolutePath(),
ProfilesDialog profilesDialog(m_OrganizerCore.currentProfile()->name(),
m_OrganizerCore.managedGame(),
this);
// workaround: need to disable monitoring of the saves directory, otherwise the active
@@ -3557,7 +3562,7 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos)
menu->addAction(tr("Create Mod..."), this, SLOT(createModFromOverwrite()));
menu->addAction(tr("Clear Overwrite..."), this, SLOT(clearOverwrite()));
}
menu->addAction(tr("Open in explorer"), this, SLOT(openExplorer_clicked()));
menu->addAction(tr("Open in Explorer"), this, SLOT(openExplorer_clicked()));
} else if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_BACKUP) != flags.end()) {
menu->addAction(tr("Restore Backup"), this, SLOT(restoreBackup_clicked()));
menu->addAction(tr("Remove Backup..."), this, SLOT(removeMod_clicked()));
@@ -3592,13 +3597,19 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos)
menu->addAction(tr("Ignore update"), this, SLOT(ignoreUpdate()));
}
}
menu->addSeparator();
menu->addAction(tr("Enable selected"), this, SLOT(enableSelectedMods_clicked()));
menu->addAction(tr("Disable selected"), this, SLOT(disableSelectedMods_clicked()));
menu->addSeparator();
menu->addAction(tr("Rename Mod..."), this, SLOT(renameMod_clicked()));
menu->addAction(tr("Reinstall Mod"), this, SLOT(reinstallMod_clicked()));
menu->addAction(tr("Remove Mod..."), this, SLOT(removeMod_clicked()));
menu->addAction(tr("Remove Mod..."), this, SLOT(removeMod_clicked()));
menu->addSeparator();
menu->addSeparator();
if (info->getNexusID() > 0) {
switch (info->endorsedState()) {
@@ -3637,7 +3648,7 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos)
menu->addAction(tr("Visit web page"), this, SLOT(visitWebPage_clicked()));
}
menu->addAction(tr("Open in explorer"), this, SLOT(openExplorer_clicked()));
menu->addAction(tr("Open in Explorer"), this, SLOT(openExplorer_clicked()));
}
if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_FOREIGN) == flags.end()) {
@@ -4165,6 +4176,31 @@ void MainWindow::unhideFile()
}
}
void MainWindow::enableSelectedPlugins_clicked()
{
m_OrganizerCore.pluginList()->enableSelected(ui->espList->selectionModel());
}
void MainWindow::disableSelectedPlugins_clicked()
{
m_OrganizerCore.pluginList()->disableSelected(ui->espList->selectionModel());
}
void MainWindow::enableSelectedMods_clicked()
{
m_OrganizerCore.modList()->enableSelected(ui->modList->selectionModel());
}
void MainWindow::disableSelectedMods_clicked()
{
m_OrganizerCore.modList()->disableSelected(ui->modList->selectionModel());
}
void MainWindow::previewDataFile()
{
QString fileName = QDir::fromNativeSeparators(m_ContextItem->data(0, Qt::UserRole).toString());
@@ -4373,6 +4409,7 @@ void MainWindow::updateDownloadListDelegate()
connect(ui->downloadView->itemDelegate(), SIGNAL(installDownload(int)), &m_OrganizerCore, SLOT(installDownload(int)));
connect(ui->downloadView->itemDelegate(), SIGNAL(queryInfo(int)), m_OrganizerCore.downloadManager(), SLOT(queryInfo(int)));
connect(ui->downloadView->itemDelegate(), SIGNAL(visitOnNexus(int)), m_OrganizerCore.downloadManager(), SLOT(visitOnNexus(int)));
connect(ui->downloadView->itemDelegate(), SIGNAL(openFile(int)), m_OrganizerCore.downloadManager(), SLOT(openFile(int)));
connect(ui->downloadView->itemDelegate(), SIGNAL(openInDownloadsFolder(int)), m_OrganizerCore.downloadManager(), SLOT(openInDownloadsFolder(int)));
connect(ui->downloadView->itemDelegate(), SIGNAL(removeDownload(int, bool)), m_OrganizerCore.downloadManager(), SLOT(removeDownload(int, bool)));
connect(ui->downloadView->itemDelegate(), SIGNAL(restoreDownload(int)), m_OrganizerCore.downloadManager(), SLOT(restoreDownload(int)));
@@ -4410,8 +4447,7 @@ void MainWindow::nxmUpdatesAvailable(const std::vector<int> &modIDs, QVariant us
if (game
&& result["id"].toInt() == game->nexusModOrganizerID()
&& result["game_id"].toInt() == game->nexusGameID()) {
if (result["voted_by_user"].type() != QVariant::Invalid &&
!result["voted_by_user"].toBool()) {
if (!result["voted_by_user"].toBool()) {
ui->actionEndorseMO->setVisible(true);
}
} else {
@@ -4435,8 +4471,7 @@ void MainWindow::nxmUpdatesAvailable(const std::vector<int> &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["voted_by_user"].type() != QVariant::Invalid) {
result.contains("voted_by_user")) {
// 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());
}
@@ -4757,6 +4792,11 @@ void MainWindow::on_espList_customContextMenuRequested(const QPoint &pos)
m_ContextRow = m_PluginListSortProxy->mapToSource(ui->espList->indexAt(pos)).row();
QMenu menu;
menu.addAction(tr("Enable selected"), this, SLOT(enableSelectedPlugins_clicked()));
menu.addAction(tr("Disable selected"), this, SLOT(disableSelectedPlugins_clicked()));
menu.addSeparator();
menu.addAction(tr("Enable all"), m_OrganizerCore.pluginList(), SLOT(enableAll()));
menu.addAction(tr("Disable all"), m_OrganizerCore.pluginList(), SLOT(disableAll()));
@@ -4972,6 +5012,9 @@ void MainWindow::on_bossButton_clicked()
createStdoutPipe(&stdOutRead, &stdOutWrite);
try {
m_OrganizerCore.prepareVFS();
} catch (const UsvfsConnectorException &e) {
qDebug(e.what());
return;
} catch (const std::exception &e) {
QMessageBox::warning(qApp->activeWindow(), tr("Error"), e.what());
return;
@@ -5135,7 +5178,7 @@ QString MainWindow::queryRestore(const QString &filePath)
SelectionDialog dialog(tr("Choose backup to restore"), this);
QRegExp exp(pluginFileInfo.fileName() + PATTERN_BACKUP_REGEX);
QRegExp exp2(pluginFileInfo.fileName() + "\\.(.*)");
for(const QFileInfo &info : files) {
for(const QFileInfo &info : boost::adaptors::reverse(files)) {
if (exp.exactMatch(info.fileName())) {
QDateTime time = QDateTime::fromString(exp.cap(1), PATTERN_BACKUP_DATE);
dialog.addChoice(time.toString(), "", exp.cap(1));
+6
View File
@@ -417,6 +417,8 @@ private slots:
void visitWebPage_clicked();
void openExplorer_clicked();
void information_clicked();
void enableSelectedMods_clicked();
void disableSelectedMods_clicked();
// savegame context menu
void deleteSavegame_clicked();
void fixMods_clicked(SaveGameInfo::MissingAssets const &missingAssets);
@@ -428,6 +430,10 @@ private slots:
void hideFile();
void unhideFile();
// pluginlist context menu
void enableSelectedPlugins_clicked();
void disableSelectedPlugins_clicked();
void linkToolbar();
void linkDesktop();
void linkMenu();
+30
View File
@@ -1231,3 +1231,33 @@ bool ModList::eventFilter(QObject *obj, QEvent *event)
}
return QAbstractItemModel::eventFilter(obj, event);
}
void ModList::enableSelected(const QItemSelectionModel *selectionModel)
{
if (selectionModel->hasSelection()) {
bool dirty = false;
for (auto row : selectionModel->selectedRows(COL_PRIORITY)) {
int modID = m_Profile->modIndexByPriority(row.data().toInt());
if (!m_Profile->modEnabled(modID)) {
m_Profile->setModEnabled(modID, true);
emit modlist_changed(row, 0);
}
}
}
}
void ModList::disableSelected(const QItemSelectionModel *selectionModel)
{
if (selectionModel->hasSelection()) {
bool dirty = false;
for (auto row : selectionModel->selectedRows(COL_PRIORITY)) {
int modID = m_Profile->modIndexByPriority(row.data().toInt());
if (m_Profile->modEnabled(modID)) {
m_Profile->setModEnabled(modID, false);
emit modlist_changed(row, 0);
}
}
}
}
+4
View File
@@ -170,6 +170,10 @@ public slots:
void dropModeUpdate(bool dropOnItems);
void enableSelected(const QItemSelectionModel *selectionModel);
void disableSelected(const QItemSelectionModel *selectionModel);
signals:
/**
+503 -477
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -1311,6 +1311,9 @@ HANDLE OrganizerCore::spawnBinaryProcess(const QFileInfo &binary,
if (m_AboutToRun(binary.absoluteFilePath())) {
try {
m_USVFS.updateMapping(fileMapping(profileName, customOverwrite));
} catch (const UsvfsConnectorException &e) {
qDebug(e.what());
return INVALID_HANDLE_VALUE;
} catch (const std::exception &e) {
QMessageBox::warning(window, tr("Error"), e.what());
return INVALID_HANDLE_VALUE;
+41
View File
@@ -289,6 +289,47 @@ void PluginList::enableESP(const QString &name, bool enable)
}
}
void PluginList::enableSelected(const QItemSelectionModel *selectionModel)
{
if (selectionModel->hasSelection()){
bool dirty = false;
for (auto row : selectionModel->selectedRows(COL_PRIORITY)) {
int rowPriority = row.data().toInt();
for (int i = 0; i < m_ESPs.size(); i++) {
if (m_ESPs[i].m_Priority == rowPriority) {
if (!m_ESPs[i].m_Enabled) {
m_ESPs[i].m_Enabled = true;
dirty = true;
}
break;
}
}
}
if (dirty) emit writePluginsList();
}
}
void PluginList::disableSelected(const QItemSelectionModel *selectionModel)
{
if (selectionModel->hasSelection()){
bool dirty = false;
for (auto row : selectionModel->selectedRows(COL_PRIORITY)) {
int rowPriority = row.data().toInt();
for (int i = 0; i < m_ESPs.size(); i++) {
if (m_ESPs[i].m_Priority == rowPriority) {
if (!m_ESPs[i].m_ForceEnabled && m_ESPs[i].m_Enabled) {
m_ESPs[i].m_Enabled = false;
dirty = true;
}
break;
}
}
}
if (dirty) emit writePluginsList();
}
}
void PluginList::enableAll()
{
+10
View File
@@ -244,6 +244,16 @@ public: // implementation of the QAbstractTableModel interface
public slots:
/**
* @brief enables selected plugins
**/
void enableSelected(const QItemSelectionModel *selectionModel);
/**
* @brief disables selected plugins
**/
void disableSelected(const QItemSelectionModel *selectionModel);
/**
* @brief enables ALL plugins
**/
+12 -4
View File
@@ -53,6 +53,7 @@ ProfilesDialog::ProfilesDialog(const QString &profileName, MOBase::IPluginGame c
, ui(new Ui::ProfilesDialog)
, m_FailState(false)
, m_Game(game)
, m_ActiveProfileName("")
{
ui->setupUi(this);
@@ -66,6 +67,7 @@ ProfilesDialog::ProfilesDialog(const QString &profileName, MOBase::IPluginGame c
QListWidgetItem *item = addItem(profileIter.filePath());
if (profileName == profileIter.fileName()) {
ui->profilesList->setCurrentItem(item);
m_ActiveProfileName = profileName;
}
}
@@ -182,13 +184,19 @@ void ProfilesDialog::on_copyProfileButton_clicked()
void ProfilesDialog::on_removeProfileButton_clicked()
{
Profile::Ptr profileToDelete = ui->profilesList->currentItem()->data(Qt::UserRole).value<Profile::Ptr>();
if (profileToDelete->name() == m_ActiveProfileName) {
QMessageBox::warning(this, tr("Deleting active profile"),
tr("Unable to delete active profile. Please change to a different profile first."));
return;
}
QMessageBox confirmBox(QMessageBox::Question, tr("Confirm"), tr("Are you sure you want to remove this profile (including local savegames if any)?"),
QMessageBox::Yes | QMessageBox::No);
QMessageBox::Yes | QMessageBox::No, this);
if (confirmBox.exec() == QMessageBox::Yes) {
Profile::Ptr currentProfile = ui->profilesList->currentItem()->data(Qt::UserRole).value<Profile::Ptr>();
QString profilePath;
if (currentProfile.get() == nullptr) {
if (profileToDelete.get() == nullptr) {
profilePath = Settings::instance().getProfileDirectory()
+ "/" + ui->profilesList->currentItem()->text();
if (QMessageBox::question(this, tr("Profile broken"),
@@ -199,7 +207,7 @@ void ProfilesDialog::on_removeProfileButton_clicked()
} else {
// on destruction, the profile object would write the profile.ini file again, so
// we have to get rid of the it before deleting the directory
profilePath = currentProfile->absolutePath();
profilePath = profileToDelete->absolutePath();
}
QListWidgetItem* item = ui->profilesList->takeItem(ui->profilesList->currentRow());
if (item != nullptr) {
+1
View File
@@ -95,6 +95,7 @@ private:
QListWidget *m_ProfilesList;
bool m_FailState;
MOBase::IPluginGame const *m_Game;
QString m_ActiveProfileName;
};
#endif // PROFILESDIALOG_H
+48 -5
View File
@@ -1,4 +1,4 @@
/* v3.0 Paper Dark by 6788-00 */
/* v3.0.1 Paper Dark by 6788-00 */
/* https://6788-00.tumblr.com/ */
/* Main Window */
@@ -54,7 +54,6 @@ QToolBar::separator {
}
QToolButton {
background: #1A1A1A;
padding: 4px 6px;
border-radius: 6px;
margin: 4px 4px 0px 4px;
@@ -381,8 +380,8 @@ QMenu::item:selected {
}
QMenu::item:disabled {
background: #FFFFFF;
color: #6C6C6C;
background: #242424;
color: #808080;
}
QMenu::separator {
@@ -413,6 +412,8 @@ QProgressBar {
QProgressBar::chunk {
background: #007E7E;
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
}
/* Right Pane and Tab Bars */
@@ -448,7 +449,8 @@ QTabBar::tab:disabled {
}
QTabBar::tab:selected {
color: #007272;
background: #007272;
color: #FFFFFF;
}
@@ -504,4 +506,45 @@ QSlider::handle:horizontal:hover {
QTableView {
gridline-color: #222222;
border: 0px;
}
QListWidget::item#executablesListBox {
/* fixes the black text problem on the Modify Executables window */
color: #D3D3D3;
}
/* downloads tab */
QWidget#downloadTab QAbstractScrollArea {
/* background of the entire downloads tab */
background: #242424;
}
DownloadListWidget QFrame,
DownloadListWidgetCompact,
DownloadListWidgetCompact QLabel {
/* an entry on the Downloads tab */
background: #141414;
}
DownloadListWidget QFrame#frame {
/* outer box of an entry on the Downloads tab */
border: 2px solid #141414;
}
DownloadListWidget QLabel#installLabel {
color: none;
}
DownloadListWidget QFrame:clicked {
background: #007E7E;
}
/* compact downloads view */
DownloadListWidgetCompact,
DownloadListWidgetCompact QLabel {
/* an entry on the Downloads tab */
background: #141414;
padding: 4px;
}
+37 -3
View File
@@ -1,4 +1,4 @@
/* v3.0 Paper Light by 6788-00 */
/* v3.0.1 Paper Light by 6788-00 */
/* https://6788-00.tumblr.com/ */
/* Main Window */
@@ -54,7 +54,6 @@ QToolBar::separator {
}
QToolButton {
background: #FFFFFF;
padding: 4px 6px;
border-radius: 6px;
margin: 4px 4px 0px 4px;
@@ -413,6 +412,8 @@ QProgressBar {
QProgressBar::chunk {
background: #008F8F;
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
}
/* Right Pane and Tab Bars */
@@ -448,7 +449,8 @@ QTabBar::tab:disabled {
}
QTabBar::tab:selected {
color: #008484;
background: #008484;
color: #FFFFFF;
}
@@ -504,4 +506,36 @@ QSlider::handle:horizontal:hover {
QTableView {
gridline-color: #EFEFEF;
border: 0px;
}
/* downloads tab */
QWidget#downloadTab QAbstractScrollArea {
/* background of the entire downloads tab */
background: #EFEFEF;
}
DownloadListWidget QFrame,
DownloadListWidgetCompact,
DownloadListWidgetCompact QLabel {
/* an entry on the Downloads tab */
background: #FFFFFF;
}
DownloadListWidget QFrame#frame {
/* outer box of an entry on the Downloads tab */
border: 2px solid #FFFFFF;
}
DownloadListWidget QLabel#installLabel {
color: none;
}
/* compact downloads view */
DownloadListWidgetCompact,
DownloadListWidgetCompact QLabel {
/* an entry on the Downloads tab */
background: #FFFFFF;
padding: 4px;
}
+4
View File
@@ -363,3 +363,7 @@ QTreeView::branch:open:has-children:has-siblings
border-image: none;
image: url(:/stylesheet/branch-open.png);
}
DownloadListWidget QLabel#installLabel {
color: none;
}

Some files were not shown because too many files have changed in this diff Show More