1 /* |
|
2 * CDDL HEADER START |
|
3 * |
|
4 * The contents of this file are subject to the terms of the |
|
5 * Common Development and Distribution License (the "License"). |
|
6 * You may not use this file except in compliance with the License. |
|
7 * |
|
8 * You can obtain a copy of the license at src/OPENSOLARIS.LICENSE |
|
9 * or http://www.opensolaris.org/os/licensing. |
|
10 * See the License for the specific language governing permissions |
|
11 * and limitations under the License. |
|
12 * |
|
13 * When distributing Covered Code, include this CDDL HEADER in each |
|
14 * file and include the License file at src/OPENSOLARIS.LICENSE. |
|
15 * If applicable, add the following below this CDDL HEADER, with the |
|
16 * fields enclosed by brackets "[]" replaced with your own identifying |
|
17 * information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 * |
|
19 * CDDL HEADER END |
|
20 */ |
|
21 |
|
22 /* |
|
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. |
|
24 * Use is subject to license terms. |
|
25 */ |
|
26 |
|
27 #ifdef HAVE_CONFIG_H |
|
28 #include "config.h" |
|
29 #endif |
|
30 |
|
31 #include <gtk/gtk.h> |
|
32 #include <gconf/gconf-client.h> |
|
33 #include <libgnome/gnome-i18n.h> |
|
34 #include <libgnome/libgnome.h> |
|
35 #include <string.h> |
|
36 #include "encode.h" |
|
37 #include "fsexam-history.h" |
|
38 #include "fsexam-preference.h" |
|
39 #include "fsexam.h" |
|
40 |
|
41 #define PATH "/apps/fsexam" |
|
42 #define AUTOMATICMODE "/apps/fsexam/auto_mode" |
|
43 #define RECURSIVEMODE "/apps/fsexam/recur_mode" |
|
44 #define ENCODINGLIST "/apps/fsexam/encoding" |
|
45 #define SUFFIXLIST "/apps/fsexam/suffix" |
|
46 |
|
47 #define PREF_AUTO_MODE 0x1 |
|
48 #define PREF_RECUR_MODE 0x2 |
|
49 #define PREF_ENCODING_LIST 0x4 |
|
50 |
|
51 enum { |
|
52 COLUMN_ENCODING_NAME = 0, |
|
53 COLUMN_ENCODING_INDEX, |
|
54 ENCODING_NUM_COLS |
|
55 }; |
|
56 |
|
57 void |
|
58 fsexam_pref_free (FSEXAM_pref *pref) |
|
59 { |
|
60 destroy_encode (pref->encode_list); |
|
61 g_free (pref); |
|
62 } |
|
63 |
|
64 static GtkTreeModel * |
|
65 create_encodings_treeview_model (FSEXAM_pref *pref) |
|
66 { |
|
67 GtkListStore *store; |
|
68 GtkTreeIter iter; |
|
69 GList *list = pref->encode_list; |
|
70 gint i = 0; |
|
71 |
|
72 store = gtk_list_store_new (ENCODING_NUM_COLS, |
|
73 G_TYPE_STRING, |
|
74 G_TYPE_INT); |
|
75 |
|
76 while (list) |
|
77 { |
|
78 Encoding *en = (Encoding *)list->data; |
|
79 |
|
80 gtk_list_store_append (store, &iter); |
|
81 gtk_list_store_set (store, &iter, |
|
82 COLUMN_ENCODING_NAME, en->codename, |
|
83 COLUMN_ENCODING_INDEX, i, |
|
84 -1); |
|
85 ++i; |
|
86 list = g_list_next (list); |
|
87 } |
|
88 |
|
89 return GTK_TREE_MODEL (store); |
|
90 } |
|
91 |
|
92 static gboolean |
|
93 set_button_sensitive (GtkTreeView *treeview, |
|
94 gpointer user_data) |
|
95 { |
|
96 FSEXAM_pref *pref = view->pref; |
|
97 GtkTreeSelection *selection; |
|
98 GtkTreeModel *model; |
|
99 GtkTreeIter iter; |
|
100 gint num_encode_list = g_list_length (pref->encode_list); |
|
101 |
|
102 if (num_encode_list == 1) return TRUE; |
|
103 |
|
104 selection = gtk_tree_view_get_selection (treeview); |
|
105 if (gtk_tree_selection_get_selected (selection, &model, &iter)) |
|
106 { |
|
107 gint index; |
|
108 |
|
109 gtk_tree_model_get (model, &iter, COLUMN_ENCODING_INDEX, &index, -1); |
|
110 |
|
111 if (index == 0) |
|
112 { |
|
113 gtk_widget_set_sensitive (pref->up_button, FALSE); |
|
114 gtk_widget_set_sensitive (pref->down_button, TRUE); |
|
115 } |
|
116 else if (index == num_encode_list - 1) |
|
117 { |
|
118 gtk_widget_set_sensitive (pref->up_button, TRUE); |
|
119 gtk_widget_set_sensitive (pref->down_button, FALSE); |
|
120 } |
|
121 else |
|
122 { |
|
123 gtk_widget_set_sensitive (pref->up_button, TRUE); |
|
124 gtk_widget_set_sensitive (pref->down_button, TRUE); |
|
125 } |
|
126 } |
|
127 |
|
128 return TRUE; |
|
129 } |
|
130 |
|
131 static GtkWidget * |
|
132 create_encodings_treeview (FSEXAM_pref *pref) |
|
133 { |
|
134 GtkTreeModel *model; |
|
135 GtkWidget *encode_view; |
|
136 GtkCellRenderer *renderer; |
|
137 GtkTreeViewColumn *column; |
|
138 |
|
139 model = create_encodings_treeview_model (pref); |
|
140 encode_view = gtk_tree_view_new_with_model (model); |
|
141 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (encode_view), FALSE); |
|
142 gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (encode_view)), |
|
143 GTK_SELECTION_SINGLE); |
|
144 renderer = gtk_cell_renderer_text_new (); |
|
145 |
|
146 column = gtk_tree_view_column_new_with_attributes (NULL, |
|
147 renderer, |
|
148 "text", |
|
149 COLUMN_ENCODING_NAME, |
|
150 NULL); |
|
151 gtk_tree_view_append_column (GTK_TREE_VIEW (encode_view), |
|
152 column); |
|
153 gtk_tree_view_set_search_column (GTK_TREE_VIEW (encode_view), |
|
154 COLUMN_ENCODING_NAME); |
|
155 |
|
156 return encode_view; |
|
157 } |
|
158 |
|
159 static gint |
|
160 compEncodeList (gconstpointer a, |
|
161 gconstpointer b, |
|
162 gpointer user_data) |
|
163 { |
|
164 gchar *aText = ((Encoding *)a)->codename; |
|
165 gchar *bText = ((Encoding *)b)->codename; |
|
166 GSList *slist = (GSList *)user_data; |
|
167 gint ai = 0, bi = 0, i = 0; |
|
168 |
|
169 while (slist) |
|
170 { |
|
171 if (!strcmp ((gchar *)slist->data, aText)) ai = i; |
|
172 else if (!strcmp ((gchar *)slist->data, bText)) bi = i; |
|
173 |
|
174 ++i; |
|
175 slist = g_slist_next (slist); |
|
176 } |
|
177 |
|
178 return (ai - bi); |
|
179 } |
|
180 |
|
181 static void |
|
182 fsexam_pref_encoding_sync (FSEXAM_pref *pref, GSList *slist) |
|
183 { |
|
184 pref->encode_list = g_list_sort_with_data (pref->encode_list, compEncodeList, slist); |
|
185 } |
|
186 |
|
187 static GSList * |
|
188 adjust_encoding_set (GtkTreeModel *model) |
|
189 { |
|
190 GtkTreeIter iter; |
|
191 gchar *codename; |
|
192 GSList *list = NULL; |
|
193 |
|
194 gtk_tree_model_get_iter_first (model, &iter); |
|
195 |
|
196 do |
|
197 { |
|
198 gtk_tree_model_get (model, &iter, |
|
199 COLUMN_ENCODING_NAME, &codename, |
|
200 -1); |
|
201 list = g_slist_append (list, (gpointer)codename); |
|
202 } |
|
203 while (gtk_tree_model_iter_next (model, &iter)); |
|
204 |
|
205 return list; |
|
206 } |
|
207 |
|
208 static void |
|
209 fsexam_tree_iter_swap (GtkTreeModel *model, GtkTreeIter a, GtkTreeIter b) |
|
210 { |
|
211 gchar *aText, *bText; |
|
212 |
|
213 gtk_tree_model_get (model, &a, |
|
214 COLUMN_ENCODING_NAME, &aText, |
|
215 -1); |
|
216 |
|
217 gtk_tree_model_get (model, &b, |
|
218 COLUMN_ENCODING_NAME, &bText, |
|
219 -1); |
|
220 |
|
221 gtk_list_store_set (GTK_LIST_STORE (model), &a, |
|
222 COLUMN_ENCODING_NAME, bText, |
|
223 -1); |
|
224 gtk_list_store_set (GTK_LIST_STORE (model), &b, |
|
225 COLUMN_ENCODING_NAME, aText, |
|
226 -1); |
|
227 |
|
228 g_free (aText); g_free (bText); |
|
229 } |
|
230 |
|
231 static void |
|
232 fsexam_pref_set (GtkWidget *button, |
|
233 gpointer user_data) |
|
234 { |
|
235 FSEXAM_pref *pref = (FSEXAM_pref *)user_data; |
|
236 GtkTreeSelection *selection; |
|
237 gint num_encode_list = g_list_length (pref->encode_list); |
|
238 |
|
239 if (GTK_BUTTON (button) == GTK_BUTTON (pref->recur_button)) |
|
240 { |
|
241 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button))) |
|
242 pref->recur_mode = TRUE; |
|
243 else |
|
244 pref->recur_mode = FALSE; |
|
245 |
|
246 pref->changed |= PREF_RECUR_MODE; |
|
247 } |
|
248 else if (GTK_BUTTON (button) == GTK_BUTTON (pref->auto_button)) |
|
249 { |
|
250 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button))) |
|
251 pref->auto_mode = TRUE; |
|
252 else |
|
253 pref->auto_mode = FALSE; |
|
254 |
|
255 pref->changed |= PREF_AUTO_MODE; |
|
256 } |
|
257 else if (GTK_BUTTON (button) == GTK_BUTTON (pref->up_button)) |
|
258 { |
|
259 GtkTreeModel *model; |
|
260 GtkTreeIter iter, prev; |
|
261 |
|
262 selection = gtk_tree_view_get_selection ((GtkTreeView *) pref->encode_view); |
|
263 |
|
264 if (gtk_tree_selection_get_selected (selection, &model, &iter)) |
|
265 { |
|
266 gint index; |
|
267 |
|
268 gtk_tree_model_get (model, &iter, COLUMN_ENCODING_INDEX, &index, -1); |
|
269 if (index) |
|
270 { |
|
271 gchar *path; |
|
272 |
|
273 if (index == num_encode_list - 1) |
|
274 gtk_widget_set_sensitive (pref->down_button, TRUE); |
|
275 |
|
276 path = gtk_tree_path_to_string (gtk_tree_path_new_from_indices (--index, -1)); |
|
277 gtk_tree_model_get_iter_from_string (model, &prev, path); |
|
278 gtk_tree_selection_select_iter (selection, &prev); |
|
279 |
|
280 fsexam_tree_iter_swap (model, iter, prev); |
|
281 |
|
282 if (index == 0) |
|
283 gtk_widget_set_sensitive (button, FALSE); |
|
284 |
|
285 g_free (path); |
|
286 } |
|
287 } |
|
288 |
|
289 pref->changed |= PREF_ENCODING_LIST; |
|
290 } |
|
291 else if (GTK_BUTTON (button) == GTK_BUTTON (pref->down_button)) |
|
292 { |
|
293 GtkTreeModel *model; |
|
294 GtkTreeIter iter, next; |
|
295 |
|
296 selection = gtk_tree_view_get_selection ((GtkTreeView *) pref->encode_view); |
|
297 |
|
298 if (gtk_tree_selection_get_selected (selection, &model, &iter)) |
|
299 { |
|
300 gint index; |
|
301 |
|
302 gtk_tree_model_get (model, &iter, COLUMN_ENCODING_INDEX, &index, -1); |
|
303 if (index < num_encode_list - 1) |
|
304 { |
|
305 gchar *path; |
|
306 |
|
307 if (index == 0) |
|
308 gtk_widget_set_sensitive (pref->up_button, TRUE); |
|
309 |
|
310 path = gtk_tree_path_to_string (gtk_tree_path_new_from_indices (++index, -1)); |
|
311 gtk_tree_model_get_iter_from_string (model, &next, path); |
|
312 gtk_tree_selection_select_iter (selection, &next); |
|
313 |
|
314 fsexam_tree_iter_swap (model, iter, next); |
|
315 |
|
316 if (index == num_encode_list - 1) |
|
317 gtk_widget_set_sensitive (button, FALSE); |
|
318 |
|
319 g_free (path); |
|
320 } |
|
321 |
|
322 pref->changed |= PREF_ENCODING_LIST; |
|
323 } |
|
324 } |
|
325 else if (GTK_BUTTON (button) == GTK_BUTTON (pref->add_button)) |
|
326 { |
|
327 // FIXME |
|
328 } |
|
329 else if (GTK_BUTTON (button) == GTK_BUTTON (pref->del_button)) |
|
330 { |
|
331 // FIXME |
|
332 } |
|
333 } |
|
334 |
|
335 FSEXAM_pref * |
|
336 create_fsexam_pref () |
|
337 { |
|
338 FSEXAM_pref *pref; |
|
339 GSList *encode_text; |
|
340 |
|
341 pref = g_new0 (FSEXAM_pref, 1); |
|
342 |
|
343 pref->client = gconf_client_get_default (); |
|
344 pref->recur_mode = gconf_client_get_bool (pref->client, |
|
345 RECURSIVEMODE, |
|
346 NULL); |
|
347 pref->auto_mode = gconf_client_get_bool (pref->client, |
|
348 AUTOMATICMODE, |
|
349 NULL); |
|
350 pref->suffix_list = (GSList *)gconf_client_get_list (pref->client, |
|
351 SUFFIXLIST, |
|
352 GCONF_VALUE_STRING, |
|
353 NULL); |
|
354 encode_text = (GSList *)gconf_client_get_list (pref->client, |
|
355 ENCODINGLIST, |
|
356 GCONF_VALUE_STRING, |
|
357 NULL); |
|
358 pref->encode_list = init_encode (encode_text); |
|
359 |
|
360 g_slist_free (encode_text); |
|
361 |
|
362 return pref; |
|
363 } |
|
364 |
|
365 static void |
|
366 show_help () |
|
367 { |
|
368 GError *err = NULL; |
|
369 |
|
370 gnome_help_display ("fsexam.xml", "fsexam-prefs", &err); |
|
371 |
|
372 if (err) |
|
373 { |
|
374 GtkWidget *dialog; |
|
375 |
|
376 dialog = gtk_message_dialog_new (GTK_WINDOW (view->mainwin), |
|
377 GTK_DIALOG_DESTROY_WITH_PARENT, |
|
378 GTK_MESSAGE_ERROR, |
|
379 GTK_BUTTONS_CLOSE, |
|
380 _("There was an error displaying help: %s"), |
|
381 err->message); |
|
382 |
|
383 gtk_dialog_run (GTK_DIALOG (dialog)); |
|
384 |
|
385 gtk_widget_destroy (dialog); |
|
386 |
|
387 g_error_free (err); |
|
388 } |
|
389 } |
|
390 |
|
391 void |
|
392 create_pref_dialog (gpointer data, |
|
393 gpointer action, |
|
394 GtkWidget *widget) |
|
395 { |
|
396 FSEXAM_pref *pref = view->pref; |
|
397 GtkWidget *dialog; |
|
398 GtkWidget *hbox; |
|
399 GtkWidget *table; |
|
400 GtkWidget *label; |
|
401 GtkWidget *button; |
|
402 gchar *markup; |
|
403 gint response; |
|
404 gint num_encode_list = g_list_length (pref->encode_list); |
|
405 |
|
406 dialog = gtk_dialog_new_with_buttons (_("File System Examiner preferences"), |
|
407 GTK_WINDOW (view->mainwin), |
|
408 GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, |
|
409 NULL); |
|
410 |
|
411 hbox = gtk_hbox_new ( FALSE, 8); |
|
412 gtk_container_set_border_width (GTK_CONTAINER (hbox), 8); |
|
413 gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dialog)->vbox), |
|
414 hbox, |
|
415 FALSE, |
|
416 FALSE, |
|
417 0); |
|
418 |
|
419 table = gtk_table_new (1, 4, FALSE); |
|
420 gtk_table_set_row_spacings (GTK_TABLE (table), 4); |
|
421 gtk_table_set_col_spacings (GTK_TABLE (table), 4); |
|
422 gtk_box_pack_start (GTK_BOX (hbox), table, TRUE, TRUE, 0); |
|
423 |
|
424 label = gtk_label_new (NULL); |
|
425 markup = g_strdup_printf ("<b>%s</b>", _("Sub-folder:")); |
|
426 gtk_label_set_markup (GTK_LABEL (label), markup); |
|
427 g_free (markup); |
|
428 gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); |
|
429 gtk_table_attach_defaults (GTK_TABLE (table), |
|
430 label, |
|
431 0, 1, 0, 1); |
|
432 |
|
433 pref->recur_button = gtk_check_button_new_with_mnemonic (_("_Recursive Mode")); |
|
434 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pref->recur_button), |
|
435 pref->recur_mode); |
|
436 g_signal_connect (G_OBJECT (pref->recur_button), |
|
437 "toggled", |
|
438 G_CALLBACK (fsexam_pref_set), |
|
439 pref); |
|
440 gtk_table_attach_defaults (GTK_TABLE (table), |
|
441 pref->recur_button, |
|
442 0, 1, 1, 2); |
|
443 |
|
444 label = gtk_label_new (NULL); |
|
445 markup = g_strdup_printf ("<b>%s</b>", _("User intervention:")); |
|
446 gtk_label_set_markup (GTK_LABEL (label), markup); |
|
447 g_free (markup); |
|
448 gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); |
|
449 gtk_table_attach_defaults (GTK_TABLE (table), |
|
450 label, |
|
451 0, 1, 2, 3); |
|
452 |
|
453 pref->auto_button = gtk_check_button_new_with_mnemonic (_("_Automatic Conversion")); |
|
454 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pref->auto_button), |
|
455 pref->auto_mode); |
|
456 g_signal_connect (G_OBJECT (pref->auto_button), |
|
457 "toggled", |
|
458 G_CALLBACK (fsexam_pref_set), |
|
459 pref); |
|
460 gtk_table_attach_defaults (GTK_TABLE (table), |
|
461 pref->auto_button, |
|
462 0, 1, 3, 4); |
|
463 |
|
464 table = gtk_table_new (1, 2, FALSE); |
|
465 gtk_table_set_row_spacings (GTK_TABLE (table), 4); |
|
466 gtk_table_set_col_spacings (GTK_TABLE (table), 4); |
|
467 gtk_box_pack_start (GTK_BOX (hbox), table, TRUE, TRUE, 0); |
|
468 |
|
469 label = gtk_label_new (NULL); |
|
470 markup = g_strdup_printf ("<b>%s</b>", _("Encode list:")); |
|
471 gtk_label_set_markup (GTK_LABEL (label), markup); |
|
472 g_free (markup); |
|
473 gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); |
|
474 |
|
475 gtk_table_attach (GTK_TABLE (table), |
|
476 label, |
|
477 0, 1, 0, 1, |
|
478 GTK_EXPAND | GTK_FILL, 0, |
|
479 0, 0); |
|
480 |
|
481 pref->encode_view = create_encodings_treeview (pref); |
|
482 g_signal_connect (G_OBJECT (pref->encode_view), |
|
483 "cursor-changed", |
|
484 G_CALLBACK (set_button_sensitive), |
|
485 NULL); |
|
486 gtk_table_attach_defaults (GTK_TABLE (table), |
|
487 pref->encode_view, |
|
488 0, 1, 1, 2); |
|
489 |
|
490 table = gtk_table_new (4, 1, FALSE); |
|
491 gtk_table_set_row_spacings (GTK_TABLE (table), 4); |
|
492 gtk_table_set_col_spacings (GTK_TABLE (table), 4); |
|
493 gtk_box_pack_start (GTK_BOX (hbox), table, TRUE, TRUE, 0); |
|
494 |
|
495 pref->add_button = gtk_button_new_from_stock (GTK_STOCK_ADD); |
|
496 gtk_table_attach_defaults (GTK_TABLE (table), |
|
497 pref->add_button, |
|
498 0, 1, 0, 1); |
|
499 g_signal_connect (G_OBJECT (pref->add_button), |
|
500 "clicked", |
|
501 G_CALLBACK (fsexam_pref_set), |
|
502 view->pref); |
|
503 |
|
504 view->pref->del_button = gtk_button_new_from_stock (GTK_STOCK_DELETE); |
|
505 gtk_table_attach_defaults (GTK_TABLE (table), |
|
506 pref->del_button, |
|
507 0, 1, 1, 2); |
|
508 g_signal_connect (G_OBJECT (pref->del_button), |
|
509 "clicked", |
|
510 G_CALLBACK (fsexam_pref_set), |
|
511 pref); |
|
512 |
|
513 pref->up_button = gtk_button_new_from_stock (GTK_STOCK_GO_UP); |
|
514 gtk_table_attach_defaults (GTK_TABLE (table), |
|
515 pref->up_button, |
|
516 0, 1, 2, 3); |
|
517 g_signal_connect (G_OBJECT (pref->up_button), |
|
518 "clicked", |
|
519 G_CALLBACK (fsexam_pref_set), |
|
520 pref); |
|
521 |
|
522 if (num_encode_list == 1) |
|
523 gtk_widget_set_sensitive (pref->up_button, FALSE); |
|
524 |
|
525 pref->down_button = gtk_button_new_from_stock (GTK_STOCK_GO_DOWN); |
|
526 gtk_table_attach_defaults (GTK_TABLE (table), |
|
527 pref->down_button, |
|
528 0, 1, 3, 4); |
|
529 g_signal_connect (G_OBJECT (pref->down_button), |
|
530 "clicked", |
|
531 G_CALLBACK (fsexam_pref_set), |
|
532 pref); |
|
533 |
|
534 if (num_encode_list == 1) |
|
535 gtk_widget_set_sensitive (pref->down_button, FALSE); |
|
536 |
|
537 gtk_button_box_set_layout (GTK_BUTTON_BOX (GTK_DIALOG (dialog)->action_area), |
|
538 GTK_BUTTONBOX_EDGE); |
|
539 |
|
540 button = gtk_button_new_from_stock (GTK_STOCK_HELP); |
|
541 gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), |
|
542 button, TRUE, FALSE, 0); |
|
543 g_signal_connect (G_OBJECT (button), |
|
544 "clicked", |
|
545 G_CALLBACK (show_help), |
|
546 NULL); |
|
547 gtk_widget_show (button); |
|
548 |
|
549 gtk_dialog_add_button (GTK_DIALOG (dialog), |
|
550 GTK_STOCK_CLOSE, |
|
551 GTK_RESPONSE_CLOSE); |
|
552 |
|
553 gtk_widget_show_all (hbox); |
|
554 |
|
555 // FIXME |
|
556 gtk_widget_hide (pref->add_button); |
|
557 gtk_widget_hide (pref->del_button); |
|
558 |
|
559 response = gtk_dialog_run (GTK_DIALOG (dialog)); |
|
560 |
|
561 if (response == GTK_RESPONSE_CLOSE) |
|
562 { |
|
563 if (pref->changed & PREF_ENCODING_LIST) |
|
564 { |
|
565 GSList *slist; |
|
566 |
|
567 slist = adjust_encoding_set (gtk_tree_view_get_model (GTK_TREE_VIEW (pref->encode_view))); |
|
568 |
|
569 gconf_client_set_list (pref->client, |
|
570 ENCODINGLIST, |
|
571 GCONF_VALUE_STRING, |
|
572 slist, |
|
573 NULL); |
|
574 |
|
575 fsexam_pref_encoding_sync (pref, slist); |
|
576 |
|
577 g_slist_free (slist); |
|
578 } |
|
579 |
|
580 if (pref->changed & PREF_AUTO_MODE) |
|
581 gconf_client_set_bool (pref->client, |
|
582 AUTOMATICMODE, |
|
583 pref->auto_mode, |
|
584 NULL); |
|
585 |
|
586 if (pref->changed & PREF_RECUR_MODE) |
|
587 gconf_client_set_bool (pref->client, |
|
588 RECURSIVEMODE, |
|
589 pref->recur_mode, |
|
590 NULL); |
|
591 } |
|
592 |
|
593 pref->changed = 0x0; |
|
594 gtk_widget_destroy (dialog); |
|
595 } |
|