diff options
author | David Perry <boolean263@protonmail.com> | 2022-02-23 15:36:42 +0000 |
---|---|---|
committer | A Wireshark GitLab Utility <6629907-ws-gitlab-utility@users.noreply.gitlab.com> | 2022-02-23 15:36:42 +0000 |
commit | dd2fd30ba30241a9277d8db33ac9a6b09919a085 (patch) | |
tree | 9b56122dc63c339f951c6459950f01a9c578ec9a | |
parent | 1d84a092cfeb0d14a970ed2f79f77547126db706 (diff) |
Tooltips for menu items that open browser windows
-rw-r--r-- | ui/help_url.c | 4 | ||||
-rw-r--r-- | ui/qt/main_window.cpp | 20 | ||||
-rw-r--r-- | ui/qt/main_window.ui | 6 | ||||
-rw-r--r-- | ui/qt/proto_tree.cpp | 21 |
4 files changed, 46 insertions, 5 deletions
diff --git a/ui/help_url.c b/ui/help_url.c index b1bb01f8ee..a9702b2645 100644 --- a/ui/help_url.c +++ b/ui/help_url.c @@ -53,7 +53,7 @@ user_guide_url(const gchar *page) { /* Fall back to wireshark.org. */ if (url->len == 0) { - g_string_printf(url, WS_DOCS_URL "/wsug_html_chunked/%s", page); + g_string_printf(url, WS_DOCS_URL "wsug_html_chunked/%s", page); } return g_string_free(url, FALSE); } @@ -78,7 +78,7 @@ topic_action_url(topic_action_e action) url = g_strdup(WS_DOCS_URL); break; case(ONLINEPAGE_USERGUIDE): - url = g_strdup(WS_DOCS_URL "/wsug_html_chunked/"); + url = g_strdup(WS_DOCS_URL "wsug_html_chunked/"); break; case(ONLINEPAGE_FAQ): url = g_strdup(WS_FAQ_URL); diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp index 0c6c562629..ae06bb73b1 100644 --- a/ui/qt/main_window.cpp +++ b/ui/qt/main_window.cpp @@ -709,6 +709,26 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv); /* Register Interface Toolbar callbacks */ iface_toolbar_register_cb(mainwindow_add_toolbar, mainwindow_remove_toolbar); + /* Show tooltips on menu items that go to websites */ + main_ui_->actionHelpMPWireshark->setToolTip(gchar_free_to_qstring(topic_action_url(LOCALPAGE_MAN_WIRESHARK))); + main_ui_->actionHelpMPWireshark_Filter->setToolTip(gchar_free_to_qstring(topic_action_url(LOCALPAGE_MAN_WIRESHARK_FILTER))); + main_ui_->actionHelpMPCapinfos->setToolTip(gchar_free_to_qstring(topic_action_url(LOCALPAGE_MAN_CAPINFOS))); + main_ui_->actionHelpMPDumpcap->setToolTip(gchar_free_to_qstring(topic_action_url(LOCALPAGE_MAN_DUMPCAP))); + main_ui_->actionHelpMPEditcap->setToolTip(gchar_free_to_qstring(topic_action_url(LOCALPAGE_MAN_EDITCAP))); + main_ui_->actionHelpMPMergecap->setToolTip(gchar_free_to_qstring(topic_action_url(LOCALPAGE_MAN_MERGECAP))); + main_ui_->actionHelpMPRawshark->setToolTip(gchar_free_to_qstring(topic_action_url(LOCALPAGE_MAN_RAWSHARK))); + main_ui_->actionHelpMPReordercap->setToolTip(gchar_free_to_qstring(topic_action_url(LOCALPAGE_MAN_REORDERCAP))); + main_ui_->actionHelpMPText2pcap->setToolTip(gchar_free_to_qstring(topic_action_url(LOCALPAGE_MAN_TEXT2PCAP))); + main_ui_->actionHelpMPTShark->setToolTip(gchar_free_to_qstring(topic_action_url(LOCALPAGE_MAN_TSHARK))); + + main_ui_->actionHelpContents->setToolTip(gchar_free_to_qstring(topic_action_url(ONLINEPAGE_USERGUIDE))); + main_ui_->actionHelpWebsite->setToolTip(gchar_free_to_qstring(topic_action_url(ONLINEPAGE_HOME))); + main_ui_->actionHelpFAQ->setToolTip(gchar_free_to_qstring(topic_action_url(ONLINEPAGE_FAQ))); + main_ui_->actionHelpAsk->setToolTip(gchar_free_to_qstring(topic_action_url(ONLINEPAGE_ASK))); + main_ui_->actionHelpDownloads->setToolTip(gchar_free_to_qstring(topic_action_url(ONLINEPAGE_DOWNLOAD))); + main_ui_->actionHelpWiki->setToolTip(gchar_free_to_qstring(topic_action_url(ONLINEPAGE_WIKI))); + main_ui_->actionHelpSampleCaptures->setToolTip(gchar_free_to_qstring(topic_action_url(ONLINEPAGE_SAMPLE_CAPTURES))); + showWelcome(); } diff --git a/ui/qt/main_window.ui b/ui/qt/main_window.ui index 2dc0124c4a..228347409a 100644 --- a/ui/qt/main_window.ui +++ b/ui/qt/main_window.ui @@ -217,10 +217,16 @@ <property name="title"> <string>&Help</string> </property> + <property name="toolTipsVisible"> + <bool>true</bool> + </property> <widget class="QMenu" name="menuHelpManualPages"> <property name="title"> <string>Manual pages</string> </property> + <property name="toolTipsVisible"> + <bool>true</bool> + </property> <addaction name="actionHelpMPWireshark"/> <addaction name="actionHelpMPWireshark_Filter"/> <addaction name="separator"/> diff --git a/ui/qt/proto_tree.cpp b/ui/qt/proto_tree.cpp index 16771cb9a0..abf14b08d9 100644 --- a/ui/qt/proto_tree.cpp +++ b/ui/qt/proto_tree.cpp @@ -218,7 +218,7 @@ void ProtoTree::ctxOpenUrlWiki() else { if (field_id != hf_text_only) { - url = QString(WS_DOCS_URL "/dfref/%1/%2") + url = QString(WS_DOCS_URL "dfref/%1/%2") .arg(proto_abbrev[0]) .arg(proto_abbrev); } else { @@ -243,11 +243,12 @@ void ProtoTree::contextMenuEvent(QContextMenuEvent *event) buildForDialog = true; QMenu ctx_menu(this); + ctx_menu.setProperty("toolTipsVisible", QVariant::fromValue(true)); QMenu *main_menu_item, *submenu; QAction *action; - bool have_subtree = false; + bool have_subtree = false; FieldInformation finfo(proto_tree_model_->protoNodeFromIndex(index).protoNode()); field_info * fi = finfo.fieldInfo(); bool is_selected = false; @@ -342,9 +343,23 @@ void ProtoTree::contextMenuEvent(QContextMenuEvent *event) ctx_menu.addSeparator(); } - ctx_menu.addAction(tr("Wiki Protocol Page"), this, SLOT(ctxOpenUrlWiki())); + int field_id = finfo.headerInfo().id; + action = ctx_menu.addAction(tr("Wiki Protocol Page"), this, SLOT(ctxOpenUrlWiki())); + action->setProperty("toolTip", QString(WS_WIKI_URL("Protocols/%1")).arg(proto_registrar_get_abbrev(field_id))); + action = ctx_menu.addAction(tr("Filter Field Reference"), this, SLOT(ctxOpenUrlWiki())); action->setProperty("field_reference", QVariant::fromValue(true)); + if (field_id != hf_text_only) { + action->setEnabled(true); + const QString proto_abbrev = proto_registrar_get_abbrev(field_id); + action->setProperty("toolTip", QString(WS_DOCS_URL "dfref/%1/%2") + .arg(proto_abbrev[0]) + .arg(proto_abbrev)); + } + else { + action->setEnabled(false); + action->setProperty("toolTip", tr("No field reference available for text labels.")); + } ctx_menu.addMenu(&proto_prefs_menu_); ctx_menu.addSeparator(); |