summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-02-10 13:48:48 -0800
committerGerald Combs <gerald@wireshark.org>2015-02-19 22:09:34 +0000
commit999bbc9b700543d92d6db7301b4893ebbcd883cc (patch)
tree0559a5fde2c19ff99473e83bd2b03aa53972fbac
parentc200f1e90bf75d5f15046d97657dafd4127ad278 (diff)
downloadwireshark-999bbc9b700543d92d6db7301b4893ebbcd883cc.tar.gz
Qt: Add more version and packaging information to the main window.
Add a "flavor" (for lack of a better word) banner, which can be set at build time via WIRESHARK_VERSION_FLAVOR / VERSION_FLAVOR. Set it to "Development Build" by default. This effectively migrates the "DEVELOPMENT VERSION" logo image text from the GTK+ UI. Add full release and automatic update information at the bottom. Remove the short version from the welcome banner (top left). To do: - Add back support for gui_version_placement. - Move the version and repository branch to the flavor label? - Add update links as appropriate to the bottom. - Clean up layout and spacing. Change-Id: I28af33e6c2beb855f803a2dfedef49f3e8389057 Reviewed-on: https://code.wireshark.org/review/7071 Reviewed-by: Gerald Combs <gerald@wireshark.org>
-rw-r--r--CMakeLists.txt7
-rw-r--r--Makefile.nmake1
-rw-r--r--cmakeconfig.h.in2
-rw-r--r--config.h.win322
-rw-r--r--config.nmake7
-rw-r--r--configure.ac2
-rw-r--r--ui/qt/main_welcome.cpp49
-rw-r--r--ui/qt/main_welcome.ui49
8 files changed, 108 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cf5c017f10..2f0eaa790d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -98,6 +98,13 @@ set(PROJECT_PATCH_VERSION 3)
set(PROJECT_VERSION_EXTENSION "$ENV{WIRESHARK_VERSION_EXTRA}")
set(PROJECT_VERSION ${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION}${PROJECT_VERSION_EXTENSION})
+# Banner shown at top right of Qt welcome screen.
+if(DEFINED ENV{WIRESHARK_VERSION_FLAVOR})
+ set(VERSION_FLAVOR "$ENV{WIRESHARK_VERSION_FLAVOR}")
+else()
+ set(VERSION_FLAVOR "Development Build")
+endif()
+
# These are required in .rc files and manifests
set(VERSION_MAJOR ${PROJECT_MAJOR_VERSION})
set(VERSION_MINOR ${PROJECT_MINOR_VERSION})
diff --git a/Makefile.nmake b/Makefile.nmake
index 7aeccde513..73147a0d39 100644
--- a/Makefile.nmake
+++ b/Makefile.nmake
@@ -439,6 +439,7 @@ config.h : config.h.win32 config.nmake
-e s/@VERSION_MAJOR@/$(VERSION_MAJOR)/ \
-e s/@VERSION_MINOR@/$(VERSION_MINOR)/ \
-e s/@VERSION_MICRO@/$(VERSION_MICRO)/ \
+ -e "s/@VERSION_FLAVOR@/$(VERSION_FLAVOR)/" \
-e "s/@HAVE_C_ARES@/$(C_ARES_CONFIG)/" \
-e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" \
-e "s/@HAVE_KFW@/$(KFW_CONFIG)/" \
diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in
index 01cb1bf4f9..2887c27c80 100644
--- a/cmakeconfig.h.in
+++ b/cmakeconfig.h.in
@@ -13,6 +13,8 @@
#define VERSION_MINOR ${PROJECT_MINOR_VERSION}
#define VERSION_MICRO ${PROJECT_PATCH_VERSION}
+#define VERSION_FLAVOR "${VERSION_FLAVOR}"
+
/* FIXME: Move the path stuff to the CMakeInstallDirs.cmake file */
/* Directory for data */
#define DATAFILE_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}"
diff --git a/config.h.win32 b/config.h.win32
index ec5021b426..88085d5701 100644
--- a/config.h.win32
+++ b/config.h.win32
@@ -249,6 +249,8 @@
#define VERSION_MINOR @VERSION_MINOR@
#define VERSION_MICRO @VERSION_MICRO@
+#define VERSION_FLAVOR "@VERSION_FLAVOR@"
+
/* We shouldn't need this under Windows but we'll define it anyway. */
#define HTML_VIEWER "mozilla"
diff --git a/config.nmake b/config.nmake
index 40a4a2ee4e..c2c72eb707 100644
--- a/config.nmake
+++ b/config.nmake
@@ -44,6 +44,13 @@ VERSION_BUILD=$(VCS_REVISION)
VERSION_EXTRA=$(WIRESHARK_VERSION_EXTRA)
+# Banner shown at top right of Qt welcome screen.
+!IFDEF WIRESHARK_VERSION_FLAVOR
+VERSION_FLAVOR=$(WIRESHARK_VERSION_FLAVOR)
+!ELSE
+VERSION_FLAVOR="Development Build"
+!ENDIF
+
# The version of the wiretap library. Recommended: Leave unchanged.
WTAP_VERSION_MAJOR=$(VERSION_MAJOR)
WTAP_VERSION_MINOR=$(VERSION_MINOR)
diff --git a/configure.ac b/configure.ac
index 72b48ab08b..82fe48d51f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,6 +52,8 @@ AC_DEFINE(VERSION_MAJOR, version_major, [Wireshark's major version])
AC_DEFINE(VERSION_MINOR, version_minor, [Wireshark's minor version])
AC_DEFINE(VERSION_MICRO, version_micro, [Wireshark's micro version])
+AC_DEFINE(VERSION_FLAVOR, "Development Build", [Wireshark's package flavor])
+
AM_DISABLE_STATIC
#
diff --git a/ui/qt/main_welcome.cpp b/ui/qt/main_welcome.cpp
index 4694f361a7..c7a245f754 100644
--- a/ui/qt/main_welcome.cpp
+++ b/ui/qt/main_welcome.cpp
@@ -23,6 +23,8 @@
#include "config.h"
+#include "version.h"
+
#include <epan/prefs.h>
#include "wsutil/ws_version_info.h"
@@ -51,7 +53,7 @@ MainWelcome::MainWelcome(QWidget *parent) :
{
welcome_ui_->setupUi(this);
- welcome_ui_->mainWelcomeBanner->setText("Welcome to Wireshark " VERSION "");
+ welcome_ui_->mainWelcomeBanner->setText(tr("Welcome to Wireshark."));
recent_files_ = welcome_ui_->recentList;
setStyleSheet(QString(
@@ -89,10 +91,55 @@ MainWelcome::MainWelcome(QWidget *parent) :
"}"
)
.arg(tango_aluminium_4, 6, 16, QChar('0')); // Text color
+
+ // XXX Is there a better term than "flavor"? Provider? Admonition (a la DocBook)?
+ // Release_source?
+ // Typical use cases are automated builds from wireshark.org and private,
+ // not-for-redistribution packages.
+ QString flavor = VERSION_FLAVOR;
+ if (flavor.isEmpty()) {
+ welcome_ui_->flavorBanner->hide();
+ } else {
+ // If needed there are a couple of ways we can make this customizable.
+ // - Add one or more classes, e.g. "note" or "warning" similar to
+ // SyntaxLineEdit, which we can then expose vi #defines.
+ // - Just expose direct color values via #defines.
+ QString flavor_ss = QString(
+ "QLabel {"
+ " border-radius: 0.25em;"
+ " color: %1;"
+ " background-color: %2;"
+ " padding: 0.25em;"
+ "}"
+ )
+ .arg("white") // Text color
+ .arg("#2c4bc4"); // Background color. Matches capture start button.
+ // .arg(tango_butter_5, 6, 16, QChar('0')); // "Warning" background
+
+ welcome_ui_->flavorBanner->setText(flavor);
+ welcome_ui_->flavorBanner->setStyleSheet(flavor_ss);
+ }
welcome_ui_->captureLabel->setStyleSheet(title_ss);
welcome_ui_->recentLabel->setStyleSheet(title_ss);
welcome_ui_->helpLabel->setStyleSheet(title_ss);
+ // XXX Add a "check for updates" link?
+ QString full_release = tr("You are running Wireshark ");
+ full_release += get_ws_vcs_version_info();
+ full_release += ".";
+#ifdef HAVE_SOFTWARE_UPDATE
+ if (prefs.gui_update_enabled) {
+ full_release += tr(" You receive automatic updates.");
+ } else {
+ full_release += tr(" You have disabled automatic updates.");
+ }
+#else
+ // XXX Is there a way to tell if the user installed Wireshark via an
+ // external package manager? If so we could say so here. We could
+ // also add a link to the download page.
+#endif
+ welcome_ui_->fullReleaseLabel->setText(full_release);
+
#ifdef Q_OS_MAC
recent_files_->setAttribute(Qt::WA_MacShowFocusRect, false);
welcome_ui_->interfaceTree->setAttribute(Qt::WA_MacShowFocusRect, false);
diff --git a/ui/qt/main_welcome.ui b/ui/qt/main_welcome.ui
index 2547d909ec..c59c32e96c 100644
--- a/ui/qt/main_welcome.ui
+++ b/ui/qt/main_welcome.ui
@@ -37,22 +37,44 @@
<widget class="QWidget" name="childContainer" native="true">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
- <widget class="QLabel" name="mainWelcomeBanner">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
+ <widget class="QWidget" name="bannerLayout" native="true">
<property name="minimumSize">
<size>
<width>650</width>
<height>0</height>
</size>
</property>
- <property name="text">
- <string>Welcome to Wireshark.</string>
- </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_3" stretch="1,0">
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="mainWelcomeBanner">
+ <property name="text">
+ <string>Welcome to Wireshark.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="flavorBanner">
+ <property name="text">
+ <string>s</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
</item>
<item>
@@ -238,6 +260,13 @@ a:hover {
</property>
</widget>
</item>
+ <item>
+ <widget class="QLabel" name="fullReleaseLabel">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>