From 2b1777d4a7cc7907ee79ad5299f26a6bd981edc3 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sun, 18 Aug 2013 01:24:34 +0200 Subject: [PATCH] Transfer some features from oldUI to newUI --- UI/GameSettingsScreen.cpp | 7 ++++++- UI/GameSettingsScreen.h | 1 + UI/MainScreen.cpp | 18 ++++++++++++++++-- native | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 5c23a443c2..7203f2519c 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -436,7 +436,7 @@ void DeveloperToolsScreen::CreateViews() { list->Add(new Choice(g->T("System Information")))->OnClick.Handle(this, &DeveloperToolsScreen::OnSysInfo); list->Add(new Choice(d->T("Run CPU Tests")))->OnClick.Handle(this, &DeveloperToolsScreen::OnRunCPUTests); list->Add(new CheckBox(&g_Config.bSoftwareRendering, gs->T("Software Rendering", "Software Rendering (experimental)"))); - list->Add(new CheckBox(&enableLogging_, d->T("Enable Debug Logging"))); + list->Add(new CheckBox(&enableLogging_, d->T("Enable Logging")))->OnClick.Handle(this, &DeveloperToolsScreen::OnLoggingChanged); list->Add(new Choice(g->T("Back")))->OnClick.Handle(this, &DeveloperToolsScreen::OnBack); } @@ -452,6 +452,11 @@ UI::EventReturn DeveloperToolsScreen::OnBack(UI::EventParams &e) { return UI::EVENT_DONE; } +UI::EventReturn DeveloperToolsScreen::OnLoggingChanged(UI::EventParams &e) { + PostMessage(MainWindow::hwndMain, MainWindow::WM_USER_LOG_STATUS_CHANGED, 0, 0); + return UI::EVENT_DONE; +} + UI::EventReturn DeveloperToolsScreen::OnSysInfo(UI::EventParams &e) { screenManager()->push(new SystemInfoScreen()); return UI::EVENT_DONE; diff --git a/UI/GameSettingsScreen.h b/UI/GameSettingsScreen.h index 8fe299f594..81ee7d0fa1 100644 --- a/UI/GameSettingsScreen.h +++ b/UI/GameSettingsScreen.h @@ -78,6 +78,7 @@ private: UI::EventReturn OnBack(UI::EventParams &e); UI::EventReturn OnRunCPUTests(UI::EventParams &e); UI::EventReturn OnSysInfo(UI::EventParams &e); + UI::EventReturn OnLoggingChanged(UI::EventParams &e); // Temporary variable. bool enableLogging_; diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 09ae9af695..371e7c6cd6 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -38,6 +38,12 @@ #include "GPU/GPUInterface.h" #include "i18n/i18n.h" +#ifdef USING_QT_UI +#include +#include +#include +#endif + #ifdef _WIN32 namespace MainWindow { void BrowseAndBoot(std::string defaultPath, bool browseDirectory = false); @@ -474,7 +480,7 @@ void MainScreen::CreateViews() { ViewGroup *rightColumnItems = new LinearLayout(ORIENT_VERTICAL); rightColumn->Add(rightColumnItems); -#ifdef _WIN32 +#if defined(_WIN32) || defined(USING_QT_UI) rightColumnItems->Add(new Choice(m->T("Load","Load...")))->OnClick.Handle(this, &MainScreen::OnLoadFile); #endif rightColumnItems->Add(new Choice(m->T("Game Settings")))->OnClick.Handle(this, &MainScreen::OnGameSettings); @@ -496,7 +502,15 @@ void MainScreen::update(InputState &input) { } UI::EventReturn MainScreen::OnLoadFile(UI::EventParams &e) { -#ifdef _WIN32 +#if defined(USING_QT_UI) && !defined(MEEGO_EDITION_HARMATTAN) + QString fileName = QFileDialog::getOpenFileName(NULL, "Load ROM", g_Config.currentDirectory.c_str(), "PSP ROMs (*.iso *.cso *.pbp *.elf)"); + if (QFile::exists(fileName)) { + QDir newPath; + g_Config.currentDirectory = newPath.filePath(fileName).toStdString(); + g_Config.Save(); + screenManager()->switchScreen(new EmuScreen(fileName.toStdString())); + } +#elif defined(_WIN32) MainWindow::BrowseAndBoot(""); #endif return UI::EVENT_DONE; diff --git a/native b/native index 89361d002f..987aaa26d8 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit 89361d002f7755b4effedf67cf2fc1bf0d38e4bc +Subproject commit 987aaa26d80fc897b2678cabbd09733e67b34303