mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-17 05:57:03 +02:00
fuck you
This commit is contained in:
parent
385d52133e
commit
45b4be2462
2 changed files with 13 additions and 17 deletions
|
|
@ -80,7 +80,7 @@ QString GetProfileUsernameFromUser(QWidget* parent, const QString& title, const
|
||||||
}
|
}
|
||||||
|
|
||||||
QString GetProfileUuidFromUser(QWidget* parent, const QString& title, const QString& text) {
|
QString GetProfileUuidFromUser(QWidget* parent, const QString& title, const QString& text) {
|
||||||
return LimitableInputDialog::GetText(parent, title, text, 0, int(Common::UUID));
|
return LimitableInputDialog::GetText(parent, title, text, 0, int(sizeof(Common::UUID::uuid)));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Anonymous namespace
|
} // Anonymous namespace
|
||||||
|
|
@ -217,9 +217,7 @@ void ConfigureProfileManager::AddUser() {
|
||||||
|
|
||||||
auto const uuid_str = GetProfileUuidFromUser(this, tr("New User UUID"), tr("Enter a UUID (optional):"));
|
auto const uuid_str = GetProfileUuidFromUser(this, tr("New User UUID"), tr("Enter a UUID (optional):"));
|
||||||
auto uuid = Common::UUID::MakeRandom();
|
auto uuid = Common::UUID::MakeRandom();
|
||||||
if (uuid_str.length() > 0) {
|
if (size_t(uuid_str.length()) == uuid.uuid.size()) {
|
||||||
if (size_t(uuid_str.length()) != uuid.uuid.size())
|
|
||||||
return;
|
|
||||||
for (size_t i = 0; i < size_t(uuid_str.length()); ++i)
|
for (size_t i = 0; i < size_t(uuid_str.length()); ++i)
|
||||||
uuid.uuid[i] = u8(uuid_str[i].toLatin1());
|
uuid.uuid[i] = u8(uuid_str[i].toLatin1());
|
||||||
}
|
}
|
||||||
|
|
@ -230,34 +228,32 @@ void ConfigureProfileManager::AddUser() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigureProfileManager::RenameUser() {
|
void ConfigureProfileManager::RenameUser() {
|
||||||
const auto user = tree_view->currentIndex().row();
|
const auto row_index = tree_view->currentIndex().row();
|
||||||
|
auto user = profile_manager.GetUser(row_index);
|
||||||
|
ASSERT(user);
|
||||||
|
|
||||||
Service::Account::ProfileBase profile{};
|
Service::Account::ProfileBase profile{};
|
||||||
if (!profile_manager.GetProfileBase(*uuid, profile))
|
if (!profile_manager.GetProfileBase(*user, profile))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const auto new_username = GetProfileUsernameFromUser(this, tr("New Username"), tr("Enter a new username:"));
|
const auto new_username = GetProfileUsernameFromUser(this, tr("New Username"), tr("Enter a new username:"));
|
||||||
if (new_username.isEmpty()) {
|
if (new_username.isEmpty())
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
auto const uuid_str = GetProfileUuidFromUser(this, tr("New User UUID"), tr("Enter a UUID (optional):"));
|
auto const uuid_str = GetProfileUuidFromUser(this, tr("New User UUID"), tr("Enter a UUID (optional):"));
|
||||||
auto uuid = profile_manager.GetUser(user);
|
if (size_t(uuid_str.length()) != user->uuid.size()) {
|
||||||
if (uuid_str.length() > 0) {
|
|
||||||
if (size_t(uuid_str.length()) != uuid.uuid.size())
|
|
||||||
return;
|
|
||||||
for (size_t i = 0; i < size_t(uuid_str.length()); ++i)
|
for (size_t i = 0; i < size_t(uuid_str.length()); ++i)
|
||||||
uuid.uuid[i] = u8(uuid_str[i].toLatin1());
|
user->uuid[i] = u8(uuid_str[i].toLatin1());
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto username_std = new_username.toStdString();
|
const auto username_std = new_username.toStdString();
|
||||||
std::fill(profile.username.begin(), profile.username.end(), '\0');
|
std::fill(profile.username.begin(), profile.username.end(), '\0');
|
||||||
std::copy(username_std.begin(), username_std.end(), profile.username.begin());
|
std::copy(username_std.begin(), username_std.end(), profile.username.begin());
|
||||||
|
|
||||||
profile_manager.SetProfileBase(*uuid, profile);
|
profile_manager.SetProfileBase(*user, profile);
|
||||||
profile_manager.WriteUserSaveFile();
|
profile_manager.WriteUserSaveFile();
|
||||||
|
|
||||||
item_model->setItem(user, 0, new QStandardItem{GetIcon(*uuid), FormatUserEntryText(QString::fromStdString(username_std), *uuid)});
|
item_model->setItem(row_index, 0, new QStandardItem{GetIcon(*user), FormatUserEntryText(QString::fromStdString(username_std), *user)});
|
||||||
UpdateCurrentUser();
|
UpdateCurrentUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||||
|
|
@ -66,7 +66,7 @@ QString LimitableInputDialog::GetText(QWidget* parent, const QString& title, con
|
||||||
if (!dialog.invalid_characters.isEmpty()) {
|
if (!dialog.invalid_characters.isEmpty()) {
|
||||||
dialog.RemoveInvalidCharacters();
|
dialog.RemoveInvalidCharacters();
|
||||||
}
|
}
|
||||||
ok_button->setEnabled(dialog.text_entry->text().length() >= min_character_limit);
|
ok_button->setEnabled(dialog.text_entry->text().length() > min_character_limit);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (dialog.exec() != QDialog::Accepted) {
|
if (dialog.exec() != QDialog::Accepted) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue