Skip to content

Commit 2d17f02

Browse files
committed
Fix UI
1 parent e038cf7 commit 2d17f02

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

SerialPrograms/Source/Controllers/ControllerSelectorWidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,12 @@ void ControllerSelectorWidget::refresh_selection(ControllerInterface interface_t
146146

147147
switch (interface_type){
148148
case ControllerInterface::SerialPABotBase:
149-
m_selector = new SerialPABotBase::SerialPABotBase_SelectorWidget(*this, nullptr);
149+
m_selector = new SerialPABotBase::SerialPABotBase_SelectorWidget(*this, m_session.descriptor().get());
150150
m_dropdowns->insertWidget(1, m_selector);
151151
break;
152152

153153
case ControllerInterface::TcpSysbotBase:
154-
m_selector = new SysbotBase::TcpSysbotBase_SelectorWidget(*this, nullptr);
154+
m_selector = new SysbotBase::TcpSysbotBase_SelectorWidget(*this, m_session.descriptor().get());
155155
m_dropdowns->insertWidget(1, m_selector);
156156
break;
157157

SerialPrograms/Source/Controllers/ControllerSession.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66

77
#include "Common/Cpp/Exceptions.h"
8-
#include "ControllerTypeStrings.h"
98
#include "ControllerSession.h"
109

1110
//#include <iostream>

SerialPrograms/Source/Controllers/SerialPABotBase/SerialPABotBase_SelectorWidget.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ class SerialPABotBase_SelectorWidget : public NoWheelComboBox{
3434
{
3535
// cout << "SerialPABotBase(): " << current << endl;
3636

37-
if (current == nullptr){
37+
if (current == nullptr || (
38+
current->interface_type != ControllerInterface::None &&
39+
current->interface_type != ControllerInterface::SerialPABotBase
40+
)
41+
){
3842
std::shared_ptr<const ControllerDescriptor> descriptor =
3943
parent.session().option().get_descriptor_from_cache(ControllerInterface::SerialPABotBase);
4044
if (!descriptor){

SerialPrograms/Source/NintendoSwitch/Controllers/SysbotBase/SysbotBase_SelectorWidget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class TcpSysbotBase_SelectorWidget : public QLineEdit{
3737

3838
this->setPlaceholderText("192.168.0.100:6000");
3939

40-
if (current == nullptr){
40+
if (current == nullptr || current->interface_type != ControllerInterface::TcpSysbotBase){
4141
std::shared_ptr<const ControllerDescriptor> descriptor =
4242
parent.session().option().get_descriptor_from_cache(ControllerInterface::TcpSysbotBase);
4343
if (!descriptor){

0 commit comments

Comments
 (0)