summaryrefslogtreecommitdiff
path: root/src/citra_qt
diff options
context:
space:
mode:
Diffstat (limited to 'src/citra_qt')
-rw-r--r--src/citra_qt/bootmanager.cpp2
-rw-r--r--src/citra_qt/debugger/disassembler.cpp2
-rw-r--r--src/citra_qt/main.cpp27
-rw-r--r--src/citra_qt/main.h2
4 files changed, 24 insertions, 9 deletions
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp
index b12bd858b..a96fbea5f 100644
--- a/src/citra_qt/bootmanager.cpp
+++ b/src/citra_qt/bootmanager.cpp
@@ -94,7 +94,7 @@ private:
};
GRenderWindow::GRenderWindow(QWidget* parent, EmuThread* emu_thread) :
- QWidget(parent), emu_thread(emu_thread), keyboard_id(0) {
+ QWidget(parent), keyboard_id(0), emu_thread(emu_thread) {
std::string window_title = Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc);
setWindowTitle(QString::fromStdString(window_title));
diff --git a/src/citra_qt/debugger/disassembler.cpp b/src/citra_qt/debugger/disassembler.cpp
index 1e5ef5299..d3629bbf6 100644
--- a/src/citra_qt/debugger/disassembler.cpp
+++ b/src/citra_qt/debugger/disassembler.cpp
@@ -159,7 +159,7 @@ void DisassemblerModel::SetNextInstruction(unsigned int address) {
}
DisassemblerWidget::DisassemblerWidget(QWidget* parent, EmuThread* emu_thread) :
- QDockWidget(parent), emu_thread(emu_thread), base_addr(0) {
+ QDockWidget(parent), base_addr(0), emu_thread(emu_thread) {
disasm_ui.setupUi(this);
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index 34831f2ec..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());
@@ -207,7 +206,7 @@ void GMainWindow::OnDisplayTitleBars(bool show)
}
}
-void GMainWindow::BootGame(std::string filename) {
+void GMainWindow::BootGame(const std::string& filename) {
LOG_INFO(Frontend, "Citra starting...\n");
// Initialize the core emulation
@@ -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);
diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h
index 242b08c39..9fe9e0c9c 100644
--- a/src/citra_qt/main.h
+++ b/src/citra_qt/main.h
@@ -55,7 +55,7 @@ signals:
void EmulationStopping();
private:
- void BootGame(std::string filename);
+ void BootGame(const std::string& filename);
void ShutdownGame();
void closeEvent(QCloseEvent* event) override;