From bbfcfd00d9dc66d8f868a1442de11c160472feb1 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Thu, 28 Jun 2018 16:38:28 +0300 Subject: [PATCH] Now when you click on the "Connect" button, the button stops being available, and the text on it changes to "Waiting..." until any message is not displayed. --- src/mainwindow.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 49df6fa..4d5d7db 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -18,6 +18,8 @@ MainWindow::~MainWindow() void MainWindow::on_connectToPeer_clicked() { + ui->connectToPeer->setEnabled(false); + ui->connectToPeer->setText("Ожидание..."); QJsonObject j; j["peerID"] = my_ipv6; j["action"] = "createSession"; @@ -40,6 +42,8 @@ void MainWindow::slotTimerAlarm() int ret = QMessageBox::critical(this,QObject::tr("Error"),tr("Timeout Error")); timer->stop(); delete timer; + ui->connectToPeer->setEnabled(true); + ui->connectToPeer->setText("Подключиться"); } } @@ -48,4 +52,6 @@ void MainWindow::peerReceiverConnected() { receive = true; int ret = QMessageBox::information(this,QObject::tr("Info"),tr("Peer Available!")); + ui->connectToPeer->setEnabled(true); + ui->connectToPeer->setText("Подключиться"); }