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:
parent
620ee196e8
commit
627f58087c
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user