Add version generation and display
The control center version includes versions of the bundled ndn-cxx,
NFD, and ndn-tools. The implementation is a bit hacky and most of the
the logic should be moved to the build script eventually.
Change-Id: Ie5f33c62f5e35a6a727c038ca0a3e03385dbd7db
diff --git a/src/tray-menu.cpp b/src/tray-menu.cpp
index 9bcdaa4..a2f1c24 100644
--- a/src/tray-menu.cpp
+++ b/src/tray-menu.cpp
@@ -33,11 +33,18 @@
#include <Security/Authorization.h>
#include <Security/AuthorizationTags.h>
+
+#include "build/NFD/build/core/version.hpp"
+#include "build/ndn-tools/build/core/version.cpp"
+
#else
#define CONNECT_ICON ":/res/icon-connected-white.png"
#define DISCONNECT_ICON ":/res/icon-disconnected-white.png"
+
#endif // OSX_BUILD
+#include <ndn-cxx/version.hpp>
+
namespace ndn {
namespace ncc {
@@ -74,6 +81,13 @@
connect(this, SIGNAL(nfdActivityUpdate(bool)), this, SLOT(updateNfdActivityIcon(bool)),
Qt::QueuedConnection);
+ QString nccVersion = QString(NCC_VERSION) + " (ndn-cxx: " + NDN_CXX_VERSION_BUILD_STRING +
+ ", NFD: " + NFD_VERSION_BUILD_STRING +
+ ", ndn-tools: " + ::ndn::tools::VERSION +
+ ")";
+
+ m_context->setContextProperty("nccVersion", nccVersion);
+
m_menu->addAction(m_entryPref);
m_menu->addAction(m_entrySec);