Commit 0b219864 authored by Adam Honse's avatar Adam Honse

Update client list whenever status changes

parent 0bb0acb9
......@@ -1357,7 +1357,7 @@ void Visualizer::VisThreadFunction()
}
}
static bool started = false;
void Visualizer::OpenRGBConnect(const char * ip, unsigned short port)
NetworkClient * Visualizer::OpenRGBConnect(const char * ip, unsigned short port)
{
NetworkClient * rgb_client = new NetworkClient(rgb_controllers);
......@@ -1374,6 +1374,8 @@ void Visualizer::OpenRGBConnect(const char * ip, unsigned short port)
LEDUpdateThread = new std::thread(&Visualizer::LEDUpdateThreadFunction, this);
started = true;
}
return(rgb_client);
}
void Visualizer::LEDUpdateThreadFunction()
......
......@@ -94,7 +94,7 @@ public:
void VisThreadFunction();
//Connect to OpenRGB
void OpenRGBConnect(const char *ip, unsigned short port);
NetworkClient *OpenRGBConnect(const char *ip, unsigned short port);
//Called when settings changed
void OnSettingsChanged();
......
......@@ -11,6 +11,13 @@ boolean firstrun;
using namespace Ui;
static void UpdateOpenRGBClientListCallback(void * this_ptr)
{
KeyboardVisDlg * this_obj = (KeyboardVisDlg *)this_ptr;
QMetaObject::invokeMethod(this_obj, "UpdateOpenRGBClientList", Qt::QueuedConnection);
}
KeyboardVisDlg::KeyboardVisDlg(QWidget *parent) : QMainWindow(parent), ui(new KeyboardVisualizerDlg)
{
startminimized = false;
......@@ -400,7 +407,7 @@ void Ui::KeyboardVisDlg::on_button_Connect_clicked()
unsigned short port = std::stoi(ui->lineEdit_Port->text().toStdString());
std::string ip = ui->lineEdit_IP->text().toStdString();
vis_ptr->OpenRGBConnect(ip.c_str(), port);
NetworkClient * new_client = vis_ptr->OpenRGBConnect(ip.c_str(), port);
UpdateOpenRGBClientList();
new_client->RegisterClientInfoChangeCallback(UpdateOpenRGBClientListCallback, this);
}
......@@ -25,6 +25,8 @@ public:
void SetVisualizer(Visualizer* v);
void StartMinimized(boolean startmin);
public slots:
void UpdateOpenRGBClientList();
private slots:
......
Subproject commit e2c2b8c1df81e3cbccaa68a531507155cac45590
Subproject commit 15d23d300952d1e17ec844d7b446fa1ba6e193ae
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment