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/Info.plist b/src/Info.plist.in
similarity index 89%
rename from src/Info.plist
rename to src/Info.plist.in
index 6bb818d..a373b29 100644
--- a/src/Info.plist
+++ b/src/Info.plist.in
@@ -19,11 +19,11 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
- <string>0.1.1</string>
+ <string>@VERSION@</string>
<key>LSMinimumSystemVersion</key>
<string>10.6</string>
<key>CFBundleVersion</key>
- <string>0.1.1</string>
+ <string>@VERSION@</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
@@ -33,7 +33,7 @@
<key>LSUIElement</key>
<string>1</string>
<key>SUFeedURL</key>
- <string>https://irl.cs.ucla.edu/~cawka/ndn-control-center.xml</string>
+ <string>@APPCAST@</string>
<key>SUPublicDSAKeyFile</key>
<string>ndn_sparkle_pub.pem</string>
</dict>
diff --git a/src/main.qml b/src/main.qml
index b051c6c..eaa3b3a 100644
--- a/src/main.qml
+++ b/src/main.qml
@@ -91,6 +91,19 @@
}
}
}
+ GridLayout {
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+ Label {
+ text: "NFD Control Center version:"
+ font.pixelSize: 10
+ }
+ Label {
+ text: nccVersion
+ font.pixelSize: 10
+ font.bold: true
+ }
+ }
}
}
// Tab {
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);