mirror of
https://github.com/yuzu-emu/yuzu-android
synced 2025-08-25 16:44:03 -07:00
yuzu: create linux group in general settings
- Create files dedicated to starting and stopping gamemode functions - Use them in yuzu and yuzu_cmd modules
This commit is contained in:
@@ -29,9 +29,6 @@ ConfigureGeneral::ConfigureGeneral(const Core::System& system_,
|
||||
if (!Settings::IsConfiguringGlobal()) {
|
||||
ui->button_reset_defaults->setVisible(false);
|
||||
}
|
||||
#ifndef __linux__
|
||||
ui->enable_gamemode->setVisible(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
ConfigureGeneral::~ConfigureGeneral() = default;
|
||||
@@ -39,12 +36,29 @@ ConfigureGeneral::~ConfigureGeneral() = default;
|
||||
void ConfigureGeneral::SetConfiguration() {}
|
||||
|
||||
void ConfigureGeneral::Setup(const ConfigurationShared::Builder& builder) {
|
||||
QLayout& layout = *ui->general_widget->layout();
|
||||
QLayout& general_layout = *ui->general_widget->layout();
|
||||
QLayout& linux_layout = *ui->linux_widget->layout();
|
||||
|
||||
std::map<u32, QWidget*> hold{};
|
||||
std::map<u32, QWidget*> general_hold{};
|
||||
std::map<u32, QWidget*> linux_hold{};
|
||||
|
||||
for (const auto setting :
|
||||
UISettings::values.linkage.by_category[Settings::Category::UiGeneral]) {
|
||||
std::vector<Settings::BasicSetting*> settings;
|
||||
|
||||
auto push = [&settings](auto& list) {
|
||||
for (auto setting : list) {
|
||||
settings.push_back(setting);
|
||||
}
|
||||
};
|
||||
|
||||
push(UISettings::values.linkage.by_category[Settings::Category::UiGeneral]);
|
||||
push(Settings::values.linkage.by_category[Settings::Category::Linux]);
|
||||
|
||||
// Only show Linux group on Unix
|
||||
#ifndef __unix__
|
||||
ui->LinuxGroupBox->setVisible(false);
|
||||
#endif
|
||||
|
||||
for (const auto setting : settings) {
|
||||
auto* widget = builder.BuildWidget(setting, apply_funcs);
|
||||
|
||||
if (widget == nullptr) {
|
||||
@@ -55,11 +69,23 @@ void ConfigureGeneral::Setup(const ConfigurationShared::Builder& builder) {
|
||||
continue;
|
||||
}
|
||||
|
||||
hold.emplace(setting->Id(), widget);
|
||||
switch (setting->GetCategory()) {
|
||||
case Settings::Category::UiGeneral:
|
||||
general_hold.emplace(setting->Id(), widget);
|
||||
break;
|
||||
case Settings::Category::Linux:
|
||||
linux_hold.emplace(setting->Id(), widget);
|
||||
break;
|
||||
default:
|
||||
widget->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& [id, widget] : hold) {
|
||||
layout.addWidget(widget);
|
||||
for (const auto& [id, widget] : general_hold) {
|
||||
general_layout.addWidget(widget);
|
||||
}
|
||||
for (const auto& [id, widget] : linux_hold) {
|
||||
linux_layout.addWidget(widget);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user