mirror of
https://github.com/yuzu-mirror/yuzu
synced 2024-11-24 01:33:03 +00:00
main: Open folder when open save folder location context menu is clicked
This commit is contained in:
parent
f50dcc88bf
commit
5a4e1b469d
2 changed files with 20 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
|||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <cinttypes>
|
||||
#include <clocale>
|
||||
#include <memory>
|
||||
#include <thread>
|
||||
|
@ -41,6 +42,7 @@
|
|||
#include "common/string_util.h"
|
||||
#include "core/arm/disassembler/load_symbol_map.h"
|
||||
#include "core/core.h"
|
||||
#include "core/file_sys/archive_source_sd_savedata.h"
|
||||
#include "core/gdbstub/gdbstub.h"
|
||||
#include "core/loader/loader.h"
|
||||
#include "core/settings.h"
|
||||
|
@ -171,6 +173,8 @@ GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) {
|
|||
// Setup connections
|
||||
connect(game_list, SIGNAL(GameChosen(QString)), this, SLOT(OnGameListLoadFile(QString)),
|
||||
Qt::DirectConnection);
|
||||
connect(game_list, SIGNAL(OpenSaveFolderRequested(u64)), this,
|
||||
SLOT(OnGameListOpenSaveFolder(u64)), Qt::DirectConnection);
|
||||
connect(ui.action_Configure, SIGNAL(triggered()), this, SLOT(OnConfigure()));
|
||||
connect(ui.action_Load_File, SIGNAL(triggered()), this, SLOT(OnMenuLoadFile()),
|
||||
Qt::DirectConnection);
|
||||
|
@ -460,6 +464,21 @@ void GMainWindow::OnGameListLoadFile(QString game_path) {
|
|||
BootGame(game_path.toStdString());
|
||||
}
|
||||
|
||||
void GMainWindow::OnGameListOpenSaveFolder(u64 program_id) {
|
||||
std::string sdmc_dir = FileUtil::GetUserPath(D_SDMC_IDX);
|
||||
std::string path = FileSys::ArchiveSource_SDSaveData::GetSaveDataPathFor(sdmc_dir, program_id);
|
||||
QString qpath = QString::fromStdString(path);
|
||||
|
||||
QDir dir(qpath);
|
||||
if (!dir.exists()) {
|
||||
QMessageBox::critical(this, tr("Error Opening Save Folder"), tr("Folder does not exist!"));
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_INFO(Frontend, "Opening save data path for program_id=%" PRIu64, program_id);
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(qpath));
|
||||
}
|
||||
|
||||
void GMainWindow::OnMenuLoadFile() {
|
||||
QString filename =
|
||||
QFileDialog::getOpenFileName(this, tr("Load File"), UISettings::values.roms_path,
|
||||
|
|
|
@ -105,6 +105,7 @@ private slots:
|
|||
void OnStopGame();
|
||||
/// Called whenever a user selects a game in the game list widget.
|
||||
void OnGameListLoadFile(QString game_path);
|
||||
void OnGameListOpenSaveFolder(u64 program_id);
|
||||
void OnMenuLoadFile();
|
||||
void OnMenuLoadSymbolMap();
|
||||
/// Called whenever a user selects the "File->Select Game List Root" menu item
|
||||
|
|
Loading…
Reference in a new issue