mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-23 16:19:44 +00:00
Experimental Qt file dialog support
This commit is contained in:
parent
40852ff533
commit
7a38f459ad
@ -54,7 +54,7 @@ INCLUDEPATH += ../ext/snappy
|
||||
|
||||
# Zlib
|
||||
!symbian: {
|
||||
SOURCES += ../ext/zlib/adler32.c \
|
||||
SOURCES += ../ext/zlib/adler32.c \
|
||||
../ext/zlib/compress.c \
|
||||
../ext/zlib/crc32.c \
|
||||
../ext/zlib/deflate.c \
|
||||
|
@ -1,3 +1,4 @@
|
||||
DEFINES += USING_QT_UI
|
||||
blackberry|symbian|contains(MEEGO_EDITION,harmattan): CONFIG += mobile_platform
|
||||
unix:!blackberry:!symbian:!macx: CONFIG += linux
|
||||
|
||||
|
@ -42,6 +42,12 @@
|
||||
#include "MenuScreens.h"
|
||||
#include "EmuScreen.h"
|
||||
|
||||
#ifdef USING_QT_UI
|
||||
#include <QFileDialog>
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
#endif
|
||||
|
||||
|
||||
// Ugly communication with NativeApp
|
||||
extern std::string game_title;
|
||||
@ -163,6 +169,15 @@ void MenuScreen::render() {
|
||||
|
||||
|
||||
if (UIButton(GEN_ID, vlinear, w, "Load...", ALIGN_RIGHT)) {
|
||||
#if defined(USING_QT_UI) && defined(USING_GLES2)
|
||||
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()));
|
||||
}
|
||||
#else
|
||||
FileSelectScreenOptions options;
|
||||
options.allowChooseDirectory = true;
|
||||
options.filter = "iso:cso:pbp:elf:prx:";
|
||||
@ -172,6 +187,7 @@ void MenuScreen::render() {
|
||||
options.iconMapping["pbp"] = I_ICON_EXE;
|
||||
options.iconMapping["elf"] = I_ICON_EXE;
|
||||
screenManager()->switchScreen(new FileSelectScreen(options));
|
||||
#endif
|
||||
UIReset();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user