1 | #include "tasklist_applet.h" |
---|
2 | |
---|
3 | gboolean |
---|
4 | tasklist_write_config (GtkWidget *w, const gchar *privcfgpath, const gchar *globcfgpath, gpointer data) |
---|
5 | { |
---|
6 | Tasklist *tasklist = (Tasklist *) data; |
---|
7 | |
---|
8 | gnome_config_push_prefix (privcfgpath |
---|
9 | ? privcfgpath |
---|
10 | : APPLET_WIDGET (tasklist->applet)->privcfgpath); |
---|
11 | |
---|
12 | gnome_config_set_bool ("tasklist/follow_panel_size", tasklist->config.follow_panel_size); |
---|
13 | gnome_config_set_bool ("tasklist/horz_fixed", tasklist->config.horz_fixed); |
---|
14 | gnome_config_set_bool ("tasklist/horz_never_push", tasklist->config.horz_never_push); |
---|
15 | gnome_config_set_int ("tasklist/horz_width", tasklist->config.horz_width); |
---|
16 | gnome_config_set_int ("tasklist/horz_rows", tasklist->config.horz_rows); |
---|
17 | gnome_config_set_int ("tasklist/horz_taskwidth", tasklist->config.horz_taskwidth); |
---|
18 | gnome_config_set_bool ("tasklist/vert_fixed", tasklist->config.vert_fixed); |
---|
19 | gnome_config_set_int ("tasklist/vert_height", tasklist->config.vert_height); |
---|
20 | gnome_config_set_bool ("tasklist/vert_never_push", tasklist->config.vert_never_push); |
---|
21 | gnome_config_set_int ("tasklist/vert_width", tasklist->config.vert_width); |
---|
22 | gnome_config_set_int ("tasklist/vert_width_full", tasklist->config.vert_width_full); |
---|
23 | gnome_config_set_bool ("tasklist/show_mini_icons", tasklist->config.show_mini_icons); |
---|
24 | gnome_config_set_bool ("tasklist/show_normal", tasklist->config.show_normal); |
---|
25 | gnome_config_set_bool ("tasklist/show_minimized", tasklist->config.show_minimized); |
---|
26 | gnome_config_set_bool ("tasklist/all_desks_normal", tasklist->config.all_desks_normal); |
---|
27 | gnome_config_set_bool ("tasklist/all_desks_minimized", tasklist->config.all_desks_minimized); |
---|
28 | gnome_config_set_bool ("tasklist/confirm_before_kill", tasklist->config.confirm_before_kill); |
---|
29 | gnome_config_set_bool ("tasklist/move_to_current", tasklist->config.move_to_current); |
---|
30 | gnome_config_set_bool ("tasklist/enable_grouping", tasklist->config.enable_grouping); |
---|
31 | gnome_config_set_int ("tasklist/grouping_min", tasklist->config.grouping_min); |
---|
32 | gnome_config_set_bool ("tasklist/enable_tooltips", tasklist->config.enable_tooltips); |
---|
33 | gnome_config_set_bool ("tasklist/sunken", tasklist->config.sunken); |
---|
34 | |
---|
35 | gnome_config_sync (); |
---|
36 | |
---|
37 | gnome_config_pop_prefix (); |
---|
38 | return FALSE; |
---|
39 | } |
---|
40 | |
---|
41 | void |
---|
42 | tasklist_read_config (Tasklist *tasklist) |
---|
43 | { |
---|
44 | gnome_config_push_prefix (APPLET_WIDGET (tasklist->applet)->privcfgpath); |
---|
45 | |
---|
46 | tasklist->config.follow_panel_size = gnome_config_get_bool ("tasklist/follow_panel_size=true"); |
---|
47 | |
---|
48 | tasklist->config.horz_fixed = gnome_config_get_bool ("tasklist/horz_fixed=true"); |
---|
49 | /* if the screen is not too wide, make it default to 300 */ |
---|
50 | if (gdk_screen_width () <= 800) |
---|
51 | tasklist->config.horz_width = gnome_config_get_int ("tasklist/horz_width=300"); |
---|
52 | else |
---|
53 | tasklist->config.horz_width = gnome_config_get_int ("tasklist/horz_width=450"); |
---|
54 | tasklist->config.horz_never_push = gnome_config_get_bool ("tasklist/horz_never_push=false"); |
---|
55 | tasklist->config.horz_rows = gnome_config_get_int ("tasklist/horz_rows=2"); |
---|
56 | tasklist->config.horz_taskwidth = gnome_config_get_int ("tasklist/horz_taskwidth=150"); |
---|
57 | tasklist->config.vert_fixed = gnome_config_get_bool ("tasklist/vert_fixed=true"); |
---|
58 | tasklist->config.vert_never_push = gnome_config_get_bool ("tasklist/vert_never_push=false"); |
---|
59 | tasklist->config.vert_width = gnome_config_get_int ("tasklist/vert_width=48"); |
---|
60 | tasklist->config.vert_width_full = gnome_config_get_bool ("tasklist/vert_width_full=false"); |
---|
61 | tasklist->config.vert_height = gnome_config_get_int ("tasklist/vert_height=300"); |
---|
62 | |
---|
63 | tasklist->config.confirm_before_kill = gnome_config_get_bool ("tasklist/confirm_before_kill=true"); |
---|
64 | |
---|
65 | tasklist->config.show_mini_icons = gnome_config_get_bool ("tasklist/show_mini_icons=true"); |
---|
66 | tasklist->config.show_normal = gnome_config_get_bool ("tasklist/show_normal=true"); |
---|
67 | tasklist->config.show_minimized = gnome_config_get_bool ("tasklist/show_minimized=true"); |
---|
68 | tasklist->config.all_desks_normal = gnome_config_get_bool ("tasklist/all_desks_normal=false"); |
---|
69 | tasklist->config.all_desks_minimized = gnome_config_get_bool ("tasklist/all_desks_minimized=false"); |
---|
70 | tasklist->config.move_to_current = gnome_config_get_bool ("tasklist/move_to_current=false"); |
---|
71 | tasklist->config.sunken = gnome_config_get_bool ("tasklist/sunken=false"); |
---|
72 | |
---|
73 | tasklist->config.enable_grouping = gnome_config_get_bool ("tasklist/enable_grouping=true"); |
---|
74 | tasklist->config.grouping_min = gnome_config_get_int ("tasklist/grouping_min=3"); |
---|
75 | tasklist->config.enable_tooltips = gnome_config_get_bool ("tasklist/enable_tooltips=true"); |
---|
76 | |
---|
77 | gnome_config_pop_prefix (); |
---|
78 | } |
---|
79 | |
---|
80 | |
---|