summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2022-05-13 18:58:48 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2022-05-26 18:41:53 +0200
commitae67eeb9f42b882f41f359322863f608e05a568a (patch)
tree18d54376b9c93492d4cf60e5e25cf322dce4af01
parent267e5b1769ffd4bcc1b520d57bfe32b5029bab00 (diff)
Only enable cast button when connection is active (and disable if connection is lost)
-rw-r--r--src/mainwindow.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index 1e988bf..a443476 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -76,6 +76,17 @@ MainWindow::MainWindow(Database& db)
const auto& html = viewer->getHtml();
client.writeData(title, html.toUtf8());
});
+ act->setEnabled(false);
+ QObject::connect(&client, &Client::isConnected,
+ [act]()
+ {
+ act->setEnabled(true);
+ });
+ QObject::connect(&client, &Client::isDisconnected,
+ [act]()
+ {
+ act->setEnabled(false);
+ });
}
addToolBar(Qt::TopToolBarArea, toolbar);