mirror of
https://github.com/ModOrganizer2/modorganizer.git
synced 2026-07-27 13:58:24 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2232bdfc77 | ||
|
|
258bddb6b7 | ||
|
|
364289db72 | ||
|
|
ef771fd8ca | ||
|
|
2060df1585 | ||
|
|
9a973ccf5f | ||
|
|
a2eb3e0266 | ||
|
|
d65031c814 | ||
|
|
c27e718fbd | ||
|
|
43b2df9077 | ||
|
|
79b2e52a58 | ||
|
|
16a7ef78d3 | ||
|
|
74202cc743 | ||
|
|
8f86130759 | ||
|
|
17e4ec7b13 | ||
|
|
9a426a2474 | ||
|
|
80594d6e1a | ||
|
|
56473e0ec8 | ||
|
|
71988e386c | ||
|
|
5e7c0fddf0 | ||
|
|
b0c15c9cfb | ||
|
|
f92027bea6 | ||
|
|
a31b5495b8 | ||
|
|
fc19486f53 | ||
|
|
232bbfb23b | ||
|
|
2af99f2170 | ||
|
|
796224d733 | ||
|
|
1e4b5d2436 | ||
|
|
94ef8dffbc | ||
|
|
7b1821a518 | ||
|
|
fb0d4d5e5a |
+6
-1
@@ -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>
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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()));
|
||||
|
||||
@@ -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
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
@@ -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));
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -170,6 +170,10 @@ public slots:
|
||||
|
||||
void dropModeUpdate(bool dropOnItems);
|
||||
|
||||
void enableSelected(const QItemSelectionModel *selectionModel);
|
||||
|
||||
void disableSelected(const QItemSelectionModel *selectionModel);
|
||||
|
||||
signals:
|
||||
|
||||
/**
|
||||
|
||||
+503
-477
File diff suppressed because it is too large
Load Diff
@@ -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;
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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
@@ -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) {
|
||||
|
||||
@@ -95,6 +95,7 @@ private:
|
||||
QListWidget *m_ProfilesList;
|
||||
bool m_FailState;
|
||||
MOBase::IPluginGame const *m_Game;
|
||||
QString m_ActiveProfileName;
|
||||
};
|
||||
|
||||
#endif // PROFILESDIALOG_H
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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
Reference in New Issue
Block a user