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') 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