Compare commits

..

3 Commits

Author SHA1 Message Date
yuzubot
ca25d1cb9e Android #132 2023-11-15 00:57:02 +00:00
yuzubot
5ca8629bb2 Merge PR 11889 2023-11-15 00:57:02 +00:00
yuzubot
c3e377a701 Merge PR 11535 2023-11-15 00:57:02 +00:00
7 changed files with 12 additions and 48 deletions

View File

@@ -1,7 +1,7 @@
| Pull Request | Commit | Title | Author | Merged? |
|----|----|----|----|----|
| [11535](https://github.com/yuzu-emu/yuzu//pull/11535) | [`50bcfa5fb`](https://github.com/yuzu-emu/yuzu//pull/11535/files) | renderer_vulkan: Introduce separate cmd buffer for uploads | [GPUCode](https://github.com/GPUCode/) | Yes |
| [11889](https://github.com/yuzu-emu/yuzu//pull/11889) | [`a0410ec08`](https://github.com/yuzu-emu/yuzu//pull/11889/files) | configuration: Unify config handling across frontends | [t895](https://github.com/t895/) | Yes |
| [11889](https://github.com/yuzu-emu/yuzu//pull/11889) | [`a249b3018`](https://github.com/yuzu-emu/yuzu//pull/11889/files) | configuration: Unify config handling across frontends | [t895](https://github.com/t895/) | Yes |
End of merge log. You can find the original README.md below the break.

View File

@@ -13,7 +13,7 @@ struct Values {
Settings::Linkage linkage;
// Android
Settings::Setting<bool> picture_in_picture{linkage, false, "picture_in_picture",
Settings::Setting<bool> picture_in_picture{linkage, true, "picture_in_picture",
Settings::Category::Android};
Settings::Setting<s32> screen_layout{linkage,
5,

View File

@@ -612,12 +612,8 @@ bool Config::ReadBooleanSetting(const std::string& key, const std::optional<bool
s64 Config::ReadIntegerSetting(const std::string& key, const std::optional<s64> default_value) {
std::string full_key = GetFullKey(key, false);
if (!default_value.has_value()) {
try {
return std::stoll(
std::string(config->GetValue(GetSection().c_str(), full_key.c_str(), "0")));
} catch (...) {
return 0;
}
return std::stoll(
std::string(config->GetValue(GetSection().c_str(), full_key.c_str(), "0")));
}
s64 result = 0;
@@ -625,12 +621,8 @@ s64 Config::ReadIntegerSetting(const std::string& key, const std::optional<s64>
std::string(full_key).append("\\default").c_str(), true)) {
result = default_value.value();
} else {
try {
result = std::stoll(std::string(config->GetValue(
GetSection().c_str(), full_key.c_str(), ToString(default_value.value()).c_str())));
} catch (...) {
result = default_value.value();
}
result = std::stoll(std::string(config->GetValue(GetSection().c_str(), full_key.c_str(),
ToString(default_value.value()).c_str())));
}
return result;
}
@@ -675,11 +667,6 @@ std::string Config::ReadStringSetting(const std::string& key,
return result;
}
bool Config::Exists(const std::string& section, const std::string& key) const {
const std::string value = config->GetValue(section.c_str(), key.c_str(), "");
return !value.empty();
}
template <typename Type>
void Config::WriteSetting(const std::string& key, const Type& value,
const std::optional<Type>& default_value,

View File

@@ -36,8 +36,6 @@ public:
[[nodiscard]] const std::string& GetConfigFilePath() const;
[[nodiscard]] bool Exists(const std::string& section, const std::string& key) const;
protected:
explicit Config(ConfigType config_type = ConfigType::GlobalConfig);

View File

@@ -4878,8 +4878,8 @@ void GMainWindow::closeEvent(QCloseEvent* event) {
}
UpdateUISettings();
game_list->SaveInterfaceLayout();
UISettings::SaveWindowState();
game_list->SaveInterfaceLayout();
hotkey_registry.SaveHotkeys();
// Unload controllers early
@@ -5227,8 +5227,8 @@ static void SetHighDPIAttributes() {
}
int main(int argc, char* argv[]) {
UISettings::RestoreWindowState();
std::unique_ptr<QtConfig> config = std::make_unique<QtConfig>();
UISettings::RestoreWindowState(config);
bool has_broken_vulkan = false;
bool is_child = false;
if (CheckEnvVars(&is_child)) {

View File

@@ -55,6 +55,7 @@ u32 CalculateWidth(u32 height, Settings::AspectRatio ratio) {
return height * 16 / 9;
}
// You wanted to make a Save/Restore State thing here with a file in the config dir
void SaveWindowState() {
const auto window_state_config_loc =
FS::PathToUTF8String(FS::GetYuzuPath(FS::YuzuPath::ConfigDir) / "window_state.ini");
@@ -71,33 +72,12 @@ void SaveWindowState() {
config.sync();
}
void RestoreWindowState(std::unique_ptr<QtConfig>& qtConfig) {
void RestoreWindowState() {
const auto window_state_config_loc =
FS::PathToUTF8String(FS::GetYuzuPath(FS::YuzuPath::ConfigDir) / "window_state.ini");
// Migrate window state from old location
if (!FS::Exists(window_state_config_loc) && qtConfig->Exists("UI", "UILayout\\geometry")) {
const auto config_loc =
FS::PathToUTF8String(FS::GetYuzuPath(FS::YuzuPath::ConfigDir) / "qt-config.ini");
QSettings config(QString::fromStdString(config_loc), QSettings::IniFormat);
config.beginGroup(QStringLiteral("UI"));
config.beginGroup(QStringLiteral("UILayout"));
values.geometry = config.value(QStringLiteral("geometry")).toByteArray();
values.state = config.value(QStringLiteral("state")).toByteArray();
values.renderwindow_geometry =
config.value(QStringLiteral("geometryRenderWindow")).toByteArray();
values.gamelist_header_state =
config.value(QStringLiteral("gameListHeaderState")).toByteArray();
values.microprofile_geometry =
config.value(QStringLiteral("microProfileDialogGeometry")).toByteArray();
config.endGroup();
config.endGroup();
return;
}
void(FS::CreateParentDir(window_state_config_loc));
const QSettings config(QString::fromStdString(window_state_config_loc), QSettings::IniFormat);
QSettings config(QString::fromStdString(window_state_config_loc), QSettings::IniFormat);
values.geometry = config.value(QStringLiteral("geometry")).toByteArray();
values.state = config.value(QStringLiteral("state")).toByteArray();

View File

@@ -14,7 +14,6 @@
#include "common/common_types.h"
#include "common/settings.h"
#include "common/settings_enums.h"
#include "configuration/qt_config.h"
using Settings::Category;
using Settings::ConfirmStop;
@@ -216,7 +215,7 @@ extern Values values;
u32 CalculateWidth(u32 height, Settings::AspectRatio ratio);
void SaveWindowState();
void RestoreWindowState(std::unique_ptr<QtConfig>& qtConfig);
void RestoreWindowState();
// This shouldn't have anything except static initializers (no functions). So
// QKeySequence(...).toString() is NOT ALLOWED HERE.