mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-08-16 23:37:41 -05:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user