diff --git a/selectradio.cpp b/selectradio.cpp index 0862ace..61e0192 100644 --- a/selectradio.cpp +++ b/selectradio.cpp @@ -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); + } }