Qt: Add 'Refresh' button to toolbar for reloading game list

This commit is contained in:
Connor McLaughlin 2020-03-22 13:16:20 +10:00
parent 7e36195f44
commit bf2f9bd8d9
2 changed files with 12 additions and 0 deletions

View file

@ -436,6 +436,8 @@ void MainWindow::connectSignals()
connect(m_ui.actionReset, &QAction::triggered, m_host_interface, &QtHostInterface::resetSystem); connect(m_ui.actionReset, &QAction::triggered, m_host_interface, &QtHostInterface::resetSystem);
connect(m_ui.actionPause, &QAction::toggled, m_host_interface, &QtHostInterface::pauseSystem); connect(m_ui.actionPause, &QAction::toggled, m_host_interface, &QtHostInterface::pauseSystem);
connect(m_ui.actionScreenshot, &QAction::triggered, m_host_interface, &QtHostInterface::saveScreenshot); connect(m_ui.actionScreenshot, &QAction::triggered, m_host_interface, &QtHostInterface::saveScreenshot);
connect(m_ui.actionRefreshGameList, &QAction::triggered, this,
[this]() { m_host_interface->refreshGameList(false, false); });
connect(m_ui.actionLoadState, &QAction::triggered, this, [this]() { m_ui.menuLoadState->exec(QCursor::pos()); }); connect(m_ui.actionLoadState, &QAction::triggered, this, [this]() { m_ui.menuLoadState->exec(QCursor::pos()); });
connect(m_ui.actionSaveState, &QAction::triggered, this, [this]() { m_ui.menuSaveState->exec(QCursor::pos()); }); connect(m_ui.actionSaveState, &QAction::triggered, this, [this]() { m_ui.menuSaveState->exec(QCursor::pos()); });
connect(m_ui.actionExit, &QAction::triggered, this, &MainWindow::close); connect(m_ui.actionExit, &QAction::triggered, this, &MainWindow::close);

View file

@ -158,6 +158,7 @@
</attribute> </attribute>
<addaction name="actionStartDisc"/> <addaction name="actionStartDisc"/>
<addaction name="actionStartBios"/> <addaction name="actionStartBios"/>
<addaction name="actionRefreshGameList"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionPowerOff"/> <addaction name="actionPowerOff"/>
<addaction name="actionReset"/> <addaction name="actionReset"/>
@ -190,6 +191,15 @@
<string>Start &amp;BIOS</string> <string>Start &amp;BIOS</string>
</property> </property>
</action> </action>
<action name="actionRefreshGameList">
<property name="icon">
<iconset resource="resources/icons.qrc">
<normaloff>:/icons/folder-open.png</normaloff>:/icons/folder-open.png</iconset>
</property>
<property name="text">
<string>Refresh</string>
</property>
</action>
<action name="actionPowerOff"> <action name="actionPowerOff">
<property name="icon"> <property name="icon">
<iconset resource="resources/icons.qrc"> <iconset resource="resources/icons.qrc">