* 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:
byuu
2020-02-23 20:23:25 +09:00
parent c13745d753
commit d2211d8818
63 changed files with 1091 additions and 1154 deletions

View File

@@ -2,6 +2,11 @@
namespace hiro {
auto pApplication::exit() -> void {
quit();
::exit(EXIT_SUCCESS);
}
auto pApplication::modal() -> bool {
return Application::state().modal > 0;
}

View File

@@ -3,6 +3,7 @@
namespace hiro {
struct pApplication {
static auto exit() -> void;
static auto modal() -> bool;
static auto run() -> void;
static auto pendingEvents() -> bool;

View File

@@ -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();
*/
}
}

View File

@@ -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))
);
}
}

File diff suppressed because it is too large Load Diff