Add testbed connectivity status display
Change-Id: I13cf8a01258dab05347e78b51d25a493f45df07f
diff --git a/src/tray-menu.cpp b/src/tray-menu.cpp
index 23102a4..28d3303 100644
--- a/src/tray-menu.cpp
+++ b/src/tray-menu.cpp
@@ -30,6 +30,7 @@
#ifdef OSX_BUILD
#define CONNECT_ICON ":/res/icon-connected-black.png"
#define DISCONNECT_ICON ":/res/icon-disconnected-black.png"
+#define CONNECT_STATUS_ICON ":/res/icon-connected-status-black.png"
#include <Security/Authorization.h>
#include <Security/AuthorizationTags.h>
@@ -60,6 +61,7 @@
TrayMenu::TrayMenu(QQmlContext* context, Face& face)
: m_context(context)
, m_isNfdRunning(false)
+ , m_isConnectedToHub(false)
, m_menu(new QMenu(this))
, m_entryPref(new QAction("Preferences...", m_menu))
, m_entrySec(new QAction("Security...", m_menu))
@@ -80,6 +82,8 @@
connect(this, SIGNAL(nfdActivityUpdate(bool)), this, SLOT(updateNfdActivityIcon(bool)),
Qt::QueuedConnection);
+ connect(this, SIGNAL(connectivityUpdate(bool)), this, SLOT(updateConnectivity(bool)),
+ Qt::QueuedConnection);
QString nccVersion = QString(NCC_VERSION) + " (ndn-cxx: " + NDN_CXX_VERSION_BUILD_STRING +
", NFD: " + NFD_VERSION_BUILD_STRING +
@@ -348,7 +352,12 @@
m_isNfdRunning = isActive;
if (isActive) {
- m_tray->setIcon(QIcon(CONNECT_ICON));
+ if(m_isConnectedToHub) {
+ m_tray->setIcon(QIcon(CONNECT_STATUS_ICON));
+ }
+ else {
+ m_tray->setIcon(QIcon(CONNECT_ICON));
+ }
if (isNdnAutoConfigEnabled()) {
startNdnAutoConfig();
}
@@ -359,6 +368,12 @@
}
void
+TrayMenu::updateConnectivity(bool isConnectedToHub)
+{
+ m_isConnectedToHub = isConnectedToHub;
+}
+
+void
TrayMenu::enableCli()
{
#ifdef OSX_BUILD