diff options
author | sake <sake@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-04-14 15:01:34 +0000 |
---|---|---|
committer | sake <sake@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-04-14 15:01:34 +0000 |
commit | 69a0e0a8d021f57270e8c3a27354899ba1fb2fe8 (patch) | |
tree | 22cd118718732de749b075b74e0e2950783480c4 | |
parent | 34be8087d1fc9300aadb10f6e6ab8474f11d59b8 (diff) |
From Jim Young (bug 2212):
Add the profile name to the title of all the configuration windows.
(this is a rewrite of Jim's patch)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25016 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r-- | gtk/color_dlg.c | 2 | ||||
-rw-r--r-- | gtk/color_edit_dlg.c | 2 | ||||
-rw-r--r-- | gtk/dfilter_expr_dlg.c | 2 | ||||
-rw-r--r-- | gtk/dlg_utils.c | 29 | ||||
-rw-r--r-- | gtk/dlg_utils.h | 10 | ||||
-rw-r--r-- | gtk/filter_dlg.c | 2 | ||||
-rw-r--r-- | gtk/prefs_capture.c | 2 | ||||
-rw-r--r-- | gtk/prefs_dlg.c | 2 | ||||
-rw-r--r-- | gtk/profile_dlg.c | 2 | ||||
-rw-r--r-- | gtk/proto_dlg.c | 2 | ||||
-rw-r--r-- | gtk/uat_gui.c | 8 |
11 files changed, 51 insertions, 12 deletions
diff --git a/gtk/color_dlg.c b/gtk/color_dlg.c index 98b4500286..8275eec328 100644 --- a/gtk/color_dlg.c +++ b/gtk/color_dlg.c @@ -215,7 +215,7 @@ colorize_dialog_new (char *filter) /* Resizing of the dialog window is now reasonably done. * Default size is set so that it should fit into every usual screen resolution. * All other widgets are always packed depending on the current window size. */ - color_win = dlg_window_new ("Wireshark: Coloring Rules"); + color_win = dlg_conf_window_new ("Wireshark: Coloring Rules"); g_object_set_data(G_OBJECT(color_win), "color_win", color_win); gtk_window_set_default_size(GTK_WINDOW(color_win), DEF_WIDTH, DEF_HEIGHT * 2/3); dlg_vbox = gtk_vbox_new (FALSE, 0); diff --git a/gtk/color_edit_dlg.c b/gtk/color_edit_dlg.c index f6f044307b..6762b142ef 100644 --- a/gtk/color_edit_dlg.c +++ b/gtk/color_edit_dlg.c @@ -137,7 +137,7 @@ edit_color_filter_dialog(GtkWidget *color_filters, tooltips = gtk_tooltips_new (); /* dialog window */ - edit_dialog = dlg_window_new ("Wireshark: Edit Color Filter"); + edit_dialog = dlg_conf_window_new ("Wireshark: Edit Color Filter"); gtk_window_set_default_size(GTK_WINDOW(edit_dialog), 500, -1); g_object_set_data(G_OBJECT(edit_dialog), "edit_dialog", edit_dialog); colorf->edit_dialog = edit_dialog; diff --git a/gtk/dfilter_expr_dlg.c b/gtk/dfilter_expr_dlg.c index bba5451e2a..ce06338f7f 100644 --- a/gtk/dfilter_expr_dlg.c +++ b/gtk/dfilter_expr_dlg.c @@ -945,7 +945,7 @@ dfilter_expr_dlg_new(GtkWidget *filter_te) proto_initialize_all_prefixes(); - window = dlg_window_new("Wireshark: Filter Expression"); + window = dlg_conf_window_new("Wireshark: Filter Expression"); gtk_window_set_default_size(GTK_WINDOW(window), 500, 400); gtk_container_set_border_width(GTK_CONTAINER(window), 5); diff --git a/gtk/dlg_utils.c b/gtk/dlg_utils.c index de881cbd9d..750c949e59 100644 --- a/gtk/dlg_utils.c +++ b/gtk/dlg_utils.c @@ -35,6 +35,8 @@ #include "gtk/dlg_utils.h" #include "gtk/stock_icons.h" +#include "epan/filesystem.h" + static void dlg_activate (GtkWidget *widget, gpointer ok_button); @@ -403,6 +405,33 @@ dlg_window_new(const gchar *title) return win; } +/* Create a configuration dialog box window that belongs to Wireshark's + * main window and add the name of the current profile name to it's title bar + */ +GtkWidget * +dlg_conf_window_new(const gchar *title) +{ + const char *profile_name; + gchar *win_name; + GtkWidget *win; + + /* + * Set window title to reflect which preferences profile we are + * working with. + */ + profile_name = get_profile_name(); + if (!profile_name) { + profile_name = DEFAULT_PROFILE; + } + + win_name = g_strdup_printf("%s - Profile: %s", title, profile_name); + win = dlg_window_new(win_name); + + g_free(win_name); + + return win; +} + /* Set the "activate" signal for a widget to call a routine to activate the "OK" button for a dialog box. diff --git a/gtk/dlg_utils.h b/gtk/dlg_utils.h index 7985bb631c..62628ad052 100644 --- a/gtk/dlg_utils.h +++ b/gtk/dlg_utils.h @@ -79,6 +79,16 @@ */ extern GtkWidget *dlg_window_new(const gchar *title); +/** Create a configuration dialog box window that belongs to Wireshark's + * main window and add the name of the current profile name to it's title bar + * If you want to create a window, use window_new() instead. + * See window_new() for general window usage. + * + * @param title the title for the new dialog + * @return the newly created dialog + */ +extern GtkWidget *dlg_conf_window_new(const gchar *title); + /** Create a button row (with variable number of buttons) for a dialog. * The button widgets will be available by g_object_get_data(dlg, stock_id) later. * diff --git a/gtk/filter_dlg.c b/gtk/filter_dlg.c index 2b8230352c..d529cf544b 100644 --- a/gtk/filter_dlg.c +++ b/gtk/filter_dlg.c @@ -408,7 +408,7 @@ filter_dialog_new(GtkWidget *button, GtkWidget *parent_filter_te, tooltips = gtk_tooltips_new (); - main_w = dlg_window_new(construct_args->title); + main_w = dlg_conf_window_new(construct_args->title); gtk_window_set_default_size(GTK_WINDOW(main_w), 400, 400); g_object_set_data(G_OBJECT(main_w), E_FILT_CONSTRUCT_ARGS_KEY, construct_args); diff --git a/gtk/prefs_capture.c b/gtk/prefs_capture.c index e2e73bc090..5a5009c096 100644 --- a/gtk/prefs_capture.c +++ b/gtk/prefs_capture.c @@ -266,7 +266,7 @@ ifopts_edit_cb(GtkWidget *w, gpointer data _U_) } /* create a new dialog */ - ifopts_edit_dlg = dlg_window_new("Wireshark: Preferences: Interface Options"); + ifopts_edit_dlg = dlg_conf_window_new("Wireshark: Preferences: Interface Options"); gtk_window_set_default_size(GTK_WINDOW(ifopts_edit_dlg), DEF_WIDTH, 300); main_vb = gtk_vbox_new(FALSE, 1); diff --git a/gtk/prefs_dlg.c b/gtk/prefs_dlg.c index 17b676e261..c0d55b8a70 100644 --- a/gtk/prefs_dlg.c +++ b/gtk/prefs_dlg.c @@ -436,7 +436,7 @@ prefs_cb(GtkWidget *w _U_, gpointer dummy _U_) if the user presses "Cancel". */ copy_prefs(&saved_prefs, &prefs); - prefs_w = dlg_window_new("Wireshark: Preferences"); + prefs_w = dlg_conf_window_new("Wireshark: Preferences"); /* * Unfortunately, we can't arrange that a GtkTable widget wrap an event box diff --git a/gtk/profile_dlg.c b/gtk/profile_dlg.c index 64c1f5f76a..fdd57a0678 100644 --- a/gtk/profile_dlg.c +++ b/gtk/profile_dlg.c @@ -669,7 +669,7 @@ profile_dialog_new(void) tooltips = gtk_tooltips_new (); - main_w = dlg_window_new("Wireshark: Configuration Profiles"); + main_w = dlg_conf_window_new("Wireshark: Configuration Profiles"); gtk_window_set_default_size(GTK_WINDOW(main_w), 400, 400); main_vb = gtk_vbox_new(FALSE, 0); diff --git a/gtk/proto_dlg.c b/gtk/proto_dlg.c index 12257eb2f2..c7be15607b 100644 --- a/gtk/proto_dlg.c +++ b/gtk/proto_dlg.c @@ -96,7 +96,7 @@ proto_cb(GtkWidget *w _U_, gpointer data _U_) return; } - proto_w = dlg_window_new("Wireshark: Enabled Protocols"); + proto_w = dlg_conf_window_new("Wireshark: Enabled Protocols"); gtk_window_set_default_size(GTK_WINDOW(proto_w), DEF_WIDTH * 2/3, DEF_HEIGHT); /* Container for each row of widgets */ diff --git a/gtk/uat_gui.c b/gtk/uat_gui.c index 955faddbbc..5103c2c9f0 100644 --- a/gtk/uat_gui.c +++ b/gtk/uat_gui.c @@ -408,7 +408,7 @@ static void uat_edit_dialog(uat_t* uat, gint row) { tooltips = gtk_tooltips_new(); dd->entries = g_ptr_array_new(); - dd->win = dlg_window_new(ep_strdup_printf("%s: %s", uat->name, (row == -1 ? "New" : "Edit"))); + dd->win = dlg_conf_window_new(ep_strdup_printf("%s: %s", uat->name, (row == -1 ? "New" : "Edit"))); dd->uat = uat; dd->rec = row < 0 ? g_malloc0(uat->record_size) : UAT_INDEX_PTR(uat,row); dd->is_new = row < 0 ? TRUE : FALSE; @@ -558,7 +558,7 @@ static void uat_del_dlg(uat_t* uat, int idx) { ud->uat = uat; ud->idx = idx; - ud->win = win = dlg_window_new(ep_strdup_printf("%s: Confirm Delete", uat->name)); + ud->win = win = dlg_conf_window_new(ep_strdup_printf("%s: Confirm Delete", uat->name)); gtk_window_set_resizable(GTK_WINDOW(win),FALSE); gtk_window_resize(GTK_WINDOW(win),400,25*(uat->ncols+2)); @@ -779,7 +779,7 @@ static gboolean unsaved_dialog(GtkWindow *w _U_, GdkEvent* e _U_, gpointer u) { return TRUE; } - uat->rep->unsaved_window = win = window_new(GTK_WINDOW_TOPLEVEL, "Discard Changes?"); + uat->rep->unsaved_window = win = dlg_conf_window_new("Discard Changes?"); gtk_window_set_default_size(GTK_WINDOW(win), 360, 140); gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_CENTER_ON_PARENT); @@ -828,7 +828,7 @@ static GtkWidget* uat_window(void* u) { uat->rep = rep = g_malloc0(sizeof(uat_rep_t)); } - rep->window = window_new(GTK_WINDOW_TOPLEVEL, uat->name); + rep->window = dlg_conf_window_new(uat->name); gtk_window_set_resizable(GTK_WINDOW(rep->window),FALSE); gtk_window_resize(GTK_WINDOW(rep->window), 720, 512); |