From 482f3d1f6d790ebd411aba4552ff4dcd936a2955 Mon Sep 17 00:00:00 2001 From: Eran Mizrahi Date: Tue, 26 Dec 2017 19:38:37 +0200 Subject: Show the newly added mod when creating an empty mod --- 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 1c5e321d..3e1c6e04 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2595,6 +2595,8 @@ void MainWindow::createEmptyMod_clicked() if (newMod == nullptr) { return; } + + m_OrganizerCore.refreshModList(); } void MainWindow::createModFromOverwrite() -- cgit v1.3.1 From eb3cfe259430c374ad8aa33151a79002687691c8 Mon Sep 17 00:00:00 2001 From: Eran Mizrahi Date: Tue, 26 Dec 2017 21:01:57 +0200 Subject: Default to sorting newest download first --- src/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 3e1c6e04..263a2984 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3852,7 +3852,7 @@ void MainWindow::updateDownloadListDelegate() connect(ui->downloadFilterEdit, SIGNAL(textChanged(QString)), this, SLOT(downloadFilterChanged(QString))); ui->downloadView->setModel(sortProxy); - ui->downloadView->sortByColumn(1, Qt::AscendingOrder); + ui->downloadView->sortByColumn(1, Qt::DescendingOrder); ui->downloadView->header()->resizeSections(QHeaderView::Fixed); connect(ui->downloadView->itemDelegate(), SIGNAL(installDownload(int)), &m_OrganizerCore, SLOT(installDownload(int))); -- cgit v1.3.1 From e623c13400a3cc43e564c0e00b85a21aeefe84dd Mon Sep 17 00:00:00 2001 From: Eran Mizrahi Date: Tue, 26 Dec 2017 23:15:21 +0200 Subject: Add clear overwrite option --- src/mainwindow.cpp | 26 ++++++++++++++++++++++++++ src/mainwindow.h | 1 + 2 files changed, 27 insertions(+) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 263a2984..8871075f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2636,6 +2636,31 @@ void MainWindow::createModFromOverwrite() m_OrganizerCore.refreshModList(); } +void MainWindow::clearOverwrite() +{ + unsigned int overwriteIndex = ModInfo::findMod([](ModInfo::Ptr mod) -> bool { + std::vector flags = mod->getFlags(); + return std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) + != flags.end(); + }); + + ModInfo::Ptr modInfo = ModInfo::getByIndex(overwriteIndex); + if (modInfo) + { + QDir overwriteDir(modInfo->absolutePath()); + if (QMessageBox::question(this, tr("Are you sure?"), + tr("About to recursively delete:\n") + overwriteDir.absolutePath(), + QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) + { + QStringList delList; + for (auto f : overwriteDir.entryList(QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot)) + delList.push_back(overwriteDir.absoluteFilePath(f)); + shellDelete(delList, true); + updateProblemsButton(); + } + } +} + void MainWindow::cancelModListEditor() { ui->modList->setEnabled(false); @@ -3074,6 +3099,7 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos) if (QDir(info->absolutePath()).count() > 2) { menu->addAction(tr("Sync to Mods..."), &m_OrganizerCore, SLOT(syncOverwrite())); menu->addAction(tr("Create Mod..."), this, SLOT(createModFromOverwrite())); + menu->addAction(tr("Clear Overwrite..."), this, SLOT(clearOverwrite())); } } else if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_BACKUP) != flags.end()) { menu->addAction(tr("Restore Backup"), this, SLOT(restoreBackup_clicked())); diff --git a/src/mainwindow.h b/src/mainwindow.h index a4ded688..c9ba170c 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -425,6 +425,7 @@ private slots: BSA::EErrorCode extractBSA(BSA::Archive &archive, BSA::Folder::Ptr folder, const QString &destination, QProgressDialog &extractProgress); void createModFromOverwrite(); + void clearOverwrite(); void procError(QProcess::ProcessError error); void procFinished(int exitCode, QProcess::ExitStatus exitStatus); -- cgit v1.3.1 From 9c82a1102e54b7fb350e18bd52cbf81083f42ca7 Mon Sep 17 00:00:00 2001 From: Eran Mizrahi Date: Tue, 26 Dec 2017 23:23:04 +0200 Subject: Enable open in explorer option also for overwrite --- src/mainwindow.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 8871075f..c29e4ca4 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3100,6 +3100,7 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos) menu->addAction(tr("Sync to Mods..."), &m_OrganizerCore, SLOT(syncOverwrite())); 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())); } } else if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_BACKUP) != flags.end()) { menu->addAction(tr("Restore Backup"), this, SLOT(restoreBackup_clicked())); -- cgit v1.3.1