#ifdef HHC_DIR
#include <windows.h>
#include <htmlhelp.h>
-#include "epan/strutil.h"
+#include "epan/unicode-utils.h"
#endif
#define NOTEBOOK_KEY "notebook_key"
-static void help_destroy_cb(GtkWidget *w, gpointer data);
-
/*
* Keep a static pointer to the current "Help" window, if any, so that
* if somebody tries to do "Help->Help" while there's already a
static GSList *help_text_pages = NULL;
+
+gboolean topic_available(topic_action_e action) {
+
+#if (GLIB_MAJOR_VERSION >= 2)
+ if(action == HELP_CAPTURE_INTERFACES_DETAILS_DIALOG) {
+ /* XXX - add the page HELP_CAPTURE_INTERFACES_DETAILS_DIALOG and remove this if */
+ /* page currently not existing in user's guide */
+ return FALSE;
+ }
+ /* online: we have almost all possible pages available */
+ return TRUE;
+#else
+ /* offline: we have only some pages available */
+ switch(action) {
+ case(HELP_CONTENT):
+ return TRUE;
+ break;
+ case(HELP_GETTING_STARTED):
+ return TRUE;
+ break;
+ case(HELP_CAPTURE_OPTIONS_DIALOG):
+ return TRUE;
+ break;
+ case(HELP_CAPTURE_FILTERS_DIALOG):
+ return TRUE;
+ break;
+ case(HELP_DISPLAY_FILTERS_DIALOG):
+ return TRUE;
+ break;
+ default:
+ return FALSE;
+ }
+#endif
+}
+
+
+#if (GLIB_MAJOR_VERSION >= 2)
+/*
+ * Open the help dialog and show a specific HTML help page.
+ */
+void help_topic_html(const gchar *topic) {
+ GString *url;
+
+
+ /* try to open local .chm file */
+#ifdef HHC_DIR
+ HWND hw;
+
+ url = g_string_new("");
+
+ g_string_append_printf(url, "%s\\user-guide.chm::/wsug_chm/%s>Wireshark Help",
+ get_datafile_dir(), topic);
+
+ hw = HtmlHelpW(NULL,
+ utf_8to16(url->str),
+ HH_DISPLAY_TOPIC, 0);
+
+ g_string_free(url, TRUE /* free_segment */);
+
+ /* if the .chm file could be opened, stop here */
+ if(hw != NULL) {
+ return;
+ }
+#endif /* HHC_DIR */
+
+ url = g_string_new("");
+
+ /* try to open the HTML page from wireshark.org instead */
+ g_string_append_printf(url, "http://www.wireshark.org/docs/wsug_html_chunked/%s", topic);
+
+ browser_open_url(url->str);
+
+ g_string_free(url, TRUE /* free_segment */);
+}
+#endif
+
+
+#if (GLIB_MAJOR_VERSION < 2)
/*
* Helper function to show a simple help text page.
*/
}
+/*
+ * Help dialog is closed now.
+ */
+static void help_destroy_cb(GtkWidget *w _U_, gpointer data _U_)
+{
+ GSList *help_page_ent;
+ help_page_t *page;
+
+ /* Free up the list of help pages. */
+ for (help_page_ent = help_text_pages; help_page_ent != NULL;
+ help_page_ent = g_slist_next(help_page_ent)) {
+ page = (help_page_t *)help_page_ent->data;
+ g_free(page->topic);
+ g_free(page->pathname);
+ g_free(page);
+ }
+ g_slist_free(help_text_pages);
+ help_text_pages = NULL;
+
+ /* Note that we no longer have a Help window. */
+ help_w = NULL;
+}
+
+
/*
* Create and show help dialog.
*/
} /* help_dialog */
-gboolean topic_available(topic_action_e action) {
-
-#ifdef WIRESHARK_EUG_DIR
- if(action == HELP_CAPTURE_INTERFACES_DETAILS_DIALOG) {
- /* page currently not existing in user's guide */
- return FALSE;
- }
- /* online: we have almost all possible pages available */
- return TRUE;
-#else
- /* offline: we have only some pages available */
- switch(action) {
- case(HELP_CONTENT):
- return TRUE;
- break;
- case(HELP_GETTING_STARTED):
- return TRUE;
- break;
- case(HELP_CAPTURE_OPTIONS_DIALOG):
- return TRUE;
- break;
- case(HELP_CAPTURE_FILTERS_DIALOG):
- return TRUE;
- break;
- case(HELP_DISPLAY_FILTERS_DIALOG):
- return TRUE;
- break;
- default:
- return FALSE;
- }
-#endif
-}
-
/*
- * Open the help dialog and show a specific help page.
+ * Open the help dialog and show a specific GTK help page.
*/
-static void help_topic(const gchar *topic) {
-
-#ifdef HHC_DIR
- HWND hw;
- GString *url = g_string_new("");
-
- g_string_append_printf(url, "%s\\user-guide.chm::/%s>Wireshark Help",
- get_datafile_dir(), topic);
-
- hw = HtmlHelpW(NULL,
- utf_8to16(url->str),
- HH_DISPLAY_TOPIC, 0);
-
- if(hw == NULL) {
- simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not open help file: %s\\user-guide.chm",
- get_datafile_dir());
- }
-
- g_string_free(url, TRUE /* free_segment */);
-
- return;
-#else
+static void help_topic_gtk(const gchar *topic) {
gchar *page_topic;
GtkWidget *help_nb;
GSList *help_page_ent;
}
page_num++;
}
-#endif
/* topic page not found, default (first page) will be shown */
}
-
-
-/*
- * Help dialog is closed now.
- */
-static void help_destroy_cb(GtkWidget *w _U_, gpointer data _U_)
-{
- GSList *help_page_ent;
- help_page_t *page;
-
- /* Free up the list of help pages. */
- for (help_page_ent = help_text_pages; help_page_ent != NULL;
- help_page_ent = g_slist_next(help_page_ent)) {
- page = (help_page_t *)help_page_ent->data;
- g_free(page->topic);
- g_free(page->pathname);
- g_free(page);
- }
- g_slist_free(help_text_pages);
- help_text_pages = NULL;
-
- /* Note that we no longer have a Help window. */
- help_w = NULL;
-}
+#endif /* GLIB_MAJOR_VERSION < 2 */
/**
}
-#ifdef HHC_DIR
-#define ONLINE_HELP_CALL help_topic
-#define ONLINE_HELP_PREFIX "wsug_chm/"
-#else
-#define ONLINE_HELP_CALL browser_open_data_file
-#define ONLINE_HELP_PREFIX "wsug_html_chunked/"
-#endif
-
static void
topic_action(topic_action_e action)
{
case(LOCALPAGE_MAN_TSHARK):
browser_open_data_file("tshark.html");
break;
+ case(LOCALPAGE_MAN_RAWSHARK):
+ browser_open_data_file("rawshark.html");
+ break;
case(LOCALPAGE_MAN_DUMPCAP):
browser_open_data_file("dumpcap.html");
break;
browser_open_data_file("text2pcap.html");
break;
-#ifdef WIRESHARK_EUG_DIR
+#if (GLIB_MAJOR_VERSION >= 2)
/* local help pages (User's Guide) */
case(HELP_CONTENT):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "index.html");
+ help_topic_html( "index.html");
break;
case(HELP_CAPTURE_OPTIONS_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChCapCaptureOptions.html");
+ help_topic_html("ChCapCaptureOptions.html");
break;
case(HELP_CAPTURE_FILTERS_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChWorkDefineFilterSection.html");
+ help_topic_html("ChWorkDefineFilterSection.html");
break;
case(HELP_DISPLAY_FILTERS_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChWorkDefineFilterSection.html");
+ help_topic_html("ChWorkDefineFilterSection.html");
break;
case(HELP_COLORING_RULES_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChCustColorizationSection.html");
+ help_topic_html("ChCustColorizationSection.html");
+ break;
+ case(HELP_CONFIG_PROFILES_DIALOG):
+ help_topic_html("ChCustConfigProfilesSection.html");
break;
case(HELP_PRINT_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChIOPrintSection.html");
+ help_topic_html("ChIOPrintSection.html");
break;
case(HELP_FIND_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChWorkFindPacketSection.html");
+ help_topic_html("ChWorkFindPacketSection.html");
break;
case(HELP_GOTO_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChWorkGoToPacketSection.html");
+ help_topic_html("ChWorkGoToPacketSection.html");
break;
case(HELP_CAPTURE_INTERFACES_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChCapInterfaceSection.html");
+ help_topic_html("ChCapInterfaceSection.html");
break;
case(HELP_CAPTURE_INFO_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChCapRunningSection.html");
+ help_topic_html("ChCapRunningSection.html");
break;
case(HELP_ENABLED_PROTOCOLS_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChCustProtocolDissectionSection.html");
+ help_topic_html("ChCustProtocolDissectionSection.html");
break;
case(HELP_DECODE_AS_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChCustProtocolDissectionSection.html");
+ help_topic_html("ChCustProtocolDissectionSection.html");
break;
case(HELP_DECODE_AS_SHOW_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChCustProtocolDissectionSection.html");
+ help_topic_html("ChCustProtocolDissectionSection.html");
break;
case(HELP_FOLLOW_TCP_STREAM_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChAdvFollowTCPSection.html");
+ help_topic_html("ChAdvFollowTCPSection.html");
+ break;
+ case(HELP_EXPERT_INFO_DIALOG):
+ help_topic_html("ChAdvExpert.html");
break;
case(HELP_STATS_SUMMARY_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChStatSummary.html");
+ help_topic_html("ChStatSummary.html");
break;
case(HELP_STATS_PROTO_HIERARCHY_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChStatHierarchy.html");
+ help_topic_html("ChStatHierarchy.html");
break;
case(HELP_STATS_ENDPOINTS_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChStatEndpoints.html");
+ help_topic_html("ChStatEndpoints.html");
break;
case(HELP_STATS_CONVERSATIONS_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChStatConversations.html");
+ help_topic_html("ChStatConversations.html");
break;
case(HELP_STATS_IO_GRAPH_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChStatIOGraphs.html");
+ help_topic_html("ChStatIOGraphs.html");
+ break;
+ case(HELP_STATS_WLAN_TRAFFIC_DIALOG):
+ help_topic_html("ChStatWLANTraffic.html");
break;
case(HELP_FILESET_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChIOFileSetSection.html");
+ help_topic_html("ChIOFileSetSection.html");
break;
case(HELP_CAPTURE_INTERFACES_DETAILS_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChCapInterfaceDetailsSection.html");
+ help_topic_html("ChCapInterfaceDetailsSection.html");
break;
case(HELP_PREFERENCES_DIALOG):
- ONLINE_HELP_CALL(ONLINE_HELP_PREFIX "ChCustPreferencesSection.html");
+ help_topic_html("ChCustPreferencesSection.html");
+ break;
+ case(HELP_EXPORT_FILE_DIALOG):
+ case(HELP_EXPORT_FILE_WIN32_DIALOG):
+ help_topic_html("ChIOExportSection.html");
+ break;
+ case(HELP_EXPORT_BYTES_DIALOG):
+ case(HELP_EXPORT_BYTES_WIN32_DIALOG):
+ help_topic_html("ChIOExportSection.html#ChIOExportSelectedDialog");
+ break;
+ case(HELP_EXPORT_OBJECT_LIST):
+ help_topic_html("ChIOExportSection.html#ChIOExportObjectsDialog");
+ break;
+ case(HELP_OPEN_DIALOG):
+ case(HELP_OPEN_WIN32_DIALOG):
+ help_topic_html("ChIOOpenSection.html");
+ break;
+ case(HELP_MERGE_DIALOG):
+ case(HELP_MERGE_WIN32_DIALOG):
+ help_topic_html("ChIOMergeSection.html");
+ break;
+ case(HELP_SAVE_DIALOG):
+ case(HELP_SAVE_WIN32_DIALOG):
+ help_topic_html("ChIOSaveSection.html");
break;
#else
/* only some help pages are available for offline reading */
case(HELP_CONTENT):
- help_topic("Overview");
+ help_topic_gtk("Overview");
break;
case(HELP_GETTING_STARTED):
- help_topic("Getting Started");
+ help_topic_gtk("Getting Started");
break;
case(HELP_CAPTURE_OPTIONS_DIALOG):
- help_topic("Capturing");
+ help_topic_gtk("Capturing");
break;
case(HELP_CAPTURE_FILTERS_DIALOG):
- help_topic("Capture Filters");
+ help_topic_gtk("Capture Filters");
break;
case(HELP_DISPLAY_FILTERS_DIALOG):
- help_topic("Display Filters");
+ help_topic_gtk("Display Filters");
break;
-#endif
+#endif /* GLIB_MAJOR_VERSION */
default:
g_assert_not_reached();
}
-void
+void
topic_cb(GtkWidget *w _U_, topic_action_e action)
{
topic_action(action);
}
-void
+void
topic_menu_cb(GtkWidget *w _U_, gpointer data _U_, topic_action_e action) {
topic_action(action);
}