annotate pidgin/gtkmain.c @ 23725:fdeb05433566

Update Lithuanian translation
author Laurynas Biveinis <laurynas.biveinis@gmail.com>
date Mon, 25 Aug 2008 21:52:10 +0000
parents c6b29adc22d1
children 0bf04bded747
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 /*
15871
66dff3dfdea6 Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
2 * pidgin
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3 *
15871
66dff3dfdea6 Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
4 * Pidgin is the legal property of its developers, whose names are too numerous
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6 * source distribution.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
7 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
11 * (at your option) any later version.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
12 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
16 * GNU General Public License for more details.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
17 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
19680
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 19661
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
22 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
24 #include "internal.h"
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15506
diff changeset
25 #include "pidgin.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
26
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 #include "account.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
28 #include "conversation.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29 #include "core.h"
22724
de58bebea31a Include dbus-maybe.h rather than conditionally including dbus-server.h
Will Thompson <will.thompson@collabora.co.uk>
parents: 22723
diff changeset
30 #include "dbus-maybe.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31 #include "debug.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32 #include "eventloop.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33 #include "ft.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
34 #include "log.h"
18753
2cc872f4f620 Fix stun to work on startup (this is is a temporary hack until purple_prefs_load() happens in the core). Fixes #2334
Daniel Atallah <daniel.atallah@gmail.com>
parents: 18456
diff changeset
35 #include "network.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36 #include "notify.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
37 #include "prefs.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
38 #include "prpl.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
39 #include "pounce.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
40 #include "sound.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
41 #include "status.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
42 #include "util.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
43 #include "whiteboard.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
44
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
45 #include "gtkaccount.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
46 #include "gtkblist.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
47 #include "gtkconn.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
48 #include "gtkconv.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
49 #include "gtkdebug.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
50 #include "gtkdialogs.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
51 #include "gtkdocklet.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
52 #include "gtkeventloop.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
53 #include "gtkft.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
54 #include "gtkidle.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
55 #include "gtklog.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
56 #include "gtknotify.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
57 #include "gtkplugin.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
58 #include "gtkpounce.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
59 #include "gtkprefs.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
60 #include "gtkprivacy.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
61 #include "gtkrequest.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
62 #include "gtkroomlist.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
63 #include "gtksavedstatuses.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
64 #include "gtksession.h"
22874
02eda4bd2b22 Apply the custom smiley patches from #1187, from Jorge Villaseo (Masca) and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22066
diff changeset
65 #include "gtksmiley.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
66 #include "gtksound.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
67 #include "gtkthemes.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
68 #include "gtkutils.h"
15822
84b0f9b23ede According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@gmail.com>
parents: 15745
diff changeset
69 #include "pidginstock.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
70 #include "gtkwhiteboard.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
71
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
72 #ifdef HAVE_SIGNAL_H
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
73 # include <signal.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
74 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
75
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
76 #include <getopt.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
77
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
78 #ifdef HAVE_STARTUP_NOTIFICATION
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
79 # define SN_API_NOT_YET_FROZEN
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
80 # include <libsn/sn-launchee.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
81 # include <gdk/gdkx.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
82 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
83
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
84
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
85
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
86 #ifdef HAVE_STARTUP_NOTIFICATION
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
87 static SnLauncheeContext *sn_context = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
88 static SnDisplay *sn_display = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
89 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
90
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
91 #ifdef HAVE_SIGNAL_H
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
92
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
93 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
94 * Lists of signals we wish to catch and those we wish to ignore.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
95 * Each list terminated with -1
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
96 */
21015
787b3897ba9f Patch from Andrew Gaul to constify a bunch of static variables to reduce
Ka-Hing Cheung <khc@hxbc.us>
parents: 20740
diff changeset
97 static const int catch_sig_list[] = {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
98 SIGSEGV,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
99 SIGHUP,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
100 SIGINT,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
101 SIGTERM,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
102 SIGQUIT,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
103 SIGCHLD,
22484
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
104 #if defined(USE_GSTREAMER) && !defined(GST_CAN_DISABLE_FORKING)
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
105 SIGALRM,
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
106 #endif
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
107 -1
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
108 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
109
21015
787b3897ba9f Patch from Andrew Gaul to constify a bunch of static variables to reduce
Ka-Hing Cheung <khc@hxbc.us>
parents: 20740
diff changeset
110 static const int ignore_sig_list[] = {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
111 SIGPIPE,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
112 -1
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
113 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
114 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
115
17850
1f060ef64f77 Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <stu@nosnilmot.com>
parents: 17544
diff changeset
116 static void
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
117 dologin_named(const char *name)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
118 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
119 PurpleAccount *account;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
120 char **names;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
121 int i;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
122
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
123 if (name != NULL) { /* list of names given */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
124 names = g_strsplit(name, ",", 64);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
125 for (i = 0; names[i] != NULL; i++) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
126 account = purple_accounts_find(names[i], NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
127 if (account != NULL) { /* found a user */
17850
1f060ef64f77 Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <stu@nosnilmot.com>
parents: 17544
diff changeset
128 purple_account_set_enabled(account, PIDGIN_UI, TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
129 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
130 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
131 g_strfreev(names);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
132 } else { /* no name given, use the first account */
18063
926ccb104da0 disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents: 18058
diff changeset
133 GList *accounts;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
134
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
135 accounts = purple_accounts_get_all();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
136 if (accounts != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
137 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
138 account = (PurpleAccount *)accounts->data;
17850
1f060ef64f77 Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <stu@nosnilmot.com>
parents: 17544
diff changeset
139 purple_account_set_enabled(account, PIDGIN_UI, TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
140 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
141 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
142 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
143
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
144 #ifdef HAVE_SIGNAL_H
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
145 static void sighandler(int sig);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
146
22417
eab5bc54e163 Tell gstreamer not to fork; remove the SIGCHLD -> SIGALRM hack, which made
Will Thompson <will.thompson@collabora.co.uk>
parents: 22403
diff changeset
147 /*
eab5bc54e163 Tell gstreamer not to fork; remove the SIGCHLD -> SIGALRM hack, which made
Will Thompson <will.thompson@collabora.co.uk>
parents: 22403
diff changeset
148 * This child process reaping stuff is currently only used for processes that
eab5bc54e163 Tell gstreamer not to fork; remove the SIGCHLD -> SIGALRM hack, which made
Will Thompson <will.thompson@collabora.co.uk>
parents: 22403
diff changeset
149 * were forked to play sounds. It's not needed for forked DNS child, which
eab5bc54e163 Tell gstreamer not to fork; remove the SIGCHLD -> SIGALRM hack, which made
Will Thompson <will.thompson@collabora.co.uk>
parents: 22403
diff changeset
150 * have their own waitpid() call. It might be wise to move this code into
eab5bc54e163 Tell gstreamer not to fork; remove the SIGCHLD -> SIGALRM hack, which made
Will Thompson <will.thompson@collabora.co.uk>
parents: 22403
diff changeset
151 * gtksound.c.
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
152 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
153 static void
22007
c38d72677c8a Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents: 21865
diff changeset
154 clean_pid(void)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
155 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
156 int status;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
157 pid_t pid;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
158
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
159 do {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
160 pid = waitpid(-1, &status, WNOHANG);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
161 } while (pid != 0 && pid != (pid_t)-1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
162
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
163 if ((pid == (pid_t) - 1) && (errno != ECHILD)) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
164 char errmsg[BUFSIZ];
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
165 snprintf(errmsg, BUFSIZ, "Warning: waitpid() returned %d", pid);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
166 perror(errmsg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
167 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
168 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
169
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
170 char *segfault_message;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
171
21446
7710a871fabf Add a lengthy comment about a small problem with our signal handler
Mark Doliner <mark@kingant.net>
parents: 21030
diff changeset
172 /*
7710a871fabf Add a lengthy comment about a small problem with our signal handler
Mark Doliner <mark@kingant.net>
parents: 21030
diff changeset
173 * This signal handler shouldn't be touching this much stuff.
7710a871fabf Add a lengthy comment about a small problem with our signal handler
Mark Doliner <mark@kingant.net>
parents: 21030
diff changeset
174 * It should just set a flag and return, and something else in
7710a871fabf Add a lengthy comment about a small problem with our signal handler
Mark Doliner <mark@kingant.net>
parents: 21030
diff changeset
175 * Pidgin should monitor the flag to see if something needs to
7710a871fabf Add a lengthy comment about a small problem with our signal handler
Mark Doliner <mark@kingant.net>
parents: 21030
diff changeset
176 * be done. Because the signal handler interrupts the program,
7710a871fabf Add a lengthy comment about a small problem with our signal handler
Mark Doliner <mark@kingant.net>
parents: 21030
diff changeset
177 * it could be called in the middle of adding a new connection
7710a871fabf Add a lengthy comment about a small problem with our signal handler
Mark Doliner <mark@kingant.net>
parents: 21030
diff changeset
178 * to the list of connections, and then if we try to disconnect
7710a871fabf Add a lengthy comment about a small problem with our signal handler
Mark Doliner <mark@kingant.net>
parents: 21030
diff changeset
179 * all connections it could lead to a crash because the linked
7710a871fabf Add a lengthy comment about a small problem with our signal handler
Mark Doliner <mark@kingant.net>
parents: 21030
diff changeset
180 * list of connections could be in a weird state. But, well,
7710a871fabf Add a lengthy comment about a small problem with our signal handler
Mark Doliner <mark@kingant.net>
parents: 21030
diff changeset
181 * this signal handler probably isn't called very often, so it's
7710a871fabf Add a lengthy comment about a small problem with our signal handler
Mark Doliner <mark@kingant.net>
parents: 21030
diff changeset
182 * not a big deal.
7710a871fabf Add a lengthy comment about a small problem with our signal handler
Mark Doliner <mark@kingant.net>
parents: 21030
diff changeset
183 */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
184 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
185 sighandler(int sig)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
186 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
187 switch (sig) {
23202
5197256f66b5 Stu and Ethan think we should ignore SIGHUP. That's fine by me.
Richard Laager <rlaager@wiktel.com>
parents: 23191
diff changeset
188 case SIGHUP:
5197256f66b5 Stu and Ethan think we should ignore SIGHUP. That's fine by me.
Richard Laager <rlaager@wiktel.com>
parents: 23191
diff changeset
189 purple_debug_warning("sighandler", "Caught signal %d\n", sig);
5197256f66b5 Stu and Ethan think we should ignore SIGHUP. That's fine by me.
Richard Laager <rlaager@wiktel.com>
parents: 23191
diff changeset
190 break;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
191 case SIGSEGV:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
192 fprintf(stderr, "%s", segfault_message);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
193 abort();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
194 break;
22484
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
195 #if defined(USE_GSTREAMER) && !defined(GST_CAN_DISABLE_FORKING)
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
196 /* By default, gstreamer forks when you initialize it, and waitpids for the
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
197 * child. But if libpurple reaps the child rather than leaving it to
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
198 * gstreamer, gstreamer's initialization fails. So, we wait a second before
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
199 * reaping child processes, to give gst a chance to reap it if it wants to.
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
200 *
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
201 * This is not needed in later gstreamers, which let us disable the forking.
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
202 * And, it breaks the world on some Real Unices.
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
203 */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
204 case SIGCHLD:
22484
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
205 /* Restore signal catching */
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
206 signal(SIGCHLD, sighandler);
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
207 alarm(1);
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
208 break;
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
209 case SIGALRM:
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
210 #else
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
211 case SIGCHLD:
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
212 #endif
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
213 clean_pid();
22484
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
214 /* Restore signal catching */
5c216e2c5405 Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <will.thompson@collabora.co.uk>
parents: 22475
diff changeset
215 signal(SIGCHLD, sighandler);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
216 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
217 default:
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
218 purple_debug_warning("sighandler", "Caught signal %d\n", sig);
23191
849c3d109a38 Use purple_core_quit() in the sighandler instead of duplicating part of it.
Richard Laager <rlaager@wiktel.com>
parents: 23126
diff changeset
219 purple_core_quit();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
220 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
221 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
222 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
223
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
224 static int
22007
c38d72677c8a Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents: 21865
diff changeset
225 ui_main(void)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
226 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
227 #ifndef _WIN32
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
228 GList *icons = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
229 GdkPixbuf *icon = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
230 char *icon_path;
15991
5db7909331fa new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents: 15871
diff changeset
231 int i;
16457
2b106533b077 Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@gmail.com>
parents: 16452
diff changeset
232 struct {
2b106533b077 Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@gmail.com>
parents: 16452
diff changeset
233 const char *dir;
2b106533b077 Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@gmail.com>
parents: 16452
diff changeset
234 const char *filename;
2b106533b077 Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@gmail.com>
parents: 16452
diff changeset
235 } icon_sizes[] = {
2b106533b077 Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@gmail.com>
parents: 16452
diff changeset
236 {"16x16", "pidgin.png"},
2b106533b077 Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@gmail.com>
parents: 16452
diff changeset
237 {"24x24", "pidgin.png"},
2b106533b077 Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@gmail.com>
parents: 16452
diff changeset
238 {"32x32", "pidgin.png"},
2b106533b077 Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@gmail.com>
parents: 16452
diff changeset
239 {"48x48", "pidgin.png"},
2b106533b077 Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@gmail.com>
parents: 16452
diff changeset
240 {"scalable", "pidgin.svg"}
15991
5db7909331fa new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents: 15871
diff changeset
241 };
5db7909331fa new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents: 15871
diff changeset
242
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
243 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
244
16202
0973688f4b74 Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@wiktel.com>
parents: 16131
diff changeset
245 pidgin_themes_init();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
246
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
247 pidgin_blist_setup_sort_methods();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
248
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
249 #ifndef _WIN32
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
250 /* use the nice PNG icon for all the windows */
15991
5db7909331fa new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents: 15871
diff changeset
251 for(i=0; i<G_N_ELEMENTS(icon_sizes); i++) {
16457
2b106533b077 Add the SVG to the default window icon list for really big window icons
Sean Egan <seanegan@gmail.com>
parents: 16452
diff changeset
252 icon_path = g_build_filename(DATADIR, "icons", "hicolor", icon_sizes[i].dir, "apps", icon_sizes[i].filename, NULL);
15991
5db7909331fa new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents: 15871
diff changeset
253 icon = gdk_pixbuf_new_from_file(icon_path, NULL);
5db7909331fa new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents: 15871
diff changeset
254 g_free(icon_path);
5db7909331fa new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents: 15871
diff changeset
255 if (icon) {
5db7909331fa new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents: 15871
diff changeset
256 icons = g_list_append(icons,icon);
5db7909331fa new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents: 15871
diff changeset
257 } else {
5db7909331fa new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents: 15871
diff changeset
258 purple_debug_error("ui_main",
22475
3225c99785b8 Fix a bunch of compiler warnings caused by my addition of G_GNUC_PRINTF()
Mark Doliner <mark@kingant.net>
parents: 22417
diff changeset
259 "Failed to load the default window icon (%spx version)!\n", icon_sizes[i].dir);
15991
5db7909331fa new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents: 15871
diff changeset
260 }
5db7909331fa new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents: 15871
diff changeset
261 }
5db7909331fa new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents: 15871
diff changeset
262 if(NULL == icons) {
5db7909331fa new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents: 15871
diff changeset
263 purple_debug_error("ui_main", "Unable to load any size of default window icon!\n");
5db7909331fa new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents: 15871
diff changeset
264 } else {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
265 gtk_window_set_default_icon_list(icons);
15991
5db7909331fa new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents: 15871
diff changeset
266
5db7909331fa new icon goodness (i may have screwed this up, someone check)
Nathan Walp <nwalp@pidgin.im>
parents: 15871
diff changeset
267 g_list_foreach(icons, (GFunc)g_object_unref, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
268 g_list_free(icons);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
269 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
270 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
271
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
272 return 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
273 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
274
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
275 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
276 debug_init(void)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
277 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
278 purple_debug_set_ui_ops(pidgin_debug_get_ui_ops());
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
279 pidgin_debug_init();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
280 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
281
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
282 static void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
283 pidgin_ui_init(void)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
284 {
22339
143091589795 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 <daniel.atallah@gmail.com>
parents: 22066
diff changeset
285 pidgin_stock_init();
143091589795 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 <daniel.atallah@gmail.com>
parents: 22066
diff changeset
286
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
287 /* Set the UI operation structures. */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
288 purple_accounts_set_ui_ops(pidgin_accounts_get_ui_ops());
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
289 purple_xfers_set_ui_ops(pidgin_xfers_get_ui_ops());
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
290 purple_blist_set_ui_ops(pidgin_blist_get_ui_ops());
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
291 purple_notify_set_ui_ops(pidgin_notify_get_ui_ops());
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
292 purple_privacy_set_ui_ops(pidgin_privacy_get_ui_ops());
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
293 purple_request_set_ui_ops(pidgin_request_get_ui_ops());
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
294 purple_sound_set_ui_ops(pidgin_sound_get_ui_ops());
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
295 purple_connections_set_ui_ops(pidgin_connections_get_ui_ops());
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
296 purple_whiteboard_set_ui_ops(pidgin_whiteboard_get_ui_ops());
22631
487105d73907 Patch from Jeffery Brown to set the idle uiops on OS X when IOKit is available.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22484
diff changeset
297 #if defined(USE_SCREENSAVER) || defined(HAVE_IOKIT)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
298 purple_idle_set_ui_ops(pidgin_idle_get_ui_ops());
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
299 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
300
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
301 pidgin_account_init();
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
302 pidgin_connection_init();
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
303 pidgin_blist_init();
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
304 pidgin_status_init();
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
305 pidgin_conversations_init();
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
306 pidgin_pounces_init();
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
307 pidgin_privacy_init();
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
308 pidgin_xfers_init();
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
309 pidgin_roomlist_init();
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
310 pidgin_log_init();
16726
130d72ab7e25 Initialize docklet from pidgin_ui_init. This ensures docklet prefs are
Casey Harkins <charkins@pidgin.im>
parents: 16700
diff changeset
311 pidgin_docklet_init();
22874
02eda4bd2b22 Apply the custom smiley patches from #1187, from Jorge Villaseo (Masca) and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22066
diff changeset
312 pidgin_smileys_init();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
313 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
314
18293
5aae8608e1c6 UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents: 18184
diff changeset
315 static GHashTable *ui_info = NULL;
5aae8608e1c6 UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents: 18184
diff changeset
316
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
317 static void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
318 pidgin_quit(void)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
319 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
320 #ifdef USE_SM
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
321 /* unplug */
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
322 pidgin_session_end();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
323 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
324
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
325 /* Save the plugins we have loaded for next time. */
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
326 pidgin_plugins_save();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
327
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
328 /* Uninit */
22874
02eda4bd2b22 Apply the custom smiley patches from #1187, from Jorge Villaseo (Masca) and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22066
diff changeset
329 pidgin_smileys_uninit();
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
330 pidgin_conversations_uninit();
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
331 pidgin_status_uninit();
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
332 pidgin_docklet_uninit();
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
333 pidgin_blist_uninit();
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
334 pidgin_connection_uninit();
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
335 pidgin_account_uninit();
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
336 pidgin_xfers_uninit();
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
337 pidgin_debug_uninit();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
338
18293
5aae8608e1c6 UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents: 18184
diff changeset
339 if(NULL != ui_info)
5aae8608e1c6 UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents: 18184
diff changeset
340 g_hash_table_destroy(ui_info);
5aae8608e1c6 UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents: 18184
diff changeset
341
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
342 /* and end it all... */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
343 gtk_main_quit();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
344 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
345
22007
c38d72677c8a Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents: 21865
diff changeset
346 static GHashTable *pidgin_ui_get_info(void)
18293
5aae8608e1c6 UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents: 18184
diff changeset
347 {
5aae8608e1c6 UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents: 18184
diff changeset
348 if(NULL == ui_info) {
5aae8608e1c6 UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents: 18184
diff changeset
349 ui_info = g_hash_table_new(g_str_hash, g_str_equal);
5aae8608e1c6 UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents: 18184
diff changeset
350
5aae8608e1c6 UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents: 18184
diff changeset
351 g_hash_table_insert(ui_info, "name", (char*)PIDGIN_NAME);
5aae8608e1c6 UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents: 18184
diff changeset
352 g_hash_table_insert(ui_info, "version", VERSION);
23404
c6b29adc22d1 Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evan.s@dreskin.net>
parents: 23202
diff changeset
353 g_hash_table_insert(ui_info, "website", "http://pidgin.im");
c6b29adc22d1 Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evan.s@dreskin.net>
parents: 23202
diff changeset
354 g_hash_table_insert(ui_info, "dev_website", "http://developer.pidgin.im");
18293
5aae8608e1c6 UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents: 18184
diff changeset
355 }
5aae8608e1c6 UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents: 18184
diff changeset
356
5aae8608e1c6 UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents: 18184
diff changeset
357 return ui_info;
5aae8608e1c6 UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents: 18184
diff changeset
358 }
5aae8608e1c6 UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents: 18184
diff changeset
359
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
360 static PurpleCoreUiOps core_ops =
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
361 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
362 pidgin_prefs_init,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
363 debug_init,
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
364 pidgin_ui_init,
16681
fbf111436896 Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 16483
diff changeset
365 pidgin_quit,
18293
5aae8608e1c6 UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents: 18184
diff changeset
366 pidgin_ui_get_info,
16681
fbf111436896 Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 16483
diff changeset
367 NULL,
fbf111436896 Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 16483
diff changeset
368 NULL,
fbf111436896 Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 16483
diff changeset
369 NULL
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
370 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
371
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
372 static PurpleCoreUiOps *
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
373 pidgin_core_get_ui_ops(void)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
374 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
375 return &core_ops;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
376 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
377
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
378 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
379 show_usage(const char *name, gboolean terse)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
380 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
381 char *text;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
382
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
383 if (terse) {
21030
3cc856ca2338 Add a --with-extraversion option to ./configure so packagers can fine tune
Stu Tomlinson <stu@nosnilmot.com>
parents: 21015
diff changeset
384 text = g_strdup_printf(_("%s %s. Try `%s -h' for more information.\n"), PIDGIN_NAME, DISPLAY_VERSION, name);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
385 } else {
21865
886fa5f83f91 Ye Olde Compiler complained about this:
Stu Tomlinson <stu@nosnilmot.com>
parents: 21735
diff changeset
386 #ifndef WIN32
16010
eae8e127e4fb make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents: 15991
diff changeset
387 text = g_strdup_printf(_("%s %s\n"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
388 "Usage: %s [OPTION]...\n\n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
389 " -c, --config=DIR use DIR for config files\n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
390 " -d, --debug print debugging messages to stdout\n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
391 " -h, --help display this help and exit\n"
18136
00cec200ec58 1. Show the usage of -m in the help message.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18135
diff changeset
392 " -m, --multiple do not ensure single instance\n"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
393 " -n, --nologin don't automatically login\n"
22403
b77c8a87e15e Correct documentation in --help and man page for -l command line option.
Stu Tomlinson <stu@nosnilmot.com>
parents: 22339
diff changeset
394 " -l, --login[=NAME] enable specified account(s) (optional argument NAME\n"
b77c8a87e15e Correct documentation in --help and man page for -l command line option.
Stu Tomlinson <stu@nosnilmot.com>
parents: 22339
diff changeset
395 " specifies account(s) to use, separated by commas.\n"
b77c8a87e15e Correct documentation in --help and man page for -l command line option.
Stu Tomlinson <stu@nosnilmot.com>
parents: 22339
diff changeset
396 " Without this only the first account will be enabled).\n"
20093
df2961ce0714 Accept --display as an argument, to be passed to Gtk+.
Ethan Blanton <elb@pidgin.im>
parents: 19680
diff changeset
397 " --display=DISPLAY X display to use\n"
21865
886fa5f83f91 Ye Olde Compiler complained about this:
Stu Tomlinson <stu@nosnilmot.com>
parents: 21735
diff changeset
398 " -v, --version display the current version and exit\n"), PIDGIN_NAME, DISPLAY_VERSION, name);
886fa5f83f91 Ye Olde Compiler complained about this:
Stu Tomlinson <stu@nosnilmot.com>
parents: 21735
diff changeset
399 #else
886fa5f83f91 Ye Olde Compiler complained about this:
Stu Tomlinson <stu@nosnilmot.com>
parents: 21735
diff changeset
400 text = g_strdup_printf(_("%s %s\n"
886fa5f83f91 Ye Olde Compiler complained about this:
Stu Tomlinson <stu@nosnilmot.com>
parents: 21735
diff changeset
401 "Usage: %s [OPTION]...\n\n"
886fa5f83f91 Ye Olde Compiler complained about this:
Stu Tomlinson <stu@nosnilmot.com>
parents: 21735
diff changeset
402 " -c, --config=DIR use DIR for config files\n"
886fa5f83f91 Ye Olde Compiler complained about this:
Stu Tomlinson <stu@nosnilmot.com>
parents: 21735
diff changeset
403 " -d, --debug print debugging messages to stdout\n"
886fa5f83f91 Ye Olde Compiler complained about this:
Stu Tomlinson <stu@nosnilmot.com>
parents: 21735
diff changeset
404 " -h, --help display this help and exit\n"
886fa5f83f91 Ye Olde Compiler complained about this:
Stu Tomlinson <stu@nosnilmot.com>
parents: 21735
diff changeset
405 " -m, --multiple do not ensure single instance\n"
886fa5f83f91 Ye Olde Compiler complained about this:
Stu Tomlinson <stu@nosnilmot.com>
parents: 21735
diff changeset
406 " -n, --nologin don't automatically login\n"
22403
b77c8a87e15e Correct documentation in --help and man page for -l command line option.
Stu Tomlinson <stu@nosnilmot.com>
parents: 22339
diff changeset
407 " -l, --login[=NAME] enable specified account(s) (optional argument NAME\n"
b77c8a87e15e Correct documentation in --help and man page for -l command line option.
Stu Tomlinson <stu@nosnilmot.com>
parents: 22339
diff changeset
408 " specifies account(s) to use, separated by commas.\n"
b77c8a87e15e Correct documentation in --help and man page for -l command line option.
Stu Tomlinson <stu@nosnilmot.com>
parents: 22339
diff changeset
409 " Without this only the first account will be enabled).\n"
21865
886fa5f83f91 Ye Olde Compiler complained about this:
Stu Tomlinson <stu@nosnilmot.com>
parents: 21735
diff changeset
410 " -v, --version display the current version and exit\n"), PIDGIN_NAME, DISPLAY_VERSION, name);
20093
df2961ce0714 Accept --display as an argument, to be passed to Gtk+.
Ethan Blanton <elb@pidgin.im>
parents: 19680
diff changeset
411 #endif
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
412 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
413
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
414 purple_print_utf8_to_console(stdout, text);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
415 g_free(text);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
416 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
417
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
418 #ifdef HAVE_STARTUP_NOTIFICATION
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
419 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
420 sn_error_trap_push(SnDisplay *display, Display *xdisplay)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
421 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
422 gdk_error_trap_push();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
423 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
424
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
425 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
426 sn_error_trap_pop(SnDisplay *display, Display *xdisplay)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
427 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
428 gdk_error_trap_pop();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
429 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
430
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
431 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
432 startup_notification_complete(void)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
433 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
434 Display *xdisplay;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
435
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
436 xdisplay = GDK_DISPLAY();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
437 sn_display = sn_display_new(xdisplay,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
438 sn_error_trap_push,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
439 sn_error_trap_pop);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
440 sn_context =
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
441 sn_launchee_context_new_from_environment(sn_display,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
442 DefaultScreen(xdisplay));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
443
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
444 if (sn_context != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
445 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
446 sn_launchee_context_complete(sn_context);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
447 sn_launchee_context_unref(sn_context);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
448
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
449 sn_display_unref(sn_display);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
450 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
451 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
452 #endif /* HAVE_STARTUP_NOTIFICATION */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
453
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
454 /* FUCKING GET ME A TOWEL! */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
455 #ifdef _WIN32
15638
026f9c6cc942 winpidgin warning fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15516
diff changeset
456 /* suppress gcc "no previous prototype" warning */
026f9c6cc942 winpidgin warning fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15516
diff changeset
457 int pidgin_main(HINSTANCE hint, int argc, char *argv[]);
15515
75ffc646647f Win32 de-gaimification of pidgin
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15506
diff changeset
458 int pidgin_main(HINSTANCE hint, int argc, char *argv[])
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
459 #else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
460 int main(int argc, char *argv[])
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
461 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
462 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
463 gboolean opt_help = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
464 gboolean opt_login = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
465 gboolean opt_nologin = FALSE;
22403
b77c8a87e15e Correct documentation in --help and man page for -l command line option.
Stu Tomlinson <stu@nosnilmot.com>
parents: 22339
diff changeset
466 gboolean opt_nocrash = FALSE;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
467 gboolean opt_version = FALSE;
18135
5114739a4169 Allow disabling check for single instance.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18119
diff changeset
468 gboolean opt_si = TRUE; /* Check for single instance? */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
469 char *opt_config_dir_arg = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
470 char *opt_login_arg = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
471 char *opt_session_arg = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
472 char *search_path;
18063
926ccb104da0 disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents: 18058
diff changeset
473 GList *accounts;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
474 #ifdef HAVE_SIGNAL_H
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
475 int sig_indx; /* for setting up signal catching */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
476 sigset_t sigset;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
477 RETSIGTYPE (*prev_sig_disp)(int);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
478 char errmsg[BUFSIZ];
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
479 #ifndef DEBUG
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
480 char *segfault_message_tmp;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
481 GError *error = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
482 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
483 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
484 int opt;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
485 gboolean gui_check;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
486 gboolean debug_enabled;
16371
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
487 gboolean migration_failed = FALSE;
18058
4ca97b26a8fb Mark the return type const for the following functions. I noticed this
Richard Laager <rlaager@wiktel.com>
parents: 18032
diff changeset
488 GList *active_accounts;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
489
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
490 struct option long_options[] = {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
491 {"config", required_argument, NULL, 'c'},
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
492 {"debug", no_argument, NULL, 'd'},
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
493 {"help", no_argument, NULL, 'h'},
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
494 {"login", optional_argument, NULL, 'l'},
18136
00cec200ec58 1. Show the usage of -m in the help message.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18135
diff changeset
495 {"multiple", no_argument, NULL, 'm'},
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
496 {"nologin", no_argument, NULL, 'n'},
22403
b77c8a87e15e Correct documentation in --help and man page for -l command line option.
Stu Tomlinson <stu@nosnilmot.com>
parents: 22339
diff changeset
497 {"nocrash", no_argument, NULL, 'x'},
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
498 {"session", required_argument, NULL, 's'},
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
499 {"version", no_argument, NULL, 'v'},
20093
df2961ce0714 Accept --display as an argument, to be passed to Gtk+.
Ethan Blanton <elb@pidgin.im>
parents: 19680
diff changeset
500 {"display", required_argument, NULL, 'D'},
22066
542d35f101ff Allow --sync to reach gtk initialization. This is basically the same as
Richard Laager <rlaager@wiktel.com>
parents: 22007
diff changeset
501 {"sync", no_argument, NULL, 'S'},
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
502 {0, 0, 0, 0}
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
503 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
504
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
505 #ifdef DEBUG
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
506 debug_enabled = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
507 #else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
508 debug_enabled = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
509 #endif
17544
57e81bfeab3d disapproval of revision '3ac5981b26be545a8c546e09b6689c2359fad1bb'
Sean Egan <seanegan@gmail.com>
parents: 17073
diff changeset
510
22066
542d35f101ff Allow --sync to reach gtk initialization. This is basically the same as
Richard Laager <rlaager@wiktel.com>
parents: 22007
diff changeset
511 /* Initialize GThread before calling any Glib or GTK+ functions. */
17544
57e81bfeab3d disapproval of revision '3ac5981b26be545a8c546e09b6689c2359fad1bb'
Sean Egan <seanegan@gmail.com>
parents: 17073
diff changeset
512 g_thread_init(NULL);
18160
428bea8235cb Use g_set_application_name() so unnamed dialogs get given a name, my
Stu Tomlinson <stu@nosnilmot.com>
parents: 18136
diff changeset
513
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
514 #ifdef ENABLE_NLS
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
515 bindtextdomain(PACKAGE, LOCALEDIR);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
516 bind_textdomain_codeset(PACKAGE, "UTF-8");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
517 textdomain(PACKAGE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
518 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
519
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
520 #ifdef HAVE_SETLOCALE
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
521 /* Locale initialization is not complete here. See gtk_init_check() */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
522 setlocale(LC_ALL, "");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
523 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
524
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
525 #ifdef HAVE_SIGNAL_H
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
526
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
527 #ifndef DEBUG
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
528 /* We translate this here in case the crash breaks gettext. */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
529 segfault_message_tmp = g_strdup_printf(_(
20167
d5d0a5b88104 Include the version in the segfault message - enough people blindly copy
Stu Tomlinson <stu@nosnilmot.com>
parents: 20093
diff changeset
530 "%s %s has segfaulted and attempted to dump a core file.\n"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
531 "This is a bug in the software and has happened through\n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
532 "no fault of your own.\n\n"
16932
b668951121d8 Change the PIDGIN_NAME stuff to allow translators to transliterate the
Richard Laager <rlaager@wiktel.com>
parents: 16909
diff changeset
533 "If you can reproduce the crash, please notify the developers\n"
b668951121d8 Change the PIDGIN_NAME stuff to allow translators to transliterate the
Richard Laager <rlaager@wiktel.com>
parents: 16909
diff changeset
534 "by reporting a bug at:\n"
18184
f54f83b20929 I believe the great unwashed should be using simpleticket for submitting
Stu Tomlinson <stu@nosnilmot.com>
parents: 18160
diff changeset
535 "%ssimpleticket/\n\n"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
536 "Please make sure to specify what you were doing at the time\n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
537 "and post the backtrace from the core file. If you do not know\n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
538 "how to get the backtrace, please read the instructions at\n"
16909
a00cf76108c6 fixes #650
Luke Schierer <lschiere@pidgin.im>
parents: 16726
diff changeset
539 "%swiki/GetABacktrace\n\n"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
540 "If you need further assistance, please IM either SeanEgn or \n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
541 "LSchiere (via AIM). Contact information for Sean and Luke \n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
542 "on other protocols is at\n"
16909
a00cf76108c6 fixes #650
Luke Schierer <lschiere@pidgin.im>
parents: 16726
diff changeset
543 "%swiki/DeveloperPages\n"),
21030
3cc856ca2338 Add a --with-extraversion option to ./configure so packagers can fine tune
Stu Tomlinson <stu@nosnilmot.com>
parents: 21015
diff changeset
544 PIDGIN_NAME, DISPLAY_VERSION, PURPLE_DEVEL_WEBSITE, PURPLE_DEVEL_WEBSITE, PURPLE_DEVEL_WEBSITE
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
545 );
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
546
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
547 /* we have to convert the message (UTF-8 to console
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
548 charset) early because after a segmentation fault
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
549 it's not a good practice to allocate memory */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
550 segfault_message = g_locale_from_utf8(segfault_message_tmp,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
551 -1, NULL, NULL, &error);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
552 if (segfault_message != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
553 g_free(segfault_message_tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
554 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
555 else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
556 /* use 'segfault_message_tmp' (UTF-8) as a fallback */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
557 g_warning("%s\n", error->message);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
558 g_error_free(error);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
559 segfault_message = segfault_message_tmp;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
560 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
561 #else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
562 /* Don't mark this for translation. */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
563 segfault_message = g_strdup(
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
564 "Hi, user. We need to talk.\n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
565 "I think something's gone wrong here. It's probably my fault.\n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
566 "No, really, it's not you... it's me... no no no, I think we get along well\n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
567 "it's just that.... well, I want to see other people. I... what?!? NO! I \n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
568 "haven't been cheating on you!! How many times do you want me to tell you?! And\n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
569 "for the last time, it's just a rash!\n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
570 );
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
571 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
572
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
573 /* Let's not violate any PLA's!!!! */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
574 /* jseymour: whatever the fsck that means */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
575 /* Robot101: for some reason things like gdm like to block *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
576 * useful signals like SIGCHLD, so we unblock all the ones we *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
577 * declare a handler for. thanks JSeymour and Vann. */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
578 if (sigemptyset(&sigset)) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
579 snprintf(errmsg, BUFSIZ, "Warning: couldn't initialise empty signal set");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
580 perror(errmsg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
581 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
582 for(sig_indx = 0; catch_sig_list[sig_indx] != -1; ++sig_indx) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
583 if((prev_sig_disp = signal(catch_sig_list[sig_indx], sighandler)) == SIG_ERR) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
584 snprintf(errmsg, BUFSIZ, "Warning: couldn't set signal %d for catching",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
585 catch_sig_list[sig_indx]);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
586 perror(errmsg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
587 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
588 if(sigaddset(&sigset, catch_sig_list[sig_indx])) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
589 snprintf(errmsg, BUFSIZ, "Warning: couldn't include signal %d for unblocking",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
590 catch_sig_list[sig_indx]);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
591 perror(errmsg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
592 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
593 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
594 for(sig_indx = 0; ignore_sig_list[sig_indx] != -1; ++sig_indx) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
595 if((prev_sig_disp = signal(ignore_sig_list[sig_indx], SIG_IGN)) == SIG_ERR) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
596 snprintf(errmsg, BUFSIZ, "Warning: couldn't set signal %d to ignore",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
597 ignore_sig_list[sig_indx]);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
598 perror(errmsg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
599 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
600 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
601
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
602 if (sigprocmask(SIG_UNBLOCK, &sigset, NULL)) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
603 snprintf(errmsg, BUFSIZ, "Warning: couldn't unblock signals");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
604 perror(errmsg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
605 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
606 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
607
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
608 /* scan command-line options */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
609 opterr = 1;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
610 while ((opt = getopt_long(argc, argv,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
611 #ifndef _WIN32
18135
5114739a4169 Allow disabling check for single instance.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18119
diff changeset
612 "c:dhmnl::s:v",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
613 #else
21735
5f1ba65b018e Fix #4203 by allowing multiple instances on win32 with the -m flag.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 21606
diff changeset
614 "c:dhmnl::v",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
615 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
616 long_options, NULL)) != -1) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
617 switch (opt) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
618 case 'c': /* config dir */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
619 g_free(opt_config_dir_arg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
620 opt_config_dir_arg = g_strdup(optarg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
621 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
622 case 'd': /* debug */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
623 debug_enabled = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
624 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
625 case 'h': /* help */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
626 opt_help = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
627 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
628 case 'n': /* no autologin */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
629 opt_nologin = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
630 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
631 case 'l': /* login, option username */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
632 opt_login = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
633 g_free(opt_login_arg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
634 if (optarg != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
635 opt_login_arg = g_strdup(optarg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
636 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
637 case 's': /* use existing session ID */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
638 g_free(opt_session_arg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
639 opt_session_arg = g_strdup(optarg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
640 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
641 case 'v': /* version */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
642 opt_version = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
643 break;
18135
5114739a4169 Allow disabling check for single instance.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18119
diff changeset
644 case 'm': /* do not ensure single instance. */
5114739a4169 Allow disabling check for single instance.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18119
diff changeset
645 opt_si = FALSE;
5114739a4169 Allow disabling check for single instance.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18119
diff changeset
646 break;
22403
b77c8a87e15e Correct documentation in --help and man page for -l command line option.
Stu Tomlinson <stu@nosnilmot.com>
parents: 22339
diff changeset
647 case 'x': /* --nocrash */
b77c8a87e15e Correct documentation in --help and man page for -l command line option.
Stu Tomlinson <stu@nosnilmot.com>
parents: 22339
diff changeset
648 opt_nocrash = TRUE;
b77c8a87e15e Correct documentation in --help and man page for -l command line option.
Stu Tomlinson <stu@nosnilmot.com>
parents: 22339
diff changeset
649 break;
20093
df2961ce0714 Accept --display as an argument, to be passed to Gtk+.
Ethan Blanton <elb@pidgin.im>
parents: 19680
diff changeset
650 case 'D': /* --display */
22066
542d35f101ff Allow --sync to reach gtk initialization. This is basically the same as
Richard Laager <rlaager@wiktel.com>
parents: 22007
diff changeset
651 case 'S': /* --sync */
20093
df2961ce0714 Accept --display as an argument, to be passed to Gtk+.
Ethan Blanton <elb@pidgin.im>
parents: 19680
diff changeset
652 /* handled by gtk_init_check below */
df2961ce0714 Accept --display as an argument, to be passed to Gtk+.
Ethan Blanton <elb@pidgin.im>
parents: 19680
diff changeset
653 break;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
654 case '?': /* show terse help */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
655 default:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
656 show_usage(argv[0], TRUE);
16131
f0c6a91bfd67 Free segfault_message when Pidgin exits abnormally
Mark Doliner <mark@kingant.net>
parents: 16098
diff changeset
657 #ifdef HAVE_SIGNAL_H
f0c6a91bfd67 Free segfault_message when Pidgin exits abnormally
Mark Doliner <mark@kingant.net>
parents: 16098
diff changeset
658 g_free(segfault_message);
f0c6a91bfd67 Free segfault_message when Pidgin exits abnormally
Mark Doliner <mark@kingant.net>
parents: 16098
diff changeset
659 #endif
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
660 return 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
661 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
662 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
663 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
664
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
665 /* show help message */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
666 if (opt_help) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
667 show_usage(argv[0], FALSE);
16131
f0c6a91bfd67 Free segfault_message when Pidgin exits abnormally
Mark Doliner <mark@kingant.net>
parents: 16098
diff changeset
668 #ifdef HAVE_SIGNAL_H
f0c6a91bfd67 Free segfault_message when Pidgin exits abnormally
Mark Doliner <mark@kingant.net>
parents: 16098
diff changeset
669 g_free(segfault_message);
f0c6a91bfd67 Free segfault_message when Pidgin exits abnormally
Mark Doliner <mark@kingant.net>
parents: 16098
diff changeset
670 #endif
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
671 return 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
672 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
673 /* show version message */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
674 if (opt_version) {
21030
3cc856ca2338 Add a --with-extraversion option to ./configure so packagers can fine tune
Stu Tomlinson <stu@nosnilmot.com>
parents: 21015
diff changeset
675 printf("%s %s\n", PIDGIN_NAME, DISPLAY_VERSION);
16131
f0c6a91bfd67 Free segfault_message when Pidgin exits abnormally
Mark Doliner <mark@kingant.net>
parents: 16098
diff changeset
676 #ifdef HAVE_SIGNAL_H
f0c6a91bfd67 Free segfault_message when Pidgin exits abnormally
Mark Doliner <mark@kingant.net>
parents: 16098
diff changeset
677 g_free(segfault_message);
f0c6a91bfd67 Free segfault_message when Pidgin exits abnormally
Mark Doliner <mark@kingant.net>
parents: 16098
diff changeset
678 #endif
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
679 return 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
680 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
681
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
682 /* set a user-specified config directory */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
683 if (opt_config_dir_arg != NULL) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
684 purple_util_set_user_dir(opt_config_dir_arg);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
685 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
686
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
687 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
688 * We're done piddling around with command line arguments.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
689 * Fire up this baby.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
690 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
691
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
692 purple_debug_set_enabled(debug_enabled);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
693
16371
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
694 /* If we're using a custom configuration directory, we
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
695 * do NOT want to migrate, or weird things will happen. */
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
696 if (opt_config_dir_arg == NULL)
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
697 {
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
698 if (!purple_core_migrate())
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
699 {
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
700 migration_failed = TRUE;
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
701 }
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
702 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
703
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
704 search_path = g_build_filename(purple_user_dir(), "gtkrc-2.0", NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
705 gtk_rc_add_default_file(search_path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
706 g_free(search_path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
707
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
708 gui_check = gtk_init_check(&argc, &argv);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
709 if (!gui_check) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
710 char *display = gdk_get_display();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
711
21030
3cc856ca2338 Add a --with-extraversion option to ./configure so packagers can fine tune
Stu Tomlinson <stu@nosnilmot.com>
parents: 21015
diff changeset
712 printf("%s %s\n", PIDGIN_NAME, DISPLAY_VERSION);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
713
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
714 g_warning("cannot open display: %s", display ? display : "unset");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
715 g_free(display);
16131
f0c6a91bfd67 Free segfault_message when Pidgin exits abnormally
Mark Doliner <mark@kingant.net>
parents: 16098
diff changeset
716 #ifdef HAVE_SIGNAL_H
f0c6a91bfd67 Free segfault_message when Pidgin exits abnormally
Mark Doliner <mark@kingant.net>
parents: 16098
diff changeset
717 g_free(segfault_message);
f0c6a91bfd67 Free segfault_message when Pidgin exits abnormally
Mark Doliner <mark@kingant.net>
parents: 16098
diff changeset
718 #endif
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
719
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
720 return 1;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
721 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
722
18826
f8bea3e688b0 Patch from Gabriel Schulhof to only call g_set_application_name() if
Mark Doliner <mark@kingant.net>
parents: 18753
diff changeset
723 #if GLIB_CHECK_VERSION(2,2,0)
18283
6f5e6efd2241 Move g_set_application_name to a point before the pidgin UI is created
Gabriel Schulhof <nix@go-nix.ca>
parents: 18184
diff changeset
724 g_set_application_name(_("Pidgin"));
18826
f8bea3e688b0 Patch from Gabriel Schulhof to only call g_set_application_name() if
Mark Doliner <mark@kingant.net>
parents: 18753
diff changeset
725 #endif /* glib-2.0 >= 2.2.0 */
18283
6f5e6efd2241 Move g_set_application_name to a point before the pidgin UI is created
Gabriel Schulhof <nix@go-nix.ca>
parents: 18184
diff changeset
726
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
727 #ifdef _WIN32
15515
75ffc646647f Win32 de-gaimification of pidgin
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15506
diff changeset
728 winpidgin_init(hint);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
729 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
730
16371
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
731 if (migration_failed)
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
732 {
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
733 char *old = g_strconcat(purple_home_dir(),
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
734 G_DIR_SEPARATOR_S ".gaim", NULL);
16375
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16371
diff changeset
735 const char *text = _(
16381
72dc611f3257 Fix the custom icon stuff, and various memory leaks. At this point, custom
Richard Laager <rlaager@wiktel.com>
parents: 16375
diff changeset
736 "%s encountered errors migrating your settings "
16371
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
737 "from %s to %s. Please investigate and complete the "
16700
f8f78fa7e774 Solicit bug reports
Sean Egan <seanegan@gmail.com>
parents: 16681
diff changeset
738 "migration by hand. Please report this error at http://developer.pidgin.im");
16371
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
739 GtkWidget *dialog;
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
740
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
741 dialog = gtk_message_dialog_new(NULL,
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
742 0,
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
743 GTK_MESSAGE_ERROR,
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
744 GTK_BUTTONS_CLOSE,
16381
72dc611f3257 Fix the custom icon stuff, and various memory leaks. At this point, custom
Richard Laager <rlaager@wiktel.com>
parents: 16375
diff changeset
745 text, PIDGIN_NAME,
72dc611f3257 Fix the custom icon stuff, and various memory leaks. At this point, custom
Richard Laager <rlaager@wiktel.com>
parents: 16375
diff changeset
746 old, purple_user_dir());
16371
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
747 g_free(old);
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
748
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
749 g_signal_connect_swapped(dialog, "response",
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
750 G_CALLBACK(gtk_main_quit), NULL);
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
751
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
752 gtk_widget_show_all(dialog);
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
753
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
754 gtk_main();
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
755
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
756 #ifdef HAVE_SIGNAL_H
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
757 g_free(segfault_message);
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
758 #endif
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
759 return 0;
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
760 }
0fc1b85fd247 Call the core migrate code.
Richard Laager <rlaager@wiktel.com>
parents: 16202
diff changeset
761
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
762 purple_core_set_ui_ops(pidgin_core_get_ui_ops());
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
763 purple_eventloop_set_ui_ops(pidgin_eventloop_get_ui_ops());
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
764
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
765 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
766 * Set plugin search directories. Give priority to the plugins
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
767 * in user's home directory.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
768 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
769 search_path = g_build_filename(purple_user_dir(), "plugins", NULL);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
770 purple_plugins_add_search_path(search_path);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
771 g_free(search_path);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
772 purple_plugins_add_search_path(LIBDIR);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
773
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
774 if (!purple_core_init(PIDGIN_UI)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
775 fprintf(stderr,
16932
b668951121d8 Change the PIDGIN_NAME stuff to allow translators to transliterate the
Richard Laager <rlaager@wiktel.com>
parents: 16909
diff changeset
776 "Initialization of the libpurple core failed. Dumping core.\n"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
777 "Please report this!\n");
16131
f0c6a91bfd67 Free segfault_message when Pidgin exits abnormally
Mark Doliner <mark@kingant.net>
parents: 16098
diff changeset
778 #ifdef HAVE_SIGNAL_H
f0c6a91bfd67 Free segfault_message when Pidgin exits abnormally
Mark Doliner <mark@kingant.net>
parents: 16098
diff changeset
779 g_free(segfault_message);
f0c6a91bfd67 Free segfault_message when Pidgin exits abnormally
Mark Doliner <mark@kingant.net>
parents: 16098
diff changeset
780 #endif
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
781 abort();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
782 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
783
18135
5114739a4169 Allow disabling check for single instance.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18119
diff changeset
784 if (opt_si && !purple_core_ensure_single_instance()) {
22712
4c731c4dcc0b Pop up the buddylist of the running instance instead of exiting quietly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22631
diff changeset
785 #ifdef HAVE_DBUS
4c731c4dcc0b Pop up the buddylist of the running instance instead of exiting quietly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22631
diff changeset
786 DBusConnection *conn = purple_dbus_get_connection();
4c731c4dcc0b Pop up the buddylist of the running instance instead of exiting quietly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22631
diff changeset
787 DBusMessage *message = dbus_message_new_method_call(DBUS_SERVICE_PURPLE, DBUS_PATH_PURPLE,
4c731c4dcc0b Pop up the buddylist of the running instance instead of exiting quietly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22631
diff changeset
788 DBUS_INTERFACE_PURPLE, "PurpleBlistSetVisible");
4c731c4dcc0b Pop up the buddylist of the running instance instead of exiting quietly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22631
diff changeset
789 gboolean tr = TRUE;
4c731c4dcc0b Pop up the buddylist of the running instance instead of exiting quietly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22631
diff changeset
790 dbus_message_append_args(message, DBUS_TYPE_UINT32, &tr, DBUS_TYPE_INVALID);
4c731c4dcc0b Pop up the buddylist of the running instance instead of exiting quietly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22631
diff changeset
791 dbus_connection_send_with_reply_and_block(conn, message, -1, NULL);
4c731c4dcc0b Pop up the buddylist of the running instance instead of exiting quietly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22631
diff changeset
792 dbus_message_unref(message);
4c731c4dcc0b Pop up the buddylist of the running instance instead of exiting quietly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22631
diff changeset
793 #endif
21606
47b2074a55d8 Log a debug message when exiting as a result of the single instance check
Stu Tomlinson <stu@nosnilmot.com>
parents: 21446
diff changeset
794 purple_debug_info("main", "exiting because another libpurple client is already running\n");
17126
b5935a854ccb Added purple_core_quit to cleanup.
Gabriel Schulhof <nix@go-nix.ca>
parents: 17124
diff changeset
795 purple_core_quit();
17123
176d0fc8bc16 Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 17073
diff changeset
796 #ifdef HAVE_SIGNAL_H
176d0fc8bc16 Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 17073
diff changeset
797 g_free(segfault_message);
176d0fc8bc16 Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 17073
diff changeset
798 #endif
17129
60ca4431f867 Whitespace fix in the dbus_uniq code.
Richard Laager <rlaager@wiktel.com>
parents: 17124
diff changeset
799 return 0;
17124
601594a64190 Style changes + removed unnecessary NULL checks.
Gabriel Schulhof <nix@go-nix.ca>
parents: 17123
diff changeset
800 }
17123
176d0fc8bc16 Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 17073
diff changeset
801
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
802 /* TODO: Move blist loading into purple_blist_init() */
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
803 purple_set_blist(purple_blist_new());
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
804 purple_blist_load();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
805
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
806 /* load plugins we had when we quit */
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
807 purple_plugins_load_saved(PIDGIN_PREFS_ROOT "/plugins/loaded");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
808
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
809 /* TODO: Move pounces loading into purple_pounces_init() */
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
810 purple_pounces_load();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
811
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
812 ui_main();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
813
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
814 #ifdef USE_SM
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
815 pidgin_session_init(argv[0], opt_session_arg, opt_config_dir_arg);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
816 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
817 if (opt_session_arg != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
818 g_free(opt_session_arg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
819 opt_session_arg = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
820 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
821 if (opt_config_dir_arg != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
822 g_free(opt_config_dir_arg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
823 opt_config_dir_arg = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
824 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
825
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
826 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
827 * We want to show the blist early in the init process so the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
828 * user feels warm and fuzzy (not cold and prickley).
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
829 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
830 purple_blist_show();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
831
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
832 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled"))
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
833 pidgin_debug_window_show();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
834
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
835 if (opt_login) {
17850
1f060ef64f77 Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <stu@nosnilmot.com>
parents: 17544
diff changeset
836 /* disable all accounts */
1f060ef64f77 Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <stu@nosnilmot.com>
parents: 17544
diff changeset
837 for (accounts = purple_accounts_get_all(); accounts != NULL; accounts = accounts->next) {
1f060ef64f77 Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <stu@nosnilmot.com>
parents: 17544
diff changeset
838 PurpleAccount *account = accounts->data;
1f060ef64f77 Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <stu@nosnilmot.com>
parents: 17544
diff changeset
839 purple_account_set_enabled(account, PIDGIN_UI, FALSE);
1f060ef64f77 Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <stu@nosnilmot.com>
parents: 17544
diff changeset
840 }
1f060ef64f77 Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <stu@nosnilmot.com>
parents: 17544
diff changeset
841 /* honor the startup status preference */
1f060ef64f77 Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <stu@nosnilmot.com>
parents: 17544
diff changeset
842 if (!purple_prefs_get_bool("/purple/savedstatus/startup_current_status"))
1f060ef64f77 Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <stu@nosnilmot.com>
parents: 17544
diff changeset
843 purple_savedstatus_activate(purple_savedstatus_get_startup());
1f060ef64f77 Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <stu@nosnilmot.com>
parents: 17544
diff changeset
844 /* now enable the requested ones */
1f060ef64f77 Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <stu@nosnilmot.com>
parents: 17544
diff changeset
845 dologin_named(opt_login_arg);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
846 if (opt_login_arg != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
847 g_free(opt_login_arg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
848 opt_login_arg = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
849 }
19512
c88e64f1ed76 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 <daniel.atallah@gmail.com>
parents: 18826
diff changeset
850 } else if (opt_nologin) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
851 /* Set all accounts to "offline" */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
852 PurpleSavedStatus *saved_status;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
853
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
854 /* If we've used this type+message before, lookup the transient status */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
855 saved_status = purple_savedstatus_find_transient_by_type_and_message(
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
856 PURPLE_STATUS_OFFLINE, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
857
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
858 /* If this type+message is unique then create a new transient saved status */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
859 if (saved_status == NULL)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
860 saved_status = purple_savedstatus_new(NULL, PURPLE_STATUS_OFFLINE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
861
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
862 /* Set the status for each account */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
863 purple_savedstatus_activate(saved_status);
19512
c88e64f1ed76 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 <daniel.atallah@gmail.com>
parents: 18826
diff changeset
864 } else {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
865 /* Everything is good to go--sign on already */
16427
4999bbc52881 Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@gmail.com>
parents: 16202
diff changeset
866 if (!purple_prefs_get_bool("/purple/savedstatus/startup_current_status"))
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
867 purple_savedstatus_activate(purple_savedstatus_get_startup());
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
868 purple_accounts_restore_current_statuses();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
869 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
870
18058
4ca97b26a8fb Mark the return type const for the following functions. I noticed this
Richard Laager <rlaager@wiktel.com>
parents: 18032
diff changeset
871 if ((active_accounts = purple_accounts_get_all_active()) == NULL)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
872 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
873 pidgin_accounts_window_show();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
874 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
875 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
876 {
18058
4ca97b26a8fb Mark the return type const for the following functions. I noticed this
Richard Laager <rlaager@wiktel.com>
parents: 18032
diff changeset
877 g_list_free(active_accounts);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
878 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
879
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
880 #ifdef HAVE_STARTUP_NOTIFICATION
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
881 startup_notification_complete();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
882 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
883
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
884 #ifdef _WIN32
15515
75ffc646647f Win32 de-gaimification of pidgin
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15506
diff changeset
885 winpidgin_post_init();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
886 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
887
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
888 gtk_main();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
889
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
890 #ifdef HAVE_SIGNAL_H
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
891 g_free(segfault_message);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
892 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
893
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
894 #ifdef _WIN32
15515
75ffc646647f Win32 de-gaimification of pidgin
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15506
diff changeset
895 winpidgin_cleanup();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
896 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
897
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
898 return 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
899 }