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