Qt: Fix close button in settings not being translatable

This commit is contained in:
Connor McLaughlin 2020-10-03 01:13:18 +10:00
parent c051538d03
commit c6582bb7e4
2 changed files with 187 additions and 209 deletions

View file

@ -54,6 +54,7 @@ SettingsDialog::SettingsDialog(QtHostInterface* host_interface, QWidget* parent
m_ui.settingsContainer->setCurrentIndex(0); m_ui.settingsContainer->setCurrentIndex(0);
m_ui.helpText->setText(m_category_help_text[0]); m_ui.helpText->setText(m_category_help_text[0]);
connect(m_ui.settingsCategory, &QListWidget::currentRowChanged, this, &SettingsDialog::onCategoryCurrentRowChanged); connect(m_ui.settingsCategory, &QListWidget::currentRowChanged, this, &SettingsDialog::onCategoryCurrentRowChanged);
connect(m_ui.closeButton, &QPushButton::clicked, this, &SettingsDialog::accept);
} }
SettingsDialog::~SettingsDialog() = default; SettingsDialog::~SettingsDialog() = default;

View file

@ -26,189 +26,199 @@
<iconset resource="resources/resources.qrc"> <iconset resource="resources/resources.qrc">
<normaloff>:/icons/applications-system.png</normaloff>:/icons/applications-system.png</iconset> <normaloff>:/icons/applications-system.png</normaloff>:/icons/applications-system.png</iconset>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0"> <item row="0" column="0">
<layout class="QGridLayout" name="gridLayout"> <widget class="QListWidget" name="settingsCategory">
<property name="horizontalSpacing"> <property name="sizePolicy">
<number>10</number> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<item row="0" column="0"> <property name="minimumSize">
<widget class="QListWidget" name="settingsCategory"> <size>
<property name="sizePolicy"> <width>230</width>
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <height>0</height>
<horstretch>0</horstretch> </size>
<verstretch>0</verstretch> </property>
</sizepolicy> <property name="maximumSize">
</property> <size>
<property name="minimumSize"> <width>400</width>
<size> <height>16777215</height>
<width>230</width> </size>
<height>0</height> </property>
</size> <property name="iconSize">
</property> <size>
<property name="maximumSize"> <width>32</width>
<size> <height>32</height>
<width>400</width> </size>
<height>16777215</height> </property>
</size> <item>
</property> <property name="text">
<property name="iconSize"> <string>General Settings</string>
<size> </property>
<width>32</width> <property name="icon">
<height>32</height> <iconset resource="resources/resources.qrc">
</size> <normaloff>:/icons/applications-system.png</normaloff>:/icons/applications-system.png</iconset>
</property> </property>
<item>
<property name="text">
<string>General Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/applications-system.png</normaloff>:/icons/applications-system.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>BIOS Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/media-flash-2.png</normaloff>:/icons/media-flash-2.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Console Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/utilities-system-monitor.png</normaloff>:/icons/utilities-system-monitor.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Game List Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/system-file-manager.png</normaloff>:/icons/system-file-manager.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Hotkey Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/preferences-desktop-keyboard-shortcuts.png</normaloff>:/icons/preferences-desktop-keyboard-shortcuts.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Controller Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/input-gaming.png</normaloff>:/icons/input-gaming.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Memory Card Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/media-flash.png</normaloff>:/icons/media-flash.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Display Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/video-display.png</normaloff>:/icons/video-display.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Enhancement Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/antialias-icon.png</normaloff>:/icons/antialias-icon.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Post-Processing Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/applications-graphics.png</normaloff>:/icons/applications-graphics.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Audio Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/audio-card.png</normaloff>:/icons/audio-card.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Advanced Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/applications-development.png</normaloff>:/icons/applications-development.png</iconset>
</property>
</item>
</widget>
</item> </item>
<item row="0" column="1"> <item>
<widget class="QStackedWidget" name="settingsContainer"> <property name="text">
<property name="minimumSize"> <string>BIOS Settings</string>
<size> </property>
<width>500</width> <property name="icon">
<height>0</height> <iconset resource="resources/resources.qrc">
</size> <normaloff>:/icons/media-flash-2.png</normaloff>:/icons/media-flash-2.png</iconset>
</property> </property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="page"/>
<widget class="QWidget" name="page_2"/>
</widget>
</item> </item>
<item row="1" column="0" colspan="2"> <item>
<widget class="QTextEdit" name="helpText"> <property name="text">
<property name="minimumSize"> <string>Console Settings</string>
<size> </property>
<width>0</width> <property name="icon">
<height>120</height> <iconset resource="resources/resources.qrc">
</size> <normaloff>:/icons/utilities-system-monitor.png</normaloff>:/icons/utilities-system-monitor.png</iconset>
</property> </property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>120</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item> </item>
<item row="2" column="0" colspan="2"> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <property name="text">
<string>Game List Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/system-file-manager.png</normaloff>:/icons/system-file-manager.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Hotkey Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/preferences-desktop-keyboard-shortcuts.png</normaloff>:/icons/preferences-desktop-keyboard-shortcuts.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Controller Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/input-gaming.png</normaloff>:/icons/input-gaming.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Memory Card Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/media-flash.png</normaloff>:/icons/media-flash.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Display Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/video-display.png</normaloff>:/icons/video-display.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Enhancement Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/antialias-icon.png</normaloff>:/icons/antialias-icon.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Post-Processing Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/applications-graphics.png</normaloff>:/icons/applications-graphics.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Audio Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/audio-card.png</normaloff>:/icons/audio-card.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Advanced Settings</string>
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/applications-development.png</normaloff>:/icons/applications-development.png</iconset>
</property>
</item>
</widget>
</item>
<item row="0" column="1">
<widget class="QStackedWidget" name="settingsContainer">
<property name="minimumSize">
<size>
<width>500</width>
<height>0</height>
</size>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="page"/>
<widget class="QWidget" name="page_2"/>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QTextEdit" name="helpText">
<property name="minimumSize">
<size>
<width>0</width>
<height>120</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>120</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="standardButtons"> <property name="sizeHint" stdset="0">
<set>QDialogButtonBox::Close|QDialogButtonBox::RestoreDefaults</set> <size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="closeButton">
<property name="text">
<string>Close</string>
</property>
<property name="default">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
@ -219,38 +229,5 @@
<resources> <resources>
<include location="resources/resources.qrc"/> <include location="resources/resources.qrc"/>
</resources> </resources>
<connections> <connections/>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>SettingsDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>SettingsDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui> </ui>