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