Mercurial > pidgin
annotate src/gaimrc.c @ 5864:417b1001d2b1
[gaim-migrate @ 6295]
Rewrote the pounce API again. Now it's even MORE core/UI-split, and will
allow for loading/saving.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sat, 14 Jun 2003 11:14:49 +0000 |
parents | 96e5b32e75ad |
children | d048e5f2af27 |
rev | line source |
---|---|
1 | 1 /* |
2 * gaim | |
3 * | |
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net> | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 * | |
20 */ | |
21 | |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
340
diff
changeset
|
22 #ifdef HAVE_CONFIG_H |
2090
b66aca8e8dce
[gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2036
diff
changeset
|
23 #include <config.h> |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
340
diff
changeset
|
24 #endif |
1 | 25 #include <string.h> |
3630 | 26 |
27 #ifndef _WIN32 | |
1 | 28 #include <sys/time.h> |
3630 | 29 #include <unistd.h> |
30 #endif | |
1 | 31 |
32 #include <sys/types.h> | |
33 #include <sys/stat.h> | |
34 | |
4201
511c2b63caa4
[gaim-migrate @ 4432]
Christian Hammond <chipx86@chipx86.com>
parents:
4189
diff
changeset
|
35 #include <ctype.h> |
1 | 36 #include <stdio.h> |
37 #include <stdlib.h> | |
38 #include "gaim.h" | |
1264
6210d06da99b
[gaim-migrate @ 1274]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1254
diff
changeset
|
39 #include "prpl.h" |
5442 | 40 #include "prefs.h" |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
41 #include "proxy.h" |
4561 | 42 #include "sound.h" |
5684 | 43 #include "gtksound.h" |
5032
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
44 #include "pounce.h" |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
45 #include "gtkpounce.h" |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5422
diff
changeset
|
46 #include "notify.h" |
1 | 47 |
3630 | 48 #ifdef _WIN32 |
49 #include "win32dep.h" | |
50 #endif | |
51 | |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
180
diff
changeset
|
52 /* for people like myself, who are too lazy to add an away msg :) */ |
4596 | 53 #define BORING_DEFAULT_AWAY_MSG _("sorry, i ran out for a while. bbl") |
1139 | 54 #define MAX_VALUES 10 |
1 | 55 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
56 #define OPT_FONT_BOLD 0x00000001 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
57 #define OPT_FONT_ITALIC 0x00000002 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
58 #define OPT_FONT_UNDERLINE 0x00000008 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
59 #define OPT_FONT_STRIKE 0x00000010 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
60 #define OPT_FONT_FACE 0x00000020 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
61 #define OPT_FONT_FGCOL 0x00000040 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
62 #define OPT_FONT_BGCOL 0x00000080 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
63 #define OPT_FONT_SIZE 0x00000100 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
64 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
65 #define OPT_MISC_DEBUG 0x00000001 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
66 #define OPT_MISC_BROWSER_POPUP 0x00000002 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
67 #define OPT_MISC_BUDDY_TICKER 0x00000004 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
68 #define OPT_MISC_STEALTH_TYPING 0x00000010 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
69 #define OPT_MISC_USE_SERVER_ALIAS 0x00000020 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
70 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
71 #define OPT_LOG_CONVOS 0x00000001 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
72 #define OPT_LOG_STRIP_HTML 0x00000002 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
73 #define OPT_LOG_INDIVIDUAL 0x00000040 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
74 #define OPT_LOG_CHATS 0x00000100 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
75 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
76 #define OPT_BLIST_SHOW_GRPNUM 0x00000008 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
77 #define OPT_BLIST_SHOW_PIXMAPS 0x00000010 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
78 #define OPT_BLIST_SHOW_IDLETIME 0x00000020 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
79 #define OPT_BLIST_SHOW_BUTTON_XPM 0x00000040 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
80 #define OPT_BLIST_NO_BUTTON_TEXT 0x00000080 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
81 #define OPT_BLIST_NO_MT_GRP 0x00000100 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
82 #define OPT_BLIST_SHOW_WARN 0x00000200 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
83 #define OPT_BLIST_GREY_IDLERS 0x00000400 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
84 #define OPT_BLIST_POPUP 0x00001000 |
5633 | 85 #define OPT_BLIST_SHOW_ICONS 0x00002000 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
86 #define OPT_BLIST_SHOW_OFFLINE 0x00004000 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
87 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
88 #define OPT_CONVO_ENTER_SENDS 0x00000001 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
89 #define OPT_CONVO_SEND_LINKS 0x00000002 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
90 #define OPT_CONVO_CHECK_SPELLING 0x00000004 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
91 #define OPT_CONVO_CTL_CHARS 0x00000008 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
92 #define OPT_CONVO_CTL_SMILEYS 0x00000010 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
93 #define OPT_CONVO_ESC_CAN_CLOSE 0x00000020 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
94 #define OPT_CONVO_CTL_ENTER 0x00000040 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
95 #define OPT_CONVO_F2_TOGGLES 0x00000080 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
96 #define OPT_CONVO_SHOW_TIME 0x00000100 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
97 #define OPT_CONVO_IGNORE_COLOUR 0x00000200 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
98 #define OPT_CONVO_SHOW_SMILEY 0x00000400 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
99 #define OPT_CONVO_IGNORE_FONTS 0x00000800 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
100 #define OPT_CONVO_IGNORE_SIZES 0x00001000 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
101 #define OPT_CONVO_COMBINE 0x00002000 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
102 #define OPT_CONVO_CTL_W_CLOSES 0x00004000 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
103 #define OPT_CONVO_NO_X_ON_TAB 0x00008000 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
104 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
105 #define OPT_IM_POPUP 0x00000001 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
106 #define OPT_IM_LOGON 0x00000002 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
107 #define OPT_IM_BUTTON_TEXT 0x00000004 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
108 #define OPT_IM_BUTTON_XPM 0x00000008 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
109 #define OPT_IM_ONE_WINDOW 0x00000010 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
110 #define OPT_IM_SIDE_TAB 0x00000020 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
111 #define OPT_IM_BR_TAB 0x00000040 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
112 #define OPT_IM_HIDE_ICONS 0x00000080 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
113 #define OPT_IM_NO_ANIMATION 0x00000100 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
114 #define OPT_IM_ALIAS_TAB 0x00002000 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
115 #define OPT_IM_POPDOWN 0x00004000 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
116 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
117 #define OPT_CHAT_ONE_WINDOW 0x00000001 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
118 #define OPT_CHAT_BUTTON_TEXT 0x00000002 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
119 #define OPT_CHAT_BUTTON_XPM 0x00000004 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
120 #define OPT_CHAT_LOGON 0x00000008 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
121 #define OPT_CHAT_POPUP 0x00000010 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
122 #define OPT_CHAT_SIDE_TAB 0x00000020 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
123 #define OPT_CHAT_BR_TAB 0x00000040 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
124 #define OPT_CHAT_TAB_COMPLETE 0x00000080 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
125 #define OPT_CHAT_OLD_STYLE_TAB 0x00000100 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
126 #define OPT_CHAT_COLORIZE 0x00000200 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
127 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
128 #define OPT_SOUND_LOGIN 0x00000001 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
129 #define OPT_SOUND_LOGOUT 0x00000002 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
130 #define OPT_SOUND_RECV 0x00000004 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
131 #define OPT_SOUND_SEND 0x00000008 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
132 #define OPT_SOUND_FIRST_RCV 0x00000010 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
133 #define OPT_SOUND_WHEN_AWAY 0x00000020 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
134 #define OPT_SOUND_SILENT_SIGNON 0x00000040 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
135 #define OPT_SOUND_THROUGH_GNOME 0x00000080 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
136 #define OPT_SOUND_CHAT_JOIN 0x00000100 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
137 #define OPT_SOUND_CHAT_SAY 0x00000200 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
138 #define OPT_SOUND_BEEP 0x00000400 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
139 #define OPT_SOUND_CHAT_PART 0x00000800 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
140 #define OPT_SOUND_CHAT_YOU_SAY 0x00001000 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
141 #define OPT_SOUND_NORMAL 0x00002000 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
142 #define OPT_SOUND_NAS 0x00004000 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
143 #define OPT_SOUND_ARTS 0x00008000 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
144 #define OPT_SOUND_ESD 0x00010000 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
145 #define OPT_SOUND_CMD 0x00020000 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
146 #define OPT_SOUND_CHAT_NICK 0x00040000 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
147 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
148 #define OPT_AWAY_BACK_ON_IM 0x00000002 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
149 #define OPT_AWAY_AUTO 0x00000008 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
150 #define OPT_AWAY_NO_AUTO_RESP 0x00000010 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
151 #define OPT_AWAY_QUEUE 0x00000020 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
152 #define OPT_AWAY_IDLE_RESP 0x00000040 |
5554
7b36d02031a2
[gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
153 #define OPT_AWAY_QUEUE_UNREAD 0x00000080 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
154 #define OPT_AWAY_DELAY_IN_USE 0x00000100 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
155 |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
156 #define OPT_ACCT_AUTO 0x00000001 |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
157 /*#define OPT_ACCT_KEEPALV 0x00000002 this shouldn't be optional */ |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
158 #define OPT_ACCT_REM_PASS 0x00000004 |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
159 #define OPT_ACCT_MAIL_CHECK 0x00000008 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
160 |
5631 | 161 #define IDLE_NONE 0 |
162 #define IDLE_GAIM 1 | |
163 #define IDLE_SCREENSAVER 2 | |
164 | |
5633 | 165 #define BROWSER_NETSCAPE 0 |
166 #define BROWSER_KONQ 1 | |
167 #define BROWSER_MANUAL 2 | |
168 /*#define BROWSER_INTERNAL 3*/ | |
169 #define BROWSER_GNOME 4 | |
170 #define BROWSER_OPERA 5 | |
171 #define BROWSER_GALEON 6 | |
172 #define BROWSER_MOZILLA 7 | |
173 | |
174 | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
175 static guint misc_options; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
176 static guint logging_options; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
177 static guint blist_options; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
178 static guint convo_options; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
179 static guint im_options; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
180 static guint chat_options; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
181 static guint font_options; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
182 static guint sound_options; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
183 static guint away_options; |
4137 | 184 static guint is_loading_prefs = 0; |
185 static guint request_save_prefs = 0; | |
186 static guint is_saving_prefs = 0; | |
187 static guint request_load_prefs = 0; | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
188 static guint prefs_initial_load = 0; |
4137 | 189 guint proxy_info_is_from_gaimrc = 1; /* Only save proxy info if it |
190 * was loaded from the file | |
191 * or otherwise explicitly requested */ | |
1 | 192 |
193 struct parse { | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
194 char option[256]; |
2286
f00bf9537bb7
[gaim-migrate @ 2296]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
195 char value[MAX_VALUES][4096]; |
1 | 196 }; |
197 | |
5032
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
198 /* |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
199 * This is absolutely necessary, unfortunately. It is used to grab |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
200 * the information on the pounce, so that we can then later register |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
201 * them. The reason we do this (well, one of them) is because the buddy |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
202 * list isn't processed yet. |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
203 * |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
204 * -- ChipX86 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
205 */ |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
206 struct pounce_placeholder |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
207 { |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
208 char name[80]; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
209 char message[2048]; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
210 char command[2048]; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
211 char sound[2048]; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
212 char pouncer[80]; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
213 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
214 int protocol; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
215 int options; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
216 }; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
217 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
218 static GList *buddy_pounces = NULL; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
219 |
3493 | 220 static struct parse *parse_line(char *line, struct parse *p) |
1 | 221 { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
222 char *c = line; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
223 int inopt = 1, inval = 0, curval = -1; |
4137 | 224 int optlen = 0, vallen = 0, last_non_space = 0; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
225 int x; |
1 | 226 |
1137 | 227 for (x = 0; x < MAX_VALUES; x++) { |
3493 | 228 p->value[x][0] = 0; |
1137 | 229 } |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
230 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
231 while (*c) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
232 if (*c == '\t') { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
233 c++; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
234 continue; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
235 } |
5633 | 236 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
237 if (inopt) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
238 if ((*c < 'a' || *c > 'z') && *c != '_' && (*c < 'A' || *c > 'Z')) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
239 inopt = 0; |
3493 | 240 p->option[optlen] = 0; |
1 | 241 c++; |
242 continue; | |
243 } | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
244 |
3493 | 245 p->option[optlen] = *c; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
246 optlen++; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
247 c++; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
248 continue; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
249 } else if (inval) { |
4049 | 250 if (*c == '\\') { |
251 /* if we have a \ take the char after it literally.. */ | |
252 c++; | |
253 p->value[curval][vallen] = *c; | |
254 | |
255 vallen++; | |
4137 | 256 last_non_space = vallen; |
4049 | 257 c++; |
258 continue; | |
259 } else if (*c == '}') { | |
260 /* } that isn't escaped should end this chunk of data, and | |
261 * should have a space before it.. */ | |
4137 | 262 p->value[curval][last_non_space] = 0; |
4049 | 263 inval = 0; |
264 c++; | |
265 continue; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
266 } else { |
3493 | 267 p->value[curval][vallen] = *c; |
4049 | 268 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
269 vallen++; |
5109 | 270 if (isspace(*c)) |
271 last_non_space = vallen - 1; | |
272 else | |
4137 | 273 last_non_space = vallen; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
274 c++; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
275 continue; |
1 | 276 } |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
277 } else if (*c == '{') { |
4049 | 278 /* i really don't think this if ever succeeds, but i'm |
279 * not brave enough to take it out... */ | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
280 if (*(c - 1) == '\\') { |
4137 | 281 p->value[curval][vallen] = *c; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
282 c++; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
283 continue; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
284 } else { |
4049 | 285 /* { that isn't escaped should signify the start of a |
286 * piece of data and should have a space after it.. */ | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
287 curval++; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
288 vallen = 0; |
4137 | 289 last_non_space = vallen; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
290 inval = 1; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
291 c++; |
4137 | 292 while (*c && isspace(*c)) |
293 c++; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
294 continue; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
295 } |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
296 } |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
297 c++; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
298 } |
1137 | 299 |
3493 | 300 return p; |
1 | 301 } |
302 | |
303 | |
304 static int gaimrc_parse_tag(FILE *f) | |
305 { | |
306 char buf[2048]; | |
307 char tag[256]; | |
308 buf[0] = '#'; | |
309 | |
310 while (buf[0] == '#' && !feof(f)) | |
311 fgets(buf, sizeof(buf), f); | |
312 | |
313 if (feof(f)) | |
314 return -1; | |
315 | |
5514 | 316 if (sscanf(buf, "%s {", tag) != 1) |
317 return -1; | |
1 | 318 |
319 if (!strcmp(tag, "users")) { | |
320 return 0; | |
321 } else if (!strcmp(tag, "options")) { | |
322 return 1; | |
323 } else if (!strcmp(tag, "away")) { | |
324 return 2; | |
142
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
131
diff
changeset
|
325 } else if (!strcmp(tag, "plugins")) { |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
131
diff
changeset
|
326 return 3; |
673 | 327 } else if (!strcmp(tag, "pounce")) { |
328 return 4; | |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
329 } else if (!strcmp(tag, "sound_files")) { |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
330 return 6; |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
331 } else if (!strcmp(tag, "proxy")) { |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
332 return 7; |
4026
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3924
diff
changeset
|
333 } else if (!strcmp(tag, "wgaim")) { |
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3924
diff
changeset
|
334 return 8; |
1 | 335 } |
336 return -1; | |
337 } | |
338 | |
339 static void gaimrc_read_away(FILE *f) | |
340 { | |
3493 | 341 struct parse parse_buffer; |
1 | 342 struct parse *p; |
343 char buf[4096]; | |
344 struct away_message *a; | |
345 | |
346 buf[0] = 0; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
347 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
348 while (buf[0] != '}') { |
1 | 349 if (!fgets(buf, sizeof(buf), f)) |
350 return; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
351 |
1 | 352 if (buf[0] == '}') |
353 return; | |
354 | |
3493 | 355 p = parse_line(buf, &parse_buffer); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
356 if (!strcmp(p->option, "message")) { |
15 | 357 a = g_new0(struct away_message, 1); |
1 | 358 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
359 g_snprintf(a->name, sizeof(a->name), "%s", p->value[0]); |
15 | 360 g_snprintf(a->message, sizeof(a->message), "%s", p->value[1]); |
1209 | 361 away_messages = g_slist_insert_sorted(away_messages, a, sort_awaymsg_list); |
15 | 362 } |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1088
diff
changeset
|
363 /* auto { time } { default message } */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
364 else if (!strcmp(p->option, "auto")) { |
5748 | 365 gaim_prefs_set_int("/core/away/mins_before_away", |
366 atoi(p->value[0])); | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2369
diff
changeset
|
367 default_away = g_slist_nth_data(away_messages, atoi(p->value[1])); |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1088
diff
changeset
|
368 } |
1 | 369 } |
2383
3d4bbadf4b8d
[gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
370 if (!away_messages) { |
3d4bbadf4b8d
[gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
371 a = g_new0(struct away_message, 1); |
4589 | 372 g_snprintf(a->name, sizeof(a->name), _("boring default")); |
2383
3d4bbadf4b8d
[gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
373 g_snprintf(a->message, sizeof(a->message), "%s", BORING_DEFAULT_AWAY_MSG); |
3d4bbadf4b8d
[gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
374 away_messages = g_slist_append(away_messages, a); |
3d4bbadf4b8d
[gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
375 } |
1 | 376 } |
377 | |
5032
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
378 /* |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
379 * This is temporary, and we're using it to translate the new event |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
380 * and action values into the old ones. We're also adding entries for |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
381 * new types, but if you go and use an older gaim, these will be nuked. |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
382 * When we have a better prefs system, this can go away. |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
383 * |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
384 * -- ChipX86 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
385 */ |
5864
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
386 typedef enum |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
387 { |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
388 GAIM_GTKPOUNCE_NONE = 0x00, /**< No action. */ |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
389 GAIM_GTKPOUNCE_OPEN_WIN = 0x01, /**< Open an IM window. */ |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
390 GAIM_GTKPOUNCE_POPUP = 0x02, /**< Popup notification. */ |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
391 GAIM_GTKPOUNCE_SEND_MSG = 0x04, /**< Send a message. */ |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
392 GAIM_GTKPOUNCE_EXEC_CMD = 0x08, /**< Execute a command. */ |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
393 GAIM_GTKPOUNCE_PLAY_SOUND = 0x10 /**< Play a sound. */ |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
394 |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
395 } GaimGtkPounceAction; |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
396 |
5032
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
397 static int pounce_evt_trans_table[] = |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
398 { |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
399 0x010, GAIM_POUNCE_SIGNON, |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
400 0x020, GAIM_POUNCE_AWAY_RETURN, |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
401 0x040, GAIM_POUNCE_IDLE_RETURN, |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
402 0x080, GAIM_POUNCE_TYPING, |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
403 /* 0x100, save, is handled separately. */ |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
404 0x400, GAIM_POUNCE_SIGNOFF, |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
405 0x800, GAIM_POUNCE_AWAY, |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
406 0x1000, GAIM_POUNCE_IDLE, |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
407 0x2000, GAIM_POUNCE_TYPING_STOPPED |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
408 }; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
409 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
410 static int pounce_act_trans_table[] = |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
411 { |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
412 0x001, GAIM_GTKPOUNCE_OPEN_WIN, |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
413 0x002, GAIM_GTKPOUNCE_SEND_MSG, |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
414 0x004, GAIM_GTKPOUNCE_EXEC_CMD, |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
415 0x008, GAIM_GTKPOUNCE_PLAY_SOUND, |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
416 /* 0x100, save, is handled separately. */ |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
417 0x200, GAIM_GTKPOUNCE_POPUP |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
418 }; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
419 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
420 static int pounce_evt_trans_table_size = |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
421 (sizeof(pounce_evt_trans_table) / sizeof(*pounce_evt_trans_table)); |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
422 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
423 static int pounce_act_trans_table_size = |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
424 (sizeof(pounce_act_trans_table) / sizeof(*pounce_act_trans_table)); |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
425 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
426 static void |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
427 old_pounce_opts_to_new(int opts, GaimPounceEvent *events, |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
428 GaimGtkPounceAction *actions) |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
429 { |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
430 int i; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
431 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
432 *events = 0; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
433 *actions = 0; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
434 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
435 /* First, convert events */ |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
436 for (i = 0; i < pounce_evt_trans_table_size; i += 2) |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
437 { |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
438 int evt = pounce_evt_trans_table[i]; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
439 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
440 if ((opts & evt) == evt) |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
441 *events |= pounce_evt_trans_table[i + 1]; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
442 } |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
443 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
444 for (i = 0; i < pounce_act_trans_table_size; i += 2) |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
445 { |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
446 int act = pounce_act_trans_table[i]; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
447 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
448 if ((opts & act) == act) |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
449 *actions |= pounce_act_trans_table[i + 1]; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
450 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
451 } |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
452 } |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
453 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
454 static void |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
455 gaimrc_read_pounce(FILE *f) |
673 | 456 { |
3493 | 457 struct parse parse_buffer; |
673 | 458 struct parse *p; |
459 char buf[4096]; | |
5032
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
460 struct pounce_placeholder *b; |
673 | 461 |
462 buf[0] = 0; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
463 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
464 while (buf[0] != '}') { |
673 | 465 if (!fgets(buf, sizeof(buf), f)) |
466 return; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
467 |
673 | 468 if (buf[0] == '}') |
469 return; | |
470 | |
3493 | 471 p = parse_line(buf, &parse_buffer); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
472 if (!strcmp(p->option, "entry")) { |
5032
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
473 b = g_new0(struct pounce_placeholder, 1); |
673 | 474 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
475 g_snprintf(b->name, sizeof(b->name), "%s", p->value[0]); |
1155 | 476 g_snprintf(b->message, sizeof(b->message), "%s", p->value[1]); |
1229
229bf438c591
[gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1214
diff
changeset
|
477 g_snprintf(b->command, sizeof(b->command), "%s", p->value[2]); |
673 | 478 |
1235
a9cf2f61a7b1
[gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1229
diff
changeset
|
479 b->options = atoi(p->value[3]); |
1137 | 480 |
1235
a9cf2f61a7b1
[gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1229
diff
changeset
|
481 g_snprintf(b->pouncer, sizeof(b->pouncer), "%s", p->value[4]); |
a9cf2f61a7b1
[gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1229
diff
changeset
|
482 b->protocol = atoi(p->value[5]); |
1137 | 483 |
1694 | 484 g_snprintf(b->sound, sizeof(b->sound), "%s", p->value[6]); |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2369
diff
changeset
|
485 |
673 | 486 buddy_pounces = g_list_append(buddy_pounces, b); |
487 } | |
488 } | |
489 } | |
490 | |
142
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
131
diff
changeset
|
491 static void gaimrc_read_plugins(FILE *f) |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
131
diff
changeset
|
492 { |
3493 | 493 struct parse parse_buffer; |
142
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
131
diff
changeset
|
494 struct parse *p; |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
131
diff
changeset
|
495 char buf[4096]; |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
131
diff
changeset
|
496 |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
131
diff
changeset
|
497 buf[0] = 0; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
498 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
499 while (buf[0] != '}') { |
142
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
131
diff
changeset
|
500 if (!fgets(buf, sizeof(buf), f)) |
1236
dcf9242241ee
[gaim-migrate @ 1246]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
501 break; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
502 |
142
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
131
diff
changeset
|
503 if (buf[0] == '}') |
1236
dcf9242241ee
[gaim-migrate @ 1246]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
504 break; |
142
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
131
diff
changeset
|
505 |
3493 | 506 p = parse_line(buf, &parse_buffer); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
507 if (!strcmp(p->option, "plugin")) { |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
508 gaim_plugin_load(gaim_plugin_probe(p->value[0])); |
142
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
131
diff
changeset
|
509 } |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
131
diff
changeset
|
510 } |
fbabd28795d2
[gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
131
diff
changeset
|
511 } |
1 | 512 |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
513 static GaimAccount *gaimrc_read_user(FILE *f) |
1 | 514 { |
3493 | 515 struct parse parse_buffer; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
516 struct parse *p; |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
517 GaimAccount *account; |
1051
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
518 int i; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
519 char buf[4096]; |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
520 char user_info[2048]; |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
521 int flags; |
5618 | 522 char *tmp; |
1 | 523 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
524 if (!fgets(buf, sizeof(buf), f)) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
525 return NULL; |
1 | 526 |
3493 | 527 p = parse_line(buf, &parse_buffer); |
1 | 528 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
529 if (strcmp(p->option, "ident")) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
530 return NULL; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
531 |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
532 account = gaim_account_new(p->value[0], GAIM_PROTO_DEFAULT); |
1 | 533 |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
534 gaim_account_set_password(account, p->value[1]); |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
535 gaim_account_set_remember_password(account, TRUE); |
1 | 536 |
5710
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5691
diff
changeset
|
537 gaim_accounts_add(account); |
dbac958d8937
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5691
diff
changeset
|
538 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
539 if (!fgets(buf, sizeof(buf), f)) |
4491 | 540 return account; |
1 | 541 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
542 if (strcmp(buf, "\t\tuser_info {\n")) { |
4491 | 543 return account; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
544 } |
1 | 545 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
546 if (!fgets(buf, sizeof(buf), f)) |
4491 | 547 return account; |
1 | 548 |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
549 *user_info = '\0'; |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
550 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
551 while (strncmp(buf, "\t\t}", 3)) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
552 if (strlen(buf) > 3) |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
553 strcat(user_info, buf + 3); |
1 | 554 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
555 if (!fgets(buf, sizeof(buf), f)) { |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
556 gaim_account_set_user_info(account, user_info); |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
557 |
4491 | 558 return account; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
559 } |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
560 } |
1 | 561 |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
562 if ((i = strlen(user_info))) |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
563 user_info[i - 1] = '\0'; |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
564 |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
565 if (*user_info != '.') |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
566 gaim_account_set_user_info(account, user_info); |
1292 | 567 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
568 if (!fgets(buf, sizeof(buf), f)) { |
4491 | 569 return account; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
570 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
571 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
572 if (!strcmp(buf, "\t}")) { |
4491 | 573 return account; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
574 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
575 |
3493 | 576 p = parse_line(buf, &parse_buffer); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
577 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
578 if (strcmp(p->option, "user_opts")) |
4491 | 579 return account; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
580 |
5804 | 581 flags = atoi(p->value[0]); |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
582 |
5804 | 583 if (flags & OPT_ACCT_AUTO) |
584 gaim_account_set_auto_login(account, GAIM_GTK_UI, TRUE); | |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
585 |
5659
6b3214ab8632
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5655
diff
changeset
|
586 if (flags & OPT_ACCT_MAIL_CHECK) |
6b3214ab8632
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5655
diff
changeset
|
587 gaim_account_set_check_mail(account, TRUE); |
6b3214ab8632
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5655
diff
changeset
|
588 |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
589 if (!(flags & OPT_ACCT_REM_PASS)) |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
590 gaim_account_set_remember_password(account, FALSE); |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
591 |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
592 gaim_account_set_protocol(account, atoi(p->value[1])); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
593 |
1051
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
594 if (!fgets(buf, sizeof(buf), f)) |
4491 | 595 return account; |
1051
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
596 |
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
597 if (!strcmp(buf, "\t}")) |
4491 | 598 return account; |
1051
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
599 |
3493 | 600 p = parse_line(buf, &parse_buffer); |
1051
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
601 |
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
602 if (strcmp(p->option, "proto_opts")) |
4491 | 603 return account; |
1051
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
604 |
5580
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
605 /* I hate this part. We must convert the protocol options. */ |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
606 switch (gaim_account_get_protocol(account)) { |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
607 case GAIM_PROTO_TOC: |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
608 case GAIM_PROTO_OSCAR: |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
609 gaim_account_set_string(account, "server", p->value[0]); |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
610 gaim_account_set_int(account, "port", atoi(p->value[1])); |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
611 break; |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
612 |
5612 | 613 case GAIM_PROTO_JABBER: |
614 gaim_account_set_string(account, "connect_server", p->value[1]); | |
615 gaim_account_set_int(account, "port", atoi(p->value[0])); | |
616 break; | |
617 | |
5580
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
618 case GAIM_PROTO_MSN: |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
619 case GAIM_PROTO_NAPSTER: |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
620 case GAIM_PROTO_YAHOO: |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
621 gaim_account_set_string(account, "server", p->value[3]); |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
622 gaim_account_set_int(account, "port", atoi(p->value[4])); |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
623 break; |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
624 |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
625 case GAIM_PROTO_IRC: |
5618 | 626 if(strlen(p->value[0]) && !strchr(account->username, '@')) { |
627 tmp = g_strdup_printf("%s@%s", account->username, p->value[0]); | |
628 gaim_account_set_username(account, tmp); | |
629 g_free(tmp); | |
630 } | |
5580
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
631 gaim_account_set_int(account, "port", atoi(p->value[1])); |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
632 gaim_account_set_string(account, "charset", p->value[2]); |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
633 break; |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
634 |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
635 default: |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
636 break; |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
637 } |
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
638 |
2317
ab8ca5d75dcd
[gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
639 if (!fgets(buf, sizeof(buf), f)) |
4491 | 640 return account; |
2317
ab8ca5d75dcd
[gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
641 |
ab8ca5d75dcd
[gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
642 if (!strcmp(buf, "\t}")) |
4491 | 643 return account; |
2317
ab8ca5d75dcd
[gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
644 |
3493 | 645 p = parse_line(buf, &parse_buffer); |
2317
ab8ca5d75dcd
[gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
646 |
ab8ca5d75dcd
[gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
647 if (strcmp(p->option, "iconfile")) |
4491 | 648 return account; |
2317
ab8ca5d75dcd
[gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
649 |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
650 if (*p->value[0] != '\n' && *p->value[0] != '\0') |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
651 gaim_account_set_buddy_icon(account, p->value[0]); |
2317
ab8ca5d75dcd
[gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
652 |
3205 | 653 if (!fgets(buf, sizeof(buf), f)) |
4491 | 654 return account; |
3205 | 655 |
656 if (!strcmp(buf, "\t}")) | |
4491 | 657 return account; |
3205 | 658 |
3493 | 659 p = parse_line(buf, &parse_buffer); |
3205 | 660 |
661 if (strcmp(p->option, "alias")) | |
4491 | 662 return account; |
3205 | 663 |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
664 if (*p->value[0] != '\n' && *p->value[0] != '\0') |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
665 gaim_account_set_alias(account, p->value[0]); |
3205 | 666 |
4634 | 667 if (!fgets(buf, sizeof(buf), f)) |
668 return account; | |
669 | |
670 if (!strcmp(buf, "\t}")) | |
671 return account; | |
672 | |
673 p = parse_line(buf, &parse_buffer); | |
674 | |
675 if (strcmp(p->option, "proxy_opts")) | |
676 return account; | |
677 | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
678 if(atoi(p->value[0]) != GAIM_PROXY_USE_GLOBAL) { |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
679 GaimProxyInfo *info; |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
680 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
681 info = gaim_proxy_info_new(); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
682 gaim_proxy_info_set_type(info, atoi(p->value[0])); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
683 gaim_proxy_info_set_host(info, p->value[1]); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
684 gaim_proxy_info_set_port(info, atoi(p->value[2])); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
685 gaim_proxy_info_set_username(info, p->value[3]); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
686 gaim_proxy_info_set_password(info, p->value[4]); |
4634 | 687 } |
688 | |
4491 | 689 return account; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
690 |
1 | 691 } |
692 | |
693 static void gaimrc_read_users(FILE *f) | |
694 { | |
695 char buf[2048]; | |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
696 GaimAccount *account = NULL; |
3493 | 697 struct parse parse_buffer; |
4410
61c9c2bd2a9c
[gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4405
diff
changeset
|
698 struct parse *p=NULL; |
1 | 699 |
700 buf[0] = 0; | |
701 | |
4410
61c9c2bd2a9c
[gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4405
diff
changeset
|
702 while (fgets(buf, sizeof(buf), f)) { |
1 | 703 if (buf[0] == '#') |
704 continue; | |
4410
61c9c2bd2a9c
[gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4405
diff
changeset
|
705 else if(buf[0] == '}') |
61c9c2bd2a9c
[gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4405
diff
changeset
|
706 break; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
707 |
3493 | 708 p = parse_line(buf, &parse_buffer); |
1 | 709 |
4410
61c9c2bd2a9c
[gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4405
diff
changeset
|
710 if (strcmp(p->option, "user")==0 || |
61c9c2bd2a9c
[gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4405
diff
changeset
|
711 strcmp(p->option, "current_user")==0) { |
5580
86456ec3ca25
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
712 if((account=gaimrc_read_user(f))==NULL) { |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
713 gaim_debug(GAIM_DEBUG_ERROR, "gaimrc", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
714 "Error reading in users from .gaimrc\n"); |
4410
61c9c2bd2a9c
[gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4405
diff
changeset
|
715 return; |
61c9c2bd2a9c
[gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4405
diff
changeset
|
716 } |
159
d56878f647fb
[gaim-migrate @ 169]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
158
diff
changeset
|
717 } |
1 | 718 } |
719 } | |
720 | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
721 struct replace { |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
722 int old; |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
723 guint *val; |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
724 int new; |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
725 }; |
1 | 726 |
5804 | 727 #define OPT_GEN_ENTER_SENDS 0x00000001 |
728 #define OPT_GEN_LOG_ALL 0x00000004 | |
729 #define OPT_GEN_STRIP_HTML 0x00000008 | |
730 #define OPT_GEN_POPUP_WINDOWS 0x00000020 | |
731 #define OPT_GEN_SEND_LINKS 0x00000040 | |
732 #define OPT_GEN_DEBUG 0x00000100 | |
733 #define OPT_GEN_BROWSER_POPUP 0x00000800 | |
734 #define OPT_GEN_CHECK_SPELLING 0x00008000 | |
735 #define OPT_GEN_POPUP_CHAT 0x00010000 | |
736 #define OPT_GEN_BACK_ON_IM 0x00020000 | |
737 #define OPT_GEN_CTL_CHARS 0x00080000 | |
738 #define OPT_GEN_CTL_SMILEYS 0x00200000 | |
739 #define OPT_GEN_AUTO_AWAY 0x00800000 | |
740 #define OPT_GEN_ESC_CAN_CLOSE 0x01000000 | |
741 #define OPT_GEN_CTL_ENTER 0x02000000 | |
742 #define OPT_GEN_F2_TOGGLES 0x04000000 | |
743 #define OPT_GEN_NO_AUTO_RESP 0x08000000 | |
744 #define OPT_GEN_QUEUE_WHEN_AWAY 0x10000000 | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
745 |
5804 | 746 #define OPT_DISP_SHOW_TIME 0x00000001 |
747 #define OPT_DISP_SHOW_GRPNUM 0x00000002 | |
748 #define OPT_DISP_SHOW_IDLETIME 0x00000008 | |
749 #define OPT_DISP_SHOW_BUTTON_XPM 0x00000010 | |
750 #define OPT_DISP_IGNORE_COLOUR 0x00000020 | |
751 #define OPT_DISP_SHOW_LOGON 0x00000040 | |
752 #define OPT_DISP_SHOW_SMILEY 0x00000100 | |
753 #define OPT_DISP_CHAT_LOGON 0x00000800 | |
754 #define OPT_DISP_NO_BUTTONS 0x00002000 | |
755 #define OPT_DISP_CONV_BUTTON_TEXT 0x00004000 | |
756 #define OPT_DISP_CHAT_BUTTON_TEXT 0x00008000 | |
757 #define OPT_DISP_NO_MT_GRP 0x00040000 | |
758 #define OPT_DISP_CONV_BUTTON_XPM 0x00080000 | |
759 #define OPT_DISP_CHAT_BUTTON_XPM 0x00100000 | |
760 #define OPT_DISP_SHOW_WARN 0x00200000 | |
761 #define OPT_DISP_IGNORE_FONTS 0x00400000 | |
762 #define OPT_DISP_IGNORE_SIZES 0x00800000 | |
763 #define OPT_DISP_ONE_CHAT_WINDOW 0x02000000 | |
764 #define OPT_DISP_CONV_SIDE_TAB 0x04000000 | |
765 #define OPT_DISP_CONV_BR_TAB 0x08000000 | |
1 | 766 |
767 static void gaimrc_read_options(FILE *f) | |
768 { | |
769 char buf[2048]; | |
3493 | 770 struct parse parse_buffer; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
771 struct parse *p; |
5804 | 772 gboolean read_logging = FALSE, read_general = FALSE; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
773 int general_options = 0, display_options = 0; |
1 | 774 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
775 buf[0] = 0; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
776 |
1 | 777 while (buf[0] != '}') { |
778 if (buf[0] == '#') | |
779 continue; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
780 |
1 | 781 if (!fgets(buf, sizeof(buf), f)) |
782 return; | |
783 | |
3493 | 784 p = parse_line(buf, &parse_buffer); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
785 |
5672 | 786 /* XXX: what are we going to do about ancient prefs? */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
787 if (!strcmp(p->option, "general_options")) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
788 general_options = atoi(p->value[0]); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
789 read_general = TRUE; |
5804 | 790 gaim_prefs_set_bool("/gaim/gtk/conversations/enter_sends", |
791 general_options & OPT_GEN_ENTER_SENDS); | |
792 gaim_prefs_set_bool("/gaim/gtk/conversations/im/raise_on_events", | |
793 general_options & OPT_GEN_POPUP_WINDOWS); | |
794 gaim_prefs_set_bool("/core/conversations/send_urls_as_links", | |
795 general_options & OPT_GEN_SEND_LINKS); | |
796 gaim_prefs_set_bool("/gaim/gtk/debug/enabled", | |
797 general_options & OPT_GEN_DEBUG); | |
798 gaim_prefs_set_bool("/gaim/gtk/browsers/new_window", | |
799 general_options & OPT_GEN_BROWSER_POPUP); | |
800 gaim_prefs_set_bool("/gaim/gtk/conversations/spellecheck", | |
801 general_options & OPT_GEN_CHECK_SPELLING); | |
802 gaim_prefs_set_bool("/gaim/gtk/conversations/chat/raise_on_events", | |
803 general_options & OPT_GEN_POPUP_CHAT); | |
804 gaim_prefs_set_bool("/core/conversations/away_back_on_send", | |
805 general_options & OPT_GEN_BACK_ON_IM); | |
806 gaim_prefs_set_bool("/gaim/gtk/conversations/html_shortcuts", | |
807 general_options & OPT_GEN_CTL_CHARS); | |
808 gaim_prefs_set_bool("/gaim/gtk/conversations/smiley_shortcuts", | |
809 general_options & OPT_GEN_CTL_SMILEYS); | |
810 gaim_prefs_set_bool("/core/away/away_when_idle", | |
811 general_options & OPT_GEN_AUTO_AWAY); | |
812 gaim_prefs_set_bool("/gaim/gtk/conversations/escape_closes", | |
813 general_options & OPT_GEN_ESC_CAN_CLOSE); | |
814 gaim_prefs_set_bool("/gaim/gtk/conversations/ctrl_enter_sends", | |
815 general_options & OPT_GEN_CTL_ENTER); | |
816 gaim_prefs_set_bool("/core/away/auto_response/enabled", | |
817 !(general_options & OPT_GEN_NO_AUTO_RESP)); | |
818 gaim_prefs_set_bool("/gaim/gtk/away/queu_messages", | |
819 general_options & OPT_AWAY_QUEUE); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
820 } else if (!strcmp(p->option, "display_options")) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
821 display_options = atoi(p->value[0]); |
5804 | 822 gaim_prefs_set_bool("/gaim/gtk/conversations/show_timestamps", |
823 display_options & OPT_DISP_SHOW_TIME); | |
824 gaim_prefs_set_bool("/gaim/gtk/blist/show_group_count", | |
825 display_options & OPT_DISP_SHOW_GRPNUM); | |
826 gaim_prefs_set_bool("/gaim/gtk/blist/show_idle_time", | |
827 display_options & OPT_DISP_SHOW_IDLETIME); | |
828 gaim_prefs_set_int("/gaim/gtk/blist/button_style", | |
829 ((display_options & OPT_DISP_SHOW_BUTTON_XPM) | |
830 ? ((display_options & OPT_DISP_NO_BUTTONS) | |
831 ? GAIM_BUTTON_IMAGE : GAIM_BUTTON_TEXT_IMAGE) | |
832 : ((display_options & OPT_DISP_NO_BUTTONS) | |
833 ? GAIM_BUTTON_NONE : GAIM_BUTTON_TEXT))); | |
834 gaim_prefs_set_bool("/gaim/gtk/conversations/ignore_colors", | |
835 display_options & OPT_DISP_IGNORE_COLOUR); | |
836 gaim_prefs_set_bool("/core/conversations/im/show_login", | |
837 display_options & OPT_DISP_SHOW_LOGON); | |
838 gaim_prefs_set_bool("/gaim/gtk/conversations/show_smileys", | |
839 display_options & OPT_DISP_SHOW_SMILEY); | |
840 gaim_prefs_set_bool("/core/conversations/chat/show_join", | |
841 display_options & OPT_DISP_CHAT_LOGON); | |
842 gaim_prefs_set_bool("/gaim/gtk/conversations/im/button_type", | |
843 ((display_options & OPT_DISP_CONV_BUTTON_XPM) | |
844 ? ((display_options & OPT_DISP_CONV_BUTTON_TEXT) | |
845 ? GAIM_BUTTON_TEXT_IMAGE : GAIM_BUTTON_IMAGE) | |
846 : ((display_options & OPT_DISP_CONV_BUTTON_TEXT) | |
847 ? GAIM_BUTTON_TEXT : GAIM_BUTTON_NONE))); | |
848 gaim_prefs_set_bool("/gaim/gtk/conversations/chat/button_type", | |
849 ((display_options & OPT_DISP_CHAT_BUTTON_XPM) | |
850 ? ((display_options & OPT_DISP_CHAT_BUTTON_TEXT) | |
851 ? GAIM_BUTTON_TEXT_IMAGE : GAIM_BUTTON_IMAGE) | |
852 : ((display_options & OPT_DISP_CHAT_BUTTON_TEXT) | |
853 ? GAIM_BUTTON_TEXT : GAIM_BUTTON_NONE))); | |
854 gaim_prefs_set_bool("/gaim/gtk/blist/show_warning_level", | |
855 display_options & OPT_DISP_SHOW_WARN); | |
856 gaim_prefs_set_bool("/gaim/gtk/conversations/ignore_fonts", | |
857 display_options & OPT_DISP_IGNORE_FONTS); | |
858 gaim_prefs_set_bool("/gaim/gtk/conversations/ignore_font_sizes", | |
859 display_options & OPT_DISP_IGNORE_SIZES); | |
860 gaim_prefs_set_int("/gaim/gtk/conversations/tab_side", | |
861 ((display_options & OPT_DISP_CONV_SIDE_TAB) | |
862 ? ((display_options & OPT_DISP_CONV_BR_TAB) | |
863 ? GTK_POS_RIGHT : GTK_POS_LEFT) | |
864 : ((display_options & OPT_DISP_CONV_BR_TAB) | |
865 ? GTK_POS_BOTTOM : GTK_POS_TOP))); | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
866 } else if (!strcmp(p->option, "misc_options")) { |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
867 misc_options = atoi(p->value[0]); |
5631 | 868 gaim_prefs_set_bool("/gaim/gtk/debug/enabled", |
5823 | 869 misc_options & OPT_MISC_DEBUG); |
5631 | 870 gaim_prefs_set_bool("/gaim/gtk/browsers/new_window", |
5823 | 871 misc_options & OPT_MISC_BROWSER_POPUP); |
5631 | 872 gaim_prefs_set_bool("/gaim/gtk/conversations/im/send_typing", |
5823 | 873 !(misc_options & OPT_MISC_STEALTH_TYPING)); |
5631 | 874 gaim_prefs_set_bool("/gaim/gtk/buddies/use_server_alias", |
5823 | 875 misc_options & OPT_MISC_USE_SERVER_ALIAS); |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1456
diff
changeset
|
876 } else if (!strcmp(p->option, "logging_options")) { |
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1456
diff
changeset
|
877 logging_options = atoi(p->value[0]); |
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1456
diff
changeset
|
878 read_logging = TRUE; |
5631 | 879 gaim_prefs_set_bool("/gaim/gtk/logging/log_ims", |
5823 | 880 logging_options & OPT_LOG_CONVOS); |
5631 | 881 gaim_prefs_set_bool("/gaim/gtk/logging/strip_html", |
5823 | 882 logging_options & OPT_LOG_STRIP_HTML); |
5631 | 883 gaim_prefs_set_bool("/gaim/gtk/logging/individual_logs", |
5823 | 884 logging_options & OPT_LOG_INDIVIDUAL); |
5631 | 885 gaim_prefs_set_bool("/gaim/gtk/logging/log_chats", |
5823 | 886 logging_options & OPT_LOG_CHATS); |
887 gaim_prefs_set_bool("/gaim/gtk/logging/log_signon_signoff", | |
888 logging_options & OPT_LOG_BUDDY_SIGNON); | |
889 gaim_prefs_set_bool("/gaim/gtk/logging/log_idle_state", | |
890 logging_options & OPT_LOG_BUDDY_IDLE); | |
891 gaim_prefs_set_bool("/gaim/gtk/logging/log_away_state", | |
892 logging_options & OPT_LOG_BUDDY_AWAY); | |
893 gaim_prefs_set_bool("/gaim/gtk/logging/log_own_states", | |
894 logging_options & OPT_LOG_MY_SIGNON); | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
895 } else if (!strcmp(p->option, "blist_options")) { |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
896 blist_options = atoi(p->value[0]); |
5631 | 897 gaim_prefs_set_bool("/gaim/gtk/blist/show_group_count", |
5823 | 898 blist_options & OPT_BLIST_SHOW_GRPNUM); |
5631 | 899 gaim_prefs_set_bool("/gaim/gtk/blist/show_idle_time", |
5823 | 900 blist_options & OPT_BLIST_SHOW_IDLETIME); |
5631 | 901 gaim_prefs_set_bool("/gaim/gtk/blist/show_empty_groups", |
5823 | 902 !(blist_options & OPT_BLIST_NO_MT_GRP)); |
5631 | 903 gaim_prefs_set_bool("/gaim/gtk/blist/show_warning_level", |
5823 | 904 blist_options & OPT_BLIST_SHOW_WARN); |
5631 | 905 gaim_prefs_set_bool("/gaim/gtk/blist/grey_idle_buddies", |
5823 | 906 blist_options & OPT_BLIST_GREY_IDLERS); |
5631 | 907 gaim_prefs_set_bool("/gaim/gtk/blist/raise_on_events", |
5823 | 908 blist_options & OPT_BLIST_POPUP); |
5631 | 909 gaim_prefs_set_bool("/gaim/gtk/blist/show_buddy_icons", |
5823 | 910 blist_options & OPT_BLIST_SHOW_ICONS); |
5631 | 911 gaim_prefs_set_bool("/gaim/gtk/blist/show_offline_buddies", |
5823 | 912 blist_options & OPT_BLIST_SHOW_OFFLINE); |
5672 | 913 gaim_prefs_set_int("/gaim/gtk/blist/button_style", |
914 ((blist_options & OPT_BLIST_SHOW_BUTTON_XPM) | |
915 ? ((blist_options & OPT_BLIST_NO_BUTTON_TEXT) | |
916 ? GAIM_BUTTON_IMAGE : GAIM_BUTTON_TEXT_IMAGE) | |
917 : ((blist_options & OPT_BLIST_NO_BUTTON_TEXT) | |
918 ? GAIM_BUTTON_NONE : GAIM_BUTTON_TEXT))); | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
919 } else if (!strcmp(p->option, "convo_options")) { |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
920 convo_options = atoi(p->value[0]); |
5631 | 921 gaim_prefs_set_bool("/gaim/gtk/conversations/enter_sends", |
5823 | 922 convo_options & OPT_CONVO_ENTER_SENDS); |
5631 | 923 gaim_prefs_set_bool("/core/conversations/send_urls_as_links", |
5823 | 924 convo_options & OPT_CONVO_SEND_LINKS); |
5631 | 925 gaim_prefs_set_bool("/gaim/gtk/conversations/spellcheck", |
5823 | 926 convo_options & OPT_CONVO_CHECK_SPELLING); |
5631 | 927 gaim_prefs_set_bool("/gaim/gtk/conversations/html_shortcuts", |
5823 | 928 convo_options & OPT_CONVO_CTL_CHARS); |
5631 | 929 gaim_prefs_set_bool("/gaim/gtk/conversations/smiley_shortcuts", |
5823 | 930 convo_options & OPT_CONVO_CTL_SMILEYS); |
5631 | 931 gaim_prefs_set_bool("/gaim/gtk/conversations/escape_closes", |
5823 | 932 convo_options & OPT_CONVO_ESC_CAN_CLOSE); |
5631 | 933 gaim_prefs_set_bool("/gaim/gtk/conversations/ctrl_enter_sends", |
5823 | 934 convo_options & OPT_CONVO_CTL_ENTER); |
5631 | 935 gaim_prefs_set_bool("/gaim/gtk/conversations/show_timestamps", |
5823 | 936 convo_options & OPT_CONVO_SHOW_TIME); |
5631 | 937 gaim_prefs_set_bool("/gaim/gtk/conversations/ignore_colors", |
5823 | 938 convo_options & OPT_CONVO_IGNORE_COLOUR); |
5631 | 939 gaim_prefs_set_bool("/gaim/gtk/conversations/show_smileys", |
5823 | 940 convo_options & OPT_CONVO_SHOW_SMILEY); |
5631 | 941 gaim_prefs_set_bool("/gaim/gtk/conversations/ignore_fonts", |
5823 | 942 convo_options & OPT_CONVO_IGNORE_FONTS); |
5631 | 943 gaim_prefs_set_bool("/gaim/gtk/conversations/ignore_font_sizes", |
5823 | 944 convo_options & OPT_CONVO_IGNORE_SIZES); |
5631 | 945 gaim_prefs_set_bool("/core/conversations/combine_chat_im", |
5823 | 946 convo_options & OPT_CONVO_COMBINE); |
5631 | 947 gaim_prefs_set_bool("/gaim/gtk/conversations/ctrl_w_closes", |
5823 | 948 convo_options & OPT_CONVO_CTL_W_CLOSES); |
5631 | 949 gaim_prefs_set_bool("/gaim/gtk/conversations/close_on_tabs", |
5823 | 950 !(convo_options & OPT_CONVO_NO_X_ON_TAB)); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
951 } else if (!strcmp(p->option, "im_options")) { |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
952 im_options = atoi(p->value[0]); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
953 |
5672 | 954 gaim_prefs_set_bool("/gaim/gtk/conversations/im/raise_on_events", |
955 im_options & OPT_IM_POPUP); | |
956 gaim_prefs_set_bool("/core/conversations/im/show_login", | |
957 im_options & OPT_IM_LOGON); | |
958 gaim_prefs_set_bool("/gaim/gtk/conversations/im/button_type", | |
959 ((im_options & OPT_IM_BUTTON_XPM) | |
960 ? ((im_options & OPT_IM_BUTTON_TEXT) | |
961 ? GAIM_BUTTON_TEXT_IMAGE : GAIM_BUTTON_IMAGE) | |
962 : ((im_options & OPT_IM_BUTTON_TEXT) | |
963 ? GAIM_BUTTON_TEXT : GAIM_BUTTON_NONE))); | |
5667 | 964 gaim_prefs_set_int("/gaim/gtk/conversations/tab_side", |
965 ((im_options & OPT_IM_SIDE_TAB) | |
5672 | 966 ? ((im_options & OPT_IM_BR_TAB) |
967 ? GTK_POS_RIGHT : GTK_POS_LEFT) | |
968 : ((im_options & OPT_IM_BR_TAB) | |
969 ? GTK_POS_BOTTOM : GTK_POS_TOP))); | |
970 gaim_prefs_set_bool("/gaim/gtk/conversations/im/show_buddy_icons", | |
971 !(im_options & OPT_IM_HIDE_ICONS)); | |
972 gaim_prefs_set_bool("/gaim/gtk/conversations/im/animate_buddy_icons", | |
973 !(im_options & OPT_IM_NO_ANIMATION)); | |
974 gaim_prefs_set_bool("/core/conversations/use_alias_for_title", | |
975 im_options & OPT_IM_ALIAS_TAB); | |
5631 | 976 gaim_prefs_set_bool("/gaim/gtk/conversations/im/hide_on_send", |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
977 (im_options & OPT_IM_POPDOWN)); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
978 |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4430
diff
changeset
|
979 } else if (!strcmp(p->option, "conv_placement")) { |
5858 | 980 switch(atoi(p->value[0])) { |
981 case 1: | |
982 gaim_prefs_set_string("/core/conversations/placement", | |
983 "new"); | |
984 break; | |
985 case 2: | |
986 gaim_prefs_set_string("/core/conversations/placement", | |
987 "group"); | |
988 break; | |
989 case 3: | |
990 gaim_prefs_set_string("/core/conversations/placement", | |
991 "account"); | |
992 break; | |
993 case 0: | |
994 default: | |
995 gaim_prefs_set_string("/core/conversations/placement", | |
996 "last"); | |
997 break; | |
998 } | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
999 } else if (!strcmp(p->option, "chat_options")) { |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1000 chat_options = atoi(p->value[0]); |
5672 | 1001 |
1002 gaim_prefs_set_bool("/gaim/gtk/conversations/chat/button_type", | |
1003 ((chat_options & OPT_CHAT_BUTTON_XPM) | |
1004 ? ((chat_options & OPT_CHAT_BUTTON_TEXT) | |
1005 ? GAIM_BUTTON_TEXT_IMAGE : GAIM_BUTTON_IMAGE) | |
1006 : ((chat_options & OPT_CHAT_BUTTON_TEXT) | |
1007 ? GAIM_BUTTON_TEXT : GAIM_BUTTON_NONE))); | |
1008 gaim_prefs_set_bool("/core/conversations/chat/show_join", | |
1009 chat_options & OPT_CHAT_LOGON); | |
1010 gaim_prefs_set_bool("/gaim/gtk/conversations/chat/raise_on_events", | |
1011 chat_options & OPT_CHAT_POPUP); | |
1012 gaim_prefs_set_bool("/gaim/gtk/conversations/chat/tab_completion", | |
1013 chat_options & OPT_CHAT_TAB_COMPLETE); | |
1014 gaim_prefs_set_bool("/gaim/gtk/conversations/chat/old_tab_complete", | |
1015 chat_options & OPT_CHAT_OLD_STYLE_TAB); | |
1016 gaim_prefs_set_bool("/gaim/gtk/conversations/chat/color_nicks", | |
1017 chat_options & OPT_CHAT_COLORIZE); | |
1018 | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1019 } else if (!strcmp(p->option, "font_options")) { |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1020 font_options = atoi(p->value[0]); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1021 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1022 gaim_prefs_set_bool("/gaim/gtk/conversations/send_bold", |
5823 | 1023 font_options & OPT_FONT_BOLD); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1024 gaim_prefs_set_bool("/gaim/gtk/conversations/send_italic", |
5823 | 1025 font_options & OPT_FONT_ITALIC); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1026 gaim_prefs_set_bool("/gaim/gtk/conversations/send_underline", |
5823 | 1027 font_options & OPT_FONT_UNDERLINE); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1028 gaim_prefs_set_bool("/gaim/gtk/conversations/send_strikethrough", |
5823 | 1029 font_options & OPT_FONT_STRIKE); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1030 gaim_prefs_set_bool("/gaim/gtk/conversations/use_custom_font", |
5823 | 1031 font_options & OPT_FONT_FACE); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1032 gaim_prefs_set_bool("/gaim/gtk/conversations/use_custom_size", |
5823 | 1033 font_options & OPT_FONT_SIZE); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1034 gaim_prefs_set_bool("/gaim/gtk/conversations/use_custom_fgcolor", |
5823 | 1035 font_options & OPT_FONT_FGCOL); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1036 gaim_prefs_set_bool("/gaim/gtk/conversations/use_custom_bgcolor", |
5823 | 1037 font_options & OPT_FONT_BGCOL); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1038 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1039 } else if (!strcmp(p->option, "sound_options")) { |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1040 sound_options = atoi(p->value[0]); |
5691 | 1041 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/login", |
1042 sound_options & OPT_SOUND_LOGIN); | |
1043 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/logout", | |
1044 sound_options & OPT_SOUND_LOGOUT); | |
1045 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/im_recv", | |
1046 sound_options & OPT_SOUND_RECV); | |
1047 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/send_im", | |
1048 sound_options & OPT_SOUND_SEND); | |
1049 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/first_im_recv", | |
1050 sound_options & OPT_SOUND_FIRST_RCV); | |
1051 gaim_prefs_set_bool("/core/sound/when_away", | |
1052 sound_options & OPT_SOUND_WHEN_AWAY); | |
1053 gaim_prefs_set_bool("/gaim/gtk/sound/silent_signon", | |
1054 sound_options & OPT_SOUND_SILENT_SIGNON); | |
1055 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/join_chat", | |
1056 sound_options & OPT_SOUND_CHAT_JOIN); | |
1057 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/chat_msg_recv", | |
1058 sound_options & OPT_SOUND_CHAT_SAY); | |
1059 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/left_chat", | |
1060 sound_options & OPT_SOUND_CHAT_PART); | |
1061 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/send_chat_msg", | |
1062 sound_options & OPT_SOUND_CHAT_YOU_SAY); | |
1063 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/nick_said", | |
1064 sound_options & OPT_SOUND_CHAT_NICK); | |
1065 if(sound_options & OPT_SOUND_NAS) { | |
1066 gaim_prefs_set_string("/gaim/gtk/sound/method", "nas"); | |
1067 } else if(!(sound_options & OPT_SOUND_NORMAL)) { | |
1068 if(sound_options & OPT_SOUND_ESD) | |
1069 gaim_prefs_set_string("/gaim/gtk/sound/method", "esd"); | |
1070 else if(sound_options & OPT_SOUND_ARTS) | |
1071 gaim_prefs_set_string("/gaim/gtk/sound/method", "arts"); | |
1072 else if(sound_options & OPT_SOUND_CMD) | |
1073 gaim_prefs_set_string("/gaim/gtk/sound/method", "custom"); | |
1074 else if(sound_options & OPT_SOUND_BEEP) | |
1075 gaim_prefs_set_string("/gaim/gtk/sound/method", "beep"); | |
1076 } | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1077 } else if (!strcmp(p->option, "away_options")) { |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1078 away_options = atoi(p->value[0]); |
5672 | 1079 gaim_prefs_set_bool("/core/conversations/away_back_on_send", |
1080 away_options & OPT_AWAY_BACK_ON_IM); | |
1081 gaim_prefs_set_bool("/core/away/away_when_idle", | |
1082 away_options & OPT_AWAY_AUTO); | |
1083 gaim_prefs_set_bool("/core/away/auto_response/enabled", | |
1084 !(away_options & OPT_AWAY_NO_AUTO_RESP)); | |
1085 gaim_prefs_set_bool("/gaim/gtk/away/queue_messages", | |
1086 away_options & OPT_AWAY_QUEUE); | |
1087 gaim_prefs_set_bool("/core/away/auto_response/idle_only", | |
1088 away_options & OPT_AWAY_IDLE_RESP); | |
1089 gaim_prefs_set_bool("/plugins/gtk/docklet/queue_messages", | |
1090 away_options & OPT_AWAY_QUEUE_UNREAD); | |
1091 gaim_prefs_set_bool("/core/away/auto_response/in_active_conv", | |
1092 !(away_options & OPT_AWAY_DELAY_IN_USE)); | |
1093 gaim_prefs_set_int("/core/away/auto_response/sec_before_resend", | |
1094 atoi(p->value[1])); | |
666
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
1095 } else if (!strcmp(p->option, "font_face")) { |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1096 gaim_prefs_set_string("/gaim/gtk/conversations/font_face", |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1097 p->value[0]); |
1441
5c67b8794991
[gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1420
diff
changeset
|
1098 } else if (!strcmp(p->option, "font_size")) { |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1099 gaim_prefs_set_int("/gaim/gtk/conversations/font_size", atoi(p->value[0])); |
666
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
1100 } else if (!strcmp(p->option, "foreground")) { |
5671 | 1101 char buf[14]; |
5650 | 1102 |
5671 | 1103 g_snprintf(buf, sizeof(buf), "#%04x%04x%04x", |
1104 atoi(p->value[0]), atoi(p->value[1]), atoi(p->value[2])); | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1105 gaim_prefs_set_string("/gaim/gtk/conversations/fgcolor", buf); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1106 |
666
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
1107 } else if (!strcmp(p->option, "background")) { |
5671 | 1108 char buf[14]; |
5650 | 1109 |
5671 | 1110 g_snprintf(buf, sizeof(buf), "#%04x%04x%04x", |
1111 atoi(p->value[0]), atoi(p->value[1]), atoi(p->value[2])); | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1112 gaim_prefs_set_string("/gaim/gtk/conversations/bgcolor", buf); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1113 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
1114 } else if (!strcmp(p->option, "report_idle")) { |
5631 | 1115 switch(atoi(p->value[0])) { |
1116 case IDLE_SCREENSAVER: | |
1117 gaim_prefs_set_string("/gaim/gtk/idle/reporting_method", | |
1118 "system"); | |
1119 break; | |
1120 case IDLE_GAIM: | |
1121 gaim_prefs_set_string("/gaim/gtk/idle/reporting_method", | |
1122 "gaim"); | |
1123 break; | |
1124 default: | |
1125 gaim_prefs_set_string("/gaim/gtk/idle/reporting_method", | |
1126 "none"); | |
1127 break; | |
1128 } | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
1129 } else if (!strcmp(p->option, "web_browser")) { |
5633 | 1130 switch(atoi(p->value[0])) { |
1131 case BROWSER_NETSCAPE: | |
1132 gaim_prefs_set_string("/gaim/gtk/browsers/browser", | |
1133 "netscape"); | |
1134 break; | |
1135 case BROWSER_KONQ: | |
1136 gaim_prefs_set_string("/gaim/gtk/browsers/browser", | |
1137 "kfmclient"); | |
1138 break; | |
1139 case BROWSER_MANUAL: | |
1140 gaim_prefs_set_string("/gaim/gtk/browsers/browser", | |
1141 "manual"); | |
1142 break; | |
1143 case BROWSER_GNOME: | |
1144 gaim_prefs_set_string("/gaim/gtk/browsers/browser", | |
1145 "gnome"); | |
1146 break; | |
1147 case BROWSER_OPERA: | |
1148 gaim_prefs_set_string("/gaim/gtk/browsers/browser", | |
1149 "opera"); | |
1150 break; | |
1151 case BROWSER_GALEON: | |
1152 gaim_prefs_set_string("/gaim/gtk/browsers/browser", | |
1153 "galeon"); | |
1154 break; | |
1155 case BROWSER_MOZILLA: | |
1156 default: | |
1157 gaim_prefs_set_string("/gaim/gtk/browsers/browser", | |
1158 "mozilla"); | |
1159 break; | |
1160 } | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
1161 } else if (!strcmp(p->option, "web_command")) { |
5633 | 1162 gaim_prefs_set_string("/gaim/gtk/browsers/command", p->value[0]); |
4288 | 1163 } else if (!strcmp(p->option, "smiley_theme")) { |
5841 | 1164 gaim_prefs_set_string("/gaim/gtk/smileys/theme", p->value[0]); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1710
diff
changeset
|
1165 } else if (!strcmp(p->option, "conv_size")) { |
5633 | 1166 gaim_prefs_set_int("/gaim/gtk/conversations/im/default_width", |
1167 atoi(p->value[0])); | |
1168 gaim_prefs_set_int("/gaim/gtk/conversations/im/default_height", | |
1169 atoi(p->value[1])); | |
1170 gaim_prefs_set_int("/gaim/gtk/conversations/im/entry_right", | |
1171 atoi(p->value[2])); | |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1710
diff
changeset
|
1172 } else if (!strcmp(p->option, "buddy_chat_size")) { |
5633 | 1173 gaim_prefs_set_int("/gaim/gtk/conversations/chat/default_width", |
1174 atoi(p->value[0])); | |
1175 gaim_prefs_set_int("/gaim/gtk/conversations/chat/default_height", | |
1176 atoi(p->value[1])); | |
1177 gaim_prefs_set_int("/gaim/gtk/conversations/chat/entry_right", | |
1178 atoi(p->value[2])); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
1179 } else if (!strcmp(p->option, "blist_pos")) { |
5633 | 1180 gaim_prefs_set_int("/gaim/gtk/blist/x", atoi(p->value[0])); |
1181 gaim_prefs_set_int("/gaim/gtk/blist/y", atoi(p->value[1])); | |
1182 gaim_prefs_set_int("/gaim/gtk/blist/width", atoi(p->value[2])); | |
1183 gaim_prefs_set_int("/gaim/gtk/blist/height", atoi(p->value[3])); | |
5422 | 1184 } else if (!strcmp(p->option, "sort_method")) { |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1185 gaim_prefs_set_string("/gaim/gtk/blist/sort_type", p->value[0]); |
82 | 1186 } |
1 | 1187 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
1188 } |
1 | 1189 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1190 if (read_general) { |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1191 if (!read_logging) { |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1192 logging_options = 0; |
5804 | 1193 gaim_prefs_set_bool("/gaim/gtk/logging/log_ims", |
5823 | 1194 general_options & OPT_GEN_LOG_ALL); |
5804 | 1195 gaim_prefs_set_bool("/gaim/gtk/logging/log_chats", |
5823 | 1196 general_options & OPT_GEN_LOG_ALL); |
5804 | 1197 gaim_prefs_set_bool("/gaim/gtk/logging/strip_html", |
5823 | 1198 general_options & OPT_GEN_STRIP_HTML); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1199 } |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1456
diff
changeset
|
1200 } |
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1456
diff
changeset
|
1201 |
3391 | 1202 if (misc_options & OPT_MISC_BUDDY_TICKER) { |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1203 if (gaim_plugins_enabled()) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1204 gchar* buf; |
3630 | 1205 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1206 buf = g_strconcat(LIBDIR, G_DIR_SEPARATOR_S, |
3630 | 1207 #ifndef _WIN32 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1208 "ticker.so", |
3630 | 1209 #else |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1210 "ticker.dll", |
3630 | 1211 #endif |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1212 NULL); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1213 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1214 gaim_plugin_load(gaim_plugin_probe(buf)); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1215 g_free(buf); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1216 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1217 |
3391 | 1218 misc_options &= ~OPT_MISC_BUDDY_TICKER; |
5823 | 1219 } |
1 | 1220 } |
1221 | |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1222 static void gaimrc_read_sounds(FILE *f) |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1223 { |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1224 int i; |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1225 char buf[2048]; |
3493 | 1226 struct parse parse_buffer; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
1227 struct parse *p; |
5684 | 1228 char *pref_name; |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1229 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
1230 buf[0] = 0; |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1231 |
5684 | 1232 for(i=0; i<GAIM_NUM_SOUNDS; i++) { |
1233 pref_name = g_strdup_printf("/gaim/gtk/sound/file/%s", | |
1234 gaim_gtk_sound_get_event_option(i)); | |
1235 gaim_prefs_set_string(pref_name, ""); | |
1236 g_free(pref_name); | |
1237 } | |
4561 | 1238 |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1239 while (buf[0] != '}') { |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1240 if (buf[0] == '#') |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1241 continue; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
1242 |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1243 if (!fgets(buf, sizeof(buf), f)) |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1244 return; |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1245 |
3493 | 1246 p = parse_line(buf, &parse_buffer); |
3630 | 1247 #ifndef _WIN32 |
1214
0baf39dc5437
[gaim-migrate @ 1224]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1209
diff
changeset
|
1248 if (!strcmp(p->option, "sound_cmd")) { |
5684 | 1249 gaim_prefs_set_string("/gaim/gtk/sound/command", p->value[0]); |
4561 | 1250 } else |
3630 | 1251 #endif |
1252 if (!strncmp(p->option, "sound", strlen("sound"))) { | |
2036
ab15b91b93d8
[gaim-migrate @ 2046]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1976
diff
changeset
|
1253 i = p->option[strlen("sound")] - 'A'; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
1254 |
5684 | 1255 pref_name = g_strdup_printf("/gaim/gtk/sound/file/%s", |
1256 gaim_gtk_sound_get_event_option(i)); | |
1257 gaim_prefs_set_string(pref_name, p->value[0]); | |
1214
0baf39dc5437
[gaim-migrate @ 1224]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1209
diff
changeset
|
1258 } |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1259 } |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1260 } |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1261 |
3435 | 1262 static gboolean gaimrc_parse_proxy_uri(const char *proxy) |
1263 { | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1264 GaimProxyInfo *info; |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1265 |
3435 | 1266 char *c, *d; |
1267 char buffer[2048]; | |
1268 | |
1269 char host[128]; | |
1270 char user[128]; | |
1271 char pass[128]; | |
1272 int port = 0; | |
1273 int len = 0; | |
1274 | |
4137 | 1275 host[0] = '\0'; |
1276 user[0] = '\0'; | |
1277 pass[0] = '\0'; | |
1278 | |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1279 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1280 "gaimrc_parse_proxy_uri(%s)\n", proxy); |
4137 | 1281 |
3435 | 1282 if ((c = strchr(proxy, ':')) == NULL) |
1283 { | |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1284 gaim_debug(GAIM_DEBUG_ERROR, "gaimrc", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1285 "No URI detected.\n"); |
3435 | 1286 /* No URI detected. */ |
1287 return FALSE; | |
1288 } | |
1289 | |
1290 len = c - proxy; | |
1291 | |
5537 | 1292 if (strncmp(proxy, "http://", len + 3)) |
3435 | 1293 return FALSE; |
1294 | |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1295 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", "Found HTTP proxy.\n"); |
3435 | 1296 /* Get past "://" */ |
1297 c += 3; | |
1298 | |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1299 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", "Looking at %s\n", c); |
4137 | 1300 |
3435 | 1301 for (;;) |
1302 { | |
1303 *buffer = '\0'; | |
1304 d = buffer; | |
1305 | |
1306 while (*c != '\0' && *c != '@' && *c != ':' && *c != '/') | |
1307 *d++ = *c++; | |
1308 | |
1309 *d = '\0'; | |
1310 | |
1311 if (*c == ':') | |
1312 { | |
1313 /* | |
1314 * If there is a '@' in there somewhere, we are in the auth part. | |
1315 * If not, host. | |
1316 */ | |
1317 if (strchr(c, '@') != NULL) | |
4137 | 1318 strcpy(user, buffer); |
3435 | 1319 else |
4137 | 1320 strcpy(host, buffer); |
3435 | 1321 } |
1322 else if (*c == '@') | |
1323 { | |
4137 | 1324 if (user[0] == '\0') |
1325 strcpy(user, buffer); | |
3435 | 1326 else |
4137 | 1327 strcpy(pass, buffer); |
3435 | 1328 } |
1329 else if (*c == '/' || *c == '\0') | |
1330 { | |
4137 | 1331 if (host[0] == '\0') |
1332 strcpy(host, buffer); | |
3435 | 1333 else |
1334 port = atoi(buffer); | |
1335 | |
1336 /* Done. */ | |
1337 break; | |
1338 } | |
1339 | |
1340 c++; | |
1341 } | |
1342 | |
1343 /* NOTE: HTTP_PROXY takes precendence. */ | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1344 info = gaim_global_proxy_get_info(); |
3435 | 1345 |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1346 if (*host) gaim_proxy_info_set_host(info, host); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1347 if (*user) gaim_proxy_info_set_username(info, user); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1348 if (*pass) gaim_proxy_info_set_password(info, pass); |
3435 | 1349 |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1350 gaim_proxy_info_set_port(info, port); |
3435 | 1351 |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1352 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1353 "Host: '%s', User: '%s', Password: '%s', Port: %d\n", |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1354 gaim_proxy_info_get_host(info), |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1355 gaim_proxy_info_get_username(info), |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1356 gaim_proxy_info_get_password(info), |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1357 gaim_proxy_info_get_port(info)); |
4137 | 1358 |
3435 | 1359 return TRUE; |
1360 } | |
1361 | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1362 static void gaimrc_read_proxy(FILE *f) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1363 { |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1364 char buf[2048]; |
3493 | 1365 struct parse parse_buffer; |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1366 struct parse *p; |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1367 GaimProxyInfo *info; |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1368 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1369 info = gaim_global_proxy_get_info(); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1370 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1371 buf[0] = 0; |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1372 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", "gaimrc_read_proxy\n"); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1373 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1374 while (buf[0] != '}') { |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1375 if (buf[0] == '#') |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1376 continue; |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1377 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1378 if (!fgets(buf, sizeof(buf), f)) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1379 return; |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1380 |
3493 | 1381 p = parse_line(buf, &parse_buffer); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1382 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1383 if (!strcmp(p->option, "host")) { |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1384 gaim_proxy_info_set_host(info, p->value[0]); |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1385 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1386 "Set proxyhost %s\n", p->value[0]); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1387 } else if (!strcmp(p->option, "port")) { |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1388 gaim_proxy_info_set_port(info, atoi(p->value[0])); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1389 } else if (!strcmp(p->option, "type")) { |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1390 gaim_proxy_info_set_type(info, atoi(p->value[0])); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1391 } else if (!strcmp(p->option, "user")) { |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1392 gaim_proxy_info_set_username(info, p->value[0]); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1393 } else if (!strcmp(p->option, "pass")) { |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1394 gaim_proxy_info_set_password(info, p->value[0]); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1395 } |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1396 } |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1397 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1398 if (gaim_proxy_info_get_host(info) != NULL) |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1399 gaim_global_proxy_set_from_prefs(TRUE); |
4634 | 1400 else { |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1401 const char *host; |
3435 | 1402 gboolean getVars = TRUE; |
4634 | 1403 |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1404 if ((host = g_getenv("HTTP_PROXY")) != NULL || |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1405 (host = g_getenv("http_proxy")) != NULL || |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1406 (host = g_getenv("HTTPPROXY")) != NULL) { |
1936
f0b54f592486
[gaim-migrate @ 1946]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1921
diff
changeset
|
1407 |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1408 gaim_proxy_info_set_host(info, host); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1409 } |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1410 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1411 if (gaim_proxy_info_get_host(info) != NULL) |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1412 getVars = !gaimrc_parse_proxy_uri(gaim_proxy_info_get_host(info)); |
3435 | 1413 |
1414 if (getVars) | |
1415 { | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1416 const char *port_str, *user, *pass; |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1417 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1418 if ((port_str = g_getenv("HTTP_PROXY_PORT")) != NULL || |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1419 (port_str = g_getenv("http_proxy_port")) != NULL || |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1420 (port_str = g_getenv("HTTPPROXYPORT")) != NULL) { |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1421 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1422 gaim_proxy_info_set_port(info, atoi(port_str)); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1423 } |
1936
f0b54f592486
[gaim-migrate @ 1946]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1921
diff
changeset
|
1424 |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1425 if ((user = g_getenv("HTTP_PROXY_USER")) != NULL || |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1426 (user = g_getenv("http_proxy_user")) != NULL || |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1427 (user = g_getenv("HTTPPROXYUSER")) != NULL) { |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1428 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1429 gaim_proxy_info_set_username(info, user); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1430 } |
1936
f0b54f592486
[gaim-migrate @ 1946]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1921
diff
changeset
|
1431 |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1432 if ((pass = g_getenv("HTTP_PROXY_PASS")) != NULL || |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1433 (pass = g_getenv("http_proxy_pass")) != NULL || |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1434 (pass = g_getenv("HTTPPROXYPASS")) != NULL) { |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1435 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1436 gaim_proxy_info_set_password(info, pass); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1437 } |
3435 | 1438 } |
1936
f0b54f592486
[gaim-migrate @ 1946]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1921
diff
changeset
|
1439 } |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1440 } |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1441 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1442 static void set_defaults() |
1 | 1443 { |
5631 | 1444 #if 0 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1445 int i; |
2383
3d4bbadf4b8d
[gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
1446 struct away_message *a; |
917 | 1447 |
4227 | 1448 misc_options = |
1449 OPT_MISC_USE_SERVER_ALIAS; | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1450 |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1451 logging_options = 0; |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1452 |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1453 blist_options = |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1454 OPT_BLIST_SHOW_GRPNUM | |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1455 OPT_BLIST_SHOW_PIXMAPS | |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1456 OPT_BLIST_SHOW_IDLETIME | |
3367 | 1457 OPT_BLIST_GREY_IDLERS | |
4962 | 1458 OPT_BLIST_SHOW_BUTTON_XPM | |
1459 OPT_BLIST_SHOW_ICONS; | |
870 | 1460 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1461 convo_options = |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1462 OPT_CONVO_ENTER_SENDS | |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1463 OPT_CONVO_SEND_LINKS | |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1464 OPT_CONVO_CTL_CHARS | |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1465 OPT_CONVO_CTL_SMILEYS | |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1466 OPT_CONVO_SHOW_TIME | |
3919 | 1467 OPT_CONVO_SHOW_SMILEY | |
1468 OPT_CONVO_CHECK_SPELLING; | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1469 |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4430
diff
changeset
|
1470 conv_placement_option = 0; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4430
diff
changeset
|
1471 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1472 im_options = |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1473 OPT_IM_LOGON | |
3367 | 1474 OPT_IM_BUTTON_XPM | |
1475 OPT_IM_ONE_WINDOW ; | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1476 |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1477 chat_options = |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1478 OPT_CHAT_LOGON | |
2388
5a7234d5e052
[gaim-migrate @ 2401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2383
diff
changeset
|
1479 OPT_CHAT_BUTTON_XPM | |
3367 | 1480 OPT_CHAT_TAB_COMPLETE | |
1481 OPT_CHAT_ONE_WINDOW; | |
870 | 1482 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1483 font_options = 0; |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1484 |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1485 away_options = |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1486 OPT_AWAY_BACK_ON_IM; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
1487 |
4561 | 1488 for (i = 0; i < GAIM_NUM_SOUNDS; i++) |
1489 gaim_sound_set_event_file(i, NULL); | |
1490 | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1491 font_options = 0; |
2580
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1492 /* Enable all of the sound players that might be available. The first |
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1493 available one will be used. */ |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1494 sound_options = |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1495 OPT_SOUND_LOGIN | |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1496 OPT_SOUND_LOGOUT | |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1497 OPT_SOUND_RECV | |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1498 OPT_SOUND_SEND | |
2580
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1499 OPT_SOUND_SILENT_SIGNON | |
4581 | 1500 OPT_SOUND_NORMAL | |
1501 OPT_SOUND_NAS; | |
2383
3d4bbadf4b8d
[gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
1502 |
2990 | 1503 #ifdef USE_SCREENSAVER |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1504 report_idle = IDLE_SCREENSAVER; |
2990 | 1505 #else |
1506 report_idle = IDLE_GAIM; | |
1507 #endif | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1508 web_browser = BROWSER_NETSCAPE; |
3434 | 1509 g_snprintf(web_command, sizeof(web_command), "xterm -e lynx %%s"); |
2383
3d4bbadf4b8d
[gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
1510 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1511 auto_away = 10; |
2383
3d4bbadf4b8d
[gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
1512 a = g_new0(struct away_message, 1); |
4589 | 1513 g_snprintf(a->name, sizeof(a->name), _("boring default")); |
2383
3d4bbadf4b8d
[gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
1514 g_snprintf(a->message, sizeof(a->message), "%s", BORING_DEFAULT_AWAY_MSG); |
3d4bbadf4b8d
[gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
1515 away_messages = g_slist_append(away_messages, a); |
3d4bbadf4b8d
[gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
1516 default_away = a; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1517 |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1518 blist_pos.width = 0; |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1519 blist_pos.height = 0; |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1520 blist_pos.x = 0; |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1521 blist_pos.y = 0; |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1710
diff
changeset
|
1522 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1523 conv_size.width = 320; |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1524 conv_size.height = 175; |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1525 conv_size.entry_height = 50; |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1526 |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1527 buddy_chat_size.width = 320; |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1528 buddy_chat_size.height = 160; |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1529 buddy_chat_size.entry_height = 50; |
5631 | 1530 #endif |
1 | 1531 } |
1532 | |
1533 void load_prefs() | |
1534 { | |
1535 FILE *f; | |
1536 char buf[1024]; | |
1537 int ver = 0; | |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1538 |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1539 gaim_debug(GAIM_DEBUG_INFO, "gaimrc", "Loading preferences.\n"); |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1540 |
4137 | 1541 if (is_saving_prefs) { |
1542 request_load_prefs = 1; | |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1543 gaim_debug(GAIM_DEBUG_INFO, "gaimrc", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1544 "Currently saving. Will request load.\n"); |
4137 | 1545 return; |
1546 } | |
570 | 1547 |
1560
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1548 if (opt_rcfile_arg) |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1549 g_snprintf(buf, sizeof(buf), "%s", opt_rcfile_arg); |
3630 | 1550 else if (gaim_home_dir()) |
1551 g_snprintf(buf, sizeof(buf), "%s" G_DIR_SEPARATOR_S ".gaimrc", gaim_home_dir()); | |
1560
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1552 else { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1553 set_defaults(); |
1560
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1554 return; |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1555 } |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1556 |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1557 if ((f = fopen(buf, "r"))) { |
4137 | 1558 is_loading_prefs = 1; |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1559 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", "start load_prefs\n"); |
1560
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1560 fgets(buf, sizeof(buf), f); |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1561 sscanf(buf, "# .gaimrc v%d", &ver); |
2389
021ba044ab0b
[gaim-migrate @ 2402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2388
diff
changeset
|
1562 if ((ver <= 3) || (buf[0] != '#')) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2286
diff
changeset
|
1563 set_defaults(); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
1564 |
1560
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1565 while (!feof(f)) { |
4137 | 1566 int tag = gaimrc_parse_tag(f); |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1567 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1568 "starting read tag %d\n", tag); |
4137 | 1569 switch (tag) { |
1560
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1570 case -1: |
5514 | 1571 /* Do nothing--either EOF or empty line */ |
1560
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1572 break; |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1573 case 0: |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1574 gaimrc_read_users(f); |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1575 break; |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1576 case 1: |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1577 gaimrc_read_options(f); |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1578 break; |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1579 case 2: |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1580 gaimrc_read_away(f); |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1581 break; |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1582 case 3: |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1583 if (gaim_plugins_enabled()) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1584 gaimrc_read_plugins(f); |
1560
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1585 break; |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1586 case 4: |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1587 gaimrc_read_pounce(f); |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1588 break; |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1589 case 6: |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1590 gaimrc_read_sounds(f); |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1591 break; |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1592 case 7: |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1593 gaimrc_read_proxy(f); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
1594 break; |
1560
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1595 default: |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1596 /* NOOP */ |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1597 break; |
1 | 1598 } |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1599 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1600 "ending read tag %d\n", tag); |
1 | 1601 } |
1560
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1602 fclose(f); |
4137 | 1603 is_loading_prefs = 0; |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1604 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", "end load_prefs\n"); |
4137 | 1605 if (request_save_prefs) { |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1606 gaim_debug(GAIM_DEBUG_INFO, "gaimrc", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1607 "Saving preferences on request\n"); |
4137 | 1608 request_save_prefs = 0; |
1609 } | |
1560
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1610 } else if (opt_rcfile_arg) { |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
1611 g_snprintf(buf, sizeof(buf), _("Could not open config file %s."), opt_rcfile_arg); |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5422
diff
changeset
|
1612 gaim_notify_error(NULL, NULL, buf, NULL); |
2383
3d4bbadf4b8d
[gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
1613 set_defaults(); |
3d4bbadf4b8d
[gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
1614 } else { |
3d4bbadf4b8d
[gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
1615 set_defaults(); |
1 | 1616 } |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1617 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1618 prefs_initial_load = 1; |
1 | 1619 } |
1620 | |
1621 void save_prefs() | |
1622 { | |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1623 gaim_debug(GAIM_DEBUG_INFO, "gaimrc", "save_prefs() called. Rejected!\n"); |
1 | 1624 } |
1625 | |
1209 | 1626 |
1627 /* This function is called by g_slist_insert_sorted to compare the item | |
1628 * being compared to the rest of the items on the list. | |
1629 */ | |
1630 | |
1631 gint sort_awaymsg_list(gconstpointer a, gconstpointer b) | |
1632 { | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
1633 struct away_message *msg_a; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
1634 struct away_message *msg_b; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
1635 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
1636 msg_a = (struct away_message *)a; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
1637 msg_b = (struct away_message *)b; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
1638 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
1639 return (strcmp(msg_a->name, msg_b->name)); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1236
diff
changeset
|
1640 |
1209 | 1641 } |
5032
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1642 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1643 void |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1644 load_pounces() |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1645 { |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1646 GList *l; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1647 struct pounce_placeholder *ph; |
5857
2fa4aa9c1885
[gaim-migrate @ 6288]
Christian Hammond <chipx86@chipx86.com>
parents:
5841
diff
changeset
|
1648 GaimPounce *pounce; |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
1649 GaimAccount *account; |
5032
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1650 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1651 for (l = buddy_pounces; l != NULL; l = l->next) { |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1652 GaimPounceEvent events = GAIM_POUNCE_NONE; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1653 GaimGtkPounceAction actions = GAIM_GTKPOUNCE_NONE; |
5035 | 1654 ph = (struct pounce_placeholder *)l->data; |
5032
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1655 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1656 account = gaim_account_find(ph->pouncer, ph->protocol); |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1657 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1658 old_pounce_opts_to_new(ph->options, &events, &actions); |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1659 |
5864
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1660 pounce = gaim_gtkpounce_new(account, ph->name, events); |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1661 |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1662 gaim_pounce_action_set_enabled(pounce, "open-window", |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1663 (actions & GAIM_GTKPOUNCE_OPEN_WIN)); |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1664 gaim_pounce_action_set_enabled(pounce, "popup-notify", |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1665 (actions & GAIM_GTKPOUNCE_POPUP)); |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1666 gaim_pounce_action_set_enabled(pounce, "send-message", |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1667 (actions & GAIM_GTKPOUNCE_SEND_MSG)); |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1668 gaim_pounce_action_set_enabled(pounce, "execute-command", |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1669 (actions & GAIM_GTKPOUNCE_EXEC_CMD)); |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1670 gaim_pounce_action_set_enabled(pounce, "play-sound", |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1671 (actions & GAIM_GTKPOUNCE_PLAY_SOUND)); |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1672 |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1673 gaim_pounce_action_set_attribute(pounce, "send-message", "message", |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1674 (*ph->message == '\0' ? NULL : ph->message)); |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1675 gaim_pounce_action_set_attribute(pounce, "execute-command", "command", |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1676 (*ph->sound == '\0' ? NULL : ph->message)); |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1677 gaim_pounce_action_set_attribute(pounce, "play-sound", "filename", |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1678 (*ph->sound == '\0' ? NULL : ph->message)); |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1679 |
417b1001d2b1
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1680 gaim_pounce_set_save(pounce, (ph->options & 0x100)); |
5032
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1681 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1682 g_free(ph); |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1683 } |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1684 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1685 g_list_free(buddy_pounces); |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1686 buddy_pounces = NULL; |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1687 |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1688 /* |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1689 * < ChipX86|Coding> why do we save prefs just after reading them? |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1690 * < faceprint> ChipX86|Coding: because we're cool like that |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1691 * <SeanEgan|Coding> damn straight |
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1692 */ |
5593
b07aa997ddd8
[gaim-migrate @ 5997]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
1693 /* save_prefs(); -- I like the above comment :( */ |
5032
cb700c07ee07
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1694 } |