From 627f58087ce014bc229defebb0f56c7f54cd2af1 Mon Sep 17 00:00:00 2001 From: "Tux3 / Mlkj / !Lev.uXFMLA" Date: Wed, 3 Sep 2014 00:01:04 +0200 Subject: [PATCH] Disable status button when disconnected --- widget/widget.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/widget/widget.cpp b/widget/widget.cpp index 8757bfe66..81cd893bf 100644 --- a/widget/widget.cpp +++ b/widget/widget.cpp @@ -154,6 +154,9 @@ Widget::Widget(QWidget *parent) camera = new Camera; camview = new SelfCamView(camera); + // Disable some widgets until we're connected to the DHT + ui->statusButton->setEnabled(false); + qRegisterMetaType("Status"); qRegisterMetaType("vpx_image"); qRegisterMetaType("uint8_t"); @@ -267,11 +270,13 @@ Camera* Widget::getCamera() void Widget::onConnected() { + ui->statusButton->setEnabled(true); emit statusSet(Status::Online); } void Widget::onDisconnected() { + ui->statusButton->setEnabled(false); emit statusSet(Status::Offline); }