forked from osmocom/wireshark
Tooltips for menu items that open browser windows
This commit is contained in:
parent
1d84a092cf
commit
dd2fd30ba3
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue