1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Disable status button when disconnected

This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-09-03 00:01:04 +02:00
parent 620ee196e8
commit 627f58087c

View File

@ -154,6 +154,9 @@ Widget::Widget(QWidget *parent)
camera = new Camera; camera = new Camera;
camview = new SelfCamView(camera); camview = new SelfCamView(camera);
// Disable some widgets until we're connected to the DHT
ui->statusButton->setEnabled(false);
qRegisterMetaType<Status>("Status"); qRegisterMetaType<Status>("Status");
qRegisterMetaType<vpx_image>("vpx_image"); qRegisterMetaType<vpx_image>("vpx_image");
qRegisterMetaType<uint8_t>("uint8_t"); qRegisterMetaType<uint8_t>("uint8_t");
@ -267,11 +270,13 @@ Camera* Widget::getCamera()
void Widget::onConnected() void Widget::onConnected()
{ {
ui->statusButton->setEnabled(true);
emit statusSet(Status::Online); emit statusSet(Status::Online);
} }
void Widget::onDisconnected() void Widget::onDisconnected()
{ {
ui->statusButton->setEnabled(false);
emit statusSet(Status::Offline); emit statusSet(Status::Offline);
} }