mirror of
https://github.com/stenzek/duckstation.git
synced 2026-02-07 14:54:32 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bcc0a739b | ||
|
|
24c43abef0 | ||
|
|
740998b84d | ||
|
|
ca59d794eb | ||
|
|
ce83fb8f5d | ||
|
|
f0709ae8f9 | ||
|
|
72561b5071 | ||
|
|
1feea431bc |
@@ -110,8 +110,6 @@ struct FetchGameTitlesParameters
|
||||
|
||||
} // namespace
|
||||
|
||||
static TinyString GameHashToString(const std::optional<GameHash>& hash);
|
||||
|
||||
static void ReportError(std::string_view sv);
|
||||
template<typename... T>
|
||||
static void ReportFmtError(fmt::format_string<T...> fmt, T&&... args);
|
||||
|
||||
@@ -71,6 +71,9 @@ std::optional<GameHash> GetGameHash(const std::string_view executable_name, std:
|
||||
/// Returns the number of achievements for a given hash.
|
||||
const HashDatabaseEntry* LookupGameHash(const GameHash& hash);
|
||||
|
||||
/// Converts a game hash to a string for display. If the hash is nullopt, returns "[NO HASH]".
|
||||
TinyString GameHashToString(const std::optional<GameHash>& hash);
|
||||
|
||||
/// Initializes the RetroAchievments client.
|
||||
bool Initialize();
|
||||
|
||||
|
||||
@@ -534,7 +534,7 @@ std::optional<Image> FullscreenUI::LoadTextureImage(std::string_view path, u32 s
|
||||
if (svg_data.has_value())
|
||||
{
|
||||
image = Image();
|
||||
if (!image->RasterizeSVG(svg_data->cspan(), svg_width, svg_height))
|
||||
if (!image->RasterizeSVG(svg_data->cspan(), svg_width, svg_height, &error))
|
||||
{
|
||||
ERROR_LOG("Failed to rasterize SVG texture file '{}': {}", path, error.GetDescription());
|
||||
image.reset();
|
||||
@@ -1086,6 +1086,8 @@ void FullscreenUI::EndLayout()
|
||||
s_state.left_fullscreen_footer_text.clear();
|
||||
s_state.fullscreen_footer_text.clear();
|
||||
|
||||
s_state.split_window_focus_change = SplitWindowFocusChange::None;
|
||||
|
||||
s_state.rendered_menu_item_border = false;
|
||||
s_state.had_hovered_menu_item = std::exchange(s_state.has_hovered_menu_item, false);
|
||||
|
||||
@@ -3410,8 +3412,6 @@ void FullscreenUI::BeginInnerSplitWindow()
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_ChildBorderSize, 0.0f);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 0.0f);
|
||||
|
||||
s_state.split_window_focus_change = SplitWindowFocusChange::None;
|
||||
|
||||
if (!ImGui::IsPopupOpen(0u, ImGuiPopupFlags_AnyPopup))
|
||||
{
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_GamepadDpadLeft, true) || ImGui::IsKeyPressed(ImGuiKey_LeftArrow, true))
|
||||
@@ -3453,6 +3453,7 @@ bool FullscreenUI::BeginSplitWindowSidebar(float sidebar_width /*= 0.2f*/)
|
||||
// cancel any pending focus change
|
||||
if (s_state.split_window_focus_change == SplitWindowFocusChange::FocusSidebar)
|
||||
{
|
||||
// don't eat the right keypress
|
||||
s_state.split_window_focus_change = SplitWindowFocusChange::None;
|
||||
CancelResetFocus();
|
||||
}
|
||||
@@ -3542,7 +3543,7 @@ bool FullscreenUI::BeginSplitWindowContent(bool background)
|
||||
ImGui::PushStyleColor(ImGuiCol_ChildBg,
|
||||
ModAlpha(DarkerColor(ImGui::GetStyle().Colors[ImGuiCol_WindowBg], 1.5f), 0.25f));
|
||||
|
||||
if (IsFocusResetFromWindowChange())
|
||||
if (IsFocusResetFromWindowChange() || s_state.split_window_focus_change == SplitWindowFocusChange::FocusContent)
|
||||
ImGui::SetNextWindowScroll(ImVec2(0.0f, 0.0f));
|
||||
|
||||
ImGuiWindow* const window = ImGui::GetCurrentWindow();
|
||||
@@ -3557,10 +3558,16 @@ bool FullscreenUI::BeginSplitWindowContent(bool background)
|
||||
// cancel any pending focus change
|
||||
if (s_state.split_window_focus_change == SplitWindowFocusChange::FocusContent)
|
||||
{
|
||||
// don't eat the right keypress
|
||||
s_state.split_window_focus_change = SplitWindowFocusChange::None;
|
||||
CancelResetFocus();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (s_state.split_window_focus_change == SplitWindowFocusChange::FocusContent)
|
||||
ResetFocusHere();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -753,7 +753,7 @@ void Settings::Save(SettingsInterface& si, bool ignore_base) const
|
||||
si.SetFloatValue("Display", "OSDScale", display_osd_scale);
|
||||
si.SetFloatValue("Display", "OSDMargin", display_osd_margin);
|
||||
|
||||
for (size_t i = 0; i < static_cast<size_t>(OSDMessageType::MaxCount); i++)
|
||||
for (size_t i = 0; i < static_cast<size_t>(OSDMessageType::Persistent); i++)
|
||||
{
|
||||
si.SetFloatValue(
|
||||
"Display",
|
||||
|
||||
@@ -172,7 +172,7 @@ static void WarnAboutUnsafeSettings();
|
||||
static void LogUnsafeSettingsToConsole(const SmallStringBase& messages);
|
||||
|
||||
static bool Initialize(std::unique_ptr<CDImage> disc, DiscRegion disc_region, bool force_software_renderer,
|
||||
bool fullscreen, Error* error);
|
||||
std::optional<bool> start_fullscreen, Error* error);
|
||||
static bool LoadBIOS(Error* error);
|
||||
static bool SetBootMode(BootMode new_boot_mode, DiscRegion disc_region, Error* error);
|
||||
static void InternalReset();
|
||||
@@ -1933,9 +1933,11 @@ bool System::BootSystem(SystemBootParameters parameters, Error* error)
|
||||
}
|
||||
|
||||
// Load BIOS image, component setup, check for subchannel in games that need it.
|
||||
const std::optional<bool> start_fullscreen = parameters.override_fullscreen.has_value() ?
|
||||
std::optional<bool>(parameters.override_fullscreen.value()) :
|
||||
(ShouldStartFullscreen() ? std::optional<bool>(true) : std::nullopt);
|
||||
if (!SetBootMode(boot_mode, disc_region, error) ||
|
||||
!Initialize(std::move(disc), disc_region, parameters.force_software_renderer,
|
||||
parameters.override_fullscreen.value_or(ShouldStartFullscreen()), error))
|
||||
!Initialize(std::move(disc), disc_region, parameters.force_software_renderer, start_fullscreen, error))
|
||||
{
|
||||
Host::OnSystemStopping();
|
||||
DestroySystem();
|
||||
@@ -2030,7 +2032,7 @@ bool System::BootSystem(SystemBootParameters parameters, Error* error)
|
||||
}
|
||||
|
||||
bool System::Initialize(std::unique_ptr<CDImage> disc, DiscRegion disc_region, bool force_software_renderer,
|
||||
bool fullscreen, Error* error)
|
||||
std::optional<bool> start_fullscreen, Error* error)
|
||||
{
|
||||
// Cheats have to be loaded first, otherwise we don't apply settings that are used below.
|
||||
if (!IsReplayingGPUDump())
|
||||
@@ -2083,7 +2085,7 @@ bool System::Initialize(std::unique_ptr<CDImage> disc, DiscRegion disc_region, b
|
||||
|
||||
// This can fail due to the application being closed during startup.
|
||||
if (!VideoThread::CreateGPUBackend(force_software_renderer ? GPURenderer::Software : g_settings.gpu_renderer, false,
|
||||
fullscreen, error))
|
||||
start_fullscreen, error))
|
||||
{
|
||||
// Game info has to be manually cleared since the backend won't shutdown naturally.
|
||||
VideoThread::ClearGameInfo();
|
||||
|
||||
@@ -542,7 +542,8 @@ bool VideoThread::Reconfigure(std::optional<GPURenderer> renderer, bool upload_v
|
||||
INFO_LOG("Reconfiguring video thread.");
|
||||
|
||||
const bool new_requested_fullscreen_ui = start_fullscreen_ui.value_or(s_state.requested_fullscreen_ui);
|
||||
const bool new_fullscreen_state = fullscreen.value_or(s_state.fullscreen_state);
|
||||
const bool new_fullscreen_state =
|
||||
((renderer.has_value() || new_requested_fullscreen_ui) && fullscreen.value_or(s_state.fullscreen_state));
|
||||
|
||||
GPURenderer created_renderer = GPURenderer::Count;
|
||||
VideoThreadReconfigureCommand::Result result = VideoThreadReconfigureCommand::Result::Failed;
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
#include "moc_advancedsettingswidget.cpp"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
static QCheckBox* addBooleanTweakOption(SettingsWindow* dialog, QTableWidget* table, QString name, std::string section,
|
||||
std::string key, bool default_value)
|
||||
{
|
||||
@@ -137,13 +139,13 @@ static void addDirectoryOption(SettingsWindow* dialog, QTableWidget* table, cons
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
QLineEdit* value = new QLineEdit(container);
|
||||
value->setObjectName(QStringLiteral("value"));
|
||||
value->setObjectName("value"_L1);
|
||||
SettingWidgetBinder::BindWidgetToStringSetting(dialog->getSettingsInterface(), value, std::move(section),
|
||||
std::move(key));
|
||||
layout->addWidget(value, 1);
|
||||
|
||||
QPushButton* browse = new QPushButton(container);
|
||||
browse->setText(QStringLiteral("..."));
|
||||
browse->setText("..."_L1);
|
||||
browse->setMaximumWidth(32);
|
||||
QObject::connect(browse, &QPushButton::clicked, browse, [browse, value, name]() {
|
||||
const QString path(QDir::toNativeSeparators(QFileDialog::getExistingDirectory(
|
||||
@@ -160,7 +162,7 @@ static void setDirectoryOption(QTableWidget* table, int row, const char* value)
|
||||
{
|
||||
QWidget* widget = table->cellWidget(row, 1);
|
||||
Assert(widget);
|
||||
QLineEdit* valuew = widget->findChild<QLineEdit*>(QStringLiteral("value"));
|
||||
QLineEdit* valuew = widget->findChild<QLineEdit*>("value"_L1);
|
||||
Assert(valuew);
|
||||
valuew->setText(QString::fromUtf8(value));
|
||||
}
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
|
||||
#include "moc_autoupdaterdialog.cpp"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
// Interval at which HTTP requests are polled.
|
||||
static constexpr u32 HTTP_POLL_INTERVAL = 10;
|
||||
|
||||
@@ -427,7 +429,7 @@ void AutoUpdaterDialog::getLatestReleaseComplete(s32 status_code, const Error& e
|
||||
|
||||
// search for the correct file
|
||||
const QJsonArray assets(doc_object["assets"].toArray());
|
||||
const QString asset_filename = QStringLiteral(UPDATER_ASSET_FILENAME);
|
||||
const QLatin1StringView asset_filename = UPDATER_ASSET_FILENAME ""_L1;
|
||||
bool asset_found = false;
|
||||
for (const QJsonValue& asset : assets)
|
||||
{
|
||||
@@ -509,7 +511,7 @@ void AutoUpdaterDialog::getChangesComplete(s32 status_code, const Error& error,
|
||||
const QJsonObject doc_object(doc.object());
|
||||
|
||||
QString changes_html = tr("<h2>Changes:</h2>");
|
||||
changes_html += QStringLiteral("<ul>");
|
||||
changes_html += "<ul>"_L1;
|
||||
|
||||
const QJsonArray commits(doc_object["commits"].toArray());
|
||||
bool update_will_break_save_states = false;
|
||||
@@ -529,7 +531,7 @@ void AutoUpdaterDialog::getChangesComplete(s32 status_code, const Error& error,
|
||||
QStringLiteral("<li>%1 <i>(%2)</i></li>").arg(message.toHtmlEscaped()).arg(author.toHtmlEscaped());
|
||||
}
|
||||
|
||||
if (message.contains(QStringLiteral("[SAVEVERSION+]")))
|
||||
if (message.contains("[SAVEVERSION+]"_L1))
|
||||
update_will_break_save_states = true;
|
||||
}
|
||||
|
||||
@@ -852,7 +854,7 @@ bool AutoUpdaterDialog::processUpdate(const std::vector<u8>& update_data)
|
||||
reportError(fmt::format("Application {} isn't a bundle.", bundle_path.value()));
|
||||
return false;
|
||||
}
|
||||
if (info.suffix() != QStringLiteral("app"))
|
||||
if (info.suffix() != "app"_L1)
|
||||
{
|
||||
reportError(
|
||||
fmt::format("Unexpected application suffix {} on {}.", info.suffix().toStdString(), bundle_path.value()));
|
||||
@@ -1012,7 +1014,7 @@ bool AutoUpdaterDialog::processUpdate(const std::vector<u8>& update_data)
|
||||
// Execute new appimage.
|
||||
QProcess* new_process = new QProcess();
|
||||
new_process->setProgram(QString::fromUtf8(appimage_path));
|
||||
new_process->setArguments(QStringList{QStringLiteral("-updatecleanup")});
|
||||
new_process->setArguments(QStringList{"-updatecleanup"_L1});
|
||||
if (!new_process->startDetached())
|
||||
{
|
||||
reportError("Failed to execute new AppImage.");
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
#include "moc_biossettingswidget.cpp"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
BIOSSettingsWidget::BIOSSettingsWidget(SettingsWindow* dialog, QWidget* parent) : QWidget(parent), m_dialog(dialog)
|
||||
{
|
||||
SettingsInterface* sif = dialog->getSettingsInterface();
|
||||
@@ -134,9 +136,9 @@ void BIOSSettingsWidget::populateDropDownForRegion(ConsoleRegion region, QComboB
|
||||
cb->clear();
|
||||
|
||||
if (per_game)
|
||||
cb->addItem(QIcon(QStringLiteral(":/icons/system-search.png")), tr("Use Global Setting"));
|
||||
cb->addItem(QIcon(":/icons/system-search.png"_L1), tr("Use Global Setting"));
|
||||
|
||||
cb->addItem(QIcon(QStringLiteral(":/icons/system-search.png")), tr("Auto-Detect"));
|
||||
cb->addItem(QIcon(":/icons/system-search.png"_L1), tr("Auto-Detect"));
|
||||
|
||||
std::sort(images.begin(), images.end(), [region](const auto& left, const auto& right) {
|
||||
const bool left_region_match = (left.second && left.second->region == region);
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
|
||||
#include "moc_controllerbindingwidgets.cpp"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
LOG_CHANNEL(Host);
|
||||
|
||||
ControllerBindingWidget::ControllerBindingWidget(QWidget* parent, ControllerSettingsWindow* dialog, u32 port)
|
||||
@@ -116,7 +118,7 @@ void ControllerBindingWidget::populateWidgets()
|
||||
Ui::ControllerBindingWidget_AnalogController ui;
|
||||
ui.setupUi(m_bindings_widget);
|
||||
bindBindingWidgets(m_bindings_widget);
|
||||
m_icon = QIcon::fromTheme(QStringLiteral("controller-line"));
|
||||
m_icon = QIcon::fromTheme("controller-line"_L1);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -125,7 +127,7 @@ void ControllerBindingWidget::populateWidgets()
|
||||
Ui::ControllerBindingWidget_AnalogJoystick ui;
|
||||
ui.setupUi(m_bindings_widget);
|
||||
bindBindingWidgets(m_bindings_widget);
|
||||
m_icon = QIcon::fromTheme(QStringLiteral("joystick-line"));
|
||||
m_icon = QIcon::fromTheme("joystick-line"_L1);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -134,7 +136,7 @@ void ControllerBindingWidget::populateWidgets()
|
||||
Ui::ControllerBindingWidget_DigitalController ui;
|
||||
ui.setupUi(m_bindings_widget);
|
||||
bindBindingWidgets(m_bindings_widget);
|
||||
m_icon = QIcon::fromTheme(QStringLiteral("controller-digital-line"));
|
||||
m_icon = QIcon::fromTheme("controller-digital-line"_L1);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -143,7 +145,7 @@ void ControllerBindingWidget::populateWidgets()
|
||||
Ui::ControllerBindingWidget_GunCon ui;
|
||||
ui.setupUi(m_bindings_widget);
|
||||
bindBindingWidgets(m_bindings_widget);
|
||||
m_icon = QIcon::fromTheme(QStringLiteral("guncon-line"));
|
||||
m_icon = QIcon::fromTheme("guncon-line"_L1);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -152,7 +154,7 @@ void ControllerBindingWidget::populateWidgets()
|
||||
Ui::ControllerBindingWidget_NeGcon ui;
|
||||
ui.setupUi(m_bindings_widget);
|
||||
bindBindingWidgets(m_bindings_widget);
|
||||
m_icon = QIcon::fromTheme(QStringLiteral("negcon-line"));
|
||||
m_icon = QIcon::fromTheme("negcon-line"_L1);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -161,7 +163,7 @@ void ControllerBindingWidget::populateWidgets()
|
||||
Ui::ControllerBindingWidget_NeGconRumble ui;
|
||||
ui.setupUi(m_bindings_widget);
|
||||
bindBindingWidgets(m_bindings_widget);
|
||||
m_icon = QIcon::fromTheme(QStringLiteral("negcon-line"));
|
||||
m_icon = QIcon::fromTheme("negcon-line"_L1);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -170,7 +172,7 @@ void ControllerBindingWidget::populateWidgets()
|
||||
Ui::ControllerBindingWidget_Mouse ui;
|
||||
ui.setupUi(m_bindings_widget);
|
||||
bindBindingWidgets(m_bindings_widget);
|
||||
m_icon = QIcon::fromTheme(QStringLiteral("mouse-line"));
|
||||
m_icon = QIcon::fromTheme("mouse-line"_L1);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -179,20 +181,20 @@ void ControllerBindingWidget::populateWidgets()
|
||||
Ui::ControllerBindingWidget_Justifier ui;
|
||||
ui.setupUi(m_bindings_widget);
|
||||
bindBindingWidgets(m_bindings_widget);
|
||||
m_icon = QIcon::fromTheme(QStringLiteral("guncon-line"));
|
||||
m_icon = QIcon::fromTheme("guncon-line"_L1);
|
||||
}
|
||||
break;
|
||||
|
||||
case ControllerType::None:
|
||||
{
|
||||
m_icon = QIcon::fromTheme(QStringLiteral("controller-strike-line"));
|
||||
m_icon = QIcon::fromTheme("controller-strike-line"_L1);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
createBindingWidgets(m_bindings_widget);
|
||||
m_icon = QIcon::fromTheme(QStringLiteral("controller-line"));
|
||||
m_icon = QIcon::fromTheme("controller-line"_L1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -545,7 +547,7 @@ void ControllerMacroWidget::createWidgets(ControllerBindingWidget* bwidget)
|
||||
m_container->addWidget(m_macros[i]);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem();
|
||||
item->setIcon(QIcon::fromTheme(QStringLiteral("flashlight-line")));
|
||||
item->setIcon(QIcon::fromTheme("flashlight-line"_L1));
|
||||
m_macroList->addItem(item);
|
||||
updateListItem(i);
|
||||
}
|
||||
@@ -753,7 +755,7 @@ static void createSettingWidgets(SettingsInterface* const sif, QWidget* parent_w
|
||||
case SettingInfo::Type::Boolean:
|
||||
{
|
||||
QCheckBox* cb = new QCheckBox(qApp->translate(tr_context, si.display_name), parent_widget);
|
||||
cb->setObjectName(QString::fromUtf8(si.name));
|
||||
cb->setObjectName(si.name);
|
||||
ControllerSettingWidgetBinder::BindWidgetToInputProfileBool(sif, cb, section, std::move(key_name),
|
||||
si.BooleanDefaultValue());
|
||||
layout->addWidget(cb, current_row, 0, 1, 4);
|
||||
@@ -764,7 +766,7 @@ static void createSettingWidgets(SettingsInterface* const sif, QWidget* parent_w
|
||||
case SettingInfo::Type::Integer:
|
||||
{
|
||||
QSpinBox* sb = new QSpinBox(parent_widget);
|
||||
sb->setObjectName(QString::fromUtf8(si.name));
|
||||
sb->setObjectName(si.name);
|
||||
sb->setMinimum(si.IntegerMinValue());
|
||||
sb->setMaximum(si.IntegerMaxValue());
|
||||
sb->setSingleStep(si.IntegerStepValue());
|
||||
@@ -779,7 +781,7 @@ static void createSettingWidgets(SettingsInterface* const sif, QWidget* parent_w
|
||||
case SettingInfo::Type::IntegerList:
|
||||
{
|
||||
QComboBox* cb = new QComboBox(parent_widget);
|
||||
cb->setObjectName(QString::fromUtf8(si.name));
|
||||
cb->setObjectName(si.name);
|
||||
for (u32 j = 0; si.options[j] != nullptr; j++)
|
||||
cb->addItem(qApp->translate(tr_context, si.options[j]));
|
||||
ControllerSettingWidgetBinder::BindWidgetToInputProfileInt(sif, cb, section, std::move(key_name),
|
||||
@@ -793,7 +795,7 @@ static void createSettingWidgets(SettingsInterface* const sif, QWidget* parent_w
|
||||
case SettingInfo::Type::Float:
|
||||
{
|
||||
QDoubleSpinBox* sb = new QDoubleSpinBox(parent_widget);
|
||||
sb->setObjectName(QString::fromUtf8(si.name));
|
||||
sb->setObjectName(si.name);
|
||||
if (si.multiplier != 0.0f && si.multiplier != 1.0f)
|
||||
{
|
||||
const float multiplier = si.multiplier;
|
||||
@@ -803,7 +805,7 @@ static void createSettingWidgets(SettingsInterface* const sif, QWidget* parent_w
|
||||
if (std::abs(si.multiplier - 100.0f) < 0.01f)
|
||||
{
|
||||
sb->setDecimals(0);
|
||||
sb->setSuffix(QStringLiteral("%"));
|
||||
sb->setSuffix("%"_L1);
|
||||
}
|
||||
|
||||
ControllerSettingWidgetBinder::BindWidgetToInputProfileNormalized(sif, sb, section, std::move(key_name),
|
||||
@@ -827,7 +829,7 @@ static void createSettingWidgets(SettingsInterface* const sif, QWidget* parent_w
|
||||
case SettingInfo::Type::String:
|
||||
{
|
||||
QLineEdit* le = new QLineEdit(parent_widget);
|
||||
le->setObjectName(QString::fromUtf8(si.name));
|
||||
le->setObjectName(si.name);
|
||||
ControllerSettingWidgetBinder::BindWidgetToInputProfileString(sif, le, section, std::move(key_name),
|
||||
si.StringDefaultValue());
|
||||
layout->addWidget(new QLabel(qApp->translate(tr_context, si.display_name), parent_widget), current_row, 0);
|
||||
@@ -839,7 +841,7 @@ static void createSettingWidgets(SettingsInterface* const sif, QWidget* parent_w
|
||||
case SettingInfo::Type::Path:
|
||||
{
|
||||
QLineEdit* le = new QLineEdit(parent_widget);
|
||||
le->setObjectName(QString::fromUtf8(si.name));
|
||||
le->setObjectName(si.name);
|
||||
QPushButton* browse_button =
|
||||
new QPushButton(qApp->translate("ControllerCustomSettingsWidget", "Browse..."), parent_widget);
|
||||
ControllerSettingWidgetBinder::BindWidgetToInputProfileString(sif, le, section, std::move(key_name),
|
||||
@@ -874,13 +876,11 @@ static void restoreDefaultSettingWidgets(QWidget* parent_widget, std::span<const
|
||||
{
|
||||
for (const SettingInfo& si : settings)
|
||||
{
|
||||
const QString key(QString::fromStdString(si.name));
|
||||
|
||||
switch (si.type)
|
||||
{
|
||||
case SettingInfo::Type::Boolean:
|
||||
{
|
||||
QCheckBox* widget = parent_widget->findChild<QCheckBox*>(QString::fromStdString(si.name));
|
||||
QCheckBox* widget = parent_widget->findChild<QCheckBox*>(si.name);
|
||||
if (widget)
|
||||
widget->setChecked(si.BooleanDefaultValue());
|
||||
}
|
||||
@@ -888,7 +888,7 @@ static void restoreDefaultSettingWidgets(QWidget* parent_widget, std::span<const
|
||||
|
||||
case SettingInfo::Type::Integer:
|
||||
{
|
||||
QSpinBox* widget = parent_widget->findChild<QSpinBox*>(QString::fromStdString(si.name));
|
||||
QSpinBox* widget = parent_widget->findChild<QSpinBox*>(si.name);
|
||||
if (widget)
|
||||
widget->setValue(si.IntegerDefaultValue());
|
||||
}
|
||||
@@ -896,7 +896,7 @@ static void restoreDefaultSettingWidgets(QWidget* parent_widget, std::span<const
|
||||
|
||||
case SettingInfo::Type::IntegerList:
|
||||
{
|
||||
QComboBox* widget = parent_widget->findChild<QComboBox*>(QString::fromStdString(si.name));
|
||||
QComboBox* widget = parent_widget->findChild<QComboBox*>(si.name);
|
||||
if (widget)
|
||||
widget->setCurrentIndex(si.IntegerDefaultValue() - si.IntegerMinValue());
|
||||
}
|
||||
@@ -904,7 +904,7 @@ static void restoreDefaultSettingWidgets(QWidget* parent_widget, std::span<const
|
||||
|
||||
case SettingInfo::Type::Float:
|
||||
{
|
||||
QDoubleSpinBox* widget = parent_widget->findChild<QDoubleSpinBox*>(QString::fromStdString(si.name));
|
||||
QDoubleSpinBox* widget = parent_widget->findChild<QDoubleSpinBox*>(si.name);
|
||||
if (widget)
|
||||
{
|
||||
if (si.multiplier != 0.0f && si.multiplier != 1.0f)
|
||||
@@ -917,7 +917,7 @@ static void restoreDefaultSettingWidgets(QWidget* parent_widget, std::span<const
|
||||
|
||||
case SettingInfo::Type::String:
|
||||
{
|
||||
QLineEdit* widget = parent_widget->findChild<QLineEdit*>(QString::fromStdString(si.name));
|
||||
QLineEdit* widget = parent_widget->findChild<QLineEdit*>(si.name);
|
||||
if (widget)
|
||||
widget->setText(QString::fromUtf8(si.StringDefaultValue()));
|
||||
}
|
||||
@@ -925,7 +925,7 @@ static void restoreDefaultSettingWidgets(QWidget* parent_widget, std::span<const
|
||||
|
||||
case SettingInfo::Type::Path:
|
||||
{
|
||||
QLineEdit* widget = parent_widget->findChild<QLineEdit*>(QString::fromStdString(si.name));
|
||||
QLineEdit* widget = parent_widget->findChild<QLineEdit*>(si.name);
|
||||
if (widget)
|
||||
widget->setText(QString::fromUtf8(si.StringDefaultValue()));
|
||||
}
|
||||
@@ -957,7 +957,7 @@ ControllerCustomSettingsWidget::ControllerCustomSettingsWidget(ControllerBinding
|
||||
|
||||
QHBoxLayout* bottom_hlayout = new QHBoxLayout();
|
||||
QPushButton* restore_defaults = new QPushButton(tr("Restore Default Settings"), swidget);
|
||||
restore_defaults->setIcon(QIcon::fromTheme(QStringLiteral("restart-line")));
|
||||
restore_defaults->setIcon(QIcon::fromTheme("restart-line"_L1));
|
||||
bottom_hlayout->addStretch(1);
|
||||
bottom_hlayout->addWidget(restore_defaults);
|
||||
swidget_layout->addLayout(bottom_hlayout, current_row++, 0, 1, 4);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2019-2025 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-FileCopyrightText: 2019-2026 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-License-Identifier: CC-BY-NC-ND-4.0
|
||||
|
||||
#include "controllerglobalsettingswidget.h"
|
||||
@@ -21,6 +21,8 @@
|
||||
|
||||
#include "moc_controllerglobalsettingswidget.cpp"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
ControllerGlobalSettingsWidget::ControllerGlobalSettingsWidget(QWidget* parent, ControllerSettingsWindow* dialog)
|
||||
: QWidget(parent), m_dialog(dialog)
|
||||
{
|
||||
@@ -174,7 +176,7 @@ ControllerGlobalSettingsWidget::~ControllerGlobalSettingsWidget() = default;
|
||||
|
||||
void ControllerGlobalSettingsWidget::sdlHelpTextLinkClicked(const QString& link)
|
||||
{
|
||||
if (link == QStringLiteral("ADVANCED_SDL_OPTIONS"))
|
||||
if (link == "ADVANCED_SDL_OPTIONS"_L1)
|
||||
{
|
||||
QDialog* const dlg = new ControllerCustomSettingsDialog(m_dialog, m_dialog->getEditingSettingsInterface(),
|
||||
"InputSources", SDLInputSource::GetAdvancedSettingsInfo(),
|
||||
@@ -221,7 +223,7 @@ void ControllerGlobalSettingsWidget::ledSettingsClicked()
|
||||
|
||||
QHBoxLayout* const heading_layout = new QHBoxLayout;
|
||||
QLabel* const icon = new QLabel;
|
||||
icon->setPixmap(QIcon::fromTheme(QStringLiteral("lightbulb-line")).pixmap(32));
|
||||
icon->setPixmap(QIcon::fromTheme("lightbulb-line"_L1).pixmap(32));
|
||||
QLabel* const heading = new QLabel(
|
||||
tr("<strong>Controller LED Settings</strong><br>\nThe \"alternate\" color is used when analog mode is active."));
|
||||
heading->setWordWrap(true);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2019-2025 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-FileCopyrightText: 2019-2026 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-License-Identifier: CC-BY-NC-ND-4.0
|
||||
|
||||
#include "controllersettingswindow.h"
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
#include "moc_controllersettingswindow.cpp"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
ControllerSettingsWindow::ControllerSettingsWindow(INISettingsInterface* game_sif /* = nullptr */,
|
||||
bool edit_profiles /* = false */, QWidget* parent /* = nullptr */)
|
||||
: QWidget(parent), m_editing_settings_interface(game_sif), m_editing_input_profiles(edit_profiles)
|
||||
@@ -439,7 +441,7 @@ void ControllerSettingsWindow::createWidgets()
|
||||
// global settings
|
||||
QListWidgetItem* item = new QListWidgetItem();
|
||||
item->setText(tr("Global Settings"));
|
||||
item->setIcon(QIcon::fromTheme(QStringLiteral("settings-3-line")));
|
||||
item->setIcon(QIcon::fromTheme("settings-3-line"_L1));
|
||||
m_ui.settingsCategory->addItem(item);
|
||||
m_ui.settingsCategory->setCurrentRow(0);
|
||||
m_global_settings = new ControllerGlobalSettingsWidget(m_ui.settingsContainer, this);
|
||||
@@ -478,7 +480,7 @@ void ControllerSettingsWindow::createWidgets()
|
||||
{
|
||||
QListWidgetItem* item = new QListWidgetItem();
|
||||
item->setText(tr("Hotkeys"));
|
||||
item->setIcon(QIcon::fromTheme(QStringLiteral("keyboard-line")));
|
||||
item->setIcon(QIcon::fromTheme("keyboard-line"_L1));
|
||||
m_ui.settingsCategory->addItem(item);
|
||||
m_hotkey_settings = new HotkeySettingsWidget(m_ui.settingsContainer, this);
|
||||
m_ui.settingsContainer->addWidget(m_hotkey_settings);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2019-2025 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-FileCopyrightText: 2019-2026 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-License-Identifier: CC-BY-NC-ND-4.0
|
||||
|
||||
#include "coverdownloadwindow.h"
|
||||
@@ -13,10 +13,12 @@
|
||||
|
||||
#include "moc_coverdownloadwindow.cpp"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
CoverDownloadWindow::CoverDownloadWindow() : QWidget()
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
m_ui.coverIcon->setPixmap(QIcon::fromTheme(QStringLiteral("artboard-2-line")).pixmap(32));
|
||||
m_ui.coverIcon->setPixmap(QIcon::fromTheme("artboard-2-line"_L1).pixmap(32));
|
||||
updateEnabled();
|
||||
|
||||
connect(m_ui.start, &QPushButton::clicked, this, &CoverDownloadWindow::onStartClicked);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2019-2025 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-FileCopyrightText: 2019-2026 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-License-Identifier: CC-BY-NC-ND-4.0
|
||||
|
||||
#include "debuggercodeview.h"
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
LOG_CHANNEL(Host);
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
DebuggerCodeView::DebuggerCodeView(QWidget* parent) : QAbstractScrollArea(parent)
|
||||
{
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
|
||||
@@ -37,8 +39,8 @@ DebuggerCodeView::DebuggerCodeView(QWidget* parent) : QAbstractScrollArea(parent
|
||||
updateRowHeight();
|
||||
|
||||
// Load icons
|
||||
m_pc_pixmap = QIcon(QStringLiteral(":/icons/debug-pc.png")).pixmap(12);
|
||||
m_breakpoint_pixmap = QIcon(QStringLiteral(":/icons/media-record.png")).pixmap(12);
|
||||
m_pc_pixmap = QIcon(":/icons/debug-pc.png"_L1).pixmap(12);
|
||||
m_breakpoint_pixmap = QIcon(":/icons/media-record.png"_L1).pixmap(12);
|
||||
|
||||
// Connect scroll bar
|
||||
connect(verticalScrollBar(), &QScrollBar::valueChanged, this, [this](int value) {
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
#include "moc_debuggerwindow.cpp"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
LOG_CHANNEL(Host);
|
||||
|
||||
static constexpr int TIMER_REFRESH_INTERVAL_MS = 100;
|
||||
@@ -298,10 +300,10 @@ void DebuggerWindow::onCodeViewContextMenuRequested(const QPoint& pt)
|
||||
menu->addAction(QStringLiteral("0x%1").arg(static_cast<uint>(address), 8, 16, QChar('0')))->setEnabled(false);
|
||||
menu->addSeparator();
|
||||
|
||||
menu->addAction(QIcon::fromTheme(QStringLiteral("debug-toggle-breakpoint")), tr("Toggle &Breakpoint"),
|
||||
menu->addAction(QIcon::fromTheme("debug-toggle-breakpoint"_L1), tr("Toggle &Breakpoint"),
|
||||
[this, address]() { toggleBreakpoint(address); });
|
||||
|
||||
menu->addAction(QIcon::fromTheme(QStringLiteral("debugger-go-to-cursor")), tr("&Run To Cursor"), [address]() {
|
||||
menu->addAction(QIcon::fromTheme("debugger-go-to-cursor"_L1), tr("&Run To Cursor"), [address]() {
|
||||
Host::RunOnCoreThread([address]() {
|
||||
CPU::AddBreakpoint(CPU::BreakpointType::Execute, address, true, true);
|
||||
g_core_thread->setSystemPaused(false);
|
||||
@@ -309,10 +311,10 @@ void DebuggerWindow::onCodeViewContextMenuRequested(const QPoint& pt)
|
||||
});
|
||||
|
||||
menu->addSeparator();
|
||||
menu->addAction(QIcon::fromTheme(QStringLiteral("debugger-go-to-address")), tr("View in &Dump"),
|
||||
menu->addAction(QIcon::fromTheme("debugger-go-to-address"_L1), tr("View in &Dump"),
|
||||
[this, address]() { scrollToMemoryAddress(address); });
|
||||
|
||||
menu->addAction(QIcon::fromTheme(QStringLiteral("debug-trace-line")), tr("&Follow Load/Store"),
|
||||
menu->addAction(QIcon::fromTheme("debug-trace-line"_L1), tr("&Follow Load/Store"),
|
||||
[this, address]() { tryFollowLoadStore(address); });
|
||||
|
||||
menu->popup(m_ui.codeView->mapToGlobal(pt));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2019-2025 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-FileCopyrightText: 2019-2026 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-License-Identifier: CC-BY-NC-ND-4.0
|
||||
|
||||
#include "gamecheatsettingswidget.h"
|
||||
@@ -28,6 +28,8 @@
|
||||
|
||||
LOG_CHANNEL(Cheats);
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
namespace {
|
||||
|
||||
class CheatListOptionDelegate : public QStyledItemDelegate
|
||||
@@ -347,22 +349,22 @@ void GameCheatSettingsWidget::onCheatListContextMenuRequested(const QPoint& pos)
|
||||
|
||||
QMenu* const context_menu = QtUtils::NewPopupMenu(m_ui.cheatList);
|
||||
|
||||
context_menu->addAction(QIcon::fromTheme(QStringLiteral("add-line")), tr("Add Cheat..."), this,
|
||||
context_menu->addAction(QIcon::fromTheme("add-line"_L1), tr("Add Cheat..."), this,
|
||||
&GameCheatSettingsWidget::newCode);
|
||||
context_menu
|
||||
->addAction(QIcon::fromTheme(QStringLiteral("mag-line")), tr("Edit Cheat..."),
|
||||
->addAction(QIcon::fromTheme("mag-line"_L1), tr("Edit Cheat..."),
|
||||
[this, selected_code]() { editCode(selected_code); })
|
||||
->setEnabled(selected != nullptr);
|
||||
context_menu
|
||||
->addAction(QIcon::fromTheme(QStringLiteral("minus-line")), tr("Remove Cheat"),
|
||||
->addAction(QIcon::fromTheme("minus-line"_L1), tr("Remove Cheat"),
|
||||
[this, selected_code]() { removeCode(selected_code, true); })
|
||||
->setEnabled(selected != nullptr);
|
||||
context_menu->addSeparator();
|
||||
|
||||
context_menu->addAction(QIcon::fromTheme(QStringLiteral("chat-off-line")), tr("Disable All Cheats"), this,
|
||||
context_menu->addAction(QIcon::fromTheme("chat-off-line"_L1), tr("Disable All Cheats"), this,
|
||||
&GameCheatSettingsWidget::disableAllCheats);
|
||||
|
||||
context_menu->addAction(QIcon::fromTheme(QStringLiteral("refresh-line")), tr("Reload Cheats"), this,
|
||||
context_menu->addAction(QIcon::fromTheme("refresh-line"_L1), tr("Reload Cheats"), this,
|
||||
&GameCheatSettingsWidget::onReloadClicked);
|
||||
|
||||
context_menu->popup(m_ui.cheatList->mapToGlobal(pos));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2019-2025 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-FileCopyrightText: 2019-2026 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-License-Identifier: CC-BY-NC-ND-4.0
|
||||
|
||||
#include "gamepatchsettingswidget.h"
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
#include "moc_gamepatchsettingswidget.cpp"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
GamePatchDetailsWidget::GamePatchDetailsWidget(std::string name, const std::string& author,
|
||||
const std::string& description, bool disallowed_for_achievements,
|
||||
bool enabled, SettingsWindow* dialog, QWidget* parent)
|
||||
@@ -89,7 +91,7 @@ void GamePatchSettingsWidget::reloadList()
|
||||
m_dialog->getSettingsInterface()->GetStringList(Cheats::PATCHES_CONFIG_SECTION, Cheats::PATCH_ENABLE_CONFIG_KEY);
|
||||
|
||||
QWidget* container = new QWidget(m_ui.scrollArea);
|
||||
container->setObjectName(QStringLiteral("patches_container"));
|
||||
container->setObjectName("patches_container"_L1);
|
||||
QVBoxLayout* layout = new QVBoxLayout(container);
|
||||
m_ui.scrollArea->setWidget(container);
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#include "moc_gamesummarywidget.cpp"
|
||||
#include "ui_editgameserialdialog.h"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
GameSummaryWidget::GameSummaryWidget(const GameList::Entry* entry, SettingsWindow* dialog, QWidget* parent)
|
||||
: m_dialog(dialog)
|
||||
{
|
||||
@@ -94,7 +96,7 @@ GameSummaryWidget::GameSummaryWidget(const GameList::Entry* entry, SettingsWindo
|
||||
connect(m_ui.restoreDiscSetTitle, &QAbstractButton::clicked, this, [this]() { setCustomDiscSetTitle({}); });
|
||||
}
|
||||
connect(m_ui.changeSerial, &QAbstractButton::clicked, this, &GameSummaryWidget::onChangeSerialClicked);
|
||||
connect(m_ui.region, &QComboBox::currentIndexChanged, this, [this](int index) { setCustomRegion(index); });
|
||||
connect(m_ui.region, &QComboBox::currentIndexChanged, this, &GameSummaryWidget::setCustomRegion);
|
||||
connect(m_ui.restoreRegion, &QAbstractButton::clicked, this, [this]() { setCustomRegion(-1); });
|
||||
connect(m_ui.customLanguage, &QComboBox::currentIndexChanged, this, &GameSummaryWidget::onCustomLanguageChanged);
|
||||
}
|
||||
@@ -267,9 +269,8 @@ void GameSummaryWidget::populateUi(const GameList::Entry* entry)
|
||||
|
||||
m_ui.compatibilityComments->setEnabled(!m_compatibility_comments.isEmpty());
|
||||
|
||||
m_ui.inputProfile->addItem(QIcon::fromTheme(QStringLiteral("global-line")), tr("Use Global Settings"));
|
||||
m_ui.inputProfile->addItem(QIcon::fromTheme(QStringLiteral("controller-digital-line")),
|
||||
tr("Game Specific Configuration"));
|
||||
m_ui.inputProfile->addItem(QIcon::fromTheme("global-line"_L1), tr("Use Global Settings"));
|
||||
m_ui.inputProfile->addItem(QIcon::fromTheme("controller-digital-line"_L1), tr("Game Specific Configuration"));
|
||||
for (const std::string& name : InputManager::GetInputProfileNames())
|
||||
m_ui.inputProfile->addItem(QString::fromStdString(name));
|
||||
|
||||
@@ -298,7 +299,7 @@ void GameSummaryWidget::onChangeSerialClicked()
|
||||
QDialog* const dialog = new QDialog(this);
|
||||
Ui::EditGameSerialDialog dialog_ui;
|
||||
dialog_ui.setupUi(dialog);
|
||||
dialog_ui.icon->setPixmap(QIcon::fromTheme(QStringLiteral("disc-line")).pixmap(32));
|
||||
dialog_ui.icon->setPixmap(QIcon::fromTheme("disc-line"_L1).pixmap(32));
|
||||
dialog_ui.path->setText(QString::fromStdString(m_path));
|
||||
dialog_ui.serial->setText(QString::fromStdString(entry->serial));
|
||||
dialog_ui.serial->setFocus();
|
||||
@@ -451,8 +452,7 @@ void GameSummaryWidget::populateTracksInfo()
|
||||
const CDImage::TrackMode mode = image->GetTrackMode(static_cast<u8>(track));
|
||||
|
||||
QTreeWidgetItem* row = new QTreeWidgetItem(m_ui.tracks);
|
||||
row->setIcon(0, QIcon::fromTheme((mode == CDImage::TrackMode::Audio) ? QStringLiteral("file-music-line") :
|
||||
QStringLiteral("disc-line")));
|
||||
row->setIcon(0, QIcon::fromTheme((mode == CDImage::TrackMode::Audio) ? "file-music-line"_L1 : "disc-line"_L1));
|
||||
row->setText(0, tr("Track %1").arg(track));
|
||||
row->setText(1, QString::fromUtf8(track_mode_strings[static_cast<u32>(mode)]));
|
||||
row->setText(2, MSFToString(position));
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
|
||||
LOG_CHANNEL(Host);
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
InputBindingWidget* InputBindingWidget::s_current_hook_widget = nullptr;
|
||||
|
||||
InputBindingWidget::InputBindingWidget(QWidget* parent) : QPushButton(parent)
|
||||
@@ -101,7 +103,7 @@ void InputBindingWidget::updateElidedText()
|
||||
|
||||
// fix up accelerators
|
||||
if (elided.contains('&'))
|
||||
elided = elided.replace(QStringLiteral("&"), QStringLiteral("&&"));
|
||||
elided = elided.replace("&"_L1, "&&"_L1);
|
||||
|
||||
setText(elided);
|
||||
}
|
||||
@@ -502,7 +504,7 @@ void InputBindingWidget::showEffectBindingDialog()
|
||||
|
||||
QHBoxLayout* const heading_layout = new QHBoxLayout();
|
||||
QLabel* const icon = new QLabel(&dlg);
|
||||
icon->setPixmap(QIcon::fromTheme(QStringLiteral("pushpin-line")).pixmap(32, 32));
|
||||
icon->setPixmap(QIcon::fromTheme("pushpin-line"_L1).pixmap(32, 32));
|
||||
QLabel* const heading =
|
||||
new QLabel(tr("<strong>%1</strong><br>Select the device and effect to map this bind to.").arg(full_key), &dlg);
|
||||
heading->setWordWrap(true);
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
#include "moc_isobrowserwindow.cpp"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
LOG_CHANNEL(Host);
|
||||
|
||||
ISOBrowserWindow::ISOBrowserWindow(QWidget* parent) : QWidget(parent)
|
||||
@@ -272,7 +274,7 @@ void ISOBrowserWindow::populateDirectories()
|
||||
enableExtractButtons(false);
|
||||
|
||||
QTreeWidgetItem* root = new QTreeWidgetItem;
|
||||
root->setIcon(0, QIcon::fromTheme(QStringLiteral("disc-line")));
|
||||
root->setIcon(0, QIcon::fromTheme("disc-line"_L1));
|
||||
root->setText(0, QtUtils::StringViewToQString(Path::GetFileTitle(m_image->GetPath())));
|
||||
root->setData(0, Qt::UserRole, QString());
|
||||
m_ui.directoryView->addTopLevelItem(root);
|
||||
@@ -301,7 +303,7 @@ void ISOBrowserWindow::populateSubdirectories(std::string_view dir, QTreeWidgetI
|
||||
continue;
|
||||
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem(parent);
|
||||
item->setIcon(0, QIcon::fromTheme(QStringLiteral("folder-open-line")));
|
||||
item->setIcon(0, QIcon::fromTheme("folder-open-line"_L1));
|
||||
item->setText(0, QtUtils::StringViewToQString(Path::GetFileName(full_path)));
|
||||
item->setData(0, Qt::UserRole, QString::fromStdString(full_path));
|
||||
populateSubdirectories(full_path, item);
|
||||
@@ -326,7 +328,7 @@ void ISOBrowserWindow::populateFiles(const QString& path)
|
||||
const auto add_entry = [this](const std::string& full_path, const IsoReader::ISODirectoryEntry& entry) {
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem;
|
||||
item->setIcon(
|
||||
0, QIcon::fromTheme(entry.IsDirectory() ? QStringLiteral("folder-open-line") : QStringLiteral("file-line")));
|
||||
0, QIcon::fromTheme(entry.IsDirectory() ? "folder-open-line"_L1 : "file-line"_L1));
|
||||
item->setText(0, QtUtils::StringViewToQString(Path::GetFileName(full_path)));
|
||||
item->setData(0, Qt::UserRole, QString::fromStdString(full_path));
|
||||
item->setData(0, Qt::UserRole + 1, entry.IsDirectory());
|
||||
@@ -339,7 +341,7 @@ void ISOBrowserWindow::populateFiles(const QString& path)
|
||||
if (!path.isEmpty())
|
||||
{
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem;
|
||||
item->setIcon(0, QIcon::fromTheme(QStringLiteral("folder-open-line")));
|
||||
item->setIcon(0, QIcon::fromTheme("folder-open-line"_L1));
|
||||
item->setText(0, tr("<Parent Directory>"));
|
||||
item->setData(0, Qt::UserRole, QtUtils::StringViewToQString(Path::GetDirectory(spath)));
|
||||
item->setData(0, Qt::UserRole + 1, true);
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
#include "moc_logwindow.cpp"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
// TODO: Since log callbacks are synchronized, no mutex is needed here.
|
||||
// But once I get rid of that, there will be.
|
||||
LogWindow* g_log_window;
|
||||
@@ -308,7 +310,7 @@ void LogWindow::updateWindowTitle()
|
||||
|
||||
void LogWindow::createUi()
|
||||
{
|
||||
setWindowIcon(QIcon::fromTheme(QStringLiteral("file-list-line")));
|
||||
setWindowIcon(QIcon::fromTheme("file-list-line"_L1));
|
||||
setWindowFlag(Qt::CustomizeWindowHint, true);
|
||||
setWindowFlag(Qt::WindowCloseButtonHint, false);
|
||||
updateWindowTitle();
|
||||
|
||||
@@ -62,6 +62,8 @@
|
||||
|
||||
#include "moc_mainwindow.cpp"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
LOG_CHANNEL(Host);
|
||||
|
||||
static constexpr std::array<std::pair<Qt::ToolBarArea, const char*>, 4> s_toolbar_areas = {{
|
||||
@@ -1106,6 +1108,14 @@ bool MainWindow::openResumeStateDialog(const std::string& path, const std::strin
|
||||
if (save_state_path.empty() || !FileSystem::FileExists(save_state_path.c_str()))
|
||||
return false;
|
||||
|
||||
return openResumeStateDialog(std::move(save_state_path));
|
||||
}
|
||||
|
||||
bool MainWindow::openResumeStateDialog(std::string save_state_path)
|
||||
{
|
||||
if (s_locals.system_valid)
|
||||
return false;
|
||||
|
||||
std::optional<ExtendedSaveStateInfo> ssi = System::GetExtendedSaveStateInfo(save_state_path.c_str());
|
||||
if (!ssi.has_value())
|
||||
return false;
|
||||
@@ -1167,23 +1177,25 @@ bool MainWindow::openResumeStateDialog(const std::string& path, const std::strin
|
||||
QPushButton* const cancel = bbox->addButton(QDialogButtonBox::Cancel);
|
||||
load->setDefault(true);
|
||||
|
||||
connect(load, &QPushButton::clicked, [this, dlg, path, save_state_path]() mutable {
|
||||
connect(load, &QPushButton::clicked, [this, dlg, path = ssi->media_path, save_state_path]() mutable {
|
||||
startFile(std::move(path), std::move(save_state_path), std::nullopt);
|
||||
dlg->accept();
|
||||
});
|
||||
connect(boot, &QPushButton::clicked, [this, dlg, path]() mutable {
|
||||
startFile(std::move(path), std::nullopt, std::nullopt);
|
||||
dlg->accept();
|
||||
});
|
||||
connect(delboot, &QPushButton::clicked, [this, dlg, path, save_state_path]() mutable {
|
||||
if (!FileSystem::DeleteFile(save_state_path.c_str()))
|
||||
{
|
||||
QtUtils::MessageBoxCritical(
|
||||
this, tr("Error"), tr("Failed to delete save state file '%1'.").arg(QString::fromStdString(save_state_path)));
|
||||
}
|
||||
connect(boot, &QPushButton::clicked, [this, dlg, path = ssi->media_path]() mutable {
|
||||
startFile(std::move(path), std::nullopt, std::nullopt);
|
||||
dlg->accept();
|
||||
});
|
||||
connect(delboot, &QPushButton::clicked,
|
||||
[this, dlg, path = ssi->media_path, save_state_path = std::move(save_state_path)]() mutable {
|
||||
if (!FileSystem::DeleteFile(save_state_path.c_str()))
|
||||
{
|
||||
QtUtils::MessageBoxCritical(
|
||||
this, tr("Error"),
|
||||
tr("Failed to delete save state file '%1'.").arg(QString::fromStdString(save_state_path)));
|
||||
}
|
||||
startFile(std::move(path), std::nullopt, std::nullopt);
|
||||
dlg->accept();
|
||||
});
|
||||
connect(cancel, &QPushButton::clicked, dlg, &QDialog::reject);
|
||||
|
||||
main_layout->addWidget(bbox);
|
||||
@@ -1269,6 +1281,18 @@ void MainWindow::onStartBIOSActionTriggered()
|
||||
g_core_thread->bootSystem(getSystemBootParameters(std::string()));
|
||||
}
|
||||
|
||||
void MainWindow::onResumeLastStateActionTriggered()
|
||||
{
|
||||
std::string state_path = System::GetMostRecentResumeSaveStatePath();
|
||||
if (state_path.empty())
|
||||
{
|
||||
reportError(tr("Error"), tr("No resume save state found."));
|
||||
return;
|
||||
}
|
||||
|
||||
openResumeStateDialog(std::move(state_path));
|
||||
}
|
||||
|
||||
void MainWindow::onChangeDiscFromFileActionTriggered()
|
||||
{
|
||||
QString filename = QDir::toNativeSeparators(
|
||||
@@ -1866,7 +1890,7 @@ void MainWindow::setupAdditionalUi()
|
||||
ascending_action->setIcon(QIcon::fromTheme(QIcon::ThemeIcon::GoUp));
|
||||
ascending_action->setCheckable(true);
|
||||
ascending_action->setChecked(current_sort_order == Qt::AscendingOrder);
|
||||
ascending_action->setObjectName(QStringLiteral("SortAscending"));
|
||||
ascending_action->setObjectName("SortAscending"_L1);
|
||||
m_ui.menuSortBy->addAction(ascending_action);
|
||||
connect(ascending_action, &QAction::triggered, this, &MainWindow::onViewSortOrderActionTriggered);
|
||||
|
||||
@@ -1874,7 +1898,7 @@ void MainWindow::setupAdditionalUi()
|
||||
descending_action->setIcon(QIcon::fromTheme(QIcon::ThemeIcon::GoDown));
|
||||
descending_action->setCheckable(true);
|
||||
descending_action->setChecked(current_sort_order == Qt::DescendingOrder);
|
||||
descending_action->setObjectName(QStringLiteral("SortDescending"));
|
||||
descending_action->setObjectName("SortDescending"_L1);
|
||||
m_ui.menuSortBy->addAction(descending_action);
|
||||
connect(descending_action, &QAction::triggered, this, &MainWindow::onViewSortOrderActionTriggered);
|
||||
}
|
||||
@@ -1917,9 +1941,9 @@ void MainWindow::onGameListSortIndicatorOrderChanged(int column, Qt::SortOrder o
|
||||
{
|
||||
bool activate = false;
|
||||
|
||||
if (action->objectName() == QStringLiteral("SortAscending"))
|
||||
if (action->objectName() == "SortAscending"_L1)
|
||||
activate = (order == Qt::AscendingOrder);
|
||||
else if (action->objectName() == QStringLiteral("SortDescending"))
|
||||
else if (action->objectName() == "SortDescending"_L1)
|
||||
activate = (order == Qt::DescendingOrder);
|
||||
else
|
||||
activate = (action->data() == column);
|
||||
@@ -2422,7 +2446,7 @@ void MainWindow::connectSignals()
|
||||
connect(m_ui.actionStartFile, &QAction::triggered, this, &MainWindow::onStartFileActionTriggered);
|
||||
connect(m_ui.actionStartDisc, &QAction::triggered, this, &MainWindow::onStartDiscActionTriggered);
|
||||
connect(m_ui.actionStartBios, &QAction::triggered, this, &MainWindow::onStartBIOSActionTriggered);
|
||||
connect(m_ui.actionResumeLastState, &QAction::triggered, g_core_thread, &CoreThread::resumeSystemFromMostRecentState);
|
||||
connect(m_ui.actionResumeLastState, &QAction::triggered, this, &MainWindow::onResumeLastStateActionTriggered);
|
||||
connect(m_ui.actionChangeDisc, &QAction::triggered, [this] { m_ui.menuChangeDisc->popup(QCursor::pos()); });
|
||||
connect(m_ui.actionChangeDiscFromFile, &QAction::triggered, this, &MainWindow::onChangeDiscFromFileActionTriggered);
|
||||
connect(m_ui.actionChangeDiscFromDevice, &QAction::triggered, this,
|
||||
|
||||
@@ -225,6 +225,7 @@ private:
|
||||
std::unique_lock<std::recursive_mutex>& lock);
|
||||
std::shared_ptr<SystemBootParameters> getSystemBootParameters(std::string file);
|
||||
bool openResumeStateDialog(const std::string& path, const std::string& serial);
|
||||
bool openResumeStateDialog(std::string state_path);
|
||||
void startFile(std::string path, std::optional<std::string> save_path, std::optional<bool> fast_boot);
|
||||
void startFileOrChangeDisc(const QString& qpath);
|
||||
void promptForDiscChange(const QString& path);
|
||||
@@ -262,6 +263,7 @@ private:
|
||||
void onStartFileActionTriggered();
|
||||
void onStartDiscActionTriggered();
|
||||
void onStartBIOSActionTriggered();
|
||||
void onResumeLastStateActionTriggered();
|
||||
void onChangeDiscFromFileActionTriggered();
|
||||
void onChangeDiscFromGameListActionTriggered();
|
||||
void onChangeDiscFromDeviceActionTriggered();
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
#include "moc_memorycardeditorwindow.cpp"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
LOG_CHANNEL(Host);
|
||||
|
||||
static constexpr char MEMORY_CARD_IMAGE_FILTER[] =
|
||||
@@ -913,7 +915,7 @@ std::string MemoryCardRenameFileDialog::getNewName() const
|
||||
|
||||
void MemoryCardRenameFileDialog::setupAdditionalUi()
|
||||
{
|
||||
m_ui.icon->setPixmap(QIcon::fromTheme(QStringLiteral("memcard-line")).pixmap(32));
|
||||
m_ui.icon->setPixmap(QIcon::fromTheme("memcard-line"_L1).pixmap(32));
|
||||
|
||||
for (const auto& [region, prefix] : MEMORY_CARD_FILE_REGION_PREFIXES)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2019-2025 Connor McLaughlin <stenzek@gmail.com> and contributors.
|
||||
// SPDX-FileCopyrightText: 2019-2026 Connor McLaughlin <stenzek@gmail.com> and contributors.
|
||||
// SPDX-License-Identifier: CC-BY-NC-ND-4.0
|
||||
|
||||
#include "memoryscannerwindow.h"
|
||||
@@ -31,6 +31,8 @@
|
||||
|
||||
#include "moc_memoryscannerwindow.cpp"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
static constexpr std::array<const char*, 6> s_size_strings = {
|
||||
{TRANSLATE_NOOP("MemoryScannerWindow", "Byte"), TRANSLATE_NOOP("MemoryScannerWindow", "Halfword"),
|
||||
TRANSLATE_NOOP("MemoryScannerWindow", "Word"), TRANSLATE_NOOP("MemoryScannerWindow", "Signed Byte"),
|
||||
@@ -129,7 +131,7 @@ void MemoryScannerWindow::connectUi()
|
||||
[this](int index) { m_scanner.SetOperator(static_cast<MemoryScan::Operator>(index)); });
|
||||
connect(m_ui.scanStartAddress, &QLineEdit::textChanged, [this](const QString& value) {
|
||||
uint address;
|
||||
if (value.startsWith(QStringLiteral("0x")) && value.length() > 2)
|
||||
if (value.startsWith("0x"_L1) && value.length() > 2)
|
||||
address = value.mid(2).toUInt(nullptr, 16);
|
||||
else
|
||||
address = value.toUInt(nullptr, 16);
|
||||
@@ -137,7 +139,7 @@ void MemoryScannerWindow::connectUi()
|
||||
});
|
||||
connect(m_ui.scanEndAddress, &QLineEdit::textChanged, [this](const QString& value) {
|
||||
uint address;
|
||||
if (value.startsWith(QStringLiteral("0x")) && value.length() > 2)
|
||||
if (value.startsWith("0x"_L1) && value.length() > 2)
|
||||
address = value.mid(2).toUInt(nullptr, 16);
|
||||
else
|
||||
address = value.toUInt(nullptr, 16);
|
||||
@@ -500,7 +502,7 @@ void MemoryScannerWindow::watchItemDoubleClicked(QTableWidgetItem* item)
|
||||
void MemoryScannerWindow::updateScanValue()
|
||||
{
|
||||
QString value = m_ui.scanValue->text();
|
||||
if (value.startsWith(QStringLiteral("0x")))
|
||||
if (value.startsWith("0x"_L1))
|
||||
value.remove(0, 2);
|
||||
|
||||
bool ok = false;
|
||||
|
||||
@@ -274,9 +274,9 @@ bool QtHost::EarlyProcessStartup()
|
||||
|
||||
// allow us to override standard qt icons as well
|
||||
QStringList icon_theme_search_paths = QIcon::themeSearchPaths();
|
||||
if (!icon_theme_search_paths.contains(QStringLiteral(":/icons")))
|
||||
icon_theme_search_paths.push_back(QStringLiteral(":/icons"));
|
||||
icon_theme_search_paths.push_back(QStringLiteral(":/standard-icons"));
|
||||
if (!icon_theme_search_paths.contains(":/icons"_L1))
|
||||
icon_theme_search_paths.emplace_back(":/icons"_L1);
|
||||
icon_theme_search_paths.emplace_back(":/standard-icons"_L1);
|
||||
QIcon::setThemeSearchPaths(icon_theme_search_paths);
|
||||
return true;
|
||||
}
|
||||
@@ -368,7 +368,7 @@ void QtHost::AdjustQtEnvironmentVariables()
|
||||
bool QtHost::IsRunningOnWayland()
|
||||
{
|
||||
const QString platform_name = QGuiApplication::platformName();
|
||||
return (platform_name == QStringLiteral("wayland"));
|
||||
return (platform_name == "wayland"_L1);
|
||||
}
|
||||
|
||||
void QtHost::ApplyWaylandWorkarounds()
|
||||
@@ -1125,28 +1125,6 @@ void CoreThread::bootOrLoadState(std::string path)
|
||||
}
|
||||
}
|
||||
|
||||
void CoreThread::resumeSystemFromMostRecentState()
|
||||
{
|
||||
if (!isCurrentThread())
|
||||
{
|
||||
QMetaObject::invokeMethod(this, &CoreThread::resumeSystemFromMostRecentState, Qt::QueuedConnection);
|
||||
return;
|
||||
}
|
||||
|
||||
// shouldn't be doing this with a system running
|
||||
if (System::IsValid())
|
||||
return;
|
||||
|
||||
std::string state_filename(System::GetMostRecentResumeSaveStatePath());
|
||||
if (state_filename.empty())
|
||||
{
|
||||
emit errorReported(tr("Error"), tr("No resume save state found."));
|
||||
return;
|
||||
}
|
||||
|
||||
bootOrLoadState(std::move(state_filename));
|
||||
}
|
||||
|
||||
void CoreThread::onRenderWindowKeyEvent(int key, bool pressed)
|
||||
{
|
||||
DebugAssert(isCurrentThread());
|
||||
@@ -2798,11 +2776,11 @@ InputDeviceListModel::~InputDeviceListModel() = default;
|
||||
QIcon InputDeviceListModel::getIconForKey(const InputBindingKey& key)
|
||||
{
|
||||
if (key.source_type == InputSourceType::Keyboard)
|
||||
return QIcon::fromTheme(QStringLiteral("keyboard-line"));
|
||||
return QIcon::fromTheme("keyboard-line"_L1);
|
||||
else if (key.source_type == InputSourceType::Pointer)
|
||||
return QIcon::fromTheme(QStringLiteral("mouse-line"));
|
||||
return QIcon::fromTheme("mouse-line"_L1);
|
||||
else
|
||||
return QIcon::fromTheme(QStringLiteral("controller-line"));
|
||||
return QIcon::fromTheme("controller-line"_L1);
|
||||
}
|
||||
|
||||
QString InputDeviceListModel::getDeviceName(const InputBindingKey& key)
|
||||
|
||||
@@ -148,7 +148,6 @@ public:
|
||||
void exitFullscreenUI();
|
||||
void bootSystem(std::shared_ptr<SystemBootParameters> params);
|
||||
void bootOrSwitchNonDisc(const QString& path);
|
||||
void resumeSystemFromMostRecentState();
|
||||
void shutdownSystem(bool save_state, bool check_safety);
|
||||
void resetSystem(bool check_memcard_busy);
|
||||
void setSystemPaused(bool paused);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2019-2025 Connor McLaughlin <stenzek@gmail.com> and contributors.
|
||||
// SPDX-FileCopyrightText: 2019-2026 Connor McLaughlin <stenzek@gmail.com> and contributors.
|
||||
// SPDX-License-Identifier: CC-BY-NC-ND-4.0
|
||||
|
||||
#include "qthost.h"
|
||||
@@ -15,6 +15,8 @@
|
||||
#include <QtWidgets/QStyle>
|
||||
#include <QtWidgets/QStyleFactory>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
namespace QtHost {
|
||||
static void SetThemeAttributes(bool is_stylesheet_theme, bool is_variable_color_theme, bool is_dark_theme);
|
||||
static bool NativeThemeStylesheetNeedsUpdate();
|
||||
@@ -133,21 +135,21 @@ void QtHost::SetStyleFromSettings()
|
||||
qApp->setStyle(s_themes_locals.unthemed_style_name);
|
||||
qApp->setPalette(s_themes_locals.unthemed_palette);
|
||||
|
||||
QFile f(QStringLiteral(":qdarkstyle/style.qss"));
|
||||
QFile f(":qdarkstyle/style.qss"_L1);
|
||||
if (f.open(QFile::ReadOnly | QFile::Text))
|
||||
SetStyleSheet(f.readAll());
|
||||
}
|
||||
else if (theme == "fusion")
|
||||
{
|
||||
SetThemeAttributes(false, true, false);
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"));
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"_L1));
|
||||
qApp->setPalette(s_themes_locals.unthemed_palette);
|
||||
}
|
||||
else if (theme == "darkfusion")
|
||||
{
|
||||
// adapted from https://gist.github.com/QuantumCD/6245215
|
||||
SetThemeAttributes(false, false, true);
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"));
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"_L1));
|
||||
|
||||
static constexpr QColor lighterGray(75, 75, 75);
|
||||
static constexpr QColor darkGray(53, 53, 53);
|
||||
@@ -182,7 +184,7 @@ void QtHost::SetStyleFromSettings()
|
||||
{
|
||||
// adapted from https://gist.github.com/QuantumCD/6245215
|
||||
SetThemeAttributes(false, false, true);
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"));
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"_L1));
|
||||
|
||||
// static constexpr QColor lighterGray(75, 75, 75);
|
||||
static constexpr QColor darkGray(53, 53, 53);
|
||||
@@ -217,7 +219,7 @@ void QtHost::SetStyleFromSettings()
|
||||
else if (theme == "darkerfusion")
|
||||
{
|
||||
SetThemeAttributes(true, false, true);
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"));
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"_L1));
|
||||
|
||||
static constexpr QColor window_color(36, 36, 36);
|
||||
static constexpr QColor base_color(43, 43, 43);
|
||||
@@ -253,7 +255,7 @@ void QtHost::SetStyleFromSettings()
|
||||
qApp->setPalette(darkPalette);
|
||||
|
||||
// menus are by far the ugliest part of fusion, so we style them manually
|
||||
const QString stylesheet = QStringLiteral(R"(
|
||||
const QLatin1StringView stylesheet = R"(
|
||||
QMenu {
|
||||
border: 1px solid #444;
|
||||
border-radius: 8px;
|
||||
@@ -631,7 +633,7 @@ QTextBrowser {
|
||||
border-bottom: 1px solid #414141;
|
||||
margin: 0px 8px;
|
||||
}
|
||||
)");
|
||||
)"_L1;
|
||||
|
||||
SetStyleSheet(stylesheet);
|
||||
}
|
||||
@@ -641,7 +643,7 @@ QTextBrowser {
|
||||
// that are meant to be easy on the eyes as the main color.
|
||||
// Alternative dark theme.
|
||||
SetThemeAttributes(false, false, true);
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"));
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"_L1));
|
||||
|
||||
static constexpr QColor gray(150, 150, 150);
|
||||
static constexpr QColor royalBlue(29, 41, 81);
|
||||
@@ -675,7 +677,7 @@ QTextBrowser {
|
||||
else if (theme == "greymatter")
|
||||
{
|
||||
SetThemeAttributes(false, false, true);
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"));
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"_L1));
|
||||
|
||||
static constexpr QColor darkGray(46, 52, 64);
|
||||
static constexpr QColor lighterGray(59, 66, 82);
|
||||
@@ -710,7 +712,7 @@ QTextBrowser {
|
||||
// Custom palette by RedDevilus, Tame (Light/Washed out) Green as main color and Grayish Blue as complimentary.
|
||||
// Alternative white theme.
|
||||
SetThemeAttributes(false, false, false);
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"));
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"_L1));
|
||||
|
||||
static constexpr QColor black(25, 25, 25);
|
||||
static constexpr QColor gray(111, 111, 111);
|
||||
@@ -742,7 +744,7 @@ QTextBrowser {
|
||||
else if (theme == "pinkypals")
|
||||
{
|
||||
SetThemeAttributes(false, false, false);
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"));
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"_L1));
|
||||
|
||||
static constexpr QColor black(25, 25, 25);
|
||||
static constexpr QColor pink(255, 174, 201);
|
||||
@@ -778,7 +780,7 @@ QTextBrowser {
|
||||
// of a theme designed for maximum eye comfort and benefits
|
||||
// OLED screens.
|
||||
SetThemeAttributes(false, false, true);
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"));
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"_L1));
|
||||
|
||||
static constexpr QColor black(0, 0, 0);
|
||||
static constexpr QColor gray(25, 25, 25);
|
||||
@@ -811,7 +813,7 @@ QTextBrowser {
|
||||
else if (theme == "darkruby")
|
||||
{
|
||||
SetThemeAttributes(false, false, true);
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"));
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"_L1));
|
||||
|
||||
static constexpr QColor gray(128, 128, 128);
|
||||
static constexpr QColor slate(18, 18, 18);
|
||||
@@ -842,7 +844,7 @@ QTextBrowser {
|
||||
else if (theme == "purplerain")
|
||||
{
|
||||
SetThemeAttributes(false, false, true);
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"));
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"_L1));
|
||||
|
||||
static constexpr QColor darkPurple(73, 41, 121);
|
||||
static constexpr QColor darkerPurple(53, 29, 87);
|
||||
@@ -875,7 +877,7 @@ QTextBrowser {
|
||||
else if (theme == "windowsvista")
|
||||
{
|
||||
SetThemeAttributes(false, false, false);
|
||||
qApp->setStyle(QStyleFactory::create("windowsvista"));
|
||||
qApp->setStyle(QStyleFactory::create("windowsvista"_L1));
|
||||
qApp->setPalette(s_themes_locals.unthemed_palette);
|
||||
}
|
||||
#endif
|
||||
@@ -912,7 +914,7 @@ bool QtHost::HasGlobalStylesheet()
|
||||
|
||||
void QtHost::UpdateThemeOnStyleChange()
|
||||
{
|
||||
const QString new_theme_name = IsDarkApplicationTheme() ? QStringLiteral("white") : QStringLiteral("black");
|
||||
const QLatin1StringView new_theme_name = IsDarkApplicationTheme() ? "white"_L1 : "black"_L1;
|
||||
if (QIcon::themeName() != new_theme_name)
|
||||
QIcon::setThemeName(new_theme_name);
|
||||
|
||||
@@ -965,7 +967,7 @@ QString QtHost::GetNativeThemeStylesheet()
|
||||
#ifdef __APPLE__
|
||||
// Qt's native style on MacOS is... not great.
|
||||
// We re-theme the tool buttons to look like Cocoa tool buttons, and fix up popup menus.
|
||||
ret = QStringLiteral(R"(
|
||||
ret = R"(
|
||||
QMenu {
|
||||
border-radius: 10px;
|
||||
padding: 4px 0;
|
||||
@@ -999,10 +1001,10 @@ QToolButton {
|
||||
.settings-window GamePatchSettingsWidget #patches_container > QFrame {
|
||||
border: none;
|
||||
margin: 0px 8px;
|
||||
})");
|
||||
})"_L1;
|
||||
if (IsDarkApplicationTheme())
|
||||
{
|
||||
ret += QStringLiteral(R"(
|
||||
ret += R"(
|
||||
QMenu {
|
||||
background-color: #161616;
|
||||
border: 1px solid #2c2c2c;
|
||||
@@ -1039,11 +1041,11 @@ QToolButton:pressed {
|
||||
}
|
||||
.settings-window GamePatchSettingsWidget #patches_container > QFrame {
|
||||
border-bottom: 1px solid #414141;
|
||||
})");
|
||||
})"_L1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret += QStringLiteral(R"(
|
||||
ret += R"(
|
||||
QMenu {
|
||||
background-color: #bdbdbd;
|
||||
border: 1px solid #d5d5d4;
|
||||
@@ -1080,7 +1082,7 @@ QToolButton:pressed {
|
||||
}
|
||||
.settings-window GamePatchSettingsWidget #patches_container > QFrame {
|
||||
border-bottom: 1px solid #414141;
|
||||
})");
|
||||
})"_L1;
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
|
||||
@@ -46,6 +46,8 @@
|
||||
|
||||
LOG_CHANNEL(Host);
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
namespace QtUtils {
|
||||
|
||||
static bool TryMigrateWindowGeometry(SettingsInterface* si, std::string_view window_name, QWidget* widget);
|
||||
@@ -410,10 +412,10 @@ QIcon QtUtils::GetIconForRegion(ConsoleRegion region)
|
||||
return QIcon(QtHost::GetResourceQPath("images/flags/PAL.svg", true));
|
||||
|
||||
case ConsoleRegion::Auto:
|
||||
return QIcon(QStringLiteral(":/icons/system-search.png"));
|
||||
return QIcon(":/icons/system-search.png"_L1);
|
||||
|
||||
default:
|
||||
return QIcon::fromTheme(QStringLiteral("file-unknow-line"));
|
||||
return QIcon::fromTheme("file-unknow-line"_L1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,7 +435,7 @@ QIcon QtUtils::GetIconForRegion(DiscRegion region)
|
||||
case DiscRegion::Other:
|
||||
case DiscRegion::NonPS1:
|
||||
default:
|
||||
return QIcon::fromTheme(QStringLiteral("file-unknow-line"));
|
||||
return QIcon::fromTheme("file-unknow-line"_L1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -442,16 +444,16 @@ QIcon QtUtils::GetIconForEntryType(GameList::EntryType type)
|
||||
switch (type)
|
||||
{
|
||||
case GameList::EntryType::Disc:
|
||||
return QIcon::fromTheme(QStringLiteral("disc-line"));
|
||||
return QIcon::fromTheme("disc-line"_L1);
|
||||
case GameList::EntryType::Playlist:
|
||||
return QIcon::fromTheme(QStringLiteral("play-list-2-line"));
|
||||
return QIcon::fromTheme("play-list-2-line"_L1);
|
||||
case GameList::EntryType::DiscSet:
|
||||
return QIcon::fromTheme(QStringLiteral("multi-discs"));
|
||||
return QIcon::fromTheme("multi-discs"_L1);
|
||||
case GameList::EntryType::PSF:
|
||||
return QIcon::fromTheme(QStringLiteral("file-music-line"));
|
||||
return QIcon::fromTheme("file-music-line"_L1);
|
||||
case GameList::EntryType::PSExe:
|
||||
default:
|
||||
return QIcon::fromTheme(QStringLiteral("settings-3-line"));
|
||||
return QIcon::fromTheme("settings-3-line"_L1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
|
||||
LOG_CHANNEL(Host);
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
namespace {
|
||||
|
||||
struct WindowInfoLocals
|
||||
@@ -70,13 +72,13 @@ WindowInfoType QtUtils::GetWindowInfoType()
|
||||
return WindowInfoType::MacOS;
|
||||
#else
|
||||
const QString platform_name = QGuiApplication::platformName();
|
||||
if (platform_name == QStringLiteral("xcb"))
|
||||
if (platform_name == "xcb"_L1)
|
||||
{
|
||||
// This is only used for determining the automatic Vulkan renderer, therefore XCB/XLib doesn't matter here.
|
||||
// See the comment below for information about this bullshit.
|
||||
return WindowInfoType::XCB;
|
||||
}
|
||||
else if (platform_name == QStringLiteral("wayland"))
|
||||
else if (platform_name == "wayland"_L1)
|
||||
{
|
||||
return WindowInfoType::Wayland;
|
||||
}
|
||||
@@ -289,7 +291,7 @@ bool Host::SetScreensaverInhibit(bool inhibit, Error* error)
|
||||
if (inhibit)
|
||||
{
|
||||
const QDBusReply<quint32> msg = s_window_info_locals.screensaver_inhibit_interface->call(
|
||||
"Inhibit", QStringLiteral("DuckStation"), QStringLiteral("DuckStation VM is running."));
|
||||
"Inhibit", "DuckStation"_L1, "DuckStation VM is running."_L1);
|
||||
if (!msg.isValid())
|
||||
{
|
||||
FormatQDBusReplyError(error, "Inhibit message call failed: ", msg.error());
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
|
||||
LOG_CHANNEL(Host);
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
static QList<SettingsWindow*> s_open_game_properties_dialogs;
|
||||
|
||||
SettingsWindow::SettingsWindow() : QWidget()
|
||||
@@ -64,7 +66,7 @@ SettingsWindow::SettingsWindow(const GameList::Entry* entry, std::unique_ptr<INI
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
addWidget(m_game_summary = new GameSummaryWidget(entry, this, m_ui.settingsContainer), tr("Summary"),
|
||||
QStringLiteral("file-list-line"),
|
||||
"file-list-line"_L1,
|
||||
tr("<strong>Summary</strong><hr>This page shows information about the selected game, and allows you to "
|
||||
"validate your disc was dumped correctly."));
|
||||
addPages();
|
||||
@@ -90,7 +92,7 @@ void SettingsWindow::closeEvent(QCloseEvent* event)
|
||||
void SettingsWindow::addPages()
|
||||
{
|
||||
addWidget(
|
||||
new InterfaceSettingsWidget(this, m_ui.settingsContainer), tr("Interface"), QStringLiteral("settings-3-line"),
|
||||
new InterfaceSettingsWidget(this, m_ui.settingsContainer), tr("Interface"), "settings-3-line"_L1,
|
||||
tr("<strong>Interface Settings</strong><hr>These options control how the emulator looks and "
|
||||
"behaves.<br><br>Mouse over an option for additional information, and Shift+Wheel to scroll this panel."));
|
||||
|
||||
@@ -98,33 +100,33 @@ void SettingsWindow::addPages()
|
||||
{
|
||||
addWidget(
|
||||
m_game_list_settings = new GameListSettingsWidget(this, m_ui.settingsContainer), tr("Game List"),
|
||||
QStringLiteral("folder-open-line"),
|
||||
"folder-open-line"_L1,
|
||||
tr("<strong>Game List Settings</strong><hr>The list above shows the directories which will be searched by "
|
||||
"DuckStation to populate the game list. Search directories can be added, removed, and switched to "
|
||||
"recursive/non-recursive."));
|
||||
}
|
||||
|
||||
addWidget(new BIOSSettingsWidget(this, m_ui.settingsContainer), tr("BIOS"), QStringLiteral("chip-line"),
|
||||
addWidget(new BIOSSettingsWidget(this, m_ui.settingsContainer), tr("BIOS"), "chip-line"_L1,
|
||||
tr("<strong>BIOS Settings</strong><hr>These options control which BIOS and expansion port is "
|
||||
"used.<br><br>Mouse over an option for additional information, and Shift+Wheel to scroll this panel."));
|
||||
addWidget(
|
||||
new ConsoleSettingsWidget(this, m_ui.settingsContainer), tr("Console"), QStringLiteral("emulation-line"),
|
||||
new ConsoleSettingsWidget(this, m_ui.settingsContainer), tr("Console"), "emulation-line"_L1,
|
||||
tr("<strong>Console Settings</strong><hr>These options determine the configuration of the simulated "
|
||||
"console.<br><br>Mouse over an option for additional information, and Shift+Wheel to scroll this panel."));
|
||||
addWidget(
|
||||
new EmulationSettingsWidget(this, m_ui.settingsContainer), tr("Emulation"), QStringLiteral("chip-2-line"),
|
||||
new EmulationSettingsWidget(this, m_ui.settingsContainer), tr("Emulation"), "chip-2-line"_L1,
|
||||
tr("<strong>Emulation Settings</strong><hr>These options determine the speed and runahead behavior of the "
|
||||
"system.<br><br>Mouse over an option for additional information, and Shift+Wheel to scroll this panel."));
|
||||
|
||||
if (isPerGameSettings())
|
||||
{
|
||||
addWidget(new GamePatchSettingsWidget(this, m_ui.settingsContainer), tr("Patches"),
|
||||
QStringLiteral("sparkling-line"),
|
||||
"sparkling-line"_L1,
|
||||
tr("<strong>Patches</strong><hr>This section allows you to select optional patches to apply to the game, "
|
||||
"which may provide performance, visual, or gameplay improvements. Activating game patches can cause "
|
||||
"unpredictable behavior, crashing, soft-locks, or broken saved games. Use patches at your own risk, "
|
||||
"no support will be provided to users who have enabled game patches."));
|
||||
addWidget(new GameCheatSettingsWidget(this, m_ui.settingsContainer), tr("Cheats"), QStringLiteral("cheats-line"),
|
||||
addWidget(new GameCheatSettingsWidget(this, m_ui.settingsContainer), tr("Cheats"), "cheats-line"_L1,
|
||||
tr("<strong>Cheats</strong><hr>This section allows you to select which cheats you wish to enable. "
|
||||
"<strong>Using cheats can have unpredictable effects on games, causing crashes, graphical glitches, "
|
||||
"and corrupted saves.</strong> Cheats also persist through save states even after being disabled, "
|
||||
@@ -132,52 +134,52 @@ void SettingsWindow::addPages()
|
||||
}
|
||||
|
||||
addWidget(
|
||||
new MemoryCardSettingsWidget(this, m_ui.settingsContainer), tr("Memory Cards"), QStringLiteral("memcard-line"),
|
||||
new MemoryCardSettingsWidget(this, m_ui.settingsContainer), tr("Memory Cards"), "memcard-line"_L1,
|
||||
tr("<strong>Memory Card Settings</strong><hr>This page lets you control what mode the memory card emulation will "
|
||||
"function in, and where the images for these cards will be stored on disk."));
|
||||
GraphicsSettingsWidget* graphics_settings;
|
||||
addWidget(graphics_settings = new GraphicsSettingsWidget(this, m_ui.settingsContainer), tr("Graphics"),
|
||||
QStringLiteral("image-fill"),
|
||||
"image-fill"_L1,
|
||||
tr("<strong>Graphics Settings</strong><hr>These options control how the graphics of the emulated console "
|
||||
"are rendered. Not all options are available for the software renderer. Mouse over each option for "
|
||||
"additional information, and Shift+Wheel to scroll this panel."));
|
||||
//: Translators may want to shorten On-Screen Display to "OSD".
|
||||
addWidget(new OSDSettingsWidget(this, m_ui.settingsContainer), tr("On-Screen Display"),
|
||||
QStringLiteral("numbers-fill"),
|
||||
"numbers-fill"_L1,
|
||||
tr("<strong>On-Screen Display Settings</strong><hr>These options determine the behavior of the messages "
|
||||
"that are displayed while content is running."));
|
||||
addWidget(
|
||||
new PostProcessingSettingsWidget(this, m_ui.settingsContainer), tr("Post-Processing"), QStringLiteral("sun-fill"),
|
||||
new PostProcessingSettingsWidget(this, m_ui.settingsContainer), tr("Post-Processing"), "sun-fill"_L1,
|
||||
tr("<strong>Post-Processing Settings</strong><hr>Post processing allows you to alter the appearance of the image "
|
||||
"displayed on the screen with various filters. Shaders will be executed in sequence. Additional shaders can be "
|
||||
"downloaded from <a href=\"%1\">%1</a>.")
|
||||
.arg("https://github.com/stenzek/emu-shaders"));
|
||||
addWidget(
|
||||
new AudioSettingsWidget(this, m_ui.settingsContainer), tr("Audio"), QStringLiteral("volume-up-line"),
|
||||
new AudioSettingsWidget(this, m_ui.settingsContainer), tr("Audio"), "volume-up-line"_L1,
|
||||
tr("<strong>Audio Settings</strong><hr>These options control the audio output of the console. Mouse over an option "
|
||||
"for additional information."));
|
||||
addWidget(
|
||||
new AchievementSettingsWidget(this, m_ui.settingsContainer), tr("Achievements"), QStringLiteral("trophy-line"),
|
||||
new AchievementSettingsWidget(this, m_ui.settingsContainer), tr("Achievements"), "trophy-line"_L1,
|
||||
tr("<strong>Achievement Settings</strong><hr>DuckStation uses RetroAchievements as an achievement database and "
|
||||
"for tracking progress. To use achievements, please sign up for an account at <a href=\"%1\">%1</a>. To view "
|
||||
"the achievement list in-game, press the hotkey for <strong>Open Pause Menu</strong> and select "
|
||||
"<strong>Achievements</strong> from the menu. Mouse over an option for additional information, and "
|
||||
"Shift+Wheel to scroll this panel.")
|
||||
.arg("https://retroachievements.org/"));
|
||||
addWidget(new CaptureSettingsWidget(this, m_ui.settingsContainer), tr("Capture"), QStringLiteral("vidicon-line"),
|
||||
addWidget(new CaptureSettingsWidget(this, m_ui.settingsContainer), tr("Capture"), "vidicon-line"_L1,
|
||||
tr("<strong>Capture Settings</strong><hr>These options determine how screenshots and videos are captured "
|
||||
"by the application."));
|
||||
|
||||
if (!isPerGameSettings())
|
||||
{
|
||||
addWidget(
|
||||
new FolderSettingsWidget(this, m_ui.settingsContainer), tr("Folders"), QStringLiteral("folder-settings-line"),
|
||||
new FolderSettingsWidget(this, m_ui.settingsContainer), tr("Folders"), "folder-settings-line"_L1,
|
||||
tr("<strong>Folder Settings</strong><hr>These options control where DuckStation will save runtime data files."));
|
||||
}
|
||||
|
||||
AdvancedSettingsWidget* advanced_settings;
|
||||
addWidget(advanced_settings = new AdvancedSettingsWidget(this, m_ui.settingsContainer), tr("Advanced"),
|
||||
QStringLiteral("alert-line"),
|
||||
"alert-line"_L1,
|
||||
tr("<strong>Advanced Settings</strong><hr>These options control logging and internal behavior of the "
|
||||
"emulator. Mouse over an option for additional information, and Shift+Wheel to scroll this panel."));
|
||||
|
||||
@@ -247,7 +249,7 @@ void SettingsWindow::connectUi()
|
||||
connect(m_ui.clearGameSettings, &QPushButton::clicked, this, &SettingsWindow::onClearSettingsClicked);
|
||||
}
|
||||
|
||||
void SettingsWindow::addWidget(QWidget* widget, QString title, QString icon, QString help_text)
|
||||
void SettingsWindow::addWidget(QWidget* widget, QString title, QLatin1StringView icon, QString help_text)
|
||||
{
|
||||
const int index = m_ui.settingsCategory->count();
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ private:
|
||||
void addPages();
|
||||
void reloadPages();
|
||||
|
||||
void addWidget(QWidget* widget, QString title, QString icon, QString help_text);
|
||||
void addWidget(QWidget* widget, QString title, QLatin1StringView icon, QString help_text);
|
||||
bool handleWheelEvent(QWheelEvent* event);
|
||||
|
||||
void onCategoryCurrentRowChanged(int row);
|
||||
|
||||
@@ -35,6 +35,9 @@
|
||||
#include <type_traits>
|
||||
|
||||
namespace SettingWidgetBinder {
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
inline constexpr const char* NULLABLE_PROPERTY = "SettingWidgetBinder_isNullable";
|
||||
inline constexpr const char* IS_NULL_PROPERTY = "SettingWidgetBinder_isNull";
|
||||
inline constexpr const char* GLOBAL_VALUE_PROPERTY = "SettingWidgetBinder_globalValue";
|
||||
@@ -79,10 +82,7 @@ template<>
|
||||
struct SettingAccessor<QLineEdit>
|
||||
{
|
||||
static bool getBoolValue(const QLineEdit* widget) { return widget->text().toInt() != 0; }
|
||||
static void setBoolValue(QLineEdit* widget, bool value)
|
||||
{
|
||||
widget->setText(value ? QStringLiteral("1") : QStringLiteral("0"));
|
||||
}
|
||||
static void setBoolValue(QLineEdit* widget, bool value) { widget->setText(value ? "1"_L1 : "0"_L1); }
|
||||
static void makeNullableBool(QLineEdit* widget, bool globalValue) { widget->setEnabled(false); }
|
||||
static std::optional<bool> getNullableBoolValue(const QLineEdit* widget) { return getBoolValue(widget); }
|
||||
static void setNullableBoolValue(QLineEdit* widget, std::optional<bool> value)
|
||||
@@ -268,17 +268,14 @@ struct SettingAccessor<QCheckBox>
|
||||
Qt::PartiallyChecked);
|
||||
}
|
||||
|
||||
static QString getStringValue(const QCheckBox* widget)
|
||||
{
|
||||
return widget->isChecked() ? QStringLiteral("1") : QStringLiteral("0");
|
||||
}
|
||||
static QString getStringValue(const QCheckBox* widget) { return widget->isChecked() ? "1"_L1 : "0"_L1; }
|
||||
static void setStringValue(QCheckBox* widget, const QString& value) { widget->setChecked(value.toInt() != 0); }
|
||||
static void makeNullableString(QCheckBox* widget, const QString& globalValue) { widget->setTristate(true); }
|
||||
static std::optional<QString> getNullableStringValue(const QCheckBox* widget)
|
||||
{
|
||||
return (widget->checkState() == Qt::PartiallyChecked) ?
|
||||
std::nullopt :
|
||||
std::optional<QString>(widget->isChecked() ? QStringLiteral("1") : QStringLiteral("0"));
|
||||
std::optional<QString>(widget->isChecked() ? "1"_L1 : "0"_L1);
|
||||
}
|
||||
static void setNullableStringValue(QCheckBox* widget, std::optional<QString> value)
|
||||
{
|
||||
@@ -419,7 +416,7 @@ struct SettingAccessor<QSpinBox>
|
||||
static void updateFont(QSpinBox* widget, bool isNull)
|
||||
{
|
||||
// We should be able to use QFont here.. but it doesn't update on change.
|
||||
widget->setStyleSheet(isNull ? QStringLiteral("font-style: italic;") : QString());
|
||||
widget->setStyleSheet(isNull ? QString("font-style: italic;"_L1) : QString());
|
||||
widget->setPrefix(isNull ? qApp->translate("SettingWidgetBinder", "Default: ") : QString());
|
||||
}
|
||||
|
||||
@@ -711,10 +708,7 @@ struct SettingAccessor<QAction>
|
||||
setFloatValue(widget, value.value_or(0.0f));
|
||||
}
|
||||
|
||||
static QString getStringValue(const QAction* widget)
|
||||
{
|
||||
return widget->isChecked() ? QStringLiteral("1") : QStringLiteral("0");
|
||||
}
|
||||
static QString getStringValue(const QAction* widget) { return widget->isChecked() ? "1"_L1 : "0"_L1; }
|
||||
static void setStringValue(QAction* widget, const QString& value) { widget->setChecked(value.toInt() != 0); }
|
||||
static void makeNullableString(QAction* widget, const QString& globalValue) { widget->setEnabled(false); }
|
||||
static std::optional<QString> getNullableStringValue(const QAction* widget) { return getStringValue(widget); }
|
||||
|
||||
Reference in New Issue
Block a user