Don't try to connect to radio we are already connected to

merge-requests/9/merge
Phil Taylor 2022-05-14 01:11:15 +01:00
rodzic 8fd8fa390e
commit 48562aa23b
1 zmienionych plików z 13 dodań i 5 usunięć

Wyświetl plik

@ -42,21 +42,29 @@ void selectRadio::setInUse(quint8 radio, quint8 busy, QString user, QString ip)
ui->table->setItem(radio, 3, new QTableWidgetItem(user));
ui->table->setItem(radio, 4, new QTableWidgetItem(ip));
for (int f = 0; f < 5; f++) {
if (busy == 1)
if (busy == 1)
{
ui->table->item(radio, f)->setBackground(Qt::darkGreen);
else if (busy == 2)
}
else if (busy == 2)
{
ui->table->item(radio, f)->setBackground(Qt::red);
}
else
{
ui->table->item(radio, f)->setBackground(Qt::black);
}
}
}
void selectRadio::on_table_cellClicked(int row, int col) {
qInfo() << "Clicked on " << row << "," << col;
ui->table->selectRow(row);
emit selectedRadio(row);
this->setVisible(false);
if (ui->table->item(row, col)->backgroundColor() != Qt::darkGreen) {
ui->table->selectRow(row);
emit selectedRadio(row);
this->setVisible(false);
}
}