diff options
Diffstat (limited to 'src/citra_qt/main.cpp')
| -rw-r--r-- | src/citra_qt/main.cpp | 25 |
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) | |||
| 122 | y = (screenRect.y() + screenRect.height()) / 2 - h * 55 / 100; | 122 | y = (screenRect.y() + screenRect.height()) / 2 - h * 55 / 100; |
| 123 | setGeometry(x, y, w, h); | 123 | setGeometry(x, y, w, h); |
| 124 | 124 | ||
| 125 | |||
| 126 | // Restore UI state | 125 | // Restore UI state |
| 127 | QSettings settings(QSettings::IniFormat, QSettings::UserScope, "Citra team", "Citra"); | 126 | QSettings settings; |
| 128 | restoreGeometry(settings.value("geometry").toByteArray()); | 127 | restoreGeometry(settings.value("geometry").toByteArray()); |
| 129 | restoreState(settings.value("state").toByteArray()); | 128 | restoreState(settings.value("state").toByteArray()); |
| 130 | render_window->restoreGeometry(settings.value("geometryRenderWindow").toByteArray()); | 129 | render_window->restoreGeometry(settings.value("geometryRenderWindow").toByteArray()); |
| @@ -271,8 +270,13 @@ void GMainWindow::ShutdownGame() { | |||
| 271 | 270 | ||
| 272 | void GMainWindow::OnMenuLoadFile() | 271 | void GMainWindow::OnMenuLoadFile() |
| 273 | { | 272 | { |
| 274 | QString filename = QFileDialog::getOpenFileName(this, tr("Load File"), QString(), tr("3DS executable (*.3ds *.3dsx *.elf *.axf *.cci *.cxi)")); | 273 | QSettings settings; |
| 274 | QString rom_path = settings.value("romsPath", QString()).toString(); | ||
| 275 | |||
| 276 | QString filename = QFileDialog::getOpenFileName(this, tr("Load File"), rom_path, tr("3DS executable (*.3ds *.3dsx *.elf *.axf *.cci *.cxi)")); | ||
| 275 | if (filename.size()) { | 277 | if (filename.size()) { |
| 278 | settings.setValue("romsPath", QFileInfo(filename).path()); | ||
| 279 | |||
| 276 | // Shutdown previous session if the emu thread is still active... | 280 | // Shutdown previous session if the emu thread is still active... |
| 277 | if (emu_thread != nullptr) | 281 | if (emu_thread != nullptr) |
| 278 | ShutdownGame(); | 282 | ShutdownGame(); |
| @@ -282,9 +286,15 @@ void GMainWindow::OnMenuLoadFile() | |||
| 282 | } | 286 | } |
| 283 | 287 | ||
| 284 | void GMainWindow::OnMenuLoadSymbolMap() { | 288 | void GMainWindow::OnMenuLoadSymbolMap() { |
| 285 | QString filename = QFileDialog::getOpenFileName(this, tr("Load Symbol Map"), QString(), tr("Symbol map (*)")); | 289 | QSettings settings; |
| 286 | if (filename.size()) | 290 | QString symbol_path = settings.value("symbolsPath", QString()).toString(); |
| 291 | |||
| 292 | QString filename = QFileDialog::getOpenFileName(this, tr("Load Symbol Map"), symbol_path, tr("Symbol map (*)")); | ||
| 293 | if (filename.size()) { | ||
| 294 | settings.setValue("symbolsPath", QFileInfo(filename).path()); | ||
| 295 | |||
| 287 | LoadSymbolMap(filename.toLatin1().data()); | 296 | LoadSymbolMap(filename.toLatin1().data()); |
| 297 | } | ||
| 288 | } | 298 | } |
| 289 | 299 | ||
| 290 | void GMainWindow::OnStartGame() | 300 | void GMainWindow::OnStartGame() |
| @@ -375,6 +385,11 @@ int main(int argc, char* argv[]) | |||
| 375 | Log::Filter log_filter(Log::Level::Info); | 385 | Log::Filter log_filter(Log::Level::Info); |
| 376 | Log::SetFilter(&log_filter); | 386 | Log::SetFilter(&log_filter); |
| 377 | 387 | ||
| 388 | // Init settings params | ||
| 389 | QSettings::setDefaultFormat(QSettings::IniFormat); | ||
| 390 | QCoreApplication::setOrganizationName("Citra team"); | ||
| 391 | QCoreApplication::setApplicationName("Citra"); | ||
| 392 | |||
| 378 | QApplication::setAttribute(Qt::AA_X11InitThreads); | 393 | QApplication::setAttribute(Qt::AA_X11InitThreads); |
| 379 | QApplication app(argc, argv); | 394 | QApplication app(argc, argv); |
| 380 | 395 | ||