carve out the (currently disabled) welcome page into it's own file to slightly reduce...
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 4 Apr 2008 23:14:27 +0000 (23:14 +0000)
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 4 Apr 2008 23:14:27 +0000 (23:14 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24773 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/Makefile.am
gtk/Makefile.common
gtk/main.c
gtk/main_welcome.c [new file with mode: 0644]
gtk/main_welcome.h [new file with mode: 0644]

index f5aac05e8726ab582709b03361af0f81bbee534e..530311d8c581726a53039adef34663ff0ac2a3ac 100644 (file)
@@ -88,6 +88,7 @@ noinst_HEADERS = \
        layout_prefs.h  \
        macros_dlg.h    \
        main.h          \
+       main_welcome.h          \
        menu.h          \
        mtp3_stat.h     \
        nameres_prefs.h \
index 024aa8f739d78fb3e7a28c98f939ece88494fe86..5f8b79b3752e1b677ad5ab047c1794f2f38c6bd2 100644 (file)
@@ -86,6 +86,7 @@ WIRESHARK_GTK_SRC = \
        layout_prefs.c  \
        macros_dlg.c    \
        main.c          \
+       main_welcome.c          \
        menu.c          \
        nameres_prefs.c \
        packet_history.c        \
index c0879c8b2f008698b65161cc5c2508cf67862e69..c0d9acf6d3846ebb48532a2eced4c203ddab1c37 100644 (file)
 #include "color_dlg.h"
 
 #include "main.h"
+#include "main_welcome.h"
 #include "menu.h"
 #include "../main_window.h"
 #include "../menu.h"
 #include "../image/wsiconcap48.xpm"
 #endif
 #endif
-#ifdef SHOW_WELCOME_PAGE
-#include "../image/wssplash.xpm"
-#endif
 
 #ifdef HAVE_AIRPCAP
 #include <airpcap.h>
@@ -3622,529 +3620,6 @@ is_widget_visible(GtkWidget *widget, gpointer data)
     }
 }
 
