diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2006-10-03 21:03:08 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2006-10-03 21:03:08 +0000 |
commit | 57be028caf8898f526be1b57b6e4853bf2b69223 (patch) | |
tree | ab4eef6c02df723decfaa8ef0008a0f2ed4ed21c /gtk | |
parent | 1468c0b25319dafb87c2d49f1d7ba6514a8179f4 (diff) |
As Stephen Fisher noted, the Apply button should also save the changed settings (if the Save button is disabled)
svn path=/trunk/; revision=19418
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/color_dlg.c | 7 | ||||
-rw-r--r-- | gtk/filter_dlg.c | 15 | ||||
-rw-r--r-- | gtk/prefs_dlg.c | 5 | ||||
-rw-r--r-- | gtk/proto_dlg.c | 5 |
4 files changed, 28 insertions, 4 deletions
diff --git a/gtk/color_dlg.c b/gtk/color_dlg.c index af246300f5..9e6c514563 100644 --- a/gtk/color_dlg.c +++ b/gtk/color_dlg.c @@ -1163,6 +1163,13 @@ color_apply_cb(GtkButton *button _U_, gpointer user_data _U_) { color_filters_apply(color_filter_edit_list); + /* if we don't have a Save button, just save the settings now */ + if (!prefs.gui_use_pref_save) { + if (!color_filters_write(color_filter_edit_list)) + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + "Could not open filter file: %s", strerror(errno)); + } + cf_colorize_packets(&cfile); } diff --git a/gtk/filter_dlg.c b/gtk/filter_dlg.c index 91a7e27023..b8d0c99621 100644 --- a/gtk/filter_dlg.c +++ b/gtk/filter_dlg.c @@ -69,8 +69,8 @@ static GtkWidget *filter_dialog_new(GtkWidget *button, GtkWidget *filter_te, construct_args_t *construct_args); static void filter_dlg_dclick(GtkWidget *dummy, gpointer main_w_arg, gpointer activate); -static void filter_dlg_ok_cb(GtkWidget *ok_bt, gpointer dummy); -static void filter_dlg_apply_cb(GtkWidget *apply_bt, gpointer dummy); +static void filter_dlg_ok_cb(GtkWidget *ok_bt, gpointer data); +static void filter_dlg_apply_cb(GtkWidget *apply_bt, gpointer data); static void filter_apply(GtkWidget *main_w, gboolean destroy); static void filter_dlg_save(filter_list_type_t list_type); static void filter_dlg_save_cb(GtkWidget *save_bt, gpointer parent_w); @@ -638,7 +638,7 @@ filter_dialog_new(GtkWidget *button, GtkWidget *parent_filter_te, } apply_bt = OBJECT_GET_DATA(bbox, GTK_STOCK_APPLY); - SIGNAL_CONNECT(apply_bt, "clicked", filter_dlg_apply_cb, NULL); + SIGNAL_CONNECT(apply_bt, "clicked", filter_dlg_apply_cb, filter_list_type_p); gtk_tooltips_set_tip (tooltips, apply_bt, ("Apply the filters and keep this dialog open"), NULL); save_bt = OBJECT_GET_DATA(bbox, GTK_STOCK_SAVE); @@ -798,12 +798,19 @@ filter_dlg_ok_cb(GtkWidget *ok_bt, gpointer data) } static void -filter_dlg_apply_cb(GtkWidget *apply_bt, gpointer dummy _U_) +filter_dlg_apply_cb(GtkWidget *apply_bt, gpointer data) { + filter_list_type_t list_type = *(filter_list_type_t *)data; + /* * Apply the filter, but don't destroy the dialog box. */ filter_apply(gtk_widget_get_toplevel(apply_bt), FALSE); + + /* if we don't have a Save button, just save the settings now */ + if (!prefs.gui_use_pref_save) { + filter_dlg_save(list_type); + } } static void diff --git a/gtk/prefs_dlg.c b/gtk/prefs_dlg.c index aac6961a0c..73e4116005 100644 --- a/gtk/prefs_dlg.c +++ b/gtk/prefs_dlg.c @@ -1312,6 +1312,11 @@ prefs_main_apply_cb(GtkWidget *apply_bt _U_, gpointer parent_w) if (!prefs_main_fetch_all(parent_w, &must_redissect)) return; /* Errors in some preference setting - already reported */ + /* if we don't have a Save button, just save the settings now */ + if (!prefs.gui_use_pref_save) { + prefs_main_write(); + } + prefs_main_apply_all(parent_w); if (must_redissect) { diff --git a/gtk/proto_dlg.c b/gtk/proto_dlg.c index 0647a920db..3e428af699 100644 --- a/gtk/proto_dlg.c +++ b/gtk/proto_dlg.c @@ -457,6 +457,11 @@ proto_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w) static void proto_apply_cb(GtkWidget *apply_bt _U_, gpointer parent_w) { + /* if we don't have a Save button, just save the settings now */ + if (!prefs.gui_use_pref_save) { + proto_write(parent_w); + } + if (set_proto_selection(GTK_WIDGET(parent_w))) cf_redissect_packets(&cfile); } |