Skip to content

Commit

Permalink
Qt: Rename 'Input Profile' to 'Controller Preset'
Browse files Browse the repository at this point in the history
Hopefully more noob-proof?
  • Loading branch information
stenzek committed Jan 11, 2025
1 parent e4c11aa commit d3bee3c
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 41 deletions.
39 changes: 20 additions & 19 deletions src/core/fullscreen_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3872,7 +3872,7 @@ void FullscreenUI::DoLoadInputProfile()
coptions.reserve(profiles.size());
for (std::string& name : profiles)
coptions.emplace_back(std::move(name), false);
OpenChoiceDialog(FSUI_ICONSTR(ICON_FA_FOLDER_OPEN, "Load Profile"), false, std::move(coptions),
OpenChoiceDialog(FSUI_ICONSTR(ICON_FA_FOLDER_OPEN, "Load Preset"), false, std::move(coptions),
[](s32 index, const std::string& title, bool checked) {
if (index < 0)
return;
Expand All @@ -3889,7 +3889,7 @@ void FullscreenUI::DoLoadInputProfile()
SettingsInterface* dsi = GetEditingSettingsInterface();
InputManager::CopyConfiguration(dsi, ssi, true, true, true, IsEditingGameSettings(dsi));
SetSettingsChanged(dsi);
ShowToast(std::string(), fmt::format(FSUI_FSTR("Input profile '{}' loaded."), title));
ShowToast(std::string(), fmt::format(FSUI_FSTR("Controller preset '{}' loaded."), title));
CloseChoiceDialog();
});
}
Expand All @@ -3902,15 +3902,15 @@ void FullscreenUI::DoSaveInputProfile(const std::string& name)
SettingsInterface* ssi = GetEditingSettingsInterface();
InputManager::CopyConfiguration(&dsi, *ssi, true, true, true, IsEditingGameSettings(ssi));
if (dsi.Save())
ShowToast(std::string(), fmt::format(FSUI_FSTR("Input profile '{}' saved."), name));
ShowToast(std::string(), fmt::format(FSUI_FSTR("Controller preset '{}' saved."), name));
else
ShowToast(std::string(), fmt::format(FSUI_FSTR("Failed to save input profile '{}'."), name));
ShowToast(std::string(), fmt::format(FSUI_FSTR("Failed to save controller preset '{}'."), name));
}