-/*#define SHOW_WELCOME_PAGE*/
-#ifdef SHOW_WELCOME_PAGE
-/* XXX - There seems to be some disagreement about if and how this feature should be implemented.
-   As I currently don't have the time to continue this, it's temporarily disabled. - ULFL */
-GtkWidget *
-welcome_item(const gchar *stock_item, const gchar * label, const gchar * message, const gchar * tooltip,
-                        GtkSignalFunc callback, void *callback_data)
-{
-    GtkWidget *w, *item_hb;
-#if GTK_MAJOR_VERSION >= 2
-    gchar *formatted_message;
-    GtkTooltips *tooltips;
-
-    tooltips = gtk_tooltips_new();
-#endif
-
-    item_hb = gtk_hbox_new(FALSE, 1);
-
-    w = BUTTON_NEW_FROM_STOCK(stock_item);
-    WIDGET_SET_SIZE(w, 80, 40);
-#if GTK_MAJOR_VERSION >= 2
-    gtk_button_set_label(GTK_BUTTON(w), label);
-    gtk_tooltips_set_tip(tooltips, w, tooltip, NULL);
-#endif
-    gtk_box_pack_start(GTK_BOX(item_hb), w, FALSE, FALSE, 0);
-    SIGNAL_CONNECT(w, "clicked", callback, callback_data);
-
-    w = gtk_label_new(message);
-    gtk_misc_set_alignment (GTK_MISC(w), 0.0, 0.5);
-#if GTK_MAJOR_VERSION >= 2
-    formatted_message = g_strdup_printf("<span weight=\"bold\" size=\"x-large\">%s</span>", message);
-    gtk_label_set_markup(GTK_LABEL(w), formatted_message);
-    g_free(formatted_message);
-#endif
-
-    gtk_box_pack_start(GTK_BOX(item_hb), w, FALSE, FALSE, 10);
-
-    return item_hb;
-}
-
-
-GtkWidget *
-welcome_header_new(void)
-{
-    GtkWidget *item_vb;
-    GtkWidget *item_hb;
-    GtkWidget *eb;
-    GdkColor bg;
-    GtkWidget *icon;
-    gchar *message;
-    GtkWidget *w;
-
-
-    /* background color of the header bar */
-    bg.pixel = 0;
-    bg.red = 154 * 255;
-    bg.green = 210 * 255;
-    bg.blue = 229 * 255;
-
-    item_vb = gtk_vbox_new(FALSE, 0);
-
-    /* colorize vbox */
-    get_color(&bg);
-    eb = gtk_event_box_new();
-    gtk_container_add(GTK_CONTAINER(eb), item_vb);
-#if GTK_MAJOR_VERSION >= 2
-    gtk_widget_modify_bg(eb, GTK_STATE_NORMAL, &bg);
-#endif
-
-    item_hb = gtk_hbox_new(FALSE, 0);
-    gtk_box_pack_start(GTK_BOX(item_vb), item_hb, FALSE, FALSE, 10);
-
-    icon = xpm_to_widget_from_parent(top_level, wssplash_xpm);
-    /*icon = xpm_to_widget_from_parent(top_level, wsicon64_xpm);*/
-    gtk_box_pack_start(GTK_BOX(item_hb), icon, FALSE, FALSE, 10);
-
-#if GTK_MAJOR_VERSION < 2
-    message = "The World's Most Popular Network Protocol Analyzer";
-#else
-    message = "<span weight=\"bold\" size=\"x-large\">" "The World's Most Popular Network Protocol Analyzer" "</span>";
-#endif
-    w = gtk_label_new(message);
-#if GTK_MAJOR_VERSION >= 2
-    gtk_label_set_markup(GTK_LABEL(w), message);
-#endif
-    gtk_misc_set_alignment (GTK_MISC(w), 0.0, 0.5);
-    gtk_box_pack_start(GTK_BOX(item_hb), w, TRUE, TRUE, 5);
-
-    gtk_widget_show_all(eb);
-
-    return eb;
-}
-
-GtkWidget *
-welcome_topic_header_new(const char *header)
-{
-    GtkWidget *w;
-    GdkColor bg;
-    GtkWidget *eb;
-#if GTK_MAJOR_VERSION >= 2
-    gchar *formatted_message;
-#endif
-
-
-    w = gtk_label_new(header);
-#if GTK_MAJOR_VERSION >= 2
-    formatted_message = g_strdup_printf("<span weight=\"bold\" size=\"x-large\">%s</span>", header);
-    gtk_label_set_markup(GTK_LABEL(w), formatted_message);
-    g_free(formatted_message);
-#endif
-
-    /* topic header background color */
-    bg.pixel = 0;
-    bg.red = 24 * 255;
-    bg.green = 151 * 255;
-    bg.blue = 192 * 255;
-
-    /* colorize vbox */
-    get_color(&bg);
-    eb = gtk_event_box_new();
-    gtk_container_add(GTK_CONTAINER(eb), w);
-#if GTK_MAJOR_VERSION >= 2
-    gtk_widget_modify_bg(eb, GTK_STATE_NORMAL, &bg);
-#endif
-
-    return eb;
-}
-
-
-GtkWidget *
-welcome_topic_new(const char *header, GtkWidget **to_fill)
-{
-    GtkWidget *topic_vb;
-    GtkWidget *layout_vb;
-    GtkWidget *topic_eb;
-    GtkWidget *topic_header;
-    GdkColor bg;
-
-    topic_vb = gtk_vbox_new(FALSE, 0);
-
-       /* topic content background color */
-    bg.pixel = 0;
-    bg.red = 221 * 255;
-    bg.green = 226 * 255;
-    bg.blue = 228 * 255;
-
-    topic_header = welcome_topic_header_new(header);
-    gtk_box_pack_start(GTK_BOX(topic_vb), topic_header, FALSE, FALSE, 0);
-
-    layout_vb = gtk_vbox_new(FALSE, 5);
-    gtk_container_border_width(GTK_CONTAINER(layout_vb), 10);
-    gtk_box_pack_start(GTK_BOX(topic_vb), layout_vb, FALSE, FALSE, 0);
-
-    /* colorize vbox (we need an event box for this!) */
-    get_color(&bg);
-    topic_eb = gtk_event_box_new();
-    gtk_container_add(GTK_CONTAINER(topic_eb), topic_vb);
-#if GTK_MAJOR_VERSION >= 2
-    gtk_widget_modify_bg(topic_eb, GTK_STATE_NORMAL, &bg);
-#endif
-    *to_fill = layout_vb;
-
-    return topic_eb;
-}
-
-
-#if GTK_MAJOR_VERSION >= 2
-static gboolean
-welcome_link_enter_cb(GtkWidget *widget _U_, GdkEventCrossing *event _U_, gpointer user_data)
-{
-    gchar *message;
-    GtkWidget *w = user_data;
-
-    message = g_strdup_printf("<span foreground='blue' underline='single'>%s</span>", OBJECT_GET_DATA(w,"TEXT"));
-#if GTK_MAJOR_VERSION >= 2
-    gtk_label_set_markup(GTK_LABEL(w), message);
-#endif
-    g_free(message);
-
-    return FALSE;
-}
-
-static gboolean
-welcome_link_leave_cb(GtkWidget *widget _U_, GdkEvent *event _U_, gpointer user_data)
-{
-    gchar *message;
-    GtkWidget *w = user_data;
-
-    message = g_strdup_printf("<span foreground='blue'>%s</span>", OBJECT_GET_DATA(w,"TEXT"));
-#if GTK_MAJOR_VERSION >= 2
-    gtk_label_set_markup(GTK_LABEL(w), message);
-#endif
-    g_free(message);
-
-    return FALSE;
-}
-#endif
-
-
-static gboolean
-welcome_link_press_cb(GtkWidget *widget _U_, GdkEvent *event _U_, gpointer data _U_) {
-
-    g_warning("TBD: link pressed");
-
-    return FALSE;
-}
-
-GtkWidget *
-welcome_link_new(const gchar *text, GtkWidget **label /*, void *callback, void *private_data */)
-{
-    gchar *message;
-    GtkWidget *w;
-    GtkWidget *eb;
-
-#if GTK_MAJOR_VERSION < 2
-    message = g_strdup(text);
-#else
-    message = g_strdup_printf("<span foreground='blue'>%s</span>", text);
-#endif
-    w = gtk_label_new(message);
-    *label = w;
-#if GTK_MAJOR_VERSION >= 2
-    gtk_label_set_markup(GTK_LABEL(w), message);
-#endif
-    g_free(message);
-
-       /* event box */
-    eb = gtk_event_box_new();
-    gtk_container_add(GTK_CONTAINER(eb), w);
-
-#if GTK_MAJOR_VERSION >= 2
-    SIGNAL_CONNECT(eb, "enter-notify-event", welcome_link_enter_cb, w);
-    SIGNAL_CONNECT(eb, "leave-notify-event", welcome_link_leave_cb, w);
-#endif
-    SIGNAL_CONNECT(eb, "button-press-event", welcome_link_press_cb, w);
-
-    /* XXX - memleak */
-    OBJECT_SET_DATA(w, "TEXT", g_strdup(text));
-
-    return eb;
-}
-
-GtkWidget *
-welcome_filename_link_new(const char *filename, GtkWidget **label)
-{
-    GString            *str;
-    GtkWidget  *w;
-    const unsigned int max = 60;
-
-
-    str = g_string_new(filename);
-
-    if(str->len > max) {
-        g_string_erase(str, 0, str->len-max /*cut*/);
-        g_string_prepend(str, "... ");
-    }
-
-    w = welcome_link_new(str->str, label);
-
-    g_string_free(str, TRUE);
-
-    return w;
-}
-
-
-GtkWidget *
-welcome_if_new(const char *if_name, GdkColor *topic_bg, gboolean active)
-{
-    GtkWidget *interface_hb;
-    GtkWidget *w;
-    GtkWidget *label;
-    GtkTooltips *tooltips;
-    GString   *message;
-
-
-    tooltips = gtk_tooltips_new();
-
-    interface_hb = gtk_hbox_new(FALSE, 5);
-
-    w = welcome_link_new("START", &label);
-    gtk_tooltips_set_tip(tooltips, w, "Immediately start a capture on this interface", NULL);
-#if GTK_MAJOR_VERSION >= 2
-    gtk_widget_modify_bg(w, GTK_STATE_NORMAL, topic_bg);
-#endif
-    gtk_misc_set_alignment (GTK_MISC(label), 0.0, 0.0);
-    gtk_box_pack_start(GTK_BOX(interface_hb), w, FALSE, FALSE, 0);
-
-    w = welcome_link_new("OPTIONS", &label);
-    gtk_tooltips_set_tip(tooltips, w, "Show the capture options of this interface", NULL);
-#if GTK_MAJOR_VERSION >= 2
-    gtk_widget_modify_bg(w, GTK_STATE_NORMAL, topic_bg);
-#endif
-    gtk_misc_set_alignment (GTK_MISC(label), 0.0, 0.0);
-    gtk_box_pack_start(GTK_BOX(interface_hb), w, FALSE, FALSE, 0);
-
-    w = welcome_link_new("DETAILS", &label);
-    gtk_tooltips_set_tip(tooltips, w, "Show detailed information about this interface", NULL);
-#if GTK_MAJOR_VERSION >= 2
-    gtk_widget_modify_bg(w, GTK_STATE_NORMAL, topic_bg);
-#endif
-    gtk_misc_set_alignment (GTK_MISC(label), 0.0, 0.0);
-    gtk_box_pack_start(GTK_BOX(interface_hb), w, FALSE, FALSE, 0);
-
-    message = g_string_new(if_name);
-
-    /* truncate string if it's too long */
-    if(message->len > 38) {
-        g_string_truncate(message, 35);
-        g_string_append  (message, " ...");
-    }
-#if GTK_MAJOR_VERSION >= 2
-    /* if this is the "active" interface, display it bold */
-    if(active) {
-        g_string_prepend(message, "<span weight=\"bold\">");
-        g_string_append (message, "</span>");
-       }
-#endif
-    w = gtk_label_new(message->str);
-#if GTK_MAJOR_VERSION >= 2
-    gtk_label_set_markup(GTK_LABEL(w), message->str);
-#endif
-    g_string_free(message, TRUE);
-
-    gtk_misc_set_alignment (GTK_MISC(w), 0.0, 0.0);
-    gtk_box_pack_start(GTK_BOX(interface_hb), w, FALSE, FALSE, 0);
-
-    return interface_hb;
-}
-
-/* XXX - the layout has to be improved */
-GtkWidget *
-welcome_new(void)
-{
-    GtkWidget *welcome_scrollw;
-    GtkWidget *welcome_vb;
-    GtkWidget *welcome_hb;
-    GtkWidget *column_vb;
-    GtkWidget *item_hb;
-    GtkWidget *w;
-    GtkWidget *label;
-    GtkWidget *header;
-    GtkWidget *topic_vb;
-    GtkWidget *topic_to_fill;
-    GtkWidget *interface_hb;
-    GdkColor  topic_bg;
-
-
-    /* topic content background color */
-    topic_bg.pixel = 0;
-    topic_bg.red = 221 * 255;
-    topic_bg.green = 226 * 255;
-    topic_bg.blue = 228 * 255;
-
-    welcome_scrollw = scrolled_window_new(NULL, NULL);
-
-    welcome_vb = gtk_vbox_new(FALSE, 0);
-
-    /* header */
-    header = welcome_header_new();
-    gtk_box_pack_start(GTK_BOX(welcome_vb), header, FALSE, FALSE, 0);
-
-    /* content */
-    welcome_hb = gtk_hbox_new(FALSE, 10);
-    gtk_container_border_width(GTK_CONTAINER(welcome_hb), 10);
-    gtk_box_pack_start(GTK_BOX(welcome_vb), welcome_hb, TRUE, TRUE, 0);
-
-    /* column capture */
-    column_vb = gtk_vbox_new(FALSE, 10);
-    gtk_box_pack_start(GTK_BOX(welcome_hb), column_vb, TRUE, TRUE, 0);
-
-    /* capture topic */
-    topic_vb = welcome_topic_new("Capture", &topic_to_fill);
-    gtk_box_pack_start(GTK_BOX(column_vb), topic_vb, TRUE, TRUE, 0);
-
-#ifdef HAVE_LIBPCAP
-    item_hb = welcome_item(WIRESHARK_STOCK_CAPTURE_INTERFACES,
-        "Interfaces...",
-        "Interface Life List",
-               "Show a life list of the available capture interfaces",
-        GTK_SIGNAL_FUNC(capture_if_cb), NULL);
-    gtk_box_pack_start(GTK_BOX(topic_to_fill), item_hb, FALSE, FALSE, 5);
-#endif
-
-    w = gtk_label_new("Available Interfaces:");
-    gtk_misc_set_alignment (GTK_MISC(w), 0.0, 0.0);
-    gtk_box_pack_start(GTK_BOX(topic_to_fill), w, FALSE, FALSE, 5);
-
-    interface_hb = welcome_if_new("Generic dialup adapter", &topic_bg, FALSE);
-    gtk_box_pack_start(GTK_BOX(topic_to_fill), interface_hb, FALSE, FALSE, 0);
-
-    /* Marvell interface (currently "active") */
-    interface_hb = welcome_if_new("Marvell Gigabit Ethernet Controller", &topic_bg, TRUE);
-    gtk_box_pack_start(GTK_BOX(topic_to_fill), interface_hb, FALSE, FALSE, 0);
-
-    /* Wireless interface */
-    interface_hb = welcome_if_new("Intel(R) PRO/Wireless 3945ABG Network Connection", &topic_bg, FALSE);
-    gtk_box_pack_start(GTK_BOX(topic_to_fill), interface_hb, FALSE, FALSE, 0);
-
-
-    /* capture help topic */
-    topic_vb = welcome_topic_new("Capture Help", &topic_to_fill);
-    gtk_box_pack_start(GTK_BOX(column_vb), topic_vb, TRUE, TRUE, 0);
-
-#ifdef HAVE_LIBPCAP
-    item_hb = welcome_item(WIRESHARK_STOCK_CAPTURE_START,
-        "Setup",
-               "How To: Setup a Capture",
-               "How To: Setup a Capture (online from the Wiki)",
-        GTK_SIGNAL_FUNC(topic_cb), GINT_TO_POINTER(ONLINEPAGE_USERGUIDE));
-    gtk_box_pack_start(GTK_BOX(topic_to_fill), item_hb, FALSE, FALSE, 5);
-
-    item_hb = welcome_item(WIRESHARK_STOCK_CAPTURE_START,
-        "Examples",
-               "Capture Filter Examples",
-               "Capture Filter Examples (online from the Wiki)",
-        GTK_SIGNAL_FUNC(topic_cb), GINT_TO_POINTER(ONLINEPAGE_USERGUIDE));
-    gtk_box_pack_start(GTK_BOX(topic_to_fill), item_hb, FALSE, FALSE, 5);
-#endif
-
-    /* fill bottom space */
-    w = gtk_label_new("");
-    gtk_box_pack_start(GTK_BOX(topic_to_fill), w, TRUE, TRUE, 0);
-
-
-    /* column files */
-    topic_vb = welcome_topic_new("Files", &topic_to_fill);
-    gtk_box_pack_start(GTK_BOX(welcome_hb), topic_vb, TRUE, TRUE, 0);
-
-    item_hb = welcome_item(GTK_STOCK_OPEN,
-        "Open...",
-        "Open a Capture File",
-               "Open a previously captured file",
-        GTK_SIGNAL_FUNC(file_open_cmd_cb), NULL);
-    gtk_box_pack_start(GTK_BOX(topic_to_fill), item_hb, FALSE, FALSE, 5);
-
-    item_hb = welcome_item(GTK_STOCK_OPEN,
-        "Examples",
-        "Download Examples",
-               "Download Example Capture Files (from the Wiki)",
-        GTK_SIGNAL_FUNC(topic_cb), GINT_TO_POINTER(ONLINEPAGE_USERGUIDE));
-    gtk_box_pack_start(GTK_BOX(topic_to_fill), item_hb, FALSE, FALSE, 5);
-
-    w = gtk_label_new("Recent Files:");
-    gtk_misc_set_alignment (GTK_MISC(w), 0.0, 0.0);
-    gtk_box_pack_start(GTK_BOX(topic_to_fill), w, FALSE, FALSE, 5);
-
-    w = welcome_link_new("C:\\Testfiles\\hello.pcap", &label);
-#if GTK_MAJOR_VERSION >= 2
-    gtk_widget_modify_bg(w, GTK_STATE_NORMAL, &topic_bg);
-#endif
-    gtk_misc_set_alignment (GTK_MISC(label), 0.0, 0.0);
-    gtk_box_pack_start(GTK_BOX(topic_to_fill), w, FALSE, FALSE, 0);
-
-    w = welcome_filename_link_new("C:\\Testfiles\\hello2.pcap", &label);
-#if GTK_MAJOR_VERSION >= 2
-    gtk_widget_modify_bg(w, GTK_STATE_NORMAL, &topic_bg);
-#endif
-    gtk_misc_set_alignment (GTK_MISC(label), 0.0, 0.0);
-    gtk_box_pack_start(GTK_BOX(topic_to_fill), w, FALSE, FALSE, 0);
-
-    w = welcome_filename_link_new(
-               "C:\\Testfiles\\to avoid screen garbage\\Unfortunately this is a very long filename which had to be truncated.pcap",
-               &label);
-#if GTK_MAJOR_VERSION >= 2
-    gtk_widget_modify_bg(w, GTK_STATE_NORMAL, &topic_bg);
-#endif
-    gtk_misc_set_alignment (GTK_MISC(label), 0.0, 0.0);
-    gtk_box_pack_start(GTK_BOX(topic_to_fill), w, FALSE, FALSE, 0);
-
-    w = gtk_label_new("");
-    gtk_box_pack_start(GTK_BOX(topic_to_fill), w, TRUE, TRUE, 0);
-
-
-    /* column online */
-    column_vb = gtk_vbox_new(FALSE, 10);
-    gtk_box_pack_start(GTK_BOX(welcome_hb), column_vb, TRUE, TRUE, 0);
-
-    /* topic online */
-    topic_vb = welcome_topic_new("Online", &topic_to_fill);
-    gtk_box_pack_start(GTK_BOX(column_vb), topic_vb, TRUE, TRUE, 0);
-
-#if (GLIB_MAJOR_VERSION >= 2)
-    item_hb = welcome_item(WIRESHARK_STOCK_WEB_SUPPORT,
-        "Help",
-        "Show the User's Guide",
-               "Show the User's Guide (local version, if available)",
-        GTK_SIGNAL_FUNC(topic_cb), GINT_TO_POINTER(ONLINEPAGE_USERGUIDE));
-    gtk_box_pack_start(GTK_BOX(topic_to_fill), item_hb, FALSE, FALSE, 5);
-
-    item_hb = welcome_item(GTK_STOCK_HOME,
-        "Home",
-        "Projects Home Page",
-               "Visit www.wireshark.org, the project's home page",
-        GTK_SIGNAL_FUNC(topic_cb), GINT_TO_POINTER(ONLINEPAGE_HOME));
-    gtk_box_pack_start(GTK_BOX(topic_to_fill), item_hb, FALSE, FALSE, 5);
-#endif
-
-    /* topic updates */
-    topic_vb = welcome_topic_new("Updates", &topic_to_fill);
-    gtk_box_pack_start(GTK_BOX(column_vb), topic_vb, TRUE, TRUE, 0);
-
-    w = gtk_label_new("No updates available!");
-    gtk_box_pack_start(GTK_BOX(topic_to_fill), w, TRUE, TRUE, 0);
-
-
-    /* the end */
-    gtk_widget_show_all(welcome_vb);
-
-    gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(welcome_scrollw),
-                                          welcome_vb);
-    gtk_widget_show_all(welcome_scrollw);
-
-    return welcome_scrollw;
-}
-#else
-static GtkWidget *
-welcome_new(void)
-{
-    /* this is just a dummy to fill up window space, simply showing nothing */
-    return scrolled_window_new(NULL, NULL);
-}
-#endif
-
 
 
 /*
@@ -4272,6 +3747,7 @@ window_state_event_cb (GtkWidget *widget _U_,
 }
 #endif
 
+
 #ifdef HAVE_AIRPCAP
 /*
  * Changed callback for the channel combobox
diff --git a/gtk/main_welcome.c b/gtk/main_welcome.c
new file mode 100644 (file)
index 0000000..7ede153
--- /dev/null
@@ -0,0 +1,561 @@
+/* main_welcome.c\r
+ *\r
+ * $Id: main_welcome.c 24577 2008-03-06 18:26:09Z stig $\r
+ *\r
+ * Wireshark - Network traffic analyzer\r
+ * By Gerald Combs <gerald@wireshark.org>\r
+ * Copyright 1998 Gerald Combs\r
+ *\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
+ */\r
+\r
+\r
+#include <gtk/gtk.h>\r
+\r
+#include "gui_utils.h"\r
+#include "recent.h"\r
+#include "main_welcome.h"\r
+\r
+\r
+#ifdef SHOW_WELCOME_PAGE\r
+#include "../image/wssplash.xpm"\r
+#endif\r
+\r
+\r
+/*#define SHOW_WELCOME_PAGE*/\r
+#ifdef SHOW_WELCOME_PAGE\r
+/* XXX - There seems to be some disagreement about if and how this feature should be implemented.\r
+   As I currently don't have the time to continue this, it's temporarily disabled. - ULFL */\r
+GtkWidget *\r
+welcome_item(const gchar *stock_item, const gchar * label, const gchar * message, const gchar * tooltip,\r
+                        GtkSignalFunc callback, void *callback_data)\r
+{\r
+    GtkWidget *w, *item_hb;\r
+#if GTK_MAJOR_VERSION >= 2\r
+    gchar *formatted_message;\r
+    GtkTooltips *tooltips;\r
+\r
+    tooltips = gtk_tooltips_new();\r
+#endif\r
+\r
+    item_hb = gtk_hbox_new(FALSE, 1);\r
+\r
+    w = BUTTON_NEW_FROM_STOCK(stock_item);\r
+    WIDGET_SET_SIZE(w, 80, 40);\r
+#if GTK_MAJOR_VERSION >= 2\r
+    gtk_button_set_label(GTK_BUTTON(w), label);\r
+    gtk_tooltips_set_tip(tooltips, w, tooltip, NULL);\r
+#endif\r
+    gtk_box_pack_start(GTK_BOX(item_hb), w, FALSE, FALSE, 0);\r
+    SIGNAL_CONNECT(w, "clicked", callback, callback_data);\r
+\r
+    w = gtk_label_new(message);\r
+    gtk_misc_set_alignment (GTK_MISC(w), 0.0, 0.5);\r
+#if GTK_MAJOR_VERSION >= 2\r
+    formatted_message = g_strdup_printf("<span weight=\"bold\" size=\"x-large\">%s</span>", message);\r
+    gtk_label_set_markup(GTK_LABEL(w), formatted_message);\r
+    g_free(formatted_message);\r
+#endif\r
+\r
+    gtk_box_pack_start(GTK_BOX(item_hb), w, FALSE, FALSE, 10);\r
+\r
+    return item_hb;\r
+}\r
+\r
+\r
+GtkWidget *\r
+welcome_header_new(void)\r
+{\r
+    GtkWidget *item_vb;\r
+    GtkWidget *item_hb;\r
+    GtkWidget *eb;\r
+    GdkColor bg;\r
+    GtkWidget *icon;\r
+    gchar *message;\r
+    GtkWidget *w;\r
+\r
+\r
+    /* background color of the header bar */\r
+    bg.pixel = 0;\r
+    bg.red = 154 * 255;\r
+    bg.green = 210 * 255;\r
+    bg.blue = 229 * 255;\r
+\r
+    item_vb = gtk_vbox_new(FALSE, 0);\r
+\r
+    /* colorize vbox */\r
+    get_color(&bg);\r
+    eb = gtk_event_box_new();\r
+    gtk_container_add(GTK_CONTAINER(eb), item_vb);\r
+#if GTK_MAJOR_VERSION >= 2\r
+    gtk_widget_modify_bg(eb, GTK_STATE_NORMAL, &bg);\r
+#endif\r
+\r
+    item_hb = gtk_hbox_new(FALSE, 0);\r
+    gtk_box_pack_start(GTK_BOX(item_vb), item_hb, FALSE, FALSE, 10);\r
+\r
+    icon = xpm_to_widget_from_parent(top_level, wssplash_xpm);\r
+    /*icon = xpm_to_widget_from_parent(top_level, wsicon64_xpm);*/\r
+    gtk_box_pack_start(GTK_BOX(item_hb), icon, FALSE, FALSE, 10);\r
+\r
+#if GTK_MAJOR_VERSION < 2\r
+    message = "The World's Most Popular Network Protocol Analyzer";\r
+#else\r
+    message = "<span weight=\"bold\" size=\"x-large\">" "The World's Most Popular Network Protocol Analyzer" "</span>";\r
+#endif\r
+    w = gtk_label_new(message);\r
+#if GTK_MAJOR_VERSION >= 2\r
+    gtk_label_set_markup(GTK_LABEL(w), message);\r
+#endif\r
+    gtk_misc_set_alignment (GTK_MISC(w), 0.0, 0.5);\r
+    gtk_box_pack_start(GTK_BOX(item_hb), w, TRUE, TRUE, 5);\r
+\r
+    gtk_widget_show_all(eb);\r
+\r
+    return eb;\r
+}\r
+\r
+GtkWidget *\r
+welcome_topic_header_new(const char *header)\r
+{\r
+    GtkWidget *w;\r
+    GdkColor bg;\r
+    GtkWidget *eb;\r
+#if GTK_MAJOR_VERSION >= 2\r
+    gchar *formatted_message;\r
+#endif\r
+\r
+\r
+    w = gtk_label_new(header);\r
+#if GTK_MAJOR_VERSION >= 2\r
+    formatted_message = g_strdup_printf("<span weight=\"bold\" size=\"x-large\">%s</span>", header);\r
+    gtk_label_set_markup(GTK_LABEL(w), formatted_message);\r
+    g_free(formatted_message);\r
+#endif\r
+\r
+    /* topic header background color */\r
+    bg.pixel = 0;\r
+    bg.red = 24 * 255;\r
+    bg.green = 151 * 255;\r
+    bg.blue = 192 * 255;\r
+\r
+    /* colorize vbox */\r
+    get_color(&bg);\r
+    eb = gtk_event_box_new();\r
+    gtk_container_add(GTK_CONTAINER(eb), w);\r
+#if GTK_MAJOR_VERSION >= 2\r
+    gtk_widget_modify_bg(eb, GTK_STATE_NORMAL, &bg);\r
+#endif\r
+\r
+    return eb;\r
+}\r
+\r
+\r
+GtkWidget *\r
+welcome_topic_new(const char *header, GtkWidget **to_fill)\r
+{\r
+    GtkWidget *topic_vb;\r
+    GtkWidget *layout_vb;\r
+    GtkWidget *topic_eb;\r
+    GtkWidget *topic_header;\r
+    GdkColor bg;\r
+\r
+    topic_vb = gtk_vbox_new(FALSE, 0);\r
+\r
+       /* topic content background color */\r
+    bg.pixel = 0;\r
+    bg.red = 221 * 255;\r
+    bg.green = 226 * 255;\r
+    bg.blue = 228 * 255;\r
+\r
+    topic_header = welcome_topic_header_new(header);\r
+    gtk_box_pack_start(GTK_BOX(topic_vb), topic_header, FALSE, FALSE, 0);\r
+\r
+    layout_vb = gtk_vbox_new(FALSE, 5);\r
+    gtk_container_border_width(GTK_CONTAINER(layout_vb), 10);\r
+    gtk_box_pack_start(GTK_BOX(topic_vb), layout_vb, FALSE, FALSE, 0);\r
+\r
+    /* colorize vbox (we need an event box for this!) */\r
+    get_color(&bg);\r
+    topic_eb = gtk_event_box_new();\r
+    gtk_container_add(GTK_CONTAINER(topic_eb), topic_vb);\r
+#if GTK_MAJOR_VERSION >= 2\r
+    gtk_widget_modify_bg(topic_eb, GTK_STATE_NORMAL, &bg);\r
+#endif\r
+    *to_fill = layout_vb;\r
+\r
+    return topic_eb;\r
+}\r
+\r
+\r
+#if GTK_MAJOR_VERSION >= 2\r
+static gboolean\r
+welcome_link_enter_cb(GtkWidget *widget _U_, GdkEventCrossing *event _U_, gpointer user_data)\r
+{\r
+    gchar *message;\r
+    GtkWidget *w = user_data;\r
+\r
+    message = g_strdup_printf("<span foreground='blue' underline='single'>%s</span>", OBJECT_GET_DATA(w,"TEXT"));\r
+#if GTK_MAJOR_VERSION >= 2\r
+    gtk_label_set_markup(GTK_LABEL(w), message);\r
+#endif\r
+    g_free(message);\r
+\r
+    return FALSE;\r
+}\r
+\r
+static gboolean\r
+welcome_link_leave_cb(GtkWidget *widget _U_, GdkEvent *event _U_, gpointer user_data)\r
+{\r
+    gchar *message;\r
+    GtkWidget *w = user_data;\r
+\r
+    message = g_strdup_printf("<span foreground='blue'>%s</span>", OBJECT_GET_DATA(w,"TEXT"));\r
+#if GTK_MAJOR_VERSION >= 2\r
+    gtk_label_set_markup(GTK_LABEL(w), message);\r
+#endif\r
+    g_free(message);\r
+\r
+    return FALSE;\r
+}\r
+#endif\r
+\r
+\r
+static gboolean\r
+welcome_link_press_cb(GtkWidget *widget _U_, GdkEvent *event _U_, gpointer data _U_) {\r
+\r
+    g_warning("TBD: link pressed");\r
+\r
+    return FALSE;\r
+}\r
+\r
+GtkWidget *\r
+welcome_link_new(const gchar *text, GtkWidget **label /*, void *callback, void *private_data */)\r
+{\r
+    gchar *message;\r
+    GtkWidget *w;\r
+    GtkWidget *eb;\r
+\r
+#if GTK_MAJOR_VERSION < 2\r
+    message = g_strdup(text);\r
+#else\r
+    message = g_strdup_printf("<span foreground='blue'>%s</span>", text);\r
+#endif\r
+    w = gtk_label_new(message);\r
+    *label = w;\r
+#if GTK_MAJOR_VERSION >= 2\r
+    gtk_label_set_markup(GTK_LABEL(w), message);\r
+#endif\r
+    g_free(message);\r
+\r
+       /* event box */\r
+    eb = gtk_event_box_new();\r
+    gtk_container_add(GTK_CONTAINER(eb), w);\r
+\r
+#if GTK_MAJOR_VERSION >= 2\r
+    SIGNAL_CONNECT(eb, "enter-notify-event", welcome_link_enter_cb, w);\r
+    SIGNAL_CONNECT(eb, "leave-notify-event", welcome_link_leave_cb, w);\r
+#endif\r
+    SIGNAL_CONNECT(eb, "button-press-event", welcome_link_press_cb, w);\r
+\r
+    /* XXX - memleak */\r
+    OBJECT_SET_DATA(w, "TEXT", g_strdup(text));\r
+\r
+    return eb;\r
+}\r
+\r
+GtkWidget *\r
+welcome_filename_link_new(const char *filename, GtkWidget **label)\r
+{\r
+    GString            *str;\r
+    GtkWidget  *w;\r
+    const unsigned int max = 60;\r
+\r
+\r
+    str = g_string_new(filename);\r
+\r
+    if(str->len > max) {\r
+        g_string_erase(str, 0, str->len-max /*cut*/);\r
+        g_string_prepend(str, "... ");\r
+    }\r
+\r
+    w = welcome_link_new(str->str, label);\r
+\r
+    g_string_free(str, TRUE);\r
+\r
+    return w;\r
+}\r
+\r
+\r
+GtkWidget *\r
+welcome_if_new(const char *if_name, GdkColor *topic_bg, gboolean active)\r
+{\r
+    GtkWidget *interface_hb;\r
+    GtkWidget *w;\r
+    GtkWidget *label;\r
+    GtkTooltips *tooltips;\r
+    GString   *message;\r
+\r
+\r
+    tooltips = gtk_tooltips_new();\r
+\r
+    interface_hb = gtk_hbox_new(FALSE, 5);\r
+\r
+    w = welcome_link_new("START", &label);\r
+    gtk_tooltips_set_tip(tooltips, w, "Immediately start a capture on this interface", NULL);\r
+#if GTK_MAJOR_VERSION >= 2\r
+    gtk_widget_modify_bg(w, GTK_STATE_NORMAL, topic_bg);\r
+#endif\r
+    gtk_misc_set_alignment (GTK_MISC(label), 0.0, 0.0);\r
+    gtk_box_pack_start(GTK_BOX(interface_hb), w, FALSE, FALSE, 0);\r
+\r
+    w = welcome_link_new("OPTIONS", &label);\r
+    gtk_tooltips_set_tip(tooltips, w, "Show the capture options of this interface", NULL);\r
+#if GTK_MAJOR_VERSION >= 2\r
+    gtk_widget_modify_bg(w, GTK_STATE_NORMAL, topic_bg);\r
+#endif\r
+    gtk_misc_set_alignment (GTK_MISC(label), 0.0, 0.0);\r
+    gtk_box_pack_start(GTK_BOX(interface_hb), w, FALSE, FALSE, 0);\r
+\r
+    w = welcome_link_new("DETAILS", &label);\r
+    gtk_tooltips_set_tip(tooltips, w, "Show detailed information about this interface", NULL);\r
+#if GTK_MAJOR_VERSION >= 2\r
+    gtk_widget_modify_bg(w, GTK_STATE_NORMAL, topic_bg);\r
+#endif\r
+    gtk_misc_set_alignment (GTK_MISC(label), 0.0, 0.0);\r
+    gtk_box_pack_start(GTK_BOX(interface_hb), w, FALSE, FALSE, 0);\r
+\r
+    message = g_string_new(if_name);\r
+\r
+    /* truncate string if it's too long */\r
+    if(message->len > 38) {\r
+        g_string_truncate(message, 35);\r
+        g_string_append  (message, " ...");\r
+    }\r
+#if GTK_MAJOR_VERSION >= 2\r
+    /* if this is the "active" interface, display it bold */\r
+    if(active) {\r
+        g_string_prepend(message, "<span weight=\"bold\">");\r
+        g_string_append (message, "</span>");\r
+       }\r
+#endif\r
+    w = gtk_label_new(message->str);\r
+#if GTK_MAJOR_VERSION >= 2\r
+    gtk_label_set_markup(GTK_LABEL(w), message->str);\r
+#endif\r
+    g_string_free(message, TRUE);\r
+\r
+    gtk_misc_set_alignment (GTK_MISC(w), 0.0, 0.0);\r
+    gtk_box_pack_start(GTK_BOX(interface_hb), w, FALSE, FALSE, 0);\r
+\r
+    return interface_hb;\r
+}\r
+\r
+/* XXX - the layout has to be improved */\r
+GtkWidget *\r
+welcome_new(void)\r
+{\r
+    GtkWidget *welcome_scrollw;\r
+    GtkWidget *welcome_vb;\r
+    GtkWidget *welcome_hb;\r
+    GtkWidget *column_vb;\r
+    GtkWidget *item_hb;\r
+    GtkWidget *w;\r
+    GtkWidget *label;\r
+    GtkWidget *header;\r
+    GtkWidget *topic_vb;\r
+    GtkWidget *topic_to_fill;\r
+    GtkWidget *interface_hb;\r
+    GdkColor  topic_bg;\r
+\r
+\r
+    /* topic content background color */\r
+    topic_bg.pixel = 0;\r
+    topic_bg.red = 221 * 255;\r
+    topic_bg.green = 226 * 255;\r
+    topic_bg.blue = 228 * 255;\r
+\r
+    welcome_scrollw = scrolled_window_new(NULL, NULL);\r
+\r
+    welcome_vb = gtk_vbox_new(FALSE, 0);\r
+\r
+    /* header */\r
+    header = welcome_header_new();\r
+    gtk_box_pack_start(GTK_BOX(welcome_vb), header, FALSE, FALSE, 0);\r
+\r
+    /* content */\r
+    welcome_hb = gtk_hbox_new(FALSE, 10);\r
+    gtk_container_border_width(GTK_CONTAINER(welcome_hb), 10);\r
+    gtk_box_pack_start(GTK_BOX(welcome_vb), welcome_hb, TRUE, TRUE, 0);\r
+\r
+    /* column capture */\r
+    column_vb = gtk_vbox_new(FALSE, 10);\r
+    gtk_box_pack_start(GTK_BOX(welcome_hb), column_vb, TRUE, TRUE, 0);\r
+\r
+    /* capture topic */\r
+    topic_vb = welcome_topic_new("Capture", &topic_to_fill);\r
+    gtk_box_pack_start(GTK_BOX(column_vb), topic_vb, TRUE, TRUE, 0);\r
+\r
+#ifdef HAVE_LIBPCAP\r
+    item_hb = welcome_item(WIRESHARK_STOCK_CAPTURE_INTERFACES,\r
+        "Interfaces...",\r
+        "Interface Life List",\r
+               "Show a life list of the available capture interfaces",\r
+        GTK_SIGNAL_FUNC(capture_if_cb), NULL);\r
+    gtk_box_pack_start(GTK_BOX(topic_to_fill), item_hb, FALSE, FALSE, 5);\r
+#endif\r
+\r
+    w = gtk_label_new("Available Interfaces:");\r
+    gtk_misc_set_alignment (GTK_MISC(w), 0.0, 0.0);\r
+    gtk_box_pack_start(GTK_BOX(topic_to_fill), w, FALSE, FALSE, 5);\r
+\r
+    interface_hb = welcome_if_new("Generic dialup adapter", &topic_bg, FALSE);\r
+    gtk_box_pack_start(GTK_BOX(topic_to_fill), interface_hb, FALSE, FALSE, 0);\r
+\r
+    /* Marvell interface (currently "active") */\r
+    interface_hb = welcome_if_new("Marvell Gigabit Ethernet Controller", &topic_bg, TRUE);\r
+    gtk_box_pack_start(GTK_BOX(topic_to_fill), interface_hb, FALSE, FALSE, 0);\r
+\r
+    /* Wireless interface */\r
+    interface_hb = welcome_if_new("Intel(R) PRO/Wireless 3945ABG Network Connection", &topic_bg, FALSE);\r
+    gtk_box_pack_start(GTK_BOX(topic_to_fill), interface_hb, FALSE, FALSE, 0);\r
+\r
+\r
+    /* capture help topic */\r
+    topic_vb = welcome_topic_new("Capture Help", &topic_to_fill);\r
+    gtk_box_pack_start(GTK_BOX(column_vb), topic_vb, TRUE, TRUE, 0);\r
+\r
+#ifdef HAVE_LIBPCAP\r
+    item_hb = welcome_item(WIRESHARK_STOCK_CAPTURE_START,\r
+        "Setup",\r
+               "How To: Setup a Capture",\r
+               "How To: Setup a Capture (online from the Wiki)",\r
+        GTK_SIGNAL_FUNC(topic_cb), GINT_TO_POINTER(ONLINEPAGE_USERGUIDE));\r
+    gtk_box_pack_start(GTK_BOX(topic_to_fill), item_hb, FALSE, FALSE, 5);\r
+\r
+    item_hb = welcome_item(WIRESHARK_STOCK_CAPTURE_START,\r
+        "Examples",\r
+               "Capture Filter Examples",\r
+               "Capture Filter Examples (online from the Wiki)",\r
+        GTK_SIGNAL_FUNC(topic_cb), GINT_TO_POINTER(ONLINEPAGE_USERGUIDE));\r
+    gtk_box_pack_start(GTK_BOX(topic_to_fill), item_hb, FALSE, FALSE, 5);\r
+#endif\r
+\r
+    /* fill bottom space */\r
+    w = gtk_label_new("");\r
+    gtk_box_pack_start(GTK_BOX(topic_to_fill), w, TRUE, TRUE, 0);\r
+\r
+\r
+    /* column files */\r
+    topic_vb = welcome_topic_new("Files", &topic_to_fill);\r
+    gtk_box_pack_start(GTK_BOX(welcome_hb), topic_vb, TRUE, TRUE, 0);\r
+\r
+    item_hb = welcome_item(GTK_STOCK_OPEN,\r
+        "Open...",\r
+        "Open a Capture File",\r
+               "Open a previously captured file",\r
+        GTK_SIGNAL_FUNC(file_open_cmd_cb), NULL);\r
+    gtk_box_pack_start(GTK_BOX(topic_to_fill), item_hb, FALSE, FALSE, 5);\r
+\r
+    item_hb = welcome_item(GTK_STOCK_OPEN,\r
+        "Examples",\r
+        "Download Examples",\r
+               "Download Example Capture Files (from the Wiki)",\r
+        GTK_SIGNAL_FUNC(topic_cb), GINT_TO_POINTER(ONLINEPAGE_USERGUIDE));\r
+    gtk_box_pack_start(GTK_BOX(topic_to_fill), item_hb, FALSE, FALSE, 5);\r
+\r
+    w = gtk_label_new("Recent Files:");\r
+    gtk_misc_set_alignment (GTK_MISC(w), 0.0, 0.0);\r
+    gtk_box_pack_start(GTK_BOX(topic_to_fill), w, FALSE, FALSE, 5);\r
+\r
+    w = welcome_link_new("C:\\Testfiles\\hello.pcap", &label);\r
+#if GTK_MAJOR_VERSION >= 2\r
+    gtk_widget_modify_bg(w, GTK_STATE_NORMAL, &topic_bg);\r
+#endif\r
+    gtk_misc_set_alignment (GTK_MISC(label), 0.0, 0.0);\r
+    gtk_box_pack_start(GTK_BOX(topic_to_fill), w, FALSE, FALSE, 0);\r
+\r
+    w = welcome_filename_link_new("C:\\Testfiles\\hello2.pcap", &label);\r
+#if GTK_MAJOR_VERSION >= 2\r
+    gtk_widget_modify_bg(w, GTK_STATE_NORMAL, &topic_bg);\r
+#endif\r
+    gtk_misc_set_alignment (GTK_MISC(label), 0.0, 0.0);\r
+    gtk_box_pack_start(GTK_BOX(topic_to_fill), w, FALSE, FALSE, 0);\r
+\r
+    w = welcome_filename_link_new(\r
+               "C:\\Testfiles\\to avoid screen garbage\\Unfortunately this is a very long filename which had to be truncated.pcap",\r
+               &label);\r
+#if GTK_MAJOR_VERSION >= 2\r
+    gtk_widget_modify_bg(w, GTK_STATE_NORMAL, &topic_bg);\r
+#endif\r
+    gtk_misc_set_alignment (GTK_MISC(label), 0.0, 0.0);\r
+    gtk_box_pack_start(GTK_BOX(topic_to_fill), w, FALSE, FALSE, 0);\r
+\r
+    w = gtk_label_new("");\r
+    gtk_box_pack_start(GTK_BOX(topic_to_fill), w, TRUE, TRUE, 0);\r
+\r
+\r
+    /* column online */\r
+    column_vb = gtk_vbox_new(FALSE, 10);\r
+    gtk_box_pack_start(GTK_BOX(welcome_hb), column_vb, TRUE, TRUE, 0);\r
+\r
+    /* topic online */\r
+    topic_vb = welcome_topic_new("Online", &topic_to_fill);\r
+    gtk_box_pack_start(GTK_BOX(column_vb), topic_vb, TRUE, TRUE, 0);\r
+\r
+#if (GLIB_MAJOR_VERSION >= 2)\r
+    item_hb = welcome_item(WIRESHARK_STOCK_WEB_SUPPORT,\r
+        "Help",\r
+        "Show the User's Guide",\r
+               "Show the User's Guide (local version, if available)",\r
+        GTK_SIGNAL_FUNC(topic_cb), GINT_TO_POINTER(ONLINEPAGE_USERGUIDE));\r
+    gtk_box_pack_start(GTK_BOX(topic_to_fill), item_hb, FALSE, FALSE, 5);\r
+\r
+    item_hb = welcome_item(GTK_STOCK_HOME,\r
+        "Home",\r
+        "Projects Home Page",\r
+               "Visit www.wireshark.org, the project's home page",\r
+        GTK_SIGNAL_FUNC(topic_cb), GINT_TO_POINTER(ONLINEPAGE_HOME));\r
+    gtk_box_pack_start(GTK_BOX(topic_to_fill), item_hb, FALSE, FALSE, 5);\r
+#endif\r
+\r
+    /* topic updates */\r
+    topic_vb = welcome_topic_new("Updates", &topic_to_fill);\r
+    gtk_box_pack_start(GTK_BOX(column_vb), topic_vb, TRUE, TRUE, 0);\r
+\r
+    w = gtk_label_new("No updates available!");\r
+    gtk_box_pack_start(GTK_BOX(topic_to_fill), w, TRUE, TRUE, 0);\r
+\r
+\r
+    /* the end */\r
+    gtk_widget_show_all(welcome_vb);\r
+\r
+    gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(welcome_scrollw),\r
+                                          welcome_vb);\r
+    gtk_widget_show_all(welcome_scrollw);\r
+\r
+    return welcome_scrollw;\r
+}\r
+#else\r
+GtkWidget *\r
+welcome_new(void)\r
+{\r
+    /* this is just a dummy to fill up window space, simply showing nothing */\r
+    return scrolled_window_new(NULL, NULL);\r
+}\r
+#endif\r
+\r
+\r
diff --git a/gtk/main_welcome.h b/gtk/main_welcome.h
new file mode 100644 (file)
index 0000000..20f0376
--- /dev/null
@@ -0,0 +1,31 @@
+/* main_welcome.h\r
+ * Welcome "page"\r
+ *\r
+ * $Id: main_welcome.h 24604 2008-03-11 18:23:16Z stig $\r
+ *\r
+ * Wireshark - Network traffic analyzer\r
+ * By Gerald Combs <gerald@wireshark.org>\r
+ * Copyright 1998 Gerald Combs\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
+ */\r
+\r
+#ifndef __MAIN_WELCOME_H__\r
+#define __MAIN_WELCOME_H__\r
+\r
+\r
+GtkWidget *welcome_new(void);\r
+\r
+#endif /* __MAIN_WELCOME_H__ */\r