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