| 474 | } |
| 475 | |
| 476 | void QInputDeviceListWindow::onMouseListCellChanged(int row, int col) |
| 477 | { |
| 478 | if (col == DEVICE_TABLE_DISABLE_COLUMN) { |
| 479 | bool disable = false; |
| 480 | if (ui->mouseDeviceTable->item(row, col)->checkState() == Qt::Checked) { |
| 481 | disable = true; |
| 482 | } |
| 483 | else { |
| 484 | disable = false; |
| 485 | } |
| 486 | |
| 487 | #ifdef DEBUG_LOGOUT_ON |
| 488 | qDebug("[onMouseListCellChanged] row(%d) Disable = %s", row, disable == true?"ON":"OFF"); |
| 489 | #endif |
| 490 | |
| 491 | if (disable) { |
| 492 | // Temporarily block the signal emit |
| 493 | ui->mouseDeviceTable->blockSignals(true); |
| 494 | ui->mouseDeviceTable->item(row, col)->setCheckState(Qt::Unchecked); |
| 495 | QString message = tr("Please use the disable function with caution. Disabling the input device that is currently in use will prevent any further operations!"); |
| 496 | QMessageBox::StandardButton reply = QMessageBox::warning(this, PROGRAM_NAME, message, QMessageBox::Yes | QMessageBox::No); |
| 497 | if (reply == QMessageBox::No) { |
| 498 | ui->mouseDeviceTable->item(row, col)->setCheckState(Qt::Unchecked); |
| 499 | #ifdef DEBUG_LOGOUT_ON |
| 500 | qDebug() << "[onMouseListCellChanged]" << "User click confirm button of Disabled Warning MessageBox."; |
| 501 | #endif |
| 502 | } |
| 503 | else { |
| 504 | ui->mouseDeviceTable->item(row, col)->setCheckState(Qt::Checked); |
| 505 | #ifdef DEBUG_LOGOUT_ON |
| 506 | qDebug() << "[onMouseListCellChanged]" << "User click cancel button of Disabled Warning MessageBox."; |
| 507 | #endif |
| 508 | } |
| 509 | |
| 510 | // Restore the signal emit |
| 511 | ui->mouseDeviceTable->blockSignals(false); |
| 512 | } |
| 513 | } |
| 514 | } |
| 515 | |
| 516 | |
| 517 | void QInputDeviceListWindow::on_confirmButton_clicked() |
nothing calls this directly
no outgoing calls
no test coverage detected