mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-05-09 12:24:04 -05:00
The optional default value is used to implement `ConfigUserPath::Reset()`. Since `ConfigUserPath` must not be empty, there was no easy way to reset these paths to their default value. With this change users of `ConfigUserPath` can now set the default path. At the moment users of `ConfigUserPath` must place a reset button and connect a callback to `ConfigUserPath::Reset` on their own.
33 lines
856 B
C++
33 lines
856 B
C++
// Copyright 2025 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <QLineEdit>
|
|
|
|
#include "Common/Config/ConfigInfo.h"
|
|
|
|
#include "DolphinQt/Config/ConfigControls/ConfigText.h"
|
|
|
|
class ConfigUserPath final : public ConfigText
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
ConfigUserPath(const unsigned int dir_index, const Config::Info<std::string>& setting);
|
|
ConfigUserPath(const unsigned int dir_index, const Config::Info<std::string>& setting,
|
|
std::string default_value);
|
|
ConfigUserPath(const unsigned int dir_index, const Config::Info<std::string>& setting,
|
|
std::string default_value, Config::Layer* layer);
|
|
void Reset();
|
|
|
|
protected:
|
|
void OnConfigChanged() override;
|
|
|
|
private:
|
|
void RefreshText();
|
|
void Update();
|
|
|
|
const unsigned int m_dir_index;
|
|
const std::string m_default_value;
|
|
};
|