prefs.gui_webbrowser = g_strdup(HTML_VIEWER " %s");
prefs.gui_window_title = g_strdup("");
prefs.gui_start_title = g_strdup("The World's Most Popular Network Protocol Analyzer");
+ prefs.gui_version_in_start_page = FALSE;
prefs.gui_layout_type = layout_type_5;
prefs.gui_layout_content_1 = layout_pane_content_plist;
prefs.gui_layout_content_2 = layout_pane_content_pdetails;
#define PRS_GUI_WEBBROWSER "gui.webbrowser"
#define PRS_GUI_WINDOW_TITLE "gui.window_title"
#define PRS_GUI_START_TITLE "gui.start_title"
+#define PRS_GUI_VERSION_IN_START_PAGE "gui.version_in_start_page"
#define PRS_GUI_LAYOUT_TYPE "gui.layout_type"
#define PRS_GUI_LAYOUT_CONTENT_1 "gui.layout_content_1"
#define PRS_GUI_LAYOUT_CONTENT_2 "gui.layout_content_2"
if (prefs.gui_start_title != NULL)
g_free(prefs.gui_start_title);
prefs.gui_start_title = g_strdup(value);
+ } else if (strcmp(pref_name, PRS_GUI_VERSION_IN_START_PAGE) == 0) {
+ if (g_ascii_strcasecmp(value, "true") == 0) {
+ prefs.gui_version_in_start_page = TRUE;
+ } else {
+ prefs.gui_version_in_start_page = FALSE;
+ }
} else if (strcmp(pref_name, PRS_GUI_LAYOUT_TYPE) == 0) {
prefs.gui_layout_type = strtoul(value, NULL, 10);
if (prefs.gui_layout_type == layout_unused ||
fprintf(pf, PRS_GUI_START_TITLE ": %s\n",
prefs.gui_start_title);
+ fprintf(pf, "\n# Show version in start page, can be useful in custom builds.\n");
+ fprintf(pf, "# TRUE or FALSE (case-insensitive).\n");
+ fprintf(pf, PRS_GUI_VERSION_IN_START_PAGE ": %s\n",
+ prefs.gui_version_in_start_page == TRUE ? "TRUE" : "FALSE");
+
fprintf (pf, "\n######## User Interface: Layout ########\n");
fprintf(pf, "\n# Layout type (1-6).\n");
dest->gui_webbrowser = g_strdup(src->gui_webbrowser);
dest->gui_window_title = g_strdup(src->gui_window_title);
dest->gui_start_title = g_strdup(src->gui_start_title);
+ dest->gui_version_in_start_page = src->gui_version_in_start_page;
dest->console_log_level = src->console_log_level;
/* values for the capture dialog box */
dest->capture_device = g_strdup(src->capture_device);
gchar *gui_webbrowser;
gchar *gui_window_title;
gchar *gui_start_title;
+ gboolean gui_version_in_start_page;
layout_type_e gui_layout_type;
layout_pane_content_e gui_layout_content_1;
layout_pane_content_e gui_layout_content_2;
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/* Put version in Welcome screen, can be useful in custom builds.
-#define VERSION_IN_WELCOME_PAGE 1
-*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gtk/stock_icons.h"
#include "gtk/capture_globals.h"
#include "../image/wssplash-dev.xpm"
-#ifdef VERSION_IN_WELCOME_PAGE
#include "../version_info.h"
-#endif
/* XXX */
GtkWidget *item_hb;
GtkWidget *eb;
GtkWidget *icon;
- gchar *message;
+ GString *message;
GtkWidget *w;
time_t secs = time(NULL);
struct tm *now = localtime(&secs);
icon = xpm_to_widget_from_parent(top_level, wssplash_xpm);
gtk_box_pack_start(GTK_BOX(item_hb), icon, FALSE, FALSE, 10);
+ message = g_string_new("<span weight=\"bold\" size=\"x-large\" foreground=\"black\">");
if ((now->tm_mon == 3 && now->tm_mday == 1) || (now->tm_mon == 6 && now->tm_mday == 14)) {
- message = g_strdup_printf(
- "<span weight=\"bold\" size=\"x-large\" foreground=\"black\">"
- "Sniffing the glue that holds the Internet together"
- "</span>");
+ g_string_append(message, "Sniffing the glue that holds the Internet together");
} else {
- message = g_strdup_printf(
- "<span weight=\"bold\" size=\"x-large\" foreground=\"black\">"
- "%s"
-#ifdef VERSION_IN_WELCOME_PAGE
- "</span>\n<span size=\"large\">"
- "Version " VERSION "%s</span>",
- prefs.gui_start_title, wireshark_svnversion);
-#else
- "</span>", prefs.gui_start_title);
-#endif
+ g_string_append(message, prefs.gui_start_title);
+ }
+ g_string_append(message, "</span>");
+
+ if (prefs.gui_version_in_start_page) {
+ g_string_append_printf(message, "\n<span size=\"large\">Version " VERSION "%s</span>",
+ wireshark_svnversion);
}
- w = gtk_label_new(message);
- gtk_label_set_markup(GTK_LABEL(w), message);
- g_free(message);
+
+ w = gtk_label_new(message->str);
+ gtk_label_set_markup(GTK_LABEL(w), message->str);
+ g_string_free(message, TRUE);
gtk_misc_set_alignment (GTK_MISC(w), 0.0, 0.5);
gtk_box_pack_start(GTK_BOX(item_hb), w, TRUE, TRUE, 5);