mirror of https://github.com/mgba-emu/mgba.git
Qt: Add reset toggle for Dolphin connection
This commit is contained in:
parent
e2d6bc38ff
commit
885ef286d2
|
@ -37,8 +37,10 @@ void DolphinConnector::attach() {
|
|||
}
|
||||
|
||||
}
|
||||
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 @@ void DolphinConnector::attach() {
|
|||
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 @@ void DolphinConnector::attach() {
|
|||
QMessageBox::Ok);
|
||||
fail->setAttribute(Qt::WA_DeleteOnClose);
|
||||
fail->show();
|
||||
} else if (reset) {
|
||||
m_controller->reset();
|
||||
}
|
||||
|
||||
updateAttached();
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>306</width>
|
||||
<height>119</height>
|
||||
<height>123</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -40,7 +40,7 @@
|
|||
</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>
|
||||
|
@ -84,6 +84,13 @@
|
|||
</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>
|
||||
<resources/>
|
||||
|
|
Loading…
Reference in New Issue