DolphinQt: Hide buttons for read-only game config

The Open in External Editor button makes editing a game INI file easy,
and the Refresh button is only useful if you edit the game INI. You're
not supposed to edit read-only game INIs, so let's not show these two
buttons for read-only game INIs.

I implemented this by hiding the buttons instead of not creating them in
the first place so we don't have to branch on whether the buttons exist
in GameConfigEdit::ConnectWidgets.
This commit is contained in:
JosJuice
2026-04-06 17:59:45 +02:00
parent 7e98245ca4
commit 5fcdb6f8f9

View File

@@ -83,6 +83,12 @@ void GameConfigEdit::CreateWidgets()
m_refresh_button = new QPushButton(tr("Refresh"));
m_external_editor_button = new QPushButton(tr("Open in External Editor"));
if (m_read_only)
{
m_refresh_button->hide();
m_external_editor_button->hide();
}
auto* button_layout = new QHBoxLayout;
button_layout->addWidget(m_refresh_button);
button_layout->addWidget(m_external_editor_button);