diff options
author | Gerald Combs <gerald@wireshark.org> | 2016-10-20 14:35:20 -0700 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-10-22 06:32:50 +0000 |
commit | a63b5eb711cc50efe2725d716e0774e147376d25 (patch) | |
tree | 7886e4ed2742af6b86e24b57cc7785d2cebde02d | |
parent | 528894e72f973c5db5dc76c975620754f7bbe5aa (diff) |
Qt: Make "Learn" on the welcome screen clickable.
Make the "Learn" header a ClickableLabel to match "Open" and "Capture".
Link to the docs page for now. Adjust its stylesheet and properties to
match ast well.
Change-Id: Id9c7c05269de8134af28f0f9c1e2820a60442236
Reviewed-on: https://code.wireshark.org/review/18358
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | ui/help_url.c | 3 | ||||
-rw-r--r-- | ui/help_url.h | 1 | ||||
-rw-r--r-- | ui/qt/main_welcome.cpp | 26 | ||||
-rw-r--r-- | ui/qt/main_welcome.h | 1 | ||||
-rw-r--r-- | ui/qt/main_welcome.ui | 8 |
5 files changed, 28 insertions, 11 deletions
diff --git a/ui/help_url.c b/ui/help_url.c index 5ea67ba53f..af12f19c9e 100644 --- a/ui/help_url.c +++ b/ui/help_url.c @@ -76,6 +76,9 @@ topic_online_url(topic_action_e action) case(ONLINEPAGE_DOWNLOAD): return "https://www.wireshark.org/download.html"; break; + case(ONLINEPAGE_DOCS): + return "https://www.wireshark.org/docs/"; + break; case(ONLINEPAGE_USERGUIDE): return "https://www.wireshark.org/docs/wsug_html_chunked/"; break; diff --git a/ui/help_url.h b/ui/help_url.h index b88b560357..213ef65fb8 100644 --- a/ui/help_url.h +++ b/ui/help_url.h @@ -42,6 +42,7 @@ typedef enum { ONLINEPAGE_USERGUIDE, ONLINEPAGE_FAQ, ONLINEPAGE_DOWNLOAD, + ONLINEPAGE_DOCS, ONLINEPAGE_SAMPLE_FILES, ONLINEPAGE_CAPTURE_SETUP, ONLINEPAGE_NETWORK_MEDIA, diff --git a/ui/qt/main_welcome.cpp b/ui/qt/main_welcome.cpp index 8f2df3e290..ce1162e5f2 100644 --- a/ui/qt/main_welcome.cpp +++ b/ui/qt/main_welcome.cpp @@ -26,6 +26,7 @@ #include <epan/prefs.h> #include "ui/capture_globals.h" +#include "ui/help_url.h" #include "ws_version_info.h" @@ -37,6 +38,7 @@ #include "wireshark_application.h" #include <QClipboard> +#include <QDesktopServices> #include <QDir> #include <QListWidget> #include <QMenu> @@ -97,17 +99,16 @@ MainWelcome::MainWelcome(QWidget *parent) : .arg(tango_sky_blue_2, 6, 16, QChar('0')); // Background color welcome_ui_->mainWelcomeBanner->setStyleSheet(welcome_ss); - QString title_ss = QString( - "QLabel {" - " color: #%1;" - "}" - ) - .arg(tango_aluminium_4, 6, 16, QChar('0')); // Text color - QString title_button_ss = title_ss + QString( - "QLabel::hover {" + QString title_button_ss = QString( + "QLabel {" " color: #%1;" "}" - ).arg(tango_sky_blue_4, 6, 16, QChar('0')); + "QLabel::hover {" + " color: #%2;" + "}" + ) + .arg(tango_aluminium_4, 6, 16, QChar('0')) // Text color + .arg(tango_sky_blue_4, 6, 16, QChar('0')); // Hover color // XXX Is there a better term than "flavor"? Provider? Admonition (a la DocBook)? // Release_source? @@ -138,7 +139,7 @@ MainWelcome::MainWelcome(QWidget *parent) : } welcome_ui_->captureLabel->setStyleSheet(title_button_ss); welcome_ui_->recentLabel->setStyleSheet(title_button_ss); - welcome_ui_->helpLabel->setStyleSheet(title_ss); + welcome_ui_->helpLabel->setStyleSheet(title_button_ss); #ifdef Q_OS_MAC recent_files_->setAttribute(Qt::WA_MacShowFocusRect, false); @@ -503,6 +504,11 @@ void MainWelcome::on_captureLabel_clicked() wsApp->doTriggerMenuItem(WiresharkApplication::CaptureOptionsDialog); } +void MainWelcome::on_helpLabel_clicked() +{ + QDesktopServices::openUrl(QUrl(topic_online_url(ONLINEPAGE_DOCS))); +} + void MainWelcome::on_recentLabel_clicked() { wsApp->doTriggerMenuItem(WiresharkApplication::FileOpenDialog); diff --git a/ui/qt/main_welcome.h b/ui/qt/main_welcome.h index 81d087f4a8..a001f5b5c1 100644 --- a/ui/qt/main_welcome.h +++ b/ui/qt/main_welcome.h @@ -55,6 +55,7 @@ protected: protected slots: void on_recentLabel_clicked(); void on_captureLabel_clicked(); + void on_helpLabel_clicked(); private: Ui::MainWelcome *welcome_ui_; diff --git a/ui/qt/main_welcome.ui b/ui/qt/main_welcome.ui index 4b63b084f4..b791c78a4a 100644 --- a/ui/qt/main_welcome.ui +++ b/ui/qt/main_welcome.ui @@ -236,7 +236,13 @@ </widget> </item> <item> - <widget class="QLabel" name="helpLabel"> + <widget class="ClickableLabel" name="helpLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="text"> <string><h2>Learn</h2></string> </property> |