Wed, 22 Jan 2025 20:47:54 -0600
Prepare for the 2.14.14 release
Testing Done:
Ran `make distcheck`
Reviewed at https://reviews.imfreedom.org/r/3779/
| 10302 | 1 | /* |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
2 | * pidgin |
| 10302 | 3 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
4 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 10302 | 5 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 6 | * source distribution. | |
| 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 | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19840
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 10302 | 21 | * |
| 22 | */ | |
| 23 | ||
| 24 | #include "internal.h" | |
| 15577 | 25 | #include "pidgin.h" |
| 10302 | 26 | |
| 27 | #include "account.h" | |
| 28 | #include "conversation.h" | |
| 29 | #include "core.h" | |
|
22888
f54d95628a9f
Include dbus-maybe.h rather than conditionally including dbus-server.h
Will Thompson <resiak@pidgin.im>
parents:
22884
diff
changeset
|
30 | #include "dbus-maybe.h" |
| 10302 | 31 | #include "debug.h" |
| 32 | #include "eventloop.h" | |
| 33 | #include "ft.h" | |
|
40764
d687fda4047d
Add a compatiblity layer for g_s?list_free_full and port everything to it.
Gary Kramlich <grim@reaperworld.com>
parents:
39010
diff
changeset
|
34 | #include "glibcompat.h" |
| 10302 | 35 | #include "log.h" |
|
19048
432404a6b416
Fix stun to work on startup (this is is a temporary hack until purple_prefs_load() happens in the core). Fixes #2334
Daniel Atallah <datallah@pidgin.im>
parents:
18606
diff
changeset
|
36 | #include "network.h" |
| 10302 | 37 | #include "notify.h" |
| 38 | #include "prefs.h" | |
| 39 | #include "prpl.h" | |
| 40 | #include "pounce.h" | |
| 41 | #include "sound.h" | |
| 42 | #include "status.h" | |
| 43 | #include "util.h" | |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11403
diff
changeset
|
44 | #include "whiteboard.h" |
| 10302 | 45 | |
| 46 | #include "gtkaccount.h" | |
| 47 | #include "gtkblist.h" | |
| 48 | #include "gtkconn.h" | |
| 49 | #include "gtkconv.h" | |
| 50 | #include "gtkdebug.h" | |
| 51 | #include "gtkdialogs.h" | |
| 14743 | 52 | #include "gtkdocklet.h" |
| 10302 | 53 | #include "gtkeventloop.h" |
| 54 | #include "gtkft.h" | |
|
11907
de3ea77afe3c
[gaim-migrate @ 14198]
Evan Schoenberg <evands@pidgin.im>
parents:
11906
diff
changeset
|
55 | #include "gtkidle.h" |
|
12838
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12670
diff
changeset
|
56 | #include "gtklog.h" |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
24585
diff
changeset
|
57 | #include "gtkmedia.h" |
| 10302 | 58 | #include "gtknotify.h" |
| 59 | #include "gtkplugin.h" | |
| 60 | #include "gtkpounce.h" | |
| 61 | #include "gtkprefs.h" | |
| 62 | #include "gtkprivacy.h" | |
| 63 | #include "gtkrequest.h" | |
| 64 | #include "gtkroomlist.h" | |
|
10574
5abb2931b6ff
[gaim-migrate @ 11966]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10448
diff
changeset
|
65 | #include "gtksavedstatuses.h" |
|
12246
7af1ef3b1cc4
[gaim-migrate @ 14548]
Mark Doliner <markdoliner@pidgin.im>
parents:
12202
diff
changeset
|
66 | #include "gtksession.h" |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge VillaseƱo (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22187
diff
changeset
|
67 | #include "gtksmiley.h" |
| 10302 | 68 | #include "gtksound.h" |
|
11525
1d06283bdcc9
[gaim-migrate @ 13773]
Francesco Fracassi <ffracassi@users.sourceforge.net>
parents:
11520
diff
changeset
|
69 | #include "gtkthemes.h" |
| 10302 | 70 | #include "gtkutils.h" |
|
15883
969b74a3e27a
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@pidgin.im>
parents:
15808
diff
changeset
|
71 | #include "pidginstock.h" |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11403
diff
changeset
|
72 | #include "gtkwhiteboard.h" |
| 10302 | 73 | |
|
39010
fbce915a7024
Outbound screenshare window/monitor selection
David Woodhouse <dwmw2@infradead.org>
parents:
38206
diff
changeset
|
74 | #ifdef HAVE_X11 |
|
fbce915a7024
Outbound screenshare window/monitor selection
David Woodhouse <dwmw2@infradead.org>
parents:
38206
diff
changeset
|
75 | #include <X11/Xlib.h> |
|
fbce915a7024
Outbound screenshare window/monitor selection
David Woodhouse <dwmw2@infradead.org>
parents:
38206
diff
changeset
|
76 | #endif |
|
fbce915a7024
Outbound screenshare window/monitor selection
David Woodhouse <dwmw2@infradead.org>
parents:
38206
diff
changeset
|
77 | |
|
13428
78687459c64b
[gaim-migrate @ 15802]
Daniel Atallah <datallah@pidgin.im>
parents:
13322
diff
changeset
|
78 | #ifdef HAVE_SIGNAL_H |
| 10302 | 79 | # include <signal.h> |
| 80 | #endif | |
| 81 | ||
| 82 | #include <getopt.h> | |
| 83 | ||
|
13428
78687459c64b
[gaim-migrate @ 15802]
Daniel Atallah <datallah@pidgin.im>
parents:
13322
diff
changeset
|
84 | #ifdef HAVE_SIGNAL_H |
|
14542
7c1dd9601f1d
[gaim-migrate @ 17199]
Mark Doliner <markdoliner@pidgin.im>
parents:
14323
diff
changeset
|
85 | |
| 10302 | 86 | /* |
| 87 | * Lists of signals we wish to catch and those we wish to ignore. | |
| 88 | * Each list terminated with -1 | |
| 89 | */ | |
|
21091
07fe1a99c47b
Patch from Andrew Gaul to constify a bunch of static variables to reduce
Ka-Hing Cheung <khc@pidgin.im>
parents:
20791
diff
changeset
|
90 | static const int catch_sig_list[] = { |
| 10302 | 91 | SIGSEGV, |
| 92 | SIGINT, | |
| 93 | SIGTERM, | |
| 94 | SIGQUIT, | |
| 95 | SIGCHLD, | |
|
22631
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
96 | #if defined(USE_GSTREAMER) && !defined(GST_CAN_DISABLE_FORKING) |
|
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
97 | SIGALRM, |
|
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
98 | #endif |
| 10302 | 99 | -1 |
| 100 | }; | |
| 101 | ||
|
21091
07fe1a99c47b
Patch from Andrew Gaul to constify a bunch of static variables to reduce
Ka-Hing Cheung <khc@pidgin.im>
parents:
20791
diff
changeset
|
102 | static const int ignore_sig_list[] = { |
| 10302 | 103 | SIGPIPE, |
| 104 | -1 | |
| 105 | }; | |
| 106 | #endif | |
| 107 | ||
|
17719
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
108 | static void |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
109 | dologin_named(const char *name) |
| 10302 | 110 | { |
| 15884 | 111 | PurpleAccount *account; |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
112 | char **names; |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
113 | int i; |
| 10302 | 114 | |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
115 | if (name != NULL) { /* list of names given */ |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
116 | names = g_strsplit(name, ",", 64); |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
117 | for (i = 0; names[i] != NULL; i++) { |
| 15884 | 118 | account = purple_accounts_find(names[i], NULL); |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
119 | if (account != NULL) { /* found a user */ |
|
17719
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
120 | purple_account_set_enabled(account, PIDGIN_UI, TRUE); |
| 10302 | 121 | } |
| 122 | } | |
| 123 | g_strfreev(names); | |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
124 | } else { /* no name given, use the first account */ |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
125 | GList *accounts; |
|
11520
61d34ca357f2
[gaim-migrate @ 13765]
Mark Doliner <markdoliner@pidgin.im>
parents:
11475
diff
changeset
|
126 | |
| 15884 | 127 | accounts = purple_accounts_get_all(); |
|
11520
61d34ca357f2
[gaim-migrate @ 13765]
Mark Doliner <markdoliner@pidgin.im>
parents:
11475
diff
changeset
|
128 | if (accounts != NULL) |
|
61d34ca357f2
[gaim-migrate @ 13765]
Mark Doliner <markdoliner@pidgin.im>
parents:
11475
diff
changeset
|
129 | { |
| 15884 | 130 | account = (PurpleAccount *)accounts->data; |
|
17719
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
131 | purple_account_set_enabled(account, PIDGIN_UI, TRUE); |
|
11520
61d34ca357f2
[gaim-migrate @ 13765]
Mark Doliner <markdoliner@pidgin.im>
parents:
11475
diff
changeset
|
132 | } |
| 10302 | 133 | } |
| 134 | } | |
| 135 | ||
|
13428
78687459c64b
[gaim-migrate @ 15802]
Daniel Atallah <datallah@pidgin.im>
parents:
13322
diff
changeset
|
136 | #ifdef HAVE_SIGNAL_H |
|
28820
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
137 | static char *segfault_message; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
138 | |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
139 | static int signal_sockets[2]; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
140 | |
|
14542
7c1dd9601f1d
[gaim-migrate @ 17199]
Mark Doliner <markdoliner@pidgin.im>
parents:
14323
diff
changeset
|
141 | static void sighandler(int sig); |
|
7c1dd9601f1d
[gaim-migrate @ 17199]
Mark Doliner <markdoliner@pidgin.im>
parents:
14323
diff
changeset
|
142 | |
|
22565
d1943619d6f9
Tell gstreamer not to fork; remove the SIGCHLD -> SIGALRM hack, which made
Will Thompson <resiak@pidgin.im>
parents:
22549
diff
changeset
|
143 | /* |
|
d1943619d6f9
Tell gstreamer not to fork; remove the SIGCHLD -> SIGALRM hack, which made
Will Thompson <resiak@pidgin.im>
parents:
22549
diff
changeset
|
144 | * This child process reaping stuff is currently only used for processes that |
|
d1943619d6f9
Tell gstreamer not to fork; remove the SIGCHLD -> SIGALRM hack, which made
Will Thompson <resiak@pidgin.im>
parents:
22549
diff
changeset
|
145 | * were forked to play sounds. It's not needed for forked DNS child, which |
|
d1943619d6f9
Tell gstreamer not to fork; remove the SIGCHLD -> SIGALRM hack, which made
Will Thompson <resiak@pidgin.im>
parents:
22549
diff
changeset
|
146 | * have their own waitpid() call. It might be wise to move this code into |
|
d1943619d6f9
Tell gstreamer not to fork; remove the SIGCHLD -> SIGALRM hack, which made
Will Thompson <resiak@pidgin.im>
parents:
22549
diff
changeset
|
147 | * gtksound.c. |
|
14542
7c1dd9601f1d
[gaim-migrate @ 17199]
Mark Doliner <markdoliner@pidgin.im>
parents:
14323
diff
changeset
|
148 | */ |
| 14595 | 149 | static void |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
21984
diff
changeset
|
150 | clean_pid(void) |
| 10302 | 151 | { |
| 152 | int status; | |
| 153 | pid_t pid; | |
| 154 | ||
| 155 | do { | |
| 156 | pid = waitpid(-1, &status, WNOHANG); | |
| 157 | } while (pid != 0 && pid != (pid_t)-1); | |
|
10334
11feb68437a8
[gaim-migrate @ 11541]
Mark Doliner <markdoliner@pidgin.im>
parents:
10333
diff
changeset
|
158 | |
|
11feb68437a8
[gaim-migrate @ 11541]
Mark Doliner <markdoliner@pidgin.im>
parents:
10333
diff
changeset
|
159 | if ((pid == (pid_t) - 1) && (errno != ECHILD)) { |
| 10302 | 160 | char errmsg[BUFSIZ]; |
|
29991
37e306c31983
Try to be polite and free stuff associated with our signal watcher pipes
Mark Doliner <markdoliner@pidgin.im>
parents:
29662
diff
changeset
|
161 | snprintf(errmsg, sizeof(errmsg), "Warning: waitpid() returned %d", pid); |
| 10302 | 162 | perror(errmsg); |
| 163 | } | |
| 164 | } | |
| 165 | ||
|
28820
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
166 | static void sighandler(int sig) |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
167 | { |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
168 | ssize_t written; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
169 | |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
170 | /* |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
171 | * We won't do any of the heavy lifting for the signal handling here |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
172 | * because we have no idea what was interrupted. Previously this signal |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
173 | * handler could result in some calls to malloc/free, which can cause |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
174 | * deadlock in libc when the signal handler was interrupting a previous |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
175 | * malloc or free. So instead we'll do an ugly hack where we write the |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
176 | * signal number to one end of a socket pair. The other half of the |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
177 | * socket pair is watched by our main loop. When the main loop sees new |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
178 | * data on the socket it reads in the signal and performs the appropriate |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
179 | * action without fear of interrupting stuff. |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
180 | */ |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
181 | if (sig == SIGSEGV) { |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
182 | fprintf(stderr, "%s", segfault_message); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
183 | abort(); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
184 | return; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
185 | } |
|
12556
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
186 | |
|
28820
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
187 | written = write(signal_sockets[0], &sig, sizeof(int)); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
188 | if (written < 0 || written != sizeof(int)) { |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
189 | /* This should never happen */ |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
190 | purple_debug_error("sighandler", "Received signal %d but only " |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
191 | "wrote %" G_GSSIZE_FORMAT " bytes out of %" |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
192 | G_GSIZE_FORMAT ": %s\n", |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
193 | sig, written, sizeof(int), g_strerror(errno)); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
194 | exit(1); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
195 | } |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
196 | } |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
197 | |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
198 | static gboolean |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
199 | mainloop_sighandler(GIOChannel *source, GIOCondition cond, gpointer data) |
| 10302 | 200 | { |
|
28820
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
201 | GIOStatus stat; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
202 | int sig; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
203 | gsize bytes_read; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
204 | GError *error = NULL; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
205 | |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
206 | /* read the signal number off of the io channel */ |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
207 | stat = g_io_channel_read_chars(source, (gchar *)&sig, sizeof(int), |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
208 | &bytes_read, &error); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
209 | if (stat != G_IO_STATUS_NORMAL) { |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
210 | purple_debug_error("sighandler", "Signal callback failed to read " |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
211 | "from signal socket: %s", error->message); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
212 | purple_core_quit(); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
213 | return FALSE; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
214 | } |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
215 | |
| 10302 | 216 | switch (sig) { |
|
22631
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
217 | #if defined(USE_GSTREAMER) && !defined(GST_CAN_DISABLE_FORKING) |
|
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
218 | /* By default, gstreamer forks when you initialize it, and waitpids for the |
|
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
219 | * child. But if libpurple reaps the child rather than leaving it to |
|
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
220 | * gstreamer, gstreamer's initialization fails. So, we wait a second before |
|
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
221 | * reaping child processes, to give gst a chance to reap it if it wants to. |
|
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
222 | * |
|
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
223 | * This is not needed in later gstreamers, which let us disable the forking. |
|
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
224 | * And, it breaks the world on some Real Unices. |
|
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
225 | */ |
| 10302 | 226 | case SIGCHLD: |
|
22631
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
227 | /* Restore signal catching */ |
|
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
228 | signal(SIGCHLD, sighandler); |
|
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
229 | alarm(1); |
|
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
230 | break; |
|
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
231 | case SIGALRM: |
|
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
232 | #else |
|
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
233 | case SIGCHLD: |
|
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
234 | #endif |
| 14595 | 235 | clean_pid(); |
|
22631
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
236 | /* Restore signal catching */ |
|
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22622
diff
changeset
|
237 | signal(SIGCHLD, sighandler); |
| 10302 | 238 | break; |
| 239 | default: | |
| 15884 | 240 | purple_debug_warning("sighandler", "Caught signal %d\n", sig); |
|
23338
bf7332b531d3
Use purple_core_quit() in the sighandler instead of duplicating part of it.
Richard Laager <rlaager@pidgin.im>
parents:
22895
diff
changeset
|
241 | purple_core_quit(); |
| 10302 | 242 | } |
|
28820
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
243 | |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
244 | return TRUE; |
| 10302 | 245 | } |
| 246 | #endif | |
| 247 | ||
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
248 | static int |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
21984
diff
changeset
|
249 | ui_main(void) |
| 10302 | 250 | { |
| 251 | #ifndef _WIN32 | |
| 252 | GList *icons = NULL; | |
| 253 | GdkPixbuf *icon = NULL; | |
| 254 | char *icon_path; | |
|
36256
a437550a9308
Remove -Wno-sign-compare and backport fixes from default.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35995
diff
changeset
|
255 | gsize i; |
|
16504
ae9a01ab4db3
Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@pidgin.im>
parents:
16499
diff
changeset
|
256 | struct { |
|
ae9a01ab4db3
Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@pidgin.im>
parents:
16499
diff
changeset
|
257 | const char *dir; |
|
ae9a01ab4db3
Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@pidgin.im>
parents:
16499
diff
changeset
|
258 | const char *filename; |
|
ae9a01ab4db3
Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@pidgin.im>
parents:
16499
diff
changeset
|
259 | } icon_sizes[] = { |
|
ae9a01ab4db3
Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@pidgin.im>
parents:
16499
diff
changeset
|
260 | {"16x16", "pidgin.png"}, |
|
ae9a01ab4db3
Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@pidgin.im>
parents:
16499
diff
changeset
|
261 | {"24x24", "pidgin.png"}, |
|
ae9a01ab4db3
Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@pidgin.im>
parents:
16499
diff
changeset
|
262 | {"32x32", "pidgin.png"}, |
|
ae9a01ab4db3
Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@pidgin.im>
parents:
16499
diff
changeset
|
263 | {"48x48", "pidgin.png"}, |
|
ae9a01ab4db3
Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@pidgin.im>
parents:
16499
diff
changeset
|
264 | {"scalable", "pidgin.svg"} |
|
16052
d53fc4f13ff3
new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents:
15931
diff
changeset
|
265 | }; |
|
d53fc4f13ff3
new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents:
15931
diff
changeset
|
266 | |
| 10302 | 267 | #endif |
| 268 | ||
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16193
diff
changeset
|
269 | pidgin_themes_init(); |
| 10302 | 270 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
271 | pidgin_blist_setup_sort_methods(); |
| 10302 | 272 | |
| 273 | #ifndef _WIN32 | |
| 274 | /* use the nice PNG icon for all the windows */ | |
|
16052
d53fc4f13ff3
new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents:
15931
diff
changeset
|
275 | for(i=0; i<G_N_ELEMENTS(icon_sizes); i++) { |
|
16504
ae9a01ab4db3
Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@pidgin.im>
parents:
16499
diff
changeset
|
276 | icon_path = g_build_filename(DATADIR, "icons", "hicolor", icon_sizes[i].dir, "apps", icon_sizes[i].filename, NULL); |
|
31889
96183796df0c
Start looking at the GError parameter every time we call these functions:
Mark Doliner <markdoliner@pidgin.im>
parents:
31881
diff
changeset
|
277 | icon = pidgin_pixbuf_new_from_file(icon_path); |
|
16052
d53fc4f13ff3
new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents:
15931
diff
changeset
|
278 | g_free(icon_path); |
|
d53fc4f13ff3
new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents:
15931
diff
changeset
|
279 | if (icon) { |
|
d53fc4f13ff3
new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents:
15931
diff
changeset
|
280 | icons = g_list_append(icons,icon); |
|
d53fc4f13ff3
new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents:
15931
diff
changeset
|
281 | } else { |
|
d53fc4f13ff3
new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents:
15931
diff
changeset
|
282 | purple_debug_error("ui_main", |
|
22622
1ecb840b5101
Fix a bunch of compiler warnings caused by my addition of G_GNUC_PRINTF()
Mark Doliner <markdoliner@pidgin.im>
parents:
22565
diff
changeset
|
283 | "Failed to load the default window icon (%spx version)!\n", icon_sizes[i].dir); |
|
16052
d53fc4f13ff3
new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents:
15931
diff
changeset
|
284 | } |
|
d53fc4f13ff3
new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents:
15931
diff
changeset
|
285 | } |
|
d53fc4f13ff3
new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents:
15931
diff
changeset
|
286 | if(NULL == icons) { |
|
d53fc4f13ff3
new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents:
15931
diff
changeset
|
287 | purple_debug_error("ui_main", "Unable to load any size of default window icon!\n"); |
|
d53fc4f13ff3
new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents:
15931
diff
changeset
|
288 | } else { |
| 10302 | 289 | gtk_window_set_default_icon_list(icons); |
|
16052
d53fc4f13ff3
new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents:
15931
diff
changeset
|
290 | |
|
40764
d687fda4047d
Add a compatiblity layer for g_s?list_free_full and port everything to it.
Gary Kramlich <grim@reaperworld.com>
parents:
39010
diff
changeset
|
291 | g_list_free_full(icons, (GDestroyNotify)g_object_unref); |
| 10302 | 292 | } |
| 293 | #endif | |
| 294 | ||
| 295 | return 0; | |
| 296 | } | |
| 297 | ||
| 298 | static void | |
| 299 | debug_init(void) | |
| 300 | { | |
| 15884 | 301 | purple_debug_set_ui_ops(pidgin_debug_get_ui_ops()); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
302 | pidgin_debug_init(); |
| 10302 | 303 | } |
| 304 | ||
| 305 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
306 | pidgin_ui_init(void) |
| 10302 | 307 | { |
|
22481
d8a9e927c90f
Initialize the stock stuff before doing anything else so that stock items used in error messages are ready to be used. Fixes #4917.
Daniel Atallah <datallah@pidgin.im>
parents:
22187
diff
changeset
|
308 | pidgin_stock_init(); |
|
d8a9e927c90f
Initialize the stock stuff before doing anything else so that stock items used in error messages are ready to be used. Fixes #4917.
Daniel Atallah <datallah@pidgin.im>
parents:
22187
diff
changeset
|
309 | |
| 10302 | 310 | /* Set the UI operation structures. */ |
| 15884 | 311 | purple_accounts_set_ui_ops(pidgin_accounts_get_ui_ops()); |
| 312 | purple_xfers_set_ui_ops(pidgin_xfers_get_ui_ops()); | |
| 313 | purple_blist_set_ui_ops(pidgin_blist_get_ui_ops()); | |
| 314 | purple_notify_set_ui_ops(pidgin_notify_get_ui_ops()); | |
| 315 | purple_privacy_set_ui_ops(pidgin_privacy_get_ui_ops()); | |
| 316 | purple_request_set_ui_ops(pidgin_request_get_ui_ops()); | |
| 317 | purple_sound_set_ui_ops(pidgin_sound_get_ui_ops()); | |
| 318 | purple_connections_set_ui_ops(pidgin_connections_get_ui_ops()); | |
| 319 | purple_whiteboard_set_ui_ops(pidgin_whiteboard_get_ui_ops()); | |
|
22791
6b4c7afad987
Patch from Jeffery Brown to set the idle uiops on OS X when IOKit is available.
Will Thompson <resiak@pidgin.im>
parents:
22631
diff
changeset
|
320 | #if defined(USE_SCREENSAVER) || defined(HAVE_IOKIT) |
| 15884 | 321 | purple_idle_set_ui_ops(pidgin_idle_get_ui_ops()); |
|
12272
4eee92ead973
[gaim-migrate @ 14574]
Mark Doliner <markdoliner@pidgin.im>
parents:
12246
diff
changeset
|
322 | #endif |
| 10302 | 323 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
324 | pidgin_account_init(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
325 | pidgin_connection_init(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
326 | pidgin_blist_init(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
327 | pidgin_status_init(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
328 | pidgin_conversations_init(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
329 | pidgin_pounces_init(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
330 | pidgin_privacy_init(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
331 | pidgin_xfers_init(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
332 | pidgin_roomlist_init(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
333 | pidgin_log_init(); |
|
16796
1397249dcde1
Initialize docklet from pidgin_ui_init. This ensures docklet prefs are
Casey Harkins <charkins@pidgin.im>
parents:
16763
diff
changeset
|
334 | pidgin_docklet_init(); |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge VillaseƱo (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22187
diff
changeset
|
335 | pidgin_smileys_init(); |
|
24674
36bf974a7d78
Allow plugins to specify custom link types to the GtkIMHtml widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24585
diff
changeset
|
336 | pidgin_utils_init(); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
24585
diff
changeset
|
337 | pidgin_medias_init(); |
|
27476
d44640cb5686
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
338 | pidgin_notify_init(); |
| 10302 | 339 | } |
| 340 | ||
|
18442
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
341 | static GHashTable *ui_info = NULL; |
|
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
342 | |
| 10302 | 343 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
344 | pidgin_quit(void) |
| 10302 | 345 | { |
| 346 | #ifdef USE_SM | |
| 347 | /* unplug */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
348 | pidgin_session_end(); |
| 10302 | 349 | #endif |
| 350 | ||
|
10574
5abb2931b6ff
[gaim-migrate @ 11966]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10448
diff
changeset
|
351 | /* Uninit */ |
|
24674
36bf974a7d78
Allow plugins to specify custom link types to the GtkIMHtml widget.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24585
diff
changeset
|
352 | pidgin_utils_uninit(); |
|
27476
d44640cb5686
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
353 | pidgin_notify_uninit(); |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge VillaseƱo (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22187
diff
changeset
|
354 | pidgin_smileys_uninit(); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
355 | pidgin_conversations_uninit(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
356 | pidgin_status_uninit(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
357 | pidgin_docklet_uninit(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
358 | pidgin_blist_uninit(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
359 | pidgin_connection_uninit(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
360 | pidgin_account_uninit(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
361 | pidgin_xfers_uninit(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
362 | pidgin_debug_uninit(); |
|
10574
5abb2931b6ff
[gaim-migrate @ 11966]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10448
diff
changeset
|
363 | |
|
18442
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
364 | if(NULL != ui_info) |
|
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
365 | g_hash_table_destroy(ui_info); |
|
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
366 | |
| 10302 | 367 | /* and end it all... */ |
| 368 | gtk_main_quit(); | |
| 369 | } | |
| 370 | ||
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
21984
diff
changeset
|
371 | static GHashTable *pidgin_ui_get_info(void) |
|
18442
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
372 | { |
|
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
373 | if(NULL == ui_info) { |
|
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
374 | ui_info = g_hash_table_new(g_str_hash, g_str_equal); |
|
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
375 | |
|
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
376 | g_hash_table_insert(ui_info, "name", (char*)PIDGIN_NAME); |
|
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
377 | g_hash_table_insert(ui_info, "version", VERSION); |
|
23545
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23349
diff
changeset
|
378 | g_hash_table_insert(ui_info, "website", "http://pidgin.im"); |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23349
diff
changeset
|
379 | g_hash_table_insert(ui_info, "dev_website", "http://developer.pidgin.im"); |
|
25578
c0c1b73f4fb1
Changed "type" to "client_type" for the hash value specifying client type
Marcus Lundblad <malu@pidgin.im>
parents:
25577
diff
changeset
|
380 | g_hash_table_insert(ui_info, "client_type", "pc"); |
|
27685
6e8ce73aa4a4
Use a custom clientkey for AIM and ICQ for Pidgin and Finch
Mark Doliner <markdoliner@pidgin.im>
parents:
27476
diff
changeset
|
381 | |
|
6e8ce73aa4a4
Use a custom clientkey for AIM and ICQ for Pidgin and Finch
Mark Doliner <markdoliner@pidgin.im>
parents:
27476
diff
changeset
|
382 | /* |
|
38205
bbd7e672b3af
For AIM, use the DevID and the DistID supplied to us by an AOL representative via the devel mailing list in September 2016.
Robert Vehse <robertvehse@fastmail.fm>
parents:
36256
diff
changeset
|
383 | * prpl-aim-clientkey is a DevID (or "client key") for Pidgin, given to |
|
38206
3118251ccdef
Fix a typo. Thanks, Maiku.
Robert Vehse <robertvehse@fastmail.fm>
parents:
38205
diff
changeset
|
384 | * us by AOL in September 2016. prpl-icq-clientkey is also a client key |
|
38205
bbd7e672b3af
For AIM, use the DevID and the DistID supplied to us by an AOL representative via the devel mailing list in September 2016.
Robert Vehse <robertvehse@fastmail.fm>
parents:
36256
diff
changeset
|
385 | * for Pidgin, owned by the AIM account "markdoliner." Please don't use |
|
bbd7e672b3af
For AIM, use the DevID and the DistID supplied to us by an AOL representative via the devel mailing list in September 2016.
Robert Vehse <robertvehse@fastmail.fm>
parents:
36256
diff
changeset
|
386 | * either for other applications. Instead, you can either not specify a |
|
bbd7e672b3af
For AIM, use the DevID and the DistID supplied to us by an AOL representative via the devel mailing list in September 2016.
Robert Vehse <robertvehse@fastmail.fm>
parents:
36256
diff
changeset
|
387 | * client key, in which case the default "libpurple" key will be used, |
|
bbd7e672b3af
For AIM, use the DevID and the DistID supplied to us by an AOL representative via the devel mailing list in September 2016.
Robert Vehse <robertvehse@fastmail.fm>
parents:
36256
diff
changeset
|
388 | * or you can try to register your own at the AIM or ICQ web sites |
|
bbd7e672b3af
For AIM, use the DevID and the DistID supplied to us by an AOL representative via the devel mailing list in September 2016.
Robert Vehse <robertvehse@fastmail.fm>
parents:
36256
diff
changeset
|
389 | * (although this functionality was removed at some point, it's possible |
|
bbd7e672b3af
For AIM, use the DevID and the DistID supplied to us by an AOL representative via the devel mailing list in September 2016.
Robert Vehse <robertvehse@fastmail.fm>
parents:
36256
diff
changeset
|
390 | * it has been re-added). |
|
27685
6e8ce73aa4a4
Use a custom clientkey for AIM and ICQ for Pidgin and Finch
Mark Doliner <markdoliner@pidgin.im>
parents:
27476
diff
changeset
|
391 | */ |
|
38205
bbd7e672b3af
For AIM, use the DevID and the DistID supplied to us by an AOL representative via the devel mailing list in September 2016.
Robert Vehse <robertvehse@fastmail.fm>
parents:
36256
diff
changeset
|
392 | g_hash_table_insert(ui_info, "prpl-aim-clientkey", "do1UCeb5gNqxB1S1"); |
|
27685
6e8ce73aa4a4
Use a custom clientkey for AIM and ICQ for Pidgin and Finch
Mark Doliner <markdoliner@pidgin.im>
parents:
27476
diff
changeset
|
393 | g_hash_table_insert(ui_info, "prpl-icq-clientkey", "ma1cSASNCKFtrdv9"); |
|
27688
8c89470bfe9d
Oh, we don't need a special ui_info field for the AIM clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27685
diff
changeset
|
394 | |
|
8c89470bfe9d
Oh, we don't need a special ui_info field for the AIM clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27685
diff
changeset
|
395 | /* |
|
38205
bbd7e672b3af
For AIM, use the DevID and the DistID supplied to us by an AOL representative via the devel mailing list in September 2016.
Robert Vehse <robertvehse@fastmail.fm>
parents:
36256
diff
changeset
|
396 | * prpl-aim-distid is a distID for Pidgin, given to us by AOL in |
|
bbd7e672b3af
For AIM, use the DevID and the DistID supplied to us by an AOL representative via the devel mailing list in September 2016.
Robert Vehse <robertvehse@fastmail.fm>
parents:
36256
diff
changeset
|
397 | * September 2016. prpl-icq-distid is also a distID for Pidgin, given |
|
bbd7e672b3af
For AIM, use the DevID and the DistID supplied to us by an AOL representative via the devel mailing list in September 2016.
Robert Vehse <robertvehse@fastmail.fm>
parents:
36256
diff
changeset
|
398 | * to us by AOL. Please don't use either for other applications. |
|
bbd7e672b3af
For AIM, use the DevID and the DistID supplied to us by an AOL representative via the devel mailing list in September 2016.
Robert Vehse <robertvehse@fastmail.fm>
parents:
36256
diff
changeset
|
399 | * Instead, you can just not specify a distID and libpurple will use a |
|
bbd7e672b3af
For AIM, use the DevID and the DistID supplied to us by an AOL representative via the devel mailing list in September 2016.
Robert Vehse <robertvehse@fastmail.fm>
parents:
36256
diff
changeset
|
400 | * default. |
|
27688
8c89470bfe9d
Oh, we don't need a special ui_info field for the AIM clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27685
diff
changeset
|
401 | */ |
|
38205
bbd7e672b3af
For AIM, use the DevID and the DistID supplied to us by an AOL representative via the devel mailing list in September 2016.
Robert Vehse <robertvehse@fastmail.fm>
parents:
36256
diff
changeset
|
402 | g_hash_table_insert(ui_info, "prpl-aim-distid", GINT_TO_POINTER(1715)); |
|
27688
8c89470bfe9d
Oh, we don't need a special ui_info field for the AIM clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27685
diff
changeset
|
403 | g_hash_table_insert(ui_info, "prpl-icq-distid", GINT_TO_POINTER(1550)); |
|
18442
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
404 | } |
|
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
405 | |
|
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
406 | return ui_info; |
|
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
407 | } |
|
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
408 | |
| 15884 | 409 | static PurpleCoreUiOps core_ops = |
| 10302 | 410 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
411 | pidgin_prefs_init, |
| 10302 | 412 | debug_init, |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
413 | pidgin_ui_init, |
|
16752
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16545
diff
changeset
|
414 | pidgin_quit, |
|
18442
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
415 | pidgin_ui_get_info, |
|
16752
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16545
diff
changeset
|
416 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16545
diff
changeset
|
417 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16545
diff
changeset
|
418 | NULL |
| 10302 | 419 | }; |
| 420 | ||
| 15884 | 421 | static PurpleCoreUiOps * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
422 | pidgin_core_get_ui_ops(void) |
| 10302 | 423 | { |
| 424 | return &core_ops; | |
| 425 | } | |
| 426 | ||
| 427 | static void | |
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10317
diff
changeset
|
428 | show_usage(const char *name, gboolean terse) |
| 10302 | 429 | { |
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10317
diff
changeset
|
430 | char *text; |
|
12846
93ff2d8dd1e7
[gaim-migrate @ 15194]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
12838
diff
changeset
|
431 | |
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10317
diff
changeset
|
432 | if (terse) { |
|
21106
b85fbef13eed
Add a --with-extraversion option to ./configure so packagers can fine tune
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
433 | text = g_strdup_printf(_("%s %s. Try `%s -h' for more information.\n"), PIDGIN_NAME, DISPLAY_VERSION, name); |
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10317
diff
changeset
|
434 | } else { |
|
28275
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
435 | GString *str = g_string_new(NULL); |
|
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
436 | g_string_append_printf(str, "%s %s\n", PIDGIN_NAME, DISPLAY_VERSION); |
|
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
437 | g_string_append_printf(str, _("Usage: %s [OPTION]...\n\n"), name); |
|
28473
aede2f49264b
Make DIR and NAME localizable
Mark Doliner <markdoliner@pidgin.im>
parents:
28275
diff
changeset
|
438 | g_string_append_printf(str, " -c, --config=%s %s\n", |
|
aede2f49264b
Make DIR and NAME localizable
Mark Doliner <markdoliner@pidgin.im>
parents:
28275
diff
changeset
|
439 | _("DIR"), _("use DIR for config files")); |
|
28275
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
440 | g_string_append_printf(str, " -d, --debug %s\n", |
|
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
441 | _("print debugging messages to stdout")); |
|
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
442 | g_string_append_printf(str, " -f, --force-online %s\n", |
|
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
443 | _("force online, regardless of network status")); |
|
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
444 | g_string_append_printf(str, " -h, --help %s\n", |
|
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
445 | _("display this help and exit")); |
|
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
446 | g_string_append_printf(str, " -m, --multiple %s\n", |
|
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
447 | _("allow multiple instances")); |
|
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
448 | g_string_append_printf(str, " -n, --nologin %s\n", |
|
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
449 | _("don't automatically login")); |
|
28473
aede2f49264b
Make DIR and NAME localizable
Mark Doliner <markdoliner@pidgin.im>
parents:
28275
diff
changeset
|
450 | g_string_append_printf(str, " -l, --login[=%s] %s\n", |
|
aede2f49264b
Make DIR and NAME localizable
Mark Doliner <markdoliner@pidgin.im>
parents:
28275
diff
changeset
|
451 | _("NAME"), |
|
28275
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
452 | _("enable specified account(s) (optional argument NAME\n" |
|
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
453 | " " |
|
28511
2c088c4a48c1
Comebine two separate strings into one, thus restoring balance to the
Mark Doliner <markdoliner@pidgin.im>
parents:
28473
diff
changeset
|
454 | "specifies account(s) to use, separated by commas.\n" |
|
2c088c4a48c1
Comebine two separate strings into one, thus restoring balance to the
Mark Doliner <markdoliner@pidgin.im>
parents:
28473
diff
changeset
|
455 | " " |
|
2c088c4a48c1
Comebine two separate strings into one, thus restoring balance to the
Mark Doliner <markdoliner@pidgin.im>
parents:
28473
diff
changeset
|
456 | "Without this only the first account will be enabled).")); |
|
21984
56574d6a456e
Ye Olde Compiler complained about this:
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21727
diff
changeset
|
457 | #ifndef WIN32 |
|
28275
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
458 | g_string_append_printf(str, " --display=DISPLAY %s\n", |
|
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
459 | _("X display to use")); |
|
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
460 | #endif /* !WIN32 */ |
|
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
461 | g_string_append_printf(str, " -v, --version %s\n", |
|
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
462 | _("display the current version and exit")); |
|
149a59ce7546
Split the descriptions of our --help text up into multiple smaller
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
463 | text = g_string_free(str, FALSE); |
| 10302 | 464 | } |
| 465 | ||
| 15884 | 466 | purple_print_utf8_to_console(stdout, text); |
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10317
diff
changeset
|
467 | g_free(text); |
| 10302 | 468 | } |
| 469 | ||
| 470 | /* FUCKING GET ME A TOWEL! */ | |
| 471 | #ifdef _WIN32 | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15578
diff
changeset
|
472 | /* suppress gcc "no previous prototype" warning */ |
|
33371
6d93866a4a3f
Explictly set the calling conventions for some dynamic functions on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
31889
diff
changeset
|
473 | int __cdecl pidgin_main(HINSTANCE hint, int argc, char *argv[]); |
|
6d93866a4a3f
Explictly set the calling conventions for some dynamic functions on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
31889
diff
changeset
|
474 | int __cdecl pidgin_main(HINSTANCE hint, int argc, char *argv[]) |
| 10302 | 475 | #else |
| 476 | int main(int argc, char *argv[]) | |
| 477 | #endif | |
| 478 | { | |
|
24999
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
479 | gboolean opt_force_online = FALSE; |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
480 | gboolean opt_help = FALSE; |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
481 | gboolean opt_login = FALSE; |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
482 | gboolean opt_nologin = FALSE; |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
483 | gboolean opt_version = FALSE; |
|
18207
e89bf4430ea6
Allow disabling check for single instance.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18191
diff
changeset
|
484 | gboolean opt_si = TRUE; /* Check for single instance? */ |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
485 | char *opt_config_dir_arg = NULL; |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
486 | char *opt_login_arg = NULL; |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
487 | char *opt_session_arg = NULL; |
|
10447
887380ec66f5
[gaim-migrate @ 11712]
Mark Doliner <markdoliner@pidgin.im>
parents:
10433
diff
changeset
|
488 | char *search_path; |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
489 | GList *accounts; |
|
13428
78687459c64b
[gaim-migrate @ 15802]
Daniel Atallah <datallah@pidgin.im>
parents:
13322
diff
changeset
|
490 | #ifdef HAVE_SIGNAL_H |
| 10302 | 491 | int sig_indx; /* for setting up signal catching */ |
| 492 | sigset_t sigset; | |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
493 | char errmsg[BUFSIZ]; |
|
28820
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
494 | GIOChannel *signal_channel; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
495 | GIOStatus signal_status; |
|
29991
37e306c31983
Try to be polite and free stuff associated with our signal watcher pipes
Mark Doliner <markdoliner@pidgin.im>
parents:
29662
diff
changeset
|
496 | guint signal_channel_watcher; |
|
13215
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
497 | #ifndef DEBUG |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
498 | char *segfault_message_tmp; |
|
28836
737062c0d40c
Fix compile with debugging enabled.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
28820
diff
changeset
|
499 | #endif |
|
29991
37e306c31983
Try to be polite and free stuff associated with our signal watcher pipes
Mark Doliner <markdoliner@pidgin.im>
parents:
29662
diff
changeset
|
500 | GError *error; |
|
13215
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
501 | #endif |
|
14636
5306c329992c
[gaim-migrate @ 17298]
Daniel Atallah <datallah@pidgin.im>
parents:
14623
diff
changeset
|
502 | int opt; |
|
5306c329992c
[gaim-migrate @ 17298]
Daniel Atallah <datallah@pidgin.im>
parents:
14623
diff
changeset
|
503 | gboolean gui_check; |
|
5306c329992c
[gaim-migrate @ 17298]
Daniel Atallah <datallah@pidgin.im>
parents:
14623
diff
changeset
|
504 | gboolean debug_enabled; |
|
16419
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
505 | gboolean migration_failed = FALSE; |
|
18121
2d8ea56b9097
Mark the return type const for the following functions. I noticed this
Richard Laager <rlaager@pidgin.im>
parents:
18093
diff
changeset
|
506 | GList *active_accounts; |
| 10302 | 507 | |
| 508 | struct option long_options[] = { | |
|
24999
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
509 | {"config", required_argument, NULL, 'c'}, |
|
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
510 | {"debug", no_argument, NULL, 'd'}, |
|
30844
0d9af8dbf654
Fix typoed short option for "force-online".
Daniel Atallah <datallah@pidgin.im>
parents:
30477
diff
changeset
|
511 | {"force-online", no_argument, NULL, 'f'}, |
|
24999
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
512 | {"help", no_argument, NULL, 'h'}, |
|
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
513 | {"login", optional_argument, NULL, 'l'}, |
|
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
514 | {"multiple", no_argument, NULL, 'm'}, |
|
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
515 | {"nologin", no_argument, NULL, 'n'}, |
|
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
516 | {"session", required_argument, NULL, 's'}, |
|
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
517 | {"version", no_argument, NULL, 'v'}, |
|
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
518 | {"display", required_argument, NULL, 'D'}, |
|
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
519 | {"sync", no_argument, NULL, 'S'}, |
| 10302 | 520 | {0, 0, 0, 0} |
| 521 | }; | |
| 522 | ||
| 523 | #ifdef DEBUG | |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10306
diff
changeset
|
524 | debug_enabled = TRUE; |
|
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10306
diff
changeset
|
525 | #else |
|
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10306
diff
changeset
|
526 | debug_enabled = FALSE; |
| 10302 | 527 | #endif |
|
17105
c0a8e07ee507
disapproval of revision 'd3231850edf096c5afacfab40b53717b34098355'
Sean Egan <seanegan@pidgin.im>
parents:
17104
diff
changeset
|
528 | |
|
35980
b44c08754471
Backport warning fixes for Pidgin from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33794
diff
changeset
|
529 | #if !GLIB_CHECK_VERSION(2, 32, 0) |
|
b44c08754471
Backport warning fixes for Pidgin from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33794
diff
changeset
|
530 | /* GLib threading system is automaticaly initialized since 2.32. |
|
b44c08754471
Backport warning fixes for Pidgin from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33794
diff
changeset
|
531 | * For earlier versions, it have to be initialized before calling any |
|
b44c08754471
Backport warning fixes for Pidgin from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33794
diff
changeset
|
532 | * Glib or GTK+ functions. |
|
b44c08754471
Backport warning fixes for Pidgin from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33794
diff
changeset
|
533 | */ |
|
17105
c0a8e07ee507
disapproval of revision 'd3231850edf096c5afacfab40b53717b34098355'
Sean Egan <seanegan@pidgin.im>
parents:
17104
diff
changeset
|
534 | g_thread_init(NULL); |
|
35980
b44c08754471
Backport warning fixes for Pidgin from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33794
diff
changeset
|
535 | #endif |
|
18232
2b0a1d552f56
Use g_set_application_name() so unnamed dialogs get given a name, my
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
18208
diff
changeset
|
536 | |
|
28934
d2d81a26a190
Set prgname for pidgin.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
28836
diff
changeset
|
537 | g_set_prgname("Pidgin"); |
|
d2d81a26a190
Set prgname for pidgin.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
28836
diff
changeset
|
538 | |
| 10302 | 539 | #ifdef ENABLE_NLS |
| 540 | bindtextdomain(PACKAGE, LOCALEDIR); | |
| 541 | bind_textdomain_codeset(PACKAGE, "UTF-8"); | |
| 542 | textdomain(PACKAGE); | |
| 543 | #endif | |
| 544 | ||
|
13090
aee4ed853ff3
[gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13024
diff
changeset
|
545 | #ifdef HAVE_SETLOCALE |
|
aee4ed853ff3
[gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13024
diff
changeset
|
546 | /* Locale initialization is not complete here. See gtk_init_check() */ |
|
aee4ed853ff3
[gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13024
diff
changeset
|
547 | setlocale(LC_ALL, ""); |
|
aee4ed853ff3
[gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13024
diff
changeset
|
548 | #endif |
|
11080
0578003800d0
[gaim-migrate @ 13092]
Piotr Zielinski <zielaj@users.sourceforge.net>
parents:
11067
diff
changeset
|
549 | |
|
13428
78687459c64b
[gaim-migrate @ 15802]
Daniel Atallah <datallah@pidgin.im>
parents:
13322
diff
changeset
|
550 | #ifdef HAVE_SIGNAL_H |
|
12556
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
551 | |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
552 | #ifndef DEBUG |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
553 | /* We translate this here in case the crash breaks gettext. */ |
|
13215
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
554 | segfault_message_tmp = g_strdup_printf(_( |
|
20395
81c963c89157
Include the version in the segfault message - enough people blindly copy
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20346
diff
changeset
|
555 | "%s %s has segfaulted and attempted to dump a core file.\n" |
|
12556
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
556 | "This is a bug in the software and has happened through\n" |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
557 | "no fault of your own.\n\n" |
|
16977
c9cb49bea66d
Change the PIDGIN_NAME stuff to allow translators to transliterate the
Richard Laager <rlaager@pidgin.im>
parents:
16967
diff
changeset
|
558 | "If you can reproduce the crash, please notify the developers\n" |
|
c9cb49bea66d
Change the PIDGIN_NAME stuff to allow translators to transliterate the
Richard Laager <rlaager@pidgin.im>
parents:
16967
diff
changeset
|
559 | "by reporting a bug at:\n" |
|
18256
63c91e6c806e
I believe the great unwashed should be using simpleticket for submitting
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
18232
diff
changeset
|
560 | "%ssimpleticket/\n\n" |
|
12556
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
561 | "Please make sure to specify what you were doing at the time\n" |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
562 | "and post the backtrace from the core file. If you do not know\n" |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
563 | "how to get the backtrace, please read the instructions at\n" |
|
24585
25d84f35abf8
kluge pointed out that the segfault message still recommends people IM
Richard Laager <rlaager@pidgin.im>
parents:
23545
diff
changeset
|
564 | "%swiki/GetABacktrace\n"), |
|
25d84f35abf8
kluge pointed out that the segfault message still recommends people IM
Richard Laager <rlaager@pidgin.im>
parents:
23545
diff
changeset
|
565 | PIDGIN_NAME, DISPLAY_VERSION, PURPLE_DEVEL_WEBSITE, PURPLE_DEVEL_WEBSITE |
|
13090
aee4ed853ff3
[gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13024
diff
changeset
|
566 | ); |
|
13587
fb0245a7ccab
[gaim-migrate @ 15971]
Daniel Atallah <datallah@pidgin.im>
parents:
13429
diff
changeset
|
567 | |
|
13215
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
568 | /* we have to convert the message (UTF-8 to console |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
569 | charset) early because after a segmentation fault |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
570 | it's not a good practice to allocate memory */ |
|
29991
37e306c31983
Try to be polite and free stuff associated with our signal watcher pipes
Mark Doliner <markdoliner@pidgin.im>
parents:
29662
diff
changeset
|
571 | error = NULL; |
|
13587
fb0245a7ccab
[gaim-migrate @ 15971]
Daniel Atallah <datallah@pidgin.im>
parents:
13429
diff
changeset
|
572 | segfault_message = g_locale_from_utf8(segfault_message_tmp, |
|
13215
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
573 | -1, NULL, NULL, &error); |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
574 | if (segfault_message != NULL) { |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
575 | g_free(segfault_message_tmp); |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
576 | } |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
577 | else { |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
578 | /* use 'segfault_message_tmp' (UTF-8) as a fallback */ |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
579 | g_warning("%s\n", error->message); |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
580 | g_error_free(error); |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
581 | segfault_message = segfault_message_tmp; |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
582 | } |
|
12556
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
583 | #else |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
584 | /* Don't mark this for translation. */ |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
585 | segfault_message = g_strdup( |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
586 | "Hi, user. We need to talk.\n" |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
587 | "I think something's gone wrong here. It's probably my fault.\n" |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
588 | "No, really, it's not you... it's me... no no no, I think we get along well\n" |
| 12670 | 589 | "it's just that.... well, I want to see other people. I... what?!? NO! I \n" |
| 590 | "haven't been cheating on you!! How many times do you want me to tell you?! And\n" | |
| 591 | "for the last time, it's just a rash!\n" | |
|
12556
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
592 | ); |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
593 | #endif |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
594 | |
|
28820
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
595 | /* |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
596 | * Create a socket pair for receiving unix signals from a signal |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
597 | * handler. |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
598 | */ |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
599 | if (socketpair(AF_UNIX, SOCK_STREAM, 0, signal_sockets) < 0) { |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
600 | perror("Failed to create sockets for GLib signal handling"); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
601 | exit(1); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
602 | } |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
603 | signal_channel = g_io_channel_unix_new(signal_sockets[1]); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
604 | |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
605 | /* |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
606 | * Set the channel encoding to raw binary instead of the default of |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
607 | * UTF-8, because we'll be sending integers across instead of strings. |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
608 | */ |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
609 | error = NULL; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
610 | signal_status = g_io_channel_set_encoding(signal_channel, NULL, &error); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
611 | if (signal_status != G_IO_STATUS_NORMAL) { |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
612 | fprintf(stderr, "Failed to set the signal channel to raw " |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
613 | "binary: %s", error->message); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
614 | exit(1); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
615 | } |
|
29991
37e306c31983
Try to be polite and free stuff associated with our signal watcher pipes
Mark Doliner <markdoliner@pidgin.im>
parents:
29662
diff
changeset
|
616 | signal_channel_watcher = g_io_add_watch(signal_channel, G_IO_IN, mainloop_sighandler, NULL); |
|
37e306c31983
Try to be polite and free stuff associated with our signal watcher pipes
Mark Doliner <markdoliner@pidgin.im>
parents:
29662
diff
changeset
|
617 | g_io_channel_unref(signal_channel); |
|
28820
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
618 | |
| 10302 | 619 | /* Let's not violate any PLA's!!!! */ |
| 620 | /* jseymour: whatever the fsck that means */ | |
| 621 | /* Robot101: for some reason things like gdm like to block * | |
| 622 | * useful signals like SIGCHLD, so we unblock all the ones we * | |
| 623 | * declare a handler for. thanks JSeymour and Vann. */ | |
| 624 | if (sigemptyset(&sigset)) { | |
|
29991
37e306c31983
Try to be polite and free stuff associated with our signal watcher pipes
Mark Doliner <markdoliner@pidgin.im>
parents:
29662
diff
changeset
|
625 | snprintf(errmsg, sizeof(errmsg), "Warning: couldn't initialise empty signal set"); |
| 10302 | 626 | perror(errmsg); |
| 627 | } | |
| 628 | for(sig_indx = 0; catch_sig_list[sig_indx] != -1; ++sig_indx) { | |
|
33794
716cbef8d1c6
Fix a number of additional trivial issues - unused variables, etc.
Daniel Atallah <datallah@pidgin.im>
parents:
33371
diff
changeset
|
629 | if(signal(catch_sig_list[sig_indx], sighandler) == SIG_ERR) { |
|
29991
37e306c31983
Try to be polite and free stuff associated with our signal watcher pipes
Mark Doliner <markdoliner@pidgin.im>
parents:
29662
diff
changeset
|
630 | snprintf(errmsg, sizeof(errmsg), "Warning: couldn't set signal %d for catching", |
| 10302 | 631 | catch_sig_list[sig_indx]); |
| 632 | perror(errmsg); | |
| 633 | } | |
| 634 | if(sigaddset(&sigset, catch_sig_list[sig_indx])) { | |
|
29991
37e306c31983
Try to be polite and free stuff associated with our signal watcher pipes
Mark Doliner <markdoliner@pidgin.im>
parents:
29662
diff
changeset
|
635 | snprintf(errmsg, sizeof(errmsg), "Warning: couldn't include signal %d for unblocking", |
| 10302 | 636 | catch_sig_list[sig_indx]); |
| 637 | perror(errmsg); | |
| 638 | } | |
| 639 | } | |
| 640 | for(sig_indx = 0; ignore_sig_list[sig_indx] != -1; ++sig_indx) { | |
|
33794
716cbef8d1c6
Fix a number of additional trivial issues - unused variables, etc.
Daniel Atallah <datallah@pidgin.im>
parents:
33371
diff
changeset
|
641 | if(signal(ignore_sig_list[sig_indx], SIG_IGN) == SIG_ERR) { |
|
29991
37e306c31983
Try to be polite and free stuff associated with our signal watcher pipes
Mark Doliner <markdoliner@pidgin.im>
parents:
29662
diff
changeset
|
642 | snprintf(errmsg, sizeof(errmsg), "Warning: couldn't set signal %d to ignore", |
| 10302 | 643 | ignore_sig_list[sig_indx]); |
| 644 | perror(errmsg); | |
| 645 | } | |
| 646 | } | |
| 647 | ||
| 648 | if (sigprocmask(SIG_UNBLOCK, &sigset, NULL)) { | |
|
29991
37e306c31983
Try to be polite and free stuff associated with our signal watcher pipes
Mark Doliner <markdoliner@pidgin.im>
parents:
29662
diff
changeset
|
649 | snprintf(errmsg, sizeof(errmsg), "Warning: couldn't unblock signals"); |
| 10302 | 650 | perror(errmsg); |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10306
diff
changeset
|
651 | } |
| 10302 | 652 | #endif |
| 653 | ||
| 654 | /* scan command-line options */ | |
| 655 | opterr = 1; | |
| 656 | while ((opt = getopt_long(argc, argv, | |
| 657 | #ifndef _WIN32 | |
|
24999
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
658 | "c:dfhmnl::s:v", |
| 10302 | 659 | #else |
|
24999
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
660 | "c:dfhmnl::v", |
| 10302 | 661 | #endif |
| 662 | long_options, NULL)) != -1) { | |
| 663 | switch (opt) { | |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
664 | case 'c': /* config dir */ |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
665 | g_free(opt_config_dir_arg); |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
666 | opt_config_dir_arg = g_strdup(optarg); |
| 10302 | 667 | break; |
| 668 | case 'd': /* debug */ | |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10306
diff
changeset
|
669 | debug_enabled = TRUE; |
| 10302 | 670 | break; |
|
24999
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
671 | case 'f': /* force-online */ |
|
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
672 | opt_force_online = TRUE; |
|
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
673 | break; |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
674 | case 'h': /* help */ |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
675 | opt_help = TRUE; |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
676 | break; |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
677 | case 'n': /* no autologin */ |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
678 | opt_nologin = TRUE; |
| 10302 | 679 | break; |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
680 | case 'l': /* login, option username */ |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
681 | opt_login = TRUE; |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
682 | g_free(opt_login_arg); |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
683 | if (optarg != NULL) |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
684 | opt_login_arg = g_strdup(optarg); |
| 10302 | 685 | break; |
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10317
diff
changeset
|
686 | case 's': /* use existing session ID */ |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
687 | g_free(opt_session_arg); |
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10317
diff
changeset
|
688 | opt_session_arg = g_strdup(optarg); |
|
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10317
diff
changeset
|
689 | break; |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
690 | case 'v': /* version */ |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
691 | opt_version = TRUE; |
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10317
diff
changeset
|
692 | break; |
|
18207
e89bf4430ea6
Allow disabling check for single instance.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18191
diff
changeset
|
693 | case 'm': /* do not ensure single instance. */ |
|
e89bf4430ea6
Allow disabling check for single instance.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18191
diff
changeset
|
694 | opt_si = FALSE; |
|
e89bf4430ea6
Allow disabling check for single instance.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18191
diff
changeset
|
695 | break; |
|
20346
06c3e9cfdc27
Accept --display as an argument, to be passed to Gtk+.
Ethan Blanton <elb@pidgin.im>
parents:
19859
diff
changeset
|
696 | case 'D': /* --display */ |
|
22187
6269c8333ae6
Allow --sync to reach gtk initialization. This is basically the same as
Richard Laager <rlaager@pidgin.im>
parents:
22104
diff
changeset
|
697 | case 'S': /* --sync */ |
|
20346
06c3e9cfdc27
Accept --display as an argument, to be passed to Gtk+.
Ethan Blanton <elb@pidgin.im>
parents:
19859
diff
changeset
|
698 | /* handled by gtk_init_check below */ |
|
06c3e9cfdc27
Accept --display as an argument, to be passed to Gtk+.
Ethan Blanton <elb@pidgin.im>
parents:
19859
diff
changeset
|
699 | break; |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
700 | case '?': /* show terse help */ |
| 10302 | 701 | default: |
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10317
diff
changeset
|
702 | show_usage(argv[0], TRUE); |
|
16193
e27165dcba9b
Free segfault_message when Pidgin exits abnormally
Mark Doliner <markdoliner@pidgin.im>
parents:
16158
diff
changeset
|
703 | #ifdef HAVE_SIGNAL_H |
|
e27165dcba9b
Free segfault_message when Pidgin exits abnormally
Mark Doliner <markdoliner@pidgin.im>
parents:
16158
diff
changeset
|
704 | g_free(segfault_message); |
|
e27165dcba9b
Free segfault_message when Pidgin exits abnormally
Mark Doliner <markdoliner@pidgin.im>
parents:
16158
diff
changeset
|
705 | #endif |
| 10302 | 706 | return 0; |
| 707 | break; | |
| 708 | } | |
| 709 | } | |
| 710 | ||
| 711 | /* show help message */ | |
| 712 | if (opt_help) { | |
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10317
diff
changeset
|
713 | show_usage(argv[0], FALSE); |
|
16193
e27165dcba9b
Free segfault_message when Pidgin exits abnormally
Mark Doliner <markdoliner@pidgin.im>
parents:
16158
diff
changeset
|
714 | #ifdef HAVE_SIGNAL_H |
|
e27165dcba9b
Free segfault_message when Pidgin exits abnormally
Mark Doliner <markdoliner@pidgin.im>
parents:
16158
diff
changeset
|
715 | g_free(segfault_message); |
|
e27165dcba9b
Free segfault_message when Pidgin exits abnormally
Mark Doliner <markdoliner@pidgin.im>
parents:
16158
diff
changeset
|
716 | #endif |
| 10302 | 717 | return 0; |
| 718 | } | |
| 719 | /* show version message */ | |
| 720 | if (opt_version) { | |
|
25702
41a5336bc2d6
applied changes from 20269e8849976ad6a0996f79ccbc0a12a311484f
Ethan Blanton <elb@pidgin.im>
parents:
25460
diff
changeset
|
721 | printf("%s %s (libpurple %s)\n", PIDGIN_NAME, DISPLAY_VERSION, |
|
41a5336bc2d6
applied changes from 20269e8849976ad6a0996f79ccbc0a12a311484f
Ethan Blanton <elb@pidgin.im>
parents:
25460
diff
changeset
|
722 | purple_core_get_version()); |
|
16193
e27165dcba9b
Free segfault_message when Pidgin exits abnormally
Mark Doliner <markdoliner@pidgin.im>
parents:
16158
diff
changeset
|
723 | #ifdef HAVE_SIGNAL_H |
|
e27165dcba9b
Free segfault_message when Pidgin exits abnormally
Mark Doliner <markdoliner@pidgin.im>
parents:
16158
diff
changeset
|
724 | g_free(segfault_message); |
|
e27165dcba9b
Free segfault_message when Pidgin exits abnormally
Mark Doliner <markdoliner@pidgin.im>
parents:
16158
diff
changeset
|
725 | #endif |
| 10302 | 726 | return 0; |
| 727 | } | |
| 728 | ||
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
729 | /* set a user-specified config directory */ |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
730 | if (opt_config_dir_arg != NULL) { |
| 15884 | 731 | purple_util_set_user_dir(opt_config_dir_arg); |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
732 | } |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
733 | |
|
10448
4415ffba12e9
[gaim-migrate @ 11713]
Mark Doliner <markdoliner@pidgin.im>
parents:
10447
diff
changeset
|
734 | /* |
|
4415ffba12e9
[gaim-migrate @ 11713]
Mark Doliner <markdoliner@pidgin.im>
parents:
10447
diff
changeset
|
735 | * We're done piddling around with command line arguments. |
|
4415ffba12e9
[gaim-migrate @ 11713]
Mark Doliner <markdoliner@pidgin.im>
parents:
10447
diff
changeset
|
736 | * Fire up this baby. |
|
4415ffba12e9
[gaim-migrate @ 11713]
Mark Doliner <markdoliner@pidgin.im>
parents:
10447
diff
changeset
|
737 | */ |
|
4415ffba12e9
[gaim-migrate @ 11713]
Mark Doliner <markdoliner@pidgin.im>
parents:
10447
diff
changeset
|
738 | |
| 15884 | 739 | purple_debug_set_enabled(debug_enabled); |
|
10448
4415ffba12e9
[gaim-migrate @ 11713]
Mark Doliner <markdoliner@pidgin.im>
parents:
10447
diff
changeset
|
740 | |
|
16419
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
741 | /* If we're using a custom configuration directory, we |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
742 | * do NOT want to migrate, or weird things will happen. */ |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
743 | if (opt_config_dir_arg == NULL) |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
744 | { |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
745 | if (!purple_core_migrate()) |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
746 | { |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
747 | migration_failed = TRUE; |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
748 | } |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
749 | } |
|
11067
b6353889a9ba
[gaim-migrate @ 13048]
Piotr Zielinski <zielaj@users.sourceforge.net>
parents:
11055
diff
changeset
|
750 | |
| 15884 | 751 | search_path = g_build_filename(purple_user_dir(), "gtkrc-2.0", NULL); |
|
12572
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
752 | gtk_rc_add_default_file(search_path); |
|
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
753 | g_free(search_path); |
|
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
754 | |
|
39010
fbce915a7024
Outbound screenshare window/monitor selection
David Woodhouse <dwmw2@infradead.org>
parents:
38206
diff
changeset
|
755 | #if defined(HAVE_X11) && defined(USE_VV) |
|
fbce915a7024
Outbound screenshare window/monitor selection
David Woodhouse <dwmw2@infradead.org>
parents:
38206
diff
changeset
|
756 | /* GStreamer elements such as ximagesrc may require this */ |
|
fbce915a7024
Outbound screenshare window/monitor selection
David Woodhouse <dwmw2@infradead.org>
parents:
38206
diff
changeset
|
757 | XInitThreads(); |
|
fbce915a7024
Outbound screenshare window/monitor selection
David Woodhouse <dwmw2@infradead.org>
parents:
38206
diff
changeset
|
758 | #endif |
|
fbce915a7024
Outbound screenshare window/monitor selection
David Woodhouse <dwmw2@infradead.org>
parents:
38206
diff
changeset
|
759 | |
|
12572
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
760 | gui_check = gtk_init_check(&argc, &argv); |
|
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
761 | if (!gui_check) { |
|
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
762 | char *display = gdk_get_display(); |
|
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
763 | |
|
21106
b85fbef13eed
Add a --with-extraversion option to ./configure so packagers can fine tune
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
764 | printf("%s %s\n", PIDGIN_NAME, DISPLAY_VERSION); |
|
12572
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
765 | |
|
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
766 | g_warning("cannot open display: %s", display ? display : "unset"); |
|
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
767 | g_free(display); |
|
16193
e27165dcba9b
Free segfault_message when Pidgin exits abnormally
Mark Doliner <markdoliner@pidgin.im>
parents:
16158
diff
changeset
|
768 | #ifdef HAVE_SIGNAL_H |
|
e27165dcba9b
Free segfault_message when Pidgin exits abnormally
Mark Doliner <markdoliner@pidgin.im>
parents:
16158
diff
changeset
|
769 | g_free(segfault_message); |
|
e27165dcba9b
Free segfault_message when Pidgin exits abnormally
Mark Doliner <markdoliner@pidgin.im>
parents:
16158
diff
changeset
|
770 | #endif |
|
12572
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
771 | |
|
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
772 | return 1; |
|
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
773 | } |
|
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
774 | |
|
28800
a57c85844d28
Use PIDGIN_NAME here, rather than duplicate it.
Richard Laager <rlaager@pidgin.im>
parents:
28511
diff
changeset
|
775 | g_set_application_name(PIDGIN_NAME); |
|
18345
a51a9c1e4314
Move g_set_application_name to a point before the pidgin UI is created
Gabriel Schulhof <nix@go-nix.ca>
parents:
18256
diff
changeset
|
776 | |
|
12572
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
777 | #ifdef _WIN32 |
|
15574
18d9d1c05994
Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents:
15567
diff
changeset
|
778 | winpidgin_init(hint); |
|
12572
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
779 | #endif |
|
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
780 | |
|
16419
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
781 | if (migration_failed) |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
782 | { |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
783 | char *old = g_strconcat(purple_home_dir(), |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
784 | G_DIR_SEPARATOR_S ".gaim", NULL); |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16419
diff
changeset
|
785 | const char *text = _( |
|
16446
3a6ed6c3400e
Fix the custom icon stuff, and various memory leaks. At this point, custom
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
786 | "%s encountered errors migrating your settings " |
|
16419
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
787 | "from %s to %s. Please investigate and complete the " |
| 16763 | 788 | "migration by hand. Please report this error at http://developer.pidgin.im"); |
|
16419
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
789 | GtkWidget *dialog; |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
790 | |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
791 | dialog = gtk_message_dialog_new(NULL, |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
792 | 0, |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
793 | GTK_MESSAGE_ERROR, |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
794 | GTK_BUTTONS_CLOSE, |
|
16446
3a6ed6c3400e
Fix the custom icon stuff, and various memory leaks. At this point, custom
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
795 | text, PIDGIN_NAME, |
|
3a6ed6c3400e
Fix the custom icon stuff, and various memory leaks. At this point, custom
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
796 | old, purple_user_dir()); |
|
16419
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
797 | g_free(old); |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
798 | |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
799 | g_signal_connect_swapped(dialog, "response", |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
800 | G_CALLBACK(gtk_main_quit), NULL); |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
801 | |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
802 | gtk_widget_show_all(dialog); |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
803 | |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
804 | gtk_main(); |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
805 | |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
806 | #ifdef HAVE_SIGNAL_H |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
807 | g_free(segfault_message); |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
808 | #endif |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
809 | return 0; |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
810 | } |
|
8a5a3e2cd3a7
Call the core migrate code.
Richard Laager <rlaager@pidgin.im>
parents:
16263
diff
changeset
|
811 | |
| 15884 | 812 | purple_core_set_ui_ops(pidgin_core_get_ui_ops()); |
| 813 | purple_eventloop_set_ui_ops(pidgin_eventloop_get_ui_ops()); | |
| 10302 | 814 | |
|
12342
da61b726d595
[gaim-migrate @ 14646]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12272
diff
changeset
|
815 | /* |
|
da61b726d595
[gaim-migrate @ 14646]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12272
diff
changeset
|
816 | * Set plugin search directories. Give priority to the plugins |
|
da61b726d595
[gaim-migrate @ 14646]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12272
diff
changeset
|
817 | * in user's home directory. |
|
da61b726d595
[gaim-migrate @ 14646]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12272
diff
changeset
|
818 | */ |
| 15884 | 819 | search_path = g_build_filename(purple_user_dir(), "plugins", NULL); |
|
35995
d0bbb2dad7f3
Fix some CWE-367 coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35991
diff
changeset
|
820 | if (g_mkdir(search_path, S_IRUSR | S_IWUSR | S_IXUSR) != 0 && errno != EEXIST) |
|
d0bbb2dad7f3
Fix some CWE-367 coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35991
diff
changeset
|
821 | fprintf(stderr, "Couldn't create plugins dir\n"); |
| 15884 | 822 | purple_plugins_add_search_path(search_path); |
|
10447
887380ec66f5
[gaim-migrate @ 11712]
Mark Doliner <markdoliner@pidgin.im>
parents:
10433
diff
changeset
|
823 | g_free(search_path); |
| 15884 | 824 | purple_plugins_add_search_path(LIBDIR); |
|
10447
887380ec66f5
[gaim-migrate @ 11712]
Mark Doliner <markdoliner@pidgin.im>
parents:
10433
diff
changeset
|
825 | |
| 15884 | 826 | if (!purple_core_init(PIDGIN_UI)) { |
| 10302 | 827 | fprintf(stderr, |
|
16977
c9cb49bea66d
Change the PIDGIN_NAME stuff to allow translators to transliterate the
Richard Laager <rlaager@pidgin.im>
parents:
16967
diff
changeset
|
828 | "Initialization of the libpurple core failed. Dumping core.\n" |
| 10302 | 829 | "Please report this!\n"); |
|
16193
e27165dcba9b
Free segfault_message when Pidgin exits abnormally
Mark Doliner <markdoliner@pidgin.im>
parents:
16158
diff
changeset
|
830 | #ifdef HAVE_SIGNAL_H |
|
e27165dcba9b
Free segfault_message when Pidgin exits abnormally
Mark Doliner <markdoliner@pidgin.im>
parents:
16158
diff
changeset
|
831 | g_free(segfault_message); |
|
e27165dcba9b
Free segfault_message when Pidgin exits abnormally
Mark Doliner <markdoliner@pidgin.im>
parents:
16158
diff
changeset
|
832 | #endif |
| 10302 | 833 | abort(); |
| 834 | } | |
| 835 | ||
|
18207
e89bf4430ea6
Allow disabling check for single instance.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18191
diff
changeset
|
836 | if (opt_si && !purple_core_ensure_single_instance()) { |
|
22872
41d80fc58db2
Pop up the buddylist of the running instance instead of exiting quietly
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22791
diff
changeset
|
837 | #ifdef HAVE_DBUS |
|
41d80fc58db2
Pop up the buddylist of the running instance instead of exiting quietly
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22791
diff
changeset
|
838 | DBusConnection *conn = purple_dbus_get_connection(); |
|
41d80fc58db2
Pop up the buddylist of the running instance instead of exiting quietly
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22791
diff
changeset
|
839 | DBusMessage *message = dbus_message_new_method_call(DBUS_SERVICE_PURPLE, DBUS_PATH_PURPLE, |
|
41d80fc58db2
Pop up the buddylist of the running instance instead of exiting quietly
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22791
diff
changeset
|
840 | DBUS_INTERFACE_PURPLE, "PurpleBlistSetVisible"); |
|
41d80fc58db2
Pop up the buddylist of the running instance instead of exiting quietly
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22791
diff
changeset
|
841 | gboolean tr = TRUE; |
|
25725
afd7e78b98bd
*** Plucked rev 079a5ca1 (paul@darkrain42.org):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25702
diff
changeset
|
842 | dbus_message_append_args(message, DBUS_TYPE_INT32, &tr, DBUS_TYPE_INVALID); |
|
22872
41d80fc58db2
Pop up the buddylist of the running instance instead of exiting quietly
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22791
diff
changeset
|
843 | dbus_connection_send_with_reply_and_block(conn, message, -1, NULL); |
|
41d80fc58db2
Pop up the buddylist of the running instance instead of exiting quietly
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22791
diff
changeset
|
844 | dbus_message_unref(message); |
|
41d80fc58db2
Pop up the buddylist of the running instance instead of exiting quietly
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22791
diff
changeset
|
845 | #endif |
|
31506
d282fb1e8315
Remove the dependency on libstartup-notification. Our use of it had some bugs
David Benjamin <davidben@mit.edu>
parents:
30844
diff
changeset
|
846 | gdk_notify_startup_complete(); |
|
17126
909c4e988d00
Added purple_core_quit to cleanup.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17122
diff
changeset
|
847 | purple_core_quit(); |
|
25460
3d23980668be
Display rather than log the error when another instance is running.
Richard Laager <rlaager@pidgin.im>
parents:
25440
diff
changeset
|
848 | g_printerr(_("Exiting because another libpurple client is already running.\n")); |
|
17121
43d41f5ce17b
Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents:
17104
diff
changeset
|
849 | #ifdef HAVE_SIGNAL_H |
|
43d41f5ce17b
Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents:
17104
diff
changeset
|
850 | g_free(segfault_message); |
|
43d41f5ce17b
Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents:
17104
diff
changeset
|
851 | #endif |
|
17124
f3952abcaad9
Whitespace fix in the dbus_uniq code.
Richard Laager <rlaager@pidgin.im>
parents:
17122
diff
changeset
|
852 | return 0; |
|
17122
5ba216aa4583
Style changes + removed unnecessary NULL checks.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17121
diff
changeset
|
853 | } |
|
17121
43d41f5ce17b
Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents:
17104
diff
changeset
|
854 | |
| 15884 | 855 | /* TODO: Move blist loading into purple_blist_init() */ |
| 856 | purple_set_blist(purple_blist_new()); | |
| 857 | purple_blist_load(); | |
| 10302 | 858 | |
| 859 | /* load plugins we had when we quit */ | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
860 | purple_plugins_load_saved(PIDGIN_PREFS_ROOT "/plugins/loaded"); |
| 10302 | 861 | |
| 15884 | 862 | /* TODO: Move pounces loading into purple_pounces_init() */ |
| 863 | purple_pounces_load(); | |
| 10302 | 864 | |
| 865 | ui_main(); | |
| 866 | ||
| 867 | #ifdef USE_SM | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
868 | pidgin_session_init(argv[0], opt_session_arg, opt_config_dir_arg); |
| 10302 | 869 | #endif |
| 870 | if (opt_session_arg != NULL) { | |
| 871 | g_free(opt_session_arg); | |
| 872 | opt_session_arg = NULL; | |
| 873 | } | |
| 874 | if (opt_config_dir_arg != NULL) { | |
| 875 | g_free(opt_config_dir_arg); | |
| 876 | opt_config_dir_arg = NULL; | |
| 877 | } | |
| 878 | ||
|
24999
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
879 | /* This needs to be before purple_blist_show() so the |
|
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
880 | * statusbox gets the forced online status. */ |
|
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
881 | if (opt_force_online) |
|
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
882 | purple_network_force_online(); |
|
84d597b7e7c6
Add a -f/--force-online option to Pidgin which tells libpurple to claim the
Richard Laager <rlaager@pidgin.im>
parents:
24674
diff
changeset
|
883 | |
|
12011
85a627679414
[gaim-migrate @ 14304]
Mark Doliner <markdoliner@pidgin.im>
parents:
11928
diff
changeset
|
884 | /* |
|
85a627679414
[gaim-migrate @ 14304]
Mark Doliner <markdoliner@pidgin.im>
parents:
11928
diff
changeset
|
885 | * We want to show the blist early in the init process so the |
|
85a627679414
[gaim-migrate @ 14304]
Mark Doliner <markdoliner@pidgin.im>
parents:
11928
diff
changeset
|
886 | * user feels warm and fuzzy (not cold and prickley). |
|
85a627679414
[gaim-migrate @ 14304]
Mark Doliner <markdoliner@pidgin.im>
parents:
11928
diff
changeset
|
887 | */ |
| 15884 | 888 | purple_blist_show(); |
|
12011
85a627679414
[gaim-migrate @ 14304]
Mark Doliner <markdoliner@pidgin.im>
parents:
11928
diff
changeset
|
889 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
890 | if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled")) |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
891 | pidgin_debug_window_show(); |
| 10302 | 892 | |
| 893 | if (opt_login) { | |
|
17719
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
894 | /* disable all accounts */ |
|
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
895 | for (accounts = purple_accounts_get_all(); accounts != NULL; accounts = accounts->next) { |
|
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
896 | PurpleAccount *account = accounts->data; |
|
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
897 | purple_account_set_enabled(account, PIDGIN_UI, FALSE); |
|
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
898 | } |
|
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
899 | /* honor the startup status preference */ |
|
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
900 | if (!purple_prefs_get_bool("/purple/savedstatus/startup_current_status")) |
|
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
901 | purple_savedstatus_activate(purple_savedstatus_get_startup()); |
|
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
902 | /* now enable the requested ones */ |
|
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
903 | dologin_named(opt_login_arg); |
| 10302 | 904 | if (opt_login_arg != NULL) { |
| 905 | g_free(opt_login_arg); | |
| 906 | opt_login_arg = NULL; | |
| 907 | } | |
|
19675
3c1669c529a1
Move purple_prefs_load() to purple_prefs_init() - there's been a TODO for this for a long time. I have no idea why this wasn't done sooner; it seems to work just fine and fixes some bugs where stuff isn't loaded before being used. Fixes #1848 (and I'm sure others). Yell at me if this breaks anything.
Daniel Atallah <datallah@pidgin.im>
parents:
19122
diff
changeset
|
908 | } else if (opt_nologin) { |
|
11806
269e9f78cf89
[gaim-migrate @ 14097]
Mark Doliner <markdoliner@pidgin.im>
parents:
11795
diff
changeset
|
909 | /* Set all accounts to "offline" */ |
| 15884 | 910 | PurpleSavedStatus *saved_status; |
|
13111
31caa48825f7
[gaim-migrate @ 15472]
Mark Doliner <markdoliner@pidgin.im>
parents:
13106
diff
changeset
|
911 | |
|
31caa48825f7
[gaim-migrate @ 15472]
Mark Doliner <markdoliner@pidgin.im>
parents:
13106
diff
changeset
|
912 | /* If we've used this type+message before, lookup the transient status */ |
| 15884 | 913 | saved_status = purple_savedstatus_find_transient_by_type_and_message( |
| 914 | PURPLE_STATUS_OFFLINE, NULL); | |
|
13111
31caa48825f7
[gaim-migrate @ 15472]
Mark Doliner <markdoliner@pidgin.im>
parents:
13106
diff
changeset
|
915 | |
|
31caa48825f7
[gaim-migrate @ 15472]
Mark Doliner <markdoliner@pidgin.im>
parents:
13106
diff
changeset
|
916 | /* If this type+message is unique then create a new transient saved status */ |
|
31caa48825f7
[gaim-migrate @ 15472]
Mark Doliner <markdoliner@pidgin.im>
parents:
13106
diff
changeset
|
917 | if (saved_status == NULL) |
| 15884 | 918 | saved_status = purple_savedstatus_new(NULL, PURPLE_STATUS_OFFLINE); |
|
13111
31caa48825f7
[gaim-migrate @ 15472]
Mark Doliner <markdoliner@pidgin.im>
parents:
13106
diff
changeset
|
919 | |
|
31caa48825f7
[gaim-migrate @ 15472]
Mark Doliner <markdoliner@pidgin.im>
parents:
13106
diff
changeset
|
920 | /* Set the status for each account */ |
| 15884 | 921 | purple_savedstatus_activate(saved_status); |
|
19675
3c1669c529a1
Move purple_prefs_load() to purple_prefs_init() - there's been a TODO for this for a long time. I have no idea why this wasn't done sooner; it seems to work just fine and fixes some bugs where stuff isn't loaded before being used. Fixes #1848 (and I'm sure others). Yell at me if this breaks anything.
Daniel Atallah <datallah@pidgin.im>
parents:
19122
diff
changeset
|
922 | } else { |
|
11348
b8938b189d61
[gaim-migrate @ 13565]
Mark Doliner <markdoliner@pidgin.im>
parents:
11277
diff
changeset
|
923 | /* Everything is good to go--sign on already */ |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
924 | if (!purple_prefs_get_bool("/purple/savedstatus/startup_current_status")) |
| 15884 | 925 | purple_savedstatus_activate(purple_savedstatus_get_startup()); |
| 926 | purple_accounts_restore_current_statuses(); | |
|
10738
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10638
diff
changeset
|
927 | } |
| 10302 | 928 | |
|
18121
2d8ea56b9097
Mark the return type const for the following functions. I noticed this
Richard Laager <rlaager@pidgin.im>
parents:
18093
diff
changeset
|
929 | if ((active_accounts = purple_accounts_get_all_active()) == NULL) |
|
11403
e7e7ed37dc51
[gaim-migrate @ 13638]
Mark Doliner <markdoliner@pidgin.im>
parents:
11348
diff
changeset
|
930 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
931 | pidgin_accounts_window_show(); |
| 10315 | 932 | } |
| 13835 | 933 | else |
| 934 | { | |
|
18121
2d8ea56b9097
Mark the return type const for the following functions. I noticed this
Richard Laager <rlaager@pidgin.im>
parents:
18093
diff
changeset
|
935 | g_list_free(active_accounts); |
| 13835 | 936 | } |
| 10302 | 937 | |
|
31506
d282fb1e8315
Remove the dependency on libstartup-notification. Our use of it had some bugs
David Benjamin <davidben@mit.edu>
parents:
30844
diff
changeset
|
938 | /* GTK clears the notification for us when opening the first window, |
|
d282fb1e8315
Remove the dependency on libstartup-notification. Our use of it had some bugs
David Benjamin <davidben@mit.edu>
parents:
30844
diff
changeset
|
939 | * but we may have launched with only a status icon, so clear the it |
|
d282fb1e8315
Remove the dependency on libstartup-notification. Our use of it had some bugs
David Benjamin <davidben@mit.edu>
parents:
30844
diff
changeset
|
940 | * just in case. */ |
|
d282fb1e8315
Remove the dependency on libstartup-notification. Our use of it had some bugs
David Benjamin <davidben@mit.edu>
parents:
30844
diff
changeset
|
941 | gdk_notify_startup_complete(); |
|
14762
f494a5f12981
[gaim-migrate @ 17452]
Daniel Atallah <datallah@pidgin.im>
parents:
14743
diff
changeset
|
942 | |
|
f494a5f12981
[gaim-migrate @ 17452]
Daniel Atallah <datallah@pidgin.im>
parents:
14743
diff
changeset
|
943 | #ifdef _WIN32 |
|
15574
18d9d1c05994
Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents:
15567
diff
changeset
|
944 | winpidgin_post_init(); |
|
14762
f494a5f12981
[gaim-migrate @ 17452]
Daniel Atallah <datallah@pidgin.im>
parents:
14743
diff
changeset
|
945 | #endif |
|
f494a5f12981
[gaim-migrate @ 17452]
Daniel Atallah <datallah@pidgin.im>
parents:
14743
diff
changeset
|
946 | |
| 10302 | 947 | gtk_main(); |
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10317
diff
changeset
|
948 | |
|
13428
78687459c64b
[gaim-migrate @ 15802]
Daniel Atallah <datallah@pidgin.im>
parents:
13322
diff
changeset
|
949 | #ifdef HAVE_SIGNAL_H |
|
12556
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
950 | g_free(segfault_message); |
|
29991
37e306c31983
Try to be polite and free stuff associated with our signal watcher pipes
Mark Doliner <markdoliner@pidgin.im>
parents:
29662
diff
changeset
|
951 | g_source_remove(signal_channel_watcher); |
|
37e306c31983
Try to be polite and free stuff associated with our signal watcher pipes
Mark Doliner <markdoliner@pidgin.im>
parents:
29662
diff
changeset
|
952 | close(signal_sockets[0]); |
|
37e306c31983
Try to be polite and free stuff associated with our signal watcher pipes
Mark Doliner <markdoliner@pidgin.im>
parents:
29662
diff
changeset
|
953 | close(signal_sockets[1]); |
|
12562
adbcee61068b
[gaim-migrate @ 14881]
Daniel Atallah <datallah@pidgin.im>
parents:
12556
diff
changeset
|
954 | #endif |
|
12556
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
955 | |
| 10302 | 956 | #ifdef _WIN32 |
|
15574
18d9d1c05994
Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents:
15567
diff
changeset
|
957 | winpidgin_cleanup(); |
| 10302 | 958 | #endif |
| 959 | ||
| 960 | return 0; | |
| 961 | } |