Save the changes also when selecting a profile from the list.
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 14 Jan 2008 21:58:45 +0000 (21:58 +0000)
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 14 Jan 2008 21:58:45 +0000 (21:58 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24092 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/profile_dlg.c

index 5556dc2f26ee54e79f4890881ba9af46402b7249..f0d303c3098ced1bf25277d87c8a209fdd19f828 100644 (file)
@@ -246,23 +246,7 @@ profile_select(GtkWidget *main_w, GtkTreeView *profile_l, gboolean destroy)
 }
 
 static void
-profile_dlg_select(GtkTreeView *profile_l, gpointer main_w_arg)
-{
-  GtkWidget *main_w = GTK_WIDGET(main_w_arg);
-
-  profile_select(main_w, profile_l, TRUE);
-}
-
-static void
-profile_apply(GtkWidget *main_w, gboolean destroy)
-{
-  GtkTreeView  *profile_l = GTK_TREE_VIEW(OBJECT_GET_DATA(main_w, E_PROF_PROFILE_L_KEY));
-
-  profile_select(main_w, profile_l, destroy);
-}
-
-static void
-profile_dlg_save(void)
+profile_save(void)
 {
   char        *pf_dir_path, *pf_dir_path2;
   GList       *fl1, *fl2;
@@ -335,12 +319,28 @@ profile_dlg_save(void)
 }
 
 static void
-profile_dlg_ok_cb(GtkWidget *ok_bt, gpointer data _U_)
+profile_dlg_select(GtkTreeView *profile_l, gpointer main_w_arg)
 {
-  profile_dlg_save();
+  GtkWidget *main_w = GTK_WIDGET(main_w_arg);
+
+  profile_save();
+  profile_select(main_w, profile_l, TRUE);
+}
 
+static void
+profile_apply(GtkWidget *main_w, gboolean destroy)
+{
+  GtkTreeView  *profile_l = GTK_TREE_VIEW(OBJECT_GET_DATA(main_w, E_PROF_PROFILE_L_KEY));
+
+  profile_save();
+  profile_select(main_w, profile_l, destroy);
+}
+
+static void
+profile_dlg_ok_cb(GtkWidget *ok_bt, gpointer data _U_)
+{
   /*
-   * Destroy the dialog box and apply the profile.
+   * Apply the profile and destroy the dialog box.
    */
   profile_apply(gtk_widget_get_toplevel(ok_bt), TRUE);
 }
@@ -348,8 +348,6 @@ profile_dlg_ok_cb(GtkWidget *ok_bt, gpointer data _U_)
 static void
 profile_dlg_apply_cb(GtkWidget *apply_bt, gpointer data _U_)
 {
-  profile_dlg_save();
-
   /*
    * Apply the profile, but don't destroy the dialog box.
    */