committed by
Caio Oliveira
No known key found for this signature in database
GPG Key ID: 362DA3DC1901E080
10 changed files with 1 additions and 216 deletions
-
26src/frontend_common/config.cpp
-
6src/frontend_common/config.h
-
2src/qt_common/config/shared_translation.cpp
-
3src/yuzu/CMakeLists.txt
-
4src/yuzu/configuration/configure_general.cpp
-
75src/yuzu/configuration/configure_linux_tab.cpp
-
44src/yuzu/configuration/configure_linux_tab.h
-
53src/yuzu/configuration/configure_linux_tab.ui
-
2src/yuzu/configuration/configure_per_game.cpp
-
2src/yuzu/configuration/configure_per_game.h
@ -1,75 +0,0 @@ |
|||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
||||
|
|
||||
#include "common/settings.h"
|
|
||||
#include "core/core.h"
|
|
||||
#include "ui_configure_linux_tab.h"
|
|
||||
#include "yuzu/configuration/configuration_shared.h"
|
|
||||
#include "yuzu/configuration/configure_linux_tab.h"
|
|
||||
#include "yuzu/configuration/shared_widget.h"
|
|
||||
|
|
||||
ConfigureLinuxTab::ConfigureLinuxTab(const Core::System& system_, |
|
||||
std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group_, |
|
||||
const ConfigurationShared::Builder& builder, QWidget* parent) |
|
||||
: Tab(group_, parent), ui(std::make_unique<Ui::ConfigureLinuxTab>()), system{system_} { |
|
||||
ui->setupUi(this); |
|
||||
|
|
||||
Setup(builder); |
|
||||
|
|
||||
SetConfiguration(); |
|
||||
} |
|
||||
|
|
||||
ConfigureLinuxTab::~ConfigureLinuxTab() = default; |
|
||||
|
|
||||
void ConfigureLinuxTab::SetConfiguration() {} |
|
||||
void ConfigureLinuxTab::Setup(const ConfigurationShared::Builder& builder) { |
|
||||
QLayout& linux_layout = *ui->linux_widget->layout(); |
|
||||
|
|
||||
std::map<u32, QWidget*> linux_hold{}; |
|
||||
|
|
||||
std::vector<Settings::BasicSetting*> settings; |
|
||||
const auto push = [&](Settings::Category category) { |
|
||||
for (const auto setting : Settings::values.linkage.by_category[category]) { |
|
||||
settings.push_back(setting); |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
push(Settings::Category::Linux); |
|
||||
|
|
||||
for (auto* setting : settings) { |
|
||||
auto* widget = builder.BuildWidget(setting, apply_funcs); |
|
||||
|
|
||||
if (widget == nullptr) { |
|
||||
continue; |
|
||||
} |
|
||||
if (!widget->Valid()) { |
|
||||
widget->deleteLater(); |
|
||||
continue; |
|
||||
} |
|
||||
|
|
||||
linux_hold.insert({setting->Id(), widget}); |
|
||||
} |
|
||||
|
|
||||
for (const auto& [id, widget] : linux_hold) { |
|
||||
linux_layout.addWidget(widget); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
void ConfigureLinuxTab::ApplyConfiguration() { |
|
||||
const bool is_powered_on = system.IsPoweredOn(); |
|
||||
for (const auto& apply_func : apply_funcs) { |
|
||||
apply_func(is_powered_on); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
void ConfigureLinuxTab::changeEvent(QEvent* event) { |
|
||||
if (event->type() == QEvent::LanguageChange) { |
|
||||
RetranslateUI(); |
|
||||
} |
|
||||
|
|
||||
QWidget::changeEvent(event); |
|
||||
} |
|
||||
|
|
||||
void ConfigureLinuxTab::RetranslateUI() { |
|
||||
ui->retranslateUi(this); |
|
||||
} |
|
||||
@ -1,44 +0,0 @@ |
|||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project |
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
|
|
||||
#pragma once |
|
||||
|
|
||||
#include <QWidget> |
|
||||
|
|
||||
namespace Core { |
|
||||
class System; |
|
||||
} |
|
||||
|
|
||||
namespace Ui { |
|
||||
class ConfigureLinuxTab; |
|
||||
} |
|
||||
|
|
||||
namespace ConfigurationShared { |
|
||||
class Builder; |
|
||||
} |
|
||||
|
|
||||
class ConfigureLinuxTab : public ConfigurationShared::Tab { |
|
||||
Q_OBJECT |
|
||||
|
|
||||
public: |
|
||||
explicit ConfigureLinuxTab(const Core::System& system_, |
|
||||
std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group, |
|
||||
const ConfigurationShared::Builder& builder, |
|
||||
QWidget* parent = nullptr); |
|
||||
~ConfigureLinuxTab() override; |
|
||||
|
|
||||
void ApplyConfiguration() override; |
|
||||
void SetConfiguration() override; |
|
||||
|
|
||||
private: |
|
||||
void changeEvent(QEvent* event) override; |
|
||||
void RetranslateUI(); |
|
||||
|
|
||||
void Setup(const ConfigurationShared::Builder& builder); |
|
||||
|
|
||||
std::unique_ptr<Ui::ConfigureLinuxTab> ui; |
|
||||
|
|
||||
const Core::System& system; |
|
||||
|
|
||||
std::vector<std::function<void(bool)>> apply_funcs{}; |
|
||||
}; |
|
||||
@ -1,53 +0,0 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||
<ui version="4.0"> |
|
||||
<class>ConfigureLinuxTab</class> |
|
||||
<widget class="QWidget" name="ConfigureLinuxTab"> |
|
||||
<property name="accessibleName"> |
|
||||
<string>Linux</string> |
|
||||
</property> |
|
||||
<layout class="QVBoxLayout"> |
|
||||
<item> |
|
||||
<widget class="QGroupBox" name="LinuxGroupBox"> |
|
||||
<property name="title"> |
|
||||
<string>Linux</string> |
|
||||
</property> |
|
||||
<layout class="QVBoxLayout" name="LinuxVerticalLayout_1"> |
|
||||
<item> |
|
||||
<widget class="QWidget" name="linux_widget" native="true"> |
|
||||
<layout class="QVBoxLayout" name="LinuxVerticalLayout_2"> |
|
||||
<property name="leftMargin"> |
|
||||
<number>0</number> |
|
||||
</property> |
|
||||
<property name="topMargin"> |
|
||||
<number>0</number> |
|
||||
</property> |
|
||||
<property name="rightMargin"> |
|
||||
<number>0</number> |
|
||||
</property> |
|
||||
<property name="bottomMargin"> |
|
||||
<number>0</number> |
|
||||
</property> |
|
||||
</layout> |
|
||||
</widget> |
|
||||
</item> |
|
||||
</layout> |
|
||||
</widget> |
|
||||
</item> |
|
||||
<item> |
|
||||
<spacer name="verticalSpacer"> |
|
||||
<property name="orientation"> |
|
||||
<enum>Qt::Vertical</enum> |
|
||||
</property> |
|
||||
<property name="sizeHint" stdset="0"> |
|
||||
<size> |
|
||||
<width>20</width> |
|
||||
<height>40</height> |
|
||||
</size> |
|
||||
</property> |
|
||||
</spacer> |
|
||||
</item> |
|
||||
</layout> |
|
||||
</widget> |
|
||||
<resources/> |
|
||||
<connections/> |
|
||||
</ui> |
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue