Qt: Add reset toggle for Dolphin connection
Vicki Pfau vi@endrift.com
Sat, 27 Feb 2021 17:12:43 -0800
2 files changed,
14 insertions(+),
2 deletions(-)
M
src/platform/qt/DolphinConnector.cpp
→
src/platform/qt/DolphinConnector.cpp
@@ -37,8 +37,10 @@ return;
} } + bool reset = m_ui.doReset->isChecked(); if (!m_window->controller()) { m_window->bootBIOS(); + reset = false; if (!m_window->controller() || m_window->controller()->platform() != mPLATFORM_GBA) { return; }@@ -49,6 +51,7 @@ m_controller = m_window->controller();
CoreController::Interrupter interrupter(m_controller); m_controller->attachDolphin(address); connect(m_controller.get(), &CoreController::stopping, this, &DolphinConnector::detach); + interrupter.resume(); if (!m_controller->isDolphinConnected()) { QMessageBox* fail = new QMessageBox(QMessageBox::Warning, tr("Couldn't Connect"),@@ -56,6 +59,8 @@ tr("Could not connect to Dolphin."),
QMessageBox::Ok); fail->setAttribute(Qt::WA_DeleteOnClose); fail->show(); + } else if (reset) { + m_controller->reset(); } updateAttached();
M
src/platform/qt/DolphinConnector.ui
→
src/platform/qt/DolphinConnector.ui
@@ -7,7 +7,7 @@ <rect>
<x>0</x> <y>0</y> <width>306</width> - <height>119</height> + <height>123</height> </rect> </property> <property name="windowTitle">@@ -40,7 +40,7 @@ <string notr="true">buttonGroup</string>
</attribute> </widget> </item> - <item row="2" column="0" colspan="2"> + <item row="2" column="1"> <widget class="QLineEdit" name="ipAddr"> <property name="enabled"> <bool>false</bool>@@ -83,6 +83,13 @@ </property>
</widget> </item> </layout> + </item> + <item row="2" column="0"> + <widget class="QCheckBox" name="doReset"> + <property name="text"> + <string>Reset on connect</string> + </property> + </widget> </item> </layout> </widget>