summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Rimpo <jeremy.rimpo@servermonkey.com>2018-02-07 14:08:17 -0600
committerGitHub <noreply@github.com>2018-02-07 14:08:17 -0600
commit28b0411ccaec2ca39685c9b6931fa46e09d484fb (patch)
tree68474702fd42ef478cf131434a19313655d4af2e /src
parent8c34131bb84aa47dc2bfa8ced1a130cacabba725 (diff)
parentd6b645413c3d3f20ad0f554a1f106206886b3a83 (diff)
Merge pull request #219 from Al12rs/new_vfs_library
Fixed customOverwrite, reverted nxm handler commit, added a few menu options.
Diffstat (limited to 'src')
-rw-r--r--src/downloadmanager.cpp4
-rw-r--r--src/mainwindow.cpp43
-rw-r--r--src/mainwindow.h5
-rw-r--r--src/settings.cpp2
4 files changed, 46 insertions, 8 deletions
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp
index 593c754a..cb954ebe 100644
--- a/src/downloadmanager.cpp
+++ b/src/downloadmanager.cpp
@@ -451,7 +451,7 @@ void DownloadManager::addNXMDownload(const QString &url)
{
NXMUrl nxmInfo(url);
- QString managedGame = m_ManagedGame->gameNexusName();
+ QString managedGame = m_ManagedGame->gameShortName();
qDebug("add nxm download: %s", qPrintable(url));
if (nxmInfo.game().compare(managedGame, Qt::CaseInsensitive) != 0) {
qDebug("download requested for wrong game (game: %s, url: %s)", qPrintable(managedGame), qPrintable(nxmInfo.game()));
@@ -1246,7 +1246,7 @@ int DownloadManager::startDownloadURLs(const QStringList &urls)
int DownloadManager::startDownloadNexusFile(int modID, int fileID)
{
int newID = m_ActiveDownloads.size();
- addNXMDownload(QString("nxm://%1/mods/%2/files/%3").arg(m_ManagedGame->gameNexusName()).arg(modID).arg(fileID));
+ addNXMDownload(QString("nxm://%1/mods/%2/files/%3").arg(m_ManagedGame->gameShortName()).arg(modID).arg(fileID));
return newID;
}
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 6648f32e..5f337da3 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1043,12 +1043,13 @@ void MainWindow::startExeAction()
if (action != nullptr) {
const Executable &selectedExecutable(
m_OrganizerCore.executablesList()->find(action->text()));
+ QString customOverwrite= m_OrganizerCore.currentProfile()->setting("custom_overwrites", selectedExecutable.m_Title).toString();
m_OrganizerCore.spawnBinary(
selectedExecutable.m_BinaryInfo, selectedExecutable.m_Arguments,
selectedExecutable.m_WorkingDirectory.length() != 0
? selectedExecutable.m_WorkingDirectory
: selectedExecutable.m_BinaryInfo.absolutePath(),
- selectedExecutable.m_SteamAppID);
+ selectedExecutable.m_SteamAppID, customOverwrite);
} else {
qCritical("not an action?");
}
@@ -1709,13 +1710,13 @@ void MainWindow::installMod(QString fileName)
void MainWindow::on_startButton_clicked() {
const Executable &selectedExecutable(getSelectedExecutable());
-
+ QString customOverwrite = m_OrganizerCore.currentProfile()->setting("custom_overwrites", selectedExecutable.m_Title).toString();
m_OrganizerCore.spawnBinary(
selectedExecutable.m_BinaryInfo, selectedExecutable.m_Arguments,
selectedExecutable.m_WorkingDirectory.length() != 0
? selectedExecutable.m_WorkingDirectory
: selectedExecutable.m_BinaryInfo.absolutePath(),
- selectedExecutable.m_SteamAppID);
+ selectedExecutable.m_SteamAppID, customOverwrite);
}
static HRESULT CreateShortcut(LPCWSTR targetFileName, LPCWSTR arguments,
@@ -2998,6 +2999,27 @@ void MainWindow::openInstanceFolder()
::ShellExecuteW(nullptr, L"explore", ToWString(m_OrganizerCore.settings().getBaseDirectory()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
}
+void MainWindow::openProfileFolder()
+{
+ ::ShellExecuteW(nullptr, L"explore", ToWString(m_OrganizerCore.currentProfile()->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);
+}
+
+void MainWindow::openGameFolder()
+{
+ ::ShellExecuteW(nullptr, L"explore", ToWString(m_OrganizerCore.managedGame()->gameDirectory().absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
+}
+
+void MainWindow::openMyGamesFolder()
+{
+ ::ShellExecuteW(nullptr, L"explore", ToWString(m_OrganizerCore.managedGame()->documentsDirectory().absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
+}
+
+
void MainWindow::exportModListCSV()
{
SelectionDialog selection(tr("Choose what to export"));
@@ -3068,6 +3090,8 @@ QMenu *MainWindow::modListContextMenu()
menu->addAction(tr("Create empty mod"), this, SLOT(createEmptyMod_clicked()));
+ menu->addSeparator();
+
menu->addAction(tr("Enable all visible"), this, SLOT(enableVisibleMods()));
menu->addAction(tr("Disable all visible"), this, SLOT(disableVisibleMods()));
@@ -3077,7 +3101,18 @@ QMenu *MainWindow::modListContextMenu()
menu->addAction(tr("Export to csv..."), this, SLOT(exportModListCSV()));
+ menu->addSeparator();
+
menu->addAction(tr("Open Instance folder"), this, SLOT(openInstanceFolder()));
+
+ menu->addAction(tr("Open Profile folder"), this, SLOT(openProfileFolder()));
+
+ menu->addAction(tr("Open Downloads folder"), this, SLOT(openDownloadsFolder()));
+
+ menu->addAction(tr("Open Game folder"), this, SLOT(openGameFolder()));
+
+ menu->addAction(tr("Open MyGames folder"), this, SLOT(openMyGamesFolder()));
+
return menu;
}
@@ -3105,8 +3140,8 @@ 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()));
}
+ 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()));
diff --git a/src/mainwindow.h b/src/mainwindow.h
index a17b706d..5c8e4ebc 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -484,7 +484,10 @@ private slots:
void disableVisibleMods();
void exportModListCSV();
void openInstanceFolder();
-
+ void openDownloadsFolder();
+ void openProfileFolder();
+ void openGameFolder();
+ void openMyGamesFolder();
void startExeAction();
void checkBSAList();
diff --git a/src/settings.cpp b/src/settings.cpp
index 62041ca2..d1130e05 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -133,7 +133,7 @@ void Settings::registerAsNXMHandler(bool force)
std::wstring nxmPath = ToWString(QCoreApplication::applicationDirPath() + "/nxmhandler.exe");
std::wstring executable = ToWString(QCoreApplication::applicationFilePath());
std::wstring mode = force ? L"forcereg" : L"reg";
- std::wstring parameters = mode + L" " + m_GamePlugin->gameNexusName().toStdWString() + L" \"" + executable + L"\"";
+ std::wstring parameters = mode + L" " + m_GamePlugin->gameShortName().toStdWString() + L" \"" + executable + L"\"";
HINSTANCE res = ::ShellExecuteW(nullptr, L"open", nxmPath.c_str(), parameters.c_str(), nullptr, SW_SHOWNORMAL);
if ((int)res <= 32) {
QMessageBox::critical(nullptr, tr("Failed"),