mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-29 06:30:27 +02:00
v114.5
* improved appended firmware detection [devinacker] * added dynamic rate control support to ALSA and PulseAudio drivers [RedDwarf] * added option to use native file dialogs
This commit is contained in:
@@ -2,6 +2,11 @@
|
||||
|
||||
namespace hiro {
|
||||
|
||||
auto pApplication::exit() -> void {
|
||||
quit();
|
||||
::exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
auto pApplication::modal() -> bool {
|
||||
return Application::state().modal > 0;
|
||||
}
|
||||
|
@@ -3,6 +3,7 @@
|
||||
namespace hiro {
|
||||
|
||||
struct pApplication {
|
||||
static auto exit() -> void;
|
||||
static auto modal() -> bool;
|
||||
static auto run() -> void;
|
||||
static auto pendingEvents() -> bool;
|
||||
|
@@ -3,63 +3,48 @@
|
||||
namespace hiro {
|
||||
|
||||
auto pBrowserWindow::directory(BrowserWindow::State& state) -> string {
|
||||
return {};
|
||||
/*
|
||||
QString directory = QFileDialog::getExistingDirectory(
|
||||
state.parent ? state.parent->p.qtWindow : nullptr,
|
||||
state.title ? state.title : "Select Directory",
|
||||
state.parent ? state.parent->self()->qtWindow : nullptr,
|
||||
state.title ? QString::fromUtf8(state.title) : "Select Directory",
|
||||
QString::fromUtf8(state.path), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
|
||||
);
|
||||
string name = directory.toUtf8().constData();
|
||||
if(name && name.endsWith("/") == false) name.append("/");
|
||||
return name;
|
||||
*/
|
||||
}
|
||||
|
||||
auto pBrowserWindow::open(BrowserWindow::State& state) -> string {
|
||||
return {};
|
||||
/*
|
||||
string filters = state.filters.merge(";;");
|
||||
|
||||
//convert filter list from phoenix to Qt format, example:
|
||||
//"Text, XML files (*.txt,*.xml)" -> "Text, XML files (*.txt *.xml)"
|
||||
signed parentheses = 0;
|
||||
for(auto& n : filters) {
|
||||
if(n == '(') parentheses++;
|
||||
if(n == ')') parentheses--;
|
||||
if(n == ',' && parentheses) n = ' ';
|
||||
string filters;
|
||||
for(auto& filter : state.filters) {
|
||||
auto part = filter.split("|", 1L);
|
||||
if(part.size() != 2) continue;
|
||||
filters.append(part[0], " (", part[1].transform(":", " "), ");;");
|
||||
}
|
||||
filters.trimRight(";;", 1L);
|
||||
|
||||
QString filename = QFileDialog::getOpenFileName(
|
||||
state.parent ? state.parent->p.qtWindow : nullptr,
|
||||
state.title ? state.title : "Open File",
|
||||
state.parent ? state.parent->self()->qtWindow : nullptr,
|
||||
state.title ? QString::fromUtf8(state.title) : "Open File",
|
||||
QString::fromUtf8(state.path), QString::fromUtf8(filters)
|
||||
);
|
||||
return filename.toUtf8().constData();
|
||||
*/
|
||||
}
|
||||
|
||||
auto pBrowserWindow::save(BrowserWindow::State& state) -> string {
|
||||
return {};
|
||||
/*
|
||||
string filters = state.filters.merge(";;");
|
||||
|
||||
//convert filter list from phoenix to Qt format, example:
|
||||
//"Text, XML files (*.txt,*.xml)" -> "Text, XML files (*.txt *.xml)"
|
||||
signed parentheses = 0;
|
||||
for(auto& n : filters) {
|
||||
if(n == '(') parentheses++;
|
||||
if(n == ')') parentheses--;
|
||||
if(n == ',' && parentheses) n = ' ';
|
||||
string filters;
|
||||
for(auto& filter : state.filters) {
|
||||
auto part = filter.split("|", 1L);
|
||||
if(part.size() != 2) continue;
|
||||
filters.append(part[0], " (", part[1].transform(":", " "), ");;");
|
||||
}
|
||||
filters.trimRight(";;", 1L);
|
||||
|
||||
QString filename = QFileDialog::getSaveFileName(
|
||||
state.parent ? state.parent->p.qtWindow : nullptr,
|
||||
state.title ? state.title : "Save File",
|
||||
state.parent ? state.parent->self()->qtWindow : nullptr,
|
||||
state.title ? QString::fromUtf8(state.title) : "Save File",
|
||||
QString::fromUtf8(state.path), QString::fromUtf8(filters)
|
||||
);
|
||||
return filename.toUtf8().constData();
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -27,35 +27,31 @@ static auto MessageWindow_response(MessageWindow::Buttons buttons, QMessageBox::
|
||||
}
|
||||
|
||||
auto pMessageWindow::error(MessageWindow::State& state) -> MessageWindow::Response {
|
||||
return {};
|
||||
// return MessageWindow_response(
|
||||
// state.buttons, QMessageBox::critical(state.parent ? state.parent->p.qtWindow : nullptr, state.title ? state.title : " ",
|
||||
// QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons))
|
||||
// );
|
||||
return MessageWindow_response(
|
||||
state.buttons, QMessageBox::critical(state.parent ? state.parent->self()->qtWindow : nullptr, state.title ? QString::fromUtf8(state.title) : " ",
|
||||
QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons))
|
||||
);
|
||||
}
|
||||
|
||||
auto pMessageWindow::information(MessageWindow::State& state) -> MessageWindow::Response {
|
||||
return {};
|
||||
// return MessageWindow_response(
|
||||
// state.buttons, QMessageBox::information(state.parent ? state.parent->p.qtWindow : nullptr, state.title ? state.title : " ",
|
||||
// QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons))
|
||||
// );
|
||||
return MessageWindow_response(
|
||||
state.buttons, QMessageBox::information(state.parent ? state.parent->self()->qtWindow : nullptr, state.title ? QString::fromUtf8(state.title) : " ",
|
||||
QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons))
|
||||
);
|
||||
}
|
||||
|
||||
auto pMessageWindow::question(MessageWindow::State& state) -> MessageWindow::Response {
|
||||
return {};
|
||||
// return MessageWindow_response(
|
||||
// state.buttons, QMessageBox::question(state.parent ? state.parent->p.qtWindow : nullptr, state.title ? state.title : " ",
|
||||
// QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons))
|
||||
// );
|
||||
return MessageWindow_response(
|
||||
state.buttons, QMessageBox::question(state.parent ? state.parent->self()->qtWindow : nullptr, state.title ? QString::fromUtf8(state.title) : " ",
|
||||
QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons))
|
||||
);
|
||||
}
|
||||
|
||||
auto pMessageWindow::warning(MessageWindow::State& state) -> MessageWindow::Response {
|
||||
return {};
|
||||
// return MessageWindow_response(
|
||||
// state.buttons, QMessageBox::warning(state.parent ? state.parent->p.qtWindow : nullptr, state.title ? state.title : " ",
|
||||
// QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons))
|
||||
// );
|
||||
return MessageWindow_response(
|
||||
state.buttons, QMessageBox::warning(state.parent ? state.parent->self()->qtWindow : nullptr, state.title ? QString::fromUtf8(state.title) : " ",
|
||||
QString::fromUtf8(state.text), MessageWindow_buttons(state.buttons))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
1378
hiro/qt/qt.moc
1378
hiro/qt/qt.moc
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user