qt: Implement GUI dialog frontend for ProfileSelector
Presents profiles in a list, similar to switch.
This commit is contained in:
parent
60b59d554d
commit
bf90f2402d
6 changed files with 269 additions and 0 deletions
|
@ -208,6 +208,28 @@ GMainWindow::~GMainWindow() {
|
|||
delete render_window;
|
||||
}
|
||||
|
||||
void GMainWindow::ProfileSelectorSelectProfile() {
|
||||
QtProfileSelectionDialog dialog(this);
|
||||
dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint |
|
||||
Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint);
|
||||
dialog.setWindowModality(Qt::WindowModal);
|
||||
dialog.exec();
|
||||
|
||||
if (!dialog.GetStatus()) {
|
||||
emit ProfileSelectorFinishedSelection(std::nullopt);
|
||||
return;
|
||||
}
|
||||
|
||||
Service::Account::ProfileManager manager;
|
||||
const auto uuid = manager.GetUser(dialog.GetIndex());
|
||||
if (!uuid.has_value()) {
|
||||
emit ProfileSelectorFinishedSelection(std::nullopt);
|
||||
return;
|
||||
}
|
||||
|
||||
emit ProfileSelectorFinishedSelection(uuid);
|
||||
}
|
||||
|
||||
void GMainWindow::SoftwareKeyboardGetText(
|
||||
const Core::Frontend::SoftwareKeyboardParameters& parameters) {
|
||||
QtSoftwareKeyboardDialog dialog(this, parameters);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue