Wed, 01 Jan 2014 11:01:34 +0530
Merged default branch
|
14620
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14461
diff
changeset
|
1 | /** |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14461
diff
changeset
|
2 | * @file gntprefs.c GNT Preferences API |
|
16255
fa61ee19f526
Rename the Doxygen group from gntui to finch and define the finch group
Richard Laager <rlaager@pidgin.im>
parents:
15931
diff
changeset
|
3 | * @ingroup finch |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
4 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
5 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
6 | /* finch |
|
14620
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14461
diff
changeset
|
7 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15906
diff
changeset
|
8 | * Finch is the legal property of its developers, whose names are too numerous |
|
14620
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14461
diff
changeset
|
9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14461
diff
changeset
|
10 | * source distribution. |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14461
diff
changeset
|
11 | * |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14461
diff
changeset
|
12 | * This program is free software; you can redistribute it and/or modify |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14461
diff
changeset
|
13 | * it under the terms of the GNU General Public License as published by |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14461
diff
changeset
|
14 | * the Free Software Foundation; either version 2 of the License, or |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14461
diff
changeset
|
15 | * (at your option) any later version. |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14461
diff
changeset
|
16 | * |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14461
diff
changeset
|
17 | * This program is distributed in the hope that it will be useful, |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14461
diff
changeset
|
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14461
diff
changeset
|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14461
diff
changeset
|
20 | * GNU General Public License for more details. |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14461
diff
changeset
|
21 | * |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14461
diff
changeset
|
22 | * You should have received a copy of the GNU General Public License |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14461
diff
changeset
|
23 | * along with this program; if not, write to the Free Software |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18561
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
14620
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14461
diff
changeset
|
25 | */ |
|
18273
e61c53184c52
#include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
18190
diff
changeset
|
26 | #include "finch.h" |
|
27829
94b279f7c38c
Don't include an internal header in the public finch headers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22104
diff
changeset
|
27 | #include <internal.h> |
|
18273
e61c53184c52
#include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
18190
diff
changeset
|
28 | |
|
14045
12b8c2bfd3fb
[gaim-migrate @ 16552]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
29 | #include <prefs.h> |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
30 | #include <savedstatuses.h> |
|
14045
12b8c2bfd3fb
[gaim-migrate @ 16552]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
31 | |
|
12b8c2bfd3fb
[gaim-migrate @ 16552]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
32 | #include "gntprefs.h" |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
33 | #include "gntrequest.h" |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
34 | |
|
18400
549820f4725c
If the action-windows are already there, then bring them to front when
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18393
diff
changeset
|
35 | #include "gnt.h" |
|
549820f4725c
If the action-windows are already there, then bring them to front when
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18393
diff
changeset
|
36 | #include "gntwidget.h" |
|
549820f4725c
If the action-windows are already there, then bring them to front when
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18393
diff
changeset
|
37 | |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
38 | #include <string.h> |
|
14045
12b8c2bfd3fb
[gaim-migrate @ 16552]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
39 | |
|
18393
215866b02ccb
Mark some string for translation, and show only one preference window at a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
40 | static struct { |
|
215866b02ccb
Mark some string for translation, and show only one preference window at a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
41 | GList *freestrings; /* strings to be freed when the pref-window is closed */ |
|
215866b02ccb
Mark some string for translation, and show only one preference window at a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
42 | gboolean showing; |
|
18400
549820f4725c
If the action-windows are already there, then bring them to front when
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18393
diff
changeset
|
43 | GntWidget *window; |
|
34191
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
44 | GntWidget *keyring_window; |
|
18393
215866b02ccb
Mark some string for translation, and show only one preference window at a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
45 | } pref_request; |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
46 | |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15820
diff
changeset
|
47 | void finch_prefs_init() |
|
14045
12b8c2bfd3fb
[gaim-migrate @ 16552]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
48 | { |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16383
diff
changeset
|
49 | purple_prefs_add_none("/finch"); |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16383
diff
changeset
|
50 | |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16383
diff
changeset
|
51 | purple_prefs_add_none("/finch/plugins"); |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16383
diff
changeset
|
52 | purple_prefs_add_path_list("/finch/plugins/loaded", NULL); |
|
16999
2d66b5256b1b
I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16629
diff
changeset
|
53 | purple_prefs_add_path_list("/finch/plugins/seen", NULL); |
|
14045
12b8c2bfd3fb
[gaim-migrate @ 16552]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
54 | |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16383
diff
changeset
|
55 | purple_prefs_add_none("/finch/conversations"); |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16383
diff
changeset
|
56 | purple_prefs_add_bool("/finch/conversations/timestamps", TRUE); |
|
16629
781a662d1fc3
Pref migration for finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
57 | purple_prefs_add_bool("/finch/conversations/notify_typing", FALSE); |
|
18561
e48a272d383c
Remember the open/save file locations.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18400
diff
changeset
|
58 | |
|
e48a272d383c
Remember the open/save file locations.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18400
diff
changeset
|
59 | purple_prefs_add_none("/finch/filelocations"); |
|
e48a272d383c
Remember the open/save file locations.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18400
diff
changeset
|
60 | purple_prefs_add_path("/finch/filelocations/last_save_folder", ""); |
|
e48a272d383c
Remember the open/save file locations.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18400
diff
changeset
|
61 | purple_prefs_add_path("/finch/filelocations/last_save_folder", ""); |
|
16629
781a662d1fc3
Pref migration for finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
62 | } |
|
781a662d1fc3
Pref migration for finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
63 | |
|
781a662d1fc3
Pref migration for finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
64 | void finch_prefs_update_old() |
|
781a662d1fc3
Pref migration for finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
65 | { |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
66 | } |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
67 | |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
68 | typedef struct |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
69 | { |
| 15884 | 70 | PurplePrefType type; |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
71 | const char *pref; |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
72 | const char *label; |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
21653
diff
changeset
|
73 | GList *(*lv)(void); /* If the value is to be selected from a number of choices */ |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
74 | } Prefs; |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
75 | |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
76 | static GList * |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
21653
diff
changeset
|
77 | get_log_options(void) |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
78 | { |
| 15884 | 79 | return purple_log_logger_get_options(); |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
80 | } |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
81 | |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
82 | static GList * |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
21653
diff
changeset
|
83 | get_idle_options(void) |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
84 | { |
|
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
85 | GList *list = NULL; |
|
17227
09bc351bfafa
Fix a compiler warning.
Richard Laager <rlaager@pidgin.im>
parents:
17207
diff
changeset
|
86 | list = g_list_append(list, (char *)_("Based on keyboard use")); |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
87 | list = g_list_append(list, "system"); |
|
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
88 | list = g_list_append(list, (char*)_("From last sent message")); |
| 15884 | 89 | list = g_list_append(list, "purple"); |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
90 | list = g_list_append(list, (char*)_("Never")); |
|
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
91 | list = g_list_append(list, "never"); |
|
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
92 | return list; |
|
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
93 | } |
|
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
94 | |
|
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
95 | static GList * |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
21653
diff
changeset
|
96 | get_status_titles(void) |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
97 | { |
|
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
98 | GList *list = NULL; |
|
18190
bcf28ef7e8ff
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@pidgin.im>
parents:
17227
diff
changeset
|
99 | GList *iter; |
| 15884 | 100 | for (iter = purple_savedstatuses_get_all(); iter; iter = iter->next) { |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
101 | char *str; |
| 15884 | 102 | if (purple_savedstatus_is_transient(iter->data)) |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
103 | continue; |
| 15884 | 104 | str = g_strdup_printf("%ld", purple_savedstatus_get_creation_time(iter->data)); |
| 105 | list = g_list_append(list, (char*)purple_savedstatus_get_title(iter->data)); | |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
106 | list = g_list_append(list, str); |
|
18393
215866b02ccb
Mark some string for translation, and show only one preference window at a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
107 | pref_request.freestrings = g_list_prepend(pref_request.freestrings, str); |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
108 | } |
|
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
109 | return list; |
|
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
110 | } |
|
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
111 | |
| 15884 | 112 | static PurpleRequestField * |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
113 | get_pref_field(Prefs *prefs) |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
114 | { |
| 15884 | 115 | PurpleRequestField *field = NULL; |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
116 | |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
117 | if (prefs->lv == NULL) |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
118 | { |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
119 | switch (prefs->type) |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
120 | { |
| 15884 | 121 | case PURPLE_PREF_BOOLEAN: |
| 122 | field = purple_request_field_bool_new(prefs->pref, _(prefs->label), | |
| 123 | purple_prefs_get_bool(prefs->pref)); | |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
124 | break; |
| 15884 | 125 | case PURPLE_PREF_INT: |
| 126 | field = purple_request_field_int_new(prefs->pref, _(prefs->label), | |
|
33935
e740bbb8350c
Request API: fix integer fields, add bounds to them
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31590
diff
changeset
|
127 | purple_prefs_get_int(prefs->pref), INT_MIN, INT_MAX); |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
128 | break; |
| 15884 | 129 | case PURPLE_PREF_STRING: |
| 130 | field = purple_request_field_string_new(prefs->pref, _(prefs->label), | |
| 131 | purple_prefs_get_string(prefs->pref), FALSE); | |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
132 | break; |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
133 | default: |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
134 | break; |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
135 | } |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
136 | } |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
137 | else |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
138 | { |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
139 | GList *list = prefs->lv(), *iter; |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
140 | if (list) |
| 15884 | 141 | field = purple_request_field_list_new(prefs->pref, _(prefs->label)); |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
142 | for (iter = list; iter; iter = iter->next) |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
143 | { |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
144 | gboolean select = FALSE; |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
145 | const char *data = iter->data; |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
146 | int idata; |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
147 | iter = iter->next; |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
148 | switch (prefs->type) |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
149 | { |
| 15884 | 150 | case PURPLE_PREF_BOOLEAN: |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
151 | sscanf(iter->data, "%d", &idata); |
| 15884 | 152 | if (purple_prefs_get_bool(prefs->pref) == idata) |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
153 | select = TRUE; |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
154 | break; |
| 15884 | 155 | case PURPLE_PREF_INT: |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
156 | sscanf(iter->data, "%d", &idata); |
| 15884 | 157 | if (purple_prefs_get_int(prefs->pref) == idata) |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
158 | select = TRUE; |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
159 | break; |
| 15884 | 160 | case PURPLE_PREF_STRING: |
| 161 | if (strcmp(purple_prefs_get_string(prefs->pref), iter->data) == 0) | |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
162 | select = TRUE; |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
163 | break; |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
164 | default: |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
165 | break; |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
166 | } |
|
24900
a19d983918c2
Deprecate purple_request_field_list_add()
Richard Laager <rlaager@pidgin.im>
parents:
22104
diff
changeset
|
167 | purple_request_field_list_add_icon(field, data, NULL, iter->data); |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
168 | if (select) |
| 15884 | 169 | purple_request_field_list_add_selected(field, data); |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
170 | } |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
171 | g_list_free(list); |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
172 | } |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
173 | return field; |
|
14045
12b8c2bfd3fb
[gaim-migrate @ 16552]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
174 | } |
|
12b8c2bfd3fb
[gaim-migrate @ 16552]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
175 | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
29304
diff
changeset
|
176 | static Prefs blist[] = |
|
14127
6c79d410dd9c
[gaim-migrate @ 16686]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
177 | { |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16383
diff
changeset
|
178 | {PURPLE_PREF_BOOLEAN, "/finch/blist/idletime", N_("Show Idle Time"), NULL}, |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16383
diff
changeset
|
179 | {PURPLE_PREF_BOOLEAN, "/finch/blist/showoffline", N_("Show Offline Buddies"), NULL}, |
| 15884 | 180 | {PURPLE_PREF_NONE, NULL, NULL, NULL} |
|
14127
6c79d410dd9c
[gaim-migrate @ 16686]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
181 | }; |
|
6c79d410dd9c
[gaim-migrate @ 16686]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
182 | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
29304
diff
changeset
|
183 | static Prefs convs[] = |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
184 | { |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16383
diff
changeset
|
185 | {PURPLE_PREF_BOOLEAN, "/finch/conversations/timestamps", N_("Show Timestamps"), NULL}, |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16383
diff
changeset
|
186 | {PURPLE_PREF_BOOLEAN, "/finch/conversations/notify_typing", N_("Notify buddies when you are typing"), NULL}, |
| 15884 | 187 | {PURPLE_PREF_NONE, NULL, NULL, NULL} |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
188 | }; |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
189 | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
29304
diff
changeset
|
190 | static Prefs logging[] = |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
191 | { |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16383
diff
changeset
|
192 | {PURPLE_PREF_STRING, "/purple/logging/format", N_("Log format"), get_log_options}, |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16383
diff
changeset
|
193 | {PURPLE_PREF_BOOLEAN, "/purple/logging/log_ims", N_("Log IMs"), NULL}, |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16383
diff
changeset
|
194 | {PURPLE_PREF_BOOLEAN, "/purple/logging/log_chats", N_("Log chats"), NULL}, |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16383
diff
changeset
|
195 | {PURPLE_PREF_BOOLEAN, "/purple/logging/log_system", N_("Log status change events"), NULL}, |
| 15884 | 196 | {PURPLE_PREF_NONE, NULL, NULL, NULL}, |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
197 | }; |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
198 | |
|
33991
0eb45874d73a
Made more calls asynch, enhanced error checking and reporting.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
22104
diff
changeset
|
199 | static Prefs keyring[] = |
|
0eb45874d73a
Made more calls asynch, enhanced error checking and reporting.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
22104
diff
changeset
|
200 | { |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34026
diff
changeset
|
201 | {PURPLE_PREF_STRING, "/purple/keyring/active", N_("Active keyring"), purple_keyring_get_options}, |
|
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34026
diff
changeset
|
202 | {PURPLE_PREF_NONE, NULL, NULL, NULL} |
|
33991
0eb45874d73a
Made more calls asynch, enhanced error checking and reporting.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
22104
diff
changeset
|
203 | }; |
|
0eb45874d73a
Made more calls asynch, enhanced error checking and reporting.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
22104
diff
changeset
|
204 | |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
205 | static Prefs idle[] = |
|
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
206 | { |
|
18393
215866b02ccb
Mark some string for translation, and show only one preference window at a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
207 | {PURPLE_PREF_STRING, "/purple/away/idle_reporting", N_("Report Idle time"), get_idle_options}, |
|
215866b02ccb
Mark some string for translation, and show only one preference window at a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
208 | {PURPLE_PREF_BOOLEAN, "/purple/away/away_when_idle", N_("Change status when idle"), NULL}, |
|
215866b02ccb
Mark some string for translation, and show only one preference window at a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
209 | {PURPLE_PREF_INT, "/purple/away/mins_before_away", N_("Minutes before changing status"), NULL}, |
|
215866b02ccb
Mark some string for translation, and show only one preference window at a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
210 | {PURPLE_PREF_INT, "/purple/savedstatus/idleaway", N_("Change status to"), get_status_titles}, |
| 15884 | 211 | {PURPLE_PREF_NONE, NULL, NULL, NULL}, |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
212 | }; |
|
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
213 | |
|
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
214 | static void |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
21653
diff
changeset
|
215 | free_strings(void) |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
216 | { |
|
18393
215866b02ccb
Mark some string for translation, and show only one preference window at a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
217 | g_list_foreach(pref_request.freestrings, (GFunc)g_free, NULL); |
|
215866b02ccb
Mark some string for translation, and show only one preference window at a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
218 | g_list_free(pref_request.freestrings); |
|
215866b02ccb
Mark some string for translation, and show only one preference window at a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
219 | pref_request.freestrings = NULL; |
|
215866b02ccb
Mark some string for translation, and show only one preference window at a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
220 | pref_request.showing = FALSE; |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
221 | } |
|
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
222 | |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
223 | static void |
| 15884 | 224 | save_cb(void *data, PurpleRequestFields *allfields) |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
225 | { |
|
16383
af8d75120347
Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
226 | finch_request_save_in_prefs(data, allfields); |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
227 | free_strings(); |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
228 | } |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
229 | |
|
14127
6c79d410dd9c
[gaim-migrate @ 16686]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
230 | static void |
| 15884 | 231 | add_pref_group(PurpleRequestFields *fields, const char *title, Prefs *prefs) |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
232 | { |
| 15884 | 233 | PurpleRequestField *field; |
| 234 | PurpleRequestFieldGroup *group; | |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
235 | int i; |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
236 | |
| 15884 | 237 | group = purple_request_field_group_new(title); |
| 238 | purple_request_fields_add_group(fields, group); | |
|
14127
6c79d410dd9c
[gaim-migrate @ 16686]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
239 | for (i = 0; prefs[i].pref; i++) |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
240 | { |
|
14127
6c79d410dd9c
[gaim-migrate @ 16686]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
241 | field = get_pref_field(prefs + i); |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
242 | if (field) |
| 15884 | 243 | purple_request_field_group_add_field(group, field); |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
244 | } |
|
14127
6c79d410dd9c
[gaim-migrate @ 16686]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
245 | } |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
246 | |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15820
diff
changeset
|
247 | void finch_prefs_show_all() |
|
14127
6c79d410dd9c
[gaim-migrate @ 16686]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
248 | { |
| 15884 | 249 | PurpleRequestFields *fields; |
|
14127
6c79d410dd9c
[gaim-migrate @ 16686]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
250 | |
|
18400
549820f4725c
If the action-windows are already there, then bring them to front when
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18393
diff
changeset
|
251 | if (pref_request.showing) { |
|
549820f4725c
If the action-windows are already there, then bring them to front when
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18393
diff
changeset
|
252 | gnt_window_present(pref_request.window); |
|
18393
215866b02ccb
Mark some string for translation, and show only one preference window at a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
253 | return; |
|
18400
549820f4725c
If the action-windows are already there, then bring them to front when
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18393
diff
changeset
|
254 | } |
|
18393
215866b02ccb
Mark some string for translation, and show only one preference window at a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
255 | |
|
34191
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
256 | if (pref_request.keyring_window != NULL) |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
257 | purple_request_close(PURPLE_REQUEST_FIELDS, |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
258 | pref_request.keyring_window); |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
259 | |
| 15884 | 260 | fields = purple_request_fields_new(); |
|
14127
6c79d410dd9c
[gaim-migrate @ 16686]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
261 | |
|
6c79d410dd9c
[gaim-migrate @ 16686]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
262 | add_pref_group(fields, _("Buddy List"), blist); |
|
6c79d410dd9c
[gaim-migrate @ 16686]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
263 | add_pref_group(fields, _("Conversations"), convs); |
|
33991
0eb45874d73a
Made more calls asynch, enhanced error checking and reporting.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
22104
diff
changeset
|
264 | add_pref_group(fields, _("Keyring"), keyring); |
|
14127
6c79d410dd9c
[gaim-migrate @ 16686]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
265 | add_pref_group(fields, _("Logging"), logging); |
|
15820
28b339ab3f4a
Preference for idleness. Someone was looking for this thing.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15387
diff
changeset
|
266 | add_pref_group(fields, _("Idle"), idle); |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
267 | |
|
18393
215866b02ccb
Mark some string for translation, and show only one preference window at a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
268 | pref_request.showing = TRUE; |
|
21653
621c47778132
merge of '73ae9aeda3c58fbf8437421da68d19d06f93e686'
Evan Schoenberg <evands@pidgin.im>
parents:
21233
diff
changeset
|
269 | pref_request.window = purple_request_fields(NULL, _("Preferences"), NULL, NULL, fields, |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16478
diff
changeset
|
270 | _("Save"), G_CALLBACK(save_cb), _("Cancel"), free_strings, |
|
34332
876483829700
Request API refactoring: switch purple_request_fields to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34193
diff
changeset
|
271 | NULL, NULL); |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
272 | } |
|
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14045
diff
changeset
|
273 | |
|
34191
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
274 | static void |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
275 | finch_prefs_keyring_save(void *data, PurpleRequestFields *fields) |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
276 | { |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
277 | pref_request.keyring_window = NULL; |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
278 | |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
279 | purple_keyring_apply_settings(NULL, fields); |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
280 | } |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
281 | |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
282 | static void |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
283 | finch_prefs_keyring_cancel(void) |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
284 | { |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
285 | pref_request.keyring_window = NULL; |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
286 | } |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
287 | |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
288 | void finch_prefs_show_keyring(void) |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
289 | { |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
290 | PurpleRequestFields *fields; |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
291 | |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
292 | if (pref_request.keyring_window != NULL) { |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
293 | gnt_window_present(pref_request.keyring_window); |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
294 | return; |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
295 | } |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
296 | |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
297 | fields = purple_keyring_read_settings(); |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
298 | if (fields == NULL) { |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
299 | purple_notify_info(NULL, _("Keyring settings"), |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
300 | _("Selected keyring doesn't allow any configuration"), |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34332
diff
changeset
|
301 | NULL, NULL); |
|
34191
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
302 | return; |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
303 | } |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
304 | |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
305 | pref_request.keyring_window = purple_request_fields(NULL, |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
306 | _("Keyring settings"), NULL, NULL, fields, |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
307 | _("Save"), G_CALLBACK(finch_prefs_keyring_save), |
|
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
308 | _("Cancel"), G_CALLBACK(finch_prefs_keyring_cancel), |
|
34332
876483829700
Request API refactoring: switch purple_request_fields to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34193
diff
changeset
|
309 | NULL, NULL); |
|
34191
13be8e0a1bd0
Add keyring settings to finch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
310 | } |