xwhatsit util: main window: when a subwindow is open correctly disable all of the...
authorPurdea Andrei <andrei@purdea.ro>
Mon, 8 Jun 2020 23:44:15 +0000 (02:44 +0300)
committerPurdea Andrei <andrei@purdea.ro>
Tue, 9 Jun 2020 00:10:06 +0000 (03:10 +0300)
keyboards/xwhatsit/util/util/mainwindow.cpp

index 697e8c3..bef7f63 100644 (file)
@@ -129,9 +129,10 @@ void MainWindow::on_keypressMinotorPushButton_clicked()
     //mw->setWindowModality(Qt::WindowModal);
     thread.monitor(ui->listWidget->currentItem()->text().toStdString());
     bool previousScanning = thread.setScanning(false);
-    ui->listWidget->setEnabled(false);
+    this->setEnabled(false);
+    mw->setEnabled(true);
     mw->exec();
-    ui->listWidget->setEnabled(true);
+    this->setEnabled(true);
     thread.setScanning(previousScanning);
 }
 
@@ -152,9 +153,10 @@ void MainWindow::on_signalLevelPushButton_clicked()
     //mw->setWindowModality(Qt::WindowModal);
     thread.signalLevel(ui->listWidget->currentItem()->text().toStdString());
     bool previousScanning = thread.setScanning(false);
-    ui->listWidget->setEnabled(false);
+    this->setEnabled(false);
+    mw->setEnabled(true);
     mw->exec();
-    ui->listWidget->setEnabled(true);
+    this->setEnabled(true);
     thread.setScanning(previousScanning);
 }
 
@@ -163,10 +165,11 @@ void MainWindow::on_columnTesterButton_clicked()
     ColumnTester *ctw = new ColumnTester(thread, ui->listWidget->currentItem()->text().toStdString(), this);
     ctw->setAttribute(Qt::WA_DeleteOnClose);
     bool previousScanning = thread.setScanning(false);
-    ui->listWidget->setEnabled(false);
     thread.shiftData(ui->listWidget->currentItem()->text().toStdString(), 0);
+    this->setEnabled(false);
+    ctw->setEnabled(true);
     ctw->exec();
-    ui->listWidget->setEnabled(true);
     thread.shiftData(ui->listWidget->currentItem()->text().toStdString(), 0);
+    this->setEnabled(true);
     thread.setScanning(previousScanning);
 }