summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2015-08-01 01:00:09 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2015-08-01 01:00:09 +0200
commit1af1c5c37b2001f3ae4360c18aac2196be535894 (patch)
tree5c770e72221afb7d777f634930198ee1bbd24de0
parentMerge pull request #1008 from lioncash/pc (diff)
parentSave the path leading where the last file have been loaded (diff)
downloadyuzu-1af1c5c37b2001f3ae4360c18aac2196be535894.tar
yuzu-1af1c5c37b2001f3ae4360c18aac2196be535894.tar.gz
yuzu-1af1c5c37b2001f3ae4360c18aac2196be535894.tar.bz2
yuzu-1af1c5c37b2001f3ae4360c18aac2196be535894.tar.lz
yuzu-1af1c5c37b2001f3ae4360c18aac2196be535894.tar.xz
yuzu-1af1c5c37b2001f3ae4360c18aac2196be535894.tar.zst
yuzu-1af1c5c37b2001f3ae4360c18aac2196be535894.zip
-rw-r--r--src/citra_qt/main.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index e93e8ebb8..6b030c178 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -122,9 +122,8 @@ GMainWindow::GMainWindow() : emu_thread(nullptr)
y = (screenRect.y() + screenRect.height()) / 2 - h * 55 / 100;
setGeometry(x, y, w, h);
-
// Restore UI state
- QSettings settings(QSettings::IniFormat, QSettings::UserScope, "Citra team", "Citra");
+ QSettings settings;
restoreGeometry(settings.value("geometry").toByteArray());
restoreState(settings.value("state").toByteArray());
render_window->restoreGeometry(settings.value("geometryRenderWindow").toByteArray());
@@ -271,8 +270,13 @@ void GMainWindow::ShutdownGame() {
void GMainWindow::OnMenuLoadFile()
{
- QString filename = QFileDialog::getOpenFileName(this, tr("Load File"), QString(), tr("3DS executable (*.3ds *.3dsx *.elf *.axf *.cci *.cxi)"));
+ QSettings settings;
+ QString rom_path = settings.value("romsPath", QString()).toString();
+
+ QString filename = QFileDialog::getOpenFileName(this, tr("Load File"), rom_path, tr("3DS executable (*.3ds *.3dsx *.elf *.axf *.cci *.cxi)"));
if (filename.size()) {
+ settings.setValue("romsPath", QFileInfo(filename).path());
+
// Shutdown previous session if the emu thread is still active...
if (emu_thread != nullptr)
ShutdownGame();
@@ -282,9 +286,15 @@ void GMainWindow::OnMenuLoadFile()
}
void GMainWindow::OnMenuLoadSymbolMap() {
- QString filename = QFileDialog::getOpenFileName(this, tr("Load Symbol Map"), QString(), tr("Symbol map (*)"));
- if (filename.size())
+ QSettings settings;
+ QString symbol_path = settings.value("symbolsPath", QString()).toString();
+
+ QString filename = QFileDialog::getOpenFileName(this, tr("Load Symbol Map"), symbol_path, tr("Symbol map (*)"));
+ if (filename.size()) {
+ settings.setValue("symbolsPath", QFileInfo(filename).path());
+
LoadSymbolMap(filename.toLatin1().data());
+ }
}
void GMainWindow::OnStartGame()
@@ -375,6 +385,11 @@ int main(int argc, char* argv[])
Log::Filter log_filter(Log::Level::Info);
Log::SetFilter(&log_filter);
+ // Init settings params
+ QSettings::setDefaultFormat(QSettings::IniFormat);
+ QCoreApplication::setOrganizationName("Citra team");
+ QCoreApplication::setApplicationName("Citra");
+
QApplication::setAttribute(Qt::AA_X11InitThreads);
QApplication app(argc, argv);