summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-09-03 19:23:10 -0400
committerGravatar Zach Hilman2018-09-03 19:23:33 -0400
commit04397cd185bf6f6f8c979df4fe48379f669f0ed5 (patch)
tree4c47ee24a8a6b5d9ea8edcf9b01390dd0259a52a /src
parentqt: Add UI options to change NAND/SD dirs (diff)
downloadyuzu-04397cd185bf6f6f8c979df4fe48379f669f0ed5.tar.gz
yuzu-04397cd185bf6f6f8c979df4fe48379f669f0ed5.tar.xz
yuzu-04397cd185bf6f6f8c979df4fe48379f669f0ed5.zip
qt: Add message about not moving contents on dir change
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/main.cpp21
-rw-r--r--src/yuzu/main.h8
2 files changed, 23 insertions, 6 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 01a5d2552..a21f7bdbc 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -12,6 +12,7 @@
12 12
13#define QT_NO_OPENGL 13#define QT_NO_OPENGL
14#include <QDesktopWidget> 14#include <QDesktopWidget>
15#include <QDialogButtonBox>
15#include <QFileDialog> 16#include <QFileDialog>
16#include <QMessageBox> 17#include <QMessageBox>
17#include <QtGui> 18#include <QtGui>
@@ -373,9 +374,9 @@ void GMainWindow::ConnectMenuEvents() {
373 connect(ui.action_Select_Game_List_Root, &QAction::triggered, this, 374 connect(ui.action_Select_Game_List_Root, &QAction::triggered, this,
374 &GMainWindow::OnMenuSelectGameListRoot); 375 &GMainWindow::OnMenuSelectGameListRoot);
375 connect(ui.action_Select_NAND_Directory, &QAction::triggered, this, 376 connect(ui.action_Select_NAND_Directory, &QAction::triggered, this,
376 [this] { OnMenuSelectEmulatedDirectory(false); }); 377 [this] { OnMenuSelectEmulatedDirectory(EmulatedDirectoryTarget::NAND); });
377 connect(ui.action_Select_SDMC_Directory, &QAction::triggered, this, 378 connect(ui.action_Select_SDMC_Directory, &QAction::triggered, this,
378 [this] { OnMenuSelectEmulatedDirectory(true); }); 379 [this] { OnMenuSelectEmulatedDirectory(EmulatedDirectoryTarget::SDMC); });
379 connect(ui.action_Exit, &QAction::triggered, this, &QMainWindow::close); 380 connect(ui.action_Exit, &QAction::triggered, this, &QMainWindow::close);
380 381
381 // Emulation 382 // Emulation
@@ -891,10 +892,22 @@ void GMainWindow::OnMenuSelectGameListRoot() {
891 } 892 }
892} 893}
893 894
894void GMainWindow::OnMenuSelectEmulatedDirectory(bool is_sdmc) { 895void GMainWindow::OnMenuSelectEmulatedDirectory(EmulatedDirectoryTarget target) {
896 const auto res = QMessageBox::information(
897 this, tr("Changing Emulated Directory"),
898 tr("You are about to change the emulated %1 directory of the system. Please note "
899 "that this does not also move the contents of the previous directory to the "
900 "new one and you will have to do that yourself.")
901 .arg(target == EmulatedDirectoryTarget::SDMC ? tr("SD card") : tr("NAND")),
902 QMessageBox::StandardButtons{QMessageBox::Ok, QMessageBox::Cancel});
903
904 if (res == QMessageBox::Cancel)
905 return;
906
895 QString dir_path = QFileDialog::getExistingDirectory(this, tr("Select Directory")); 907 QString dir_path = QFileDialog::getExistingDirectory(this, tr("Select Directory"));
896 if (!dir_path.isEmpty()) { 908 if (!dir_path.isEmpty()) {
897 FileUtil::GetUserPath(is_sdmc ? FileUtil::UserPath::SDMCDir : FileUtil::UserPath::NANDDir, 909 FileUtil::GetUserPath(target == EmulatedDirectoryTarget::SDMC ? FileUtil::UserPath::SDMCDir
910 : FileUtil::UserPath::NANDDir,
898 dir_path.toStdString()); 911 dir_path.toStdString());
899 Service::FileSystem::CreateFactories(vfs); 912 Service::FileSystem::CreateFactories(vfs);
900 game_list->PopulateAsync(UISettings::values.gamedir, UISettings::values.gamedir_deepscan); 913 game_list->PopulateAsync(UISettings::values.gamedir, UISettings::values.gamedir_deepscan);
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index b85149f8e..56b592a9e 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -32,6 +32,11 @@ namespace Tegra {
32class DebugContext; 32class DebugContext;
33} 33}
34 34
35enum class EmulatedDirectoryTarget {
36 NAND,
37 SDMC,
38};
39
35class GMainWindow : public QMainWindow { 40class GMainWindow : public QMainWindow {
36 Q_OBJECT 41 Q_OBJECT
37 42
@@ -138,8 +143,7 @@ private slots:
138 /// Called whenever a user selects the "File->Select Game List Root" menu item 143 /// Called whenever a user selects the "File->Select Game List Root" menu item
139 void OnMenuSelectGameListRoot(); 144 void OnMenuSelectGameListRoot();
140 /// Called whenever a user select the "File->Select -- Directory" where -- is NAND or SD Card 145 /// Called whenever a user select the "File->Select -- Directory" where -- is NAND or SD Card
141 /// (false for nand, true for sdmc) 146 void OnMenuSelectEmulatedDirectory(EmulatedDirectoryTarget target);
142 void OnMenuSelectEmulatedDirectory(bool is_sdmc);
143 void OnMenuRecentFile(); 147 void OnMenuRecentFile();
144 void OnConfigure(); 148 void OnConfigure();
145 void OnAbout(); 149 void OnAbout();