mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-02-20 07:13:49 -07:00
update load/save button when edition profile, before hitting enter
Co-Authored-By: iTrooz <hey@itrooz.fr> Co-Authored-By: Max Chateau <maxban.chateau@gmail.com> Co-Authored-By: Damien R. <rodriguezdamien1677@gmail.com>
This commit is contained in:
parent
919c53b3af
commit
73b454f99c
@ -213,7 +213,7 @@ void MappingWindow::ConnectWidgets()
|
||||
connect(m_profiles_open_folder, &QPushButton::clicked, this, &MappingWindow::OnOpenProfileFolder);
|
||||
|
||||
connect(m_profiles_combo, &QComboBox::currentIndexChanged, this, &MappingWindow::OnSelectProfile);
|
||||
connect(m_profiles_combo, &QComboBox::editTextChanged, this,
|
||||
connect(m_profiles_combo, &QComboBox::currentTextChanged, this,
|
||||
&MappingWindow::OnProfileTextChanged);
|
||||
|
||||
// We currently use the "Close" button as an "Accept" button so we must save on reject.
|
||||
@ -237,18 +237,16 @@ void MappingWindow::UpdateProfileIndex()
|
||||
|
||||
void MappingWindow::UpdateProfileButtonState()
|
||||
{
|
||||
// Make sure save/delete buttons are disabled for built-in profiles
|
||||
bool builtin = false;
|
||||
if (m_profiles_combo->findText(m_profiles_combo->currentText()) != -1)
|
||||
{
|
||||
const QString profile_path = m_profiles_combo->currentData().toString();
|
||||
std::string sys_dir = File::GetSysDirectory();
|
||||
sys_dir = ReplaceAll(sys_dir, "\\", DIR_SEP);
|
||||
builtin = profile_path.startsWith(QString::fromStdString(sys_dir));
|
||||
}
|
||||
// currentData() is not up to date on a currentTextChanged() event, so find profile path from currentText() (which is up to date)
|
||||
const int index = m_profiles_combo->findText(m_profiles_combo->currentText());
|
||||
QString profile_path;
|
||||
if (index != -1) profile_path = m_profiles_combo->itemData(index).toString();
|
||||
|
||||
// Make sure save/delete buttons are disabled for built-in profiles
|
||||
std::string sys_dir = File::GetSysDirectory();
|
||||
sys_dir = ReplaceAll(sys_dir, "\\", DIR_SEP);
|
||||
bool builtin = profile_path.startsWith(QString::fromStdString(sys_dir));
|
||||
// Check if mapping is modified
|
||||
const QString profile_path = m_profiles_combo->currentData().toString();
|
||||
Common::IniFile diskIni;
|
||||
diskIni.Load(profile_path.toStdString());
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user