void FullscreenUI::DoSaveNewInputProfile()
{
OpenInputStringDialog(FSUI_ICONSTR(ICON_FA_SAVE, "Save Profile"),
FSUI_STR("Enter the name of the input profile you wish to create."), std::string(),
OpenInputStringDialog(FSUI_ICONSTR(ICON_FA_SAVE, "Save Controller Preset"),
FSUI_STR("Enter the name of the controller preset you wish to create."), std::string(),
FSUI_ICONSTR(ICON_FA_FOLDER_PLUS, "Create"), [](std::string title) {
if (!title.empty())
DoSaveInputProfile(title);
Expand All @@ -3931,7 +3931,7 @@ void FullscreenUI::DoSaveInputProfile()
coptions.emplace_back(FSUI_STR("Create New..."), false);
for (std::string& name : profiles)
coptions.emplace_back(std::move(name), false);
OpenChoiceDialog(FSUI_ICONSTR(ICON_FA_SAVE, "Save Profile"), false, std::move(coptions),
OpenChoiceDialog(FSUI_ICONSTR(ICON_FA_SAVE, "Save Preset"), false, std::move(coptions),
[](s32 index, const std::string& title, bool checked) {
if (index < 0)
return;
Expand Down Expand Up @@ -4004,13 +4004,13 @@ void FullscreenUI::DrawControllerSettingsPage()
}
}

if (MenuButton(FSUI_ICONSTR(ICON_FA_FOLDER_OPEN, "Load Profile"),
FSUI_CSTR("Replaces these settings with a previously saved input profile.")))
if (MenuButton(FSUI_ICONSTR(ICON_FA_FOLDER_OPEN, "Load Preset"),
FSUI_CSTR("Replaces these settings with a previously saved controller preset.")))
{
DoLoadInputProfile();
}
if (MenuButton(FSUI_ICONSTR(ICON_FA_SAVE, "Save Profile"),
FSUI_CSTR("Stores the current settings to an input profile.")))
if (MenuButton(FSUI_ICONSTR(ICON_FA_SAVE, "Save Preset"),
FSUI_CSTR("Stores the current settings to a controller preset.")))
{
DoSaveInputProfile();
}
Expand Down Expand Up @@ -8214,6 +8214,8 @@ TRANSLATE_NOOP("FullscreenUI", "Controller Port {} Macros");
TRANSLATE_NOOP("FullscreenUI", "Controller Port {} Settings");
TRANSLATE_NOOP("FullscreenUI", "Controller Settings");
TRANSLATE_NOOP("FullscreenUI", "Controller Type");
TRANSLATE_NOOP("FullscreenUI", "Controller preset '{}' loaded.");
TRANSLATE_NOOP("FullscreenUI", "Controller preset '{}' saved.");
TRANSLATE_NOOP("FullscreenUI", "Controller settings reset to default.");
TRANSLATE_NOOP("FullscreenUI", "Controls");
TRANSLATE_NOOP("FullscreenUI", "Controls the volume of the audio played on the host when fast forwarding.");
Expand Down Expand Up @@ -8327,7 +8329,7 @@ TRANSLATE_NOOP("FullscreenUI", "Enables the replacement of background textures i
TRANSLATE_NOOP("FullscreenUI", "Encore Mode");
TRANSLATE_NOOP("FullscreenUI", "Ensures every frame generated is displayed for optimal pacing. Enable for variable refresh displays, such as GSync/FreeSync. Disable if you are having speed or sound issues.");
TRANSLATE_NOOP("FullscreenUI", "Enter Value");
TRANSLATE_NOOP("FullscreenUI", "Enter the name of the input profile you wish to create.");
TRANSLATE_NOOP("FullscreenUI", "Enter the name of the controller preset you wish to create.");
TRANSLATE_NOOP("FullscreenUI", "Error");
TRANSLATE_NOOP("FullscreenUI", "Execution Mode");
TRANSLATE_NOOP("FullscreenUI", "Exit");
Expand All @@ -8341,7 +8343,7 @@ TRANSLATE_NOOP("FullscreenUI", "Failed to delete save state.");
TRANSLATE_NOOP("FullscreenUI", "Failed to delete {}.");
TRANSLATE_NOOP("FullscreenUI", "Failed to load '{}'.");
TRANSLATE_NOOP("FullscreenUI", "Failed to load shader {}. It may be invalid.\nError was:");
TRANSLATE_NOOP("FullscreenUI", "Failed to save input profile '{}'.");
TRANSLATE_NOOP("FullscreenUI", "Failed to save controller preset '{}'.");
TRANSLATE_NOOP("FullscreenUI", "Fast Boot");
TRANSLATE_NOOP("FullscreenUI", "Fast Forward Boot");
TRANSLATE_NOOP("FullscreenUI", "Fast Forward Speed");
Expand Down Expand Up @@ -8399,8 +8401,6 @@ TRANSLATE_NOOP("FullscreenUI", "Increases the field of view from 4:3 to the chos
TRANSLATE_NOOP("FullscreenUI", "Increases the precision of polygon culling, reducing the number of holes in geometry.");
TRANSLATE_NOOP("FullscreenUI", "Inhibit Screensaver");
TRANSLATE_NOOP("FullscreenUI", "Input Sources");
TRANSLATE_NOOP("FullscreenUI", "Input profile '{}' loaded.");
TRANSLATE_NOOP("FullscreenUI", "Input profile '{}' saved.");
TRANSLATE_NOOP("FullscreenUI", "Integration");
TRANSLATE_NOOP("FullscreenUI", "Interface Settings");
TRANSLATE_NOOP("FullscreenUI", "Internal Resolution");
Expand All @@ -8420,7 +8420,7 @@ TRANSLATE_NOOP("FullscreenUI", "List Settings");
TRANSLATE_NOOP("FullscreenUI", "Load Database Cheats");
TRANSLATE_NOOP("FullscreenUI", "Load Devices From Save States");
TRANSLATE_NOOP("FullscreenUI", "Load Global State");
TRANSLATE_NOOP("FullscreenUI", "Load Profile");
TRANSLATE_NOOP("FullscreenUI", "Load Preset");
TRANSLATE_NOOP("FullscreenUI", "Load Resume State");
TRANSLATE_NOOP("FullscreenUI", "Load State");
TRANSLATE_NOOP("FullscreenUI", "Loads all replacement texture to RAM, reducing stuttering at runtime.");
Expand Down Expand Up @@ -8546,7 +8546,7 @@ TRANSLATE_NOOP("FullscreenUI", "Removed stage {} ({}).");
TRANSLATE_NOOP("FullscreenUI", "Removes this shader from the chain.");
TRANSLATE_NOOP("FullscreenUI", "Renames existing save states when saving to a backup file.");
TRANSLATE_NOOP("FullscreenUI", "Rendering");
TRANSLATE_NOOP("FullscreenUI", "Replaces these settings with a previously saved input profile.");
TRANSLATE_NOOP("FullscreenUI", "Replaces these settings with a previously saved controller preset.");
TRANSLATE_NOOP("FullscreenUI", "Rescan All Games");
TRANSLATE_NOOP("FullscreenUI", "Reset Memory Card Directory");
TRANSLATE_NOOP("FullscreenUI", "Reset Play Time");
Expand Down Expand Up @@ -8577,7 +8577,8 @@ TRANSLATE_NOOP("FullscreenUI", "Runs the software renderer in parallel for VRAM
TRANSLATE_NOOP("FullscreenUI", "SDL DualSense Player LED");
TRANSLATE_NOOP("FullscreenUI", "SDL DualShock 4 / DualSense Enhanced Mode");
TRANSLATE_NOOP("FullscreenUI", "Safe Mode");
TRANSLATE_NOOP("FullscreenUI", "Save Profile");
TRANSLATE_NOOP("FullscreenUI", "Save Controller Preset");
TRANSLATE_NOOP("FullscreenUI", "Save Preset");
TRANSLATE_NOOP("FullscreenUI", "Save Screenshot");
TRANSLATE_NOOP("FullscreenUI", "Save State");
TRANSLATE_NOOP("FullscreenUI", "Save State Compression");
Expand Down Expand Up @@ -8679,7 +8680,7 @@ TRANSLATE_NOOP("FullscreenUI", "Start Fullscreen");
TRANSLATE_NOOP("FullscreenUI", "Start Game");
TRANSLATE_NOOP("FullscreenUI", "Start a game from a disc in your PC's DVD drive.");
TRANSLATE_NOOP("FullscreenUI", "Start the console without any disc inserted.");
TRANSLATE_NOOP("FullscreenUI", "Stores the current settings to an input profile.");
TRANSLATE_NOOP("FullscreenUI", "Stores the current settings to a controller preset.");
TRANSLATE_NOOP("FullscreenUI", "Stretch Display Vertically");
TRANSLATE_NOOP("FullscreenUI", "Stretch Mode");
TRANSLATE_NOOP("FullscreenUI", "Stretches the display to match the aspect ratio by multiplying vertically instead of horizontally.");
Expand Down
32 changes: 16 additions & 16 deletions src/duckstation-qt/controllersettingswindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ ControllerSettingsWindow::ControllerSettingsWindow(SettingsInterface* game_sif /

if (edit_profiles)
{
setWindowTitle(tr("DuckStation Controller Profiles"));
setWindowTitle(tr("DuckStation Controller Presets"));
refreshProfileList();

connect(m_ui.currentProfile, &QComboBox::currentIndexChanged, this,
Expand Down Expand Up @@ -172,7 +172,7 @@ void ControllerSettingsWindow::onCurrentProfileChanged(int index)
void ControllerSettingsWindow::onNewProfileClicked()
{
const std::string profile_name =
QInputDialog::getText(this, tr("Create Input Profile"), tr("Enter the name for the new input profile:"))
QInputDialog::getText(this, tr("Create Controller Preset"), tr("Enter the name for the new controller preset:"))
.toStdString();
if (profile_name.empty())
return;
Expand All @@ -181,13 +181,13 @@ void ControllerSettingsWindow::onNewProfileClicked()
if (FileSystem::FileExists(profile_path.c_str()))
{
QMessageBox::critical(this, tr("Error"),
tr("A profile with the name '%1' already exists.").arg(QString::fromStdString(profile_name)));
tr("A preset with the name '%1' already exists.").arg(QString::fromStdString(profile_name)));
return;
}

const int res = QMessageBox::question(this, tr("Create Input Profile"),
tr("Do you want to copy all bindings from the currently-selected profile to "
"the new profile? Selecting No will create a completely empty profile."),
const int res = QMessageBox::question(this, tr("Create Controller Preset"),
tr("Do you want to copy all bindings from the currently-selected preset to "
"the new preset? Selecting No will create a completely empty preset."),
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
if (res == QMessageBox::Cancel)
return;
Expand All @@ -199,8 +199,8 @@ void ControllerSettingsWindow::onNewProfileClicked()
if (!m_editing_settings_interface)
{
const int hkres = QMessageBox::question(
this, tr("Create Input Profile"),
tr("Do you want to copy the current hotkey bindings from global settings to the new input profile?"),
this, tr("Create Controller Preset"),
tr("Do you want to copy the current hotkey bindings from global settings to the new controller preset?"),
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
if (hkres == QMessageBox::Cancel)
return;
Expand Down Expand Up @@ -235,7 +235,7 @@ void ControllerSettingsWindow::onNewProfileClicked()
if (!temp_si.Save())
{
QMessageBox::critical(this, tr("Error"),
tr("Failed to save the new profile to '%1'.").arg(QString::fromStdString(temp_si.GetPath())));
tr("Failed to save the new preset to '%1'.").arg(QString::fromStdString(temp_si.GetPath())));
return;
}

Expand All @@ -245,9 +245,9 @@ void ControllerSettingsWindow::onNewProfileClicked()

void ControllerSettingsWindow::onApplyProfileClicked()
{
if (QMessageBox::question(this, tr("Load Input Profile"),
tr("Are you sure you want to load the input profile named '%1'?\n\n"
"All current global bindings will be removed, and the profile bindings loaded.\n\n"
if (QMessageBox::question(this, tr("Load Controller Preset"),
tr("Are you sure you want to apply the controller preset named '%1'?\n\n"
"All current global bindings will be removed, and the preset bindings loaded.\n\n"
"You cannot undo this action.")
.arg(m_profile_name)) != QMessageBox::Yes)
{
Expand All @@ -270,8 +270,8 @@ void ControllerSettingsWindow::onApplyProfileClicked()

void ControllerSettingsWindow::onDeleteProfileClicked()
{
if (QMessageBox::question(this, tr("Delete Input Preset"),
tr("Are you sure you want to delete the input preset named '%1'?\n\n"
if (QMessageBox::question(this, tr("Delete Controller Preset"),
tr("Are you sure you want to delete the controller preset named '%1'?\n\n"
"You cannot undo this action.")
.arg(m_profile_name)) != QMessageBox::Yes)
{
Expand Down Expand Up @@ -323,7 +323,7 @@ void ControllerSettingsWindow::onCopyGlobalSettingsClicked()

QMessageBox::information(QtUtils::GetRootWidget(this), tr("DuckStation Controller Settings"),
isEditingGameSettings() ? tr("Per-game controller configuration reset to global settings.") :
tr("Controller profile reset to global settings."));
tr("Controller preset reset to global settings."));
}

bool ControllerSettingsWindow::getBoolValue(const char* section, const char* key, bool default_value) const
Expand Down Expand Up @@ -583,7 +583,7 @@ void ControllerSettingsWindow::switchProfile(const std::string_view name)
std::string path = System::GetInputProfilePath(name);
if (!FileSystem::FileExists(path.c_str()))
{
QMessageBox::critical(this, tr("Error"), tr("The input profile named '%1' cannot be found.").arg(name_qstr));
QMessageBox::critical(this, tr("Error"), tr("The controller preset named '%1' cannot be found.").arg(name_qstr));
return;
}

Expand Down
8 changes: 4 additions & 4 deletions src/duckstation-qt/controllersettingswindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<item>
<widget class="QLabel" name="editProfileLabel">
<property name="text">
<string>Editing Profile:</string>
<string>Editing Preset:</string>
</property>
</widget>
</item>
Expand All @@ -89,7 +89,7 @@
<item>
<widget class="QPushButton" name="newProfile">
<property name="text">
<string>New Profile</string>
<string>New Preset</string>
</property>
<property name="icon">
<iconset theme="add-line"/>
Expand All @@ -99,7 +99,7 @@
<item>
<widget class="QPushButton" name="applyProfile">
<property name="text">
<string>Apply Profile</string>
<string>Apply Preset</string>
</property>
<property name="icon">
<iconset theme="folder-open-line"/>
Expand All @@ -109,7 +109,7 @@
<item>
<widget class="QPushButton" name="deleteProfile">
<property name="text">
<string>Delete Profile</string>
<string>Delete Preset</string>
</property>
<property name="icon">
<iconset theme="minus-line"/>
Expand Down
2 changes: 1 addition & 1 deletion src/duckstation-qt/gamesummarywidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<item row="14" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Input Profile:</string>
<string>Controller Preset:</string>
</property>
</widget>
</item>
Expand Down
2 changes: 1 addition & 1 deletion src/duckstation-qt/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@
<iconset theme="controllers-line"/>
</property>
<property name="text">
<string>Controller Profiles</string>
<string>Controller Presets</string>
</property>
</action>
</widget>
Expand Down

0 comments on commit d3bee3c

Please sign in to comment.