annotate src/dialogs.c @ 2913:c914dc05d3fe

[gaim-migrate @ 2926] eh committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 22 Dec 2001 00:31:01 +0000
parents 538c58b43eff
children b68c648618a3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1 /*
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2 * gaim
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
5 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
9 * (at your option) any later version.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
10 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
14 * GNU General Public License for more details.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
19 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
20 */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
21
349
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
22 #ifdef HAVE_CONFIG_H
2090
b66aca8e8dce [gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
23 #include <config.h>
349
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
24 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
25 #include <string.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
26 #include <stdio.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
27 #include <stdlib.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
28 #include <time.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
29 #include <sys/types.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
30 #include <sys/stat.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
31 #include <fcntl.h>
967
17ff662183b2 [gaim-migrate @ 977]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
32 #include <ctype.h>
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
33 #include <sys/socket.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
34 #include <netdb.h>
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
35 #include <netinet/in.h>
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
36 #include <unistd.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
37 #include <netinet/in.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
38 #include <arpa/inet.h>
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
39 #include <errno.h>
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
40
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
41 #include <gtk/gtk.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
42 #include "gaim.h"
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
43 #include "gtkimhtml.h"
1270
babea41afa7e [gaim-migrate @ 1280]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1267
diff changeset
44 #include "prpl.h"
2851
6eb5bf5089f0 [gaim-migrate @ 2864]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2827
diff changeset
45 #ifdef USE_APPLET
6eb5bf5089f0 [gaim-migrate @ 2864]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2827
diff changeset
46 #include "applet.h"
6eb5bf5089f0 [gaim-migrate @ 2864]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2827
diff changeset
47 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
48
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
49 #include "pixmaps/gnome_preferences.xpm"
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
50 #include "pixmaps/cancel.xpm"
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
51 #include "pixmaps/save.xpm"
443
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
52 #include "pixmaps/ok.xpm"
459
fb1d671e168e [gaim-migrate @ 469]
Rob Flynn <gaim@robflynn.com>
parents: 458
diff changeset
53 #include "pixmaps/add.xpm"
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
54 #include "pixmaps/warn.xpm"
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
55 #include "pixmaps/close.xpm"
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
56
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
57 #include "pixmaps/angel.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
58 #include "pixmaps/bigsmile.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
59 #include "pixmaps/burp.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
60 #include "pixmaps/crossedlips.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
61 #include "pixmaps/cry.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
62 #include "pixmaps/embarrassed.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
63 #include "pixmaps/kiss.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
64 #include "pixmaps/moneymouth.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
65 #include "pixmaps/sad.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
66 #include "pixmaps/scream.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
67 #include "pixmaps/smile.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
68 #include "pixmaps/smile8.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
69 #include "pixmaps/think.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
70 #include "pixmaps/tongue.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
71 #include "pixmaps/wink.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
72 #include "pixmaps/yell.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
73
2379
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
74 #include "pixmaps/aimicon.xpm"
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
75
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
76 #include "pixmaps/aol_icon.xpm"
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
77 #include "pixmaps/free_icon.xpm"
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
78 #include "pixmaps/dt_icon.xpm"
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
79 #include "pixmaps/admin_icon.xpm"
2679
94aa499ecd39 [gaim-migrate @ 2692]
Adam Fritzler <mid@auk.cx>
parents: 2665
diff changeset
80 #include "pixmaps/ab.xpm"
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
81
1035
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
82 #define PATHSIZE 1024
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
83
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
84 int smiley_array[FACE_TOTAL];
728
a509d6fad0de [gaim-migrate @ 738]
Todd Kulesza <fflewddur>
parents: 717
diff changeset
85 GdkColor bgcolor;
a509d6fad0de [gaim-migrate @ 738]
Todd Kulesza <fflewddur>
parents: 717
diff changeset
86 GdkColor fgcolor;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
87
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
88 static GtkWidget *imdialog = NULL; /*I only want ONE of these :) */
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
89 static GtkWidget *infodialog = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
90 static GList *dialogwindows = NULL;
2493
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
91 static GtkWidget *importdialog;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
92 static struct gaim_connection *importgc;
2344
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
93 static GtkWidget *icondlg;
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
94 static GtkWidget *aliasdlg = NULL;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
95 static GtkWidget *aliasentry = NULL;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
96 static GtkWidget *aliasname = NULL;
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
97 static GtkWidget *rename_dialog = NULL;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
98 static GtkWidget *rename_bud_dialog = NULL;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
99
2743
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
100 struct confirm_del {
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
101 GtkWidget *window;
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
102 GtkWidget *label;
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
103 GtkWidget *ok;
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
104 GtkWidget *cancel;
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
105 char name[1024];
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
106 struct gaim_connection *gc;
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
107 };
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
108
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
109 struct create_away {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
110 GtkWidget *window;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
111 GtkWidget *entry;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
112 GtkWidget *text;
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
113 struct away_message *mess;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
114 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
115
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
116 struct warning {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
117 GtkWidget *window;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
118 GtkWidget *anon;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
119 char *who;
976
2586b2a3725e [gaim-migrate @ 986]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 967
diff changeset
120 struct gaim_connection *gc;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
121 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
122
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
123 struct addbuddy {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
124 GtkWidget *window;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
125 GtkWidget *combo;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
126 GtkWidget *entry;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
127 GtkWidget *entry_for_alias;
2527
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
128 GtkWidget *account;
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
129 struct gaim_connection *gc;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
130 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
131
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
132 struct addperm {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
133 GtkWidget *window;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
134 GtkWidget *entry;
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
135 struct gaim_connection *gc;
1144
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
136 gboolean permit;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
137 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
138
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
139 struct addbp {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
140 GtkWidget *window;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
141 GtkWidget *nameentry;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
142 GtkWidget *messentry;
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
143 GtkWidget *commentry;
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
144 GtkWidget *command;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
145 GtkWidget *sendim;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
146 GtkWidget *openwindow;
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
147 GtkWidget *popupnotify;
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
148 GtkWidget *p_signon;
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
149 GtkWidget *p_unaway;
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
150 GtkWidget *p_unidle;
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
151 GtkWidget *save;
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
152 GtkWidget *menu;
1694
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
153 GtkWidget *sound;
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
154 GtkWidget *soundentry;
1139
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
155
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
156 struct aim_user *user;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
157 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
158
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
159 struct findbyemail {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
160 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
161 GtkWidget *emailentry;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1499
diff changeset
162 struct gaim_connection *gc;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
163 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
164
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
165 struct findbyinfo {
2393
a7ecfd3f7714 [gaim-migrate @ 2406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2382
diff changeset
166 struct gaim_connection *gc;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
167 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
168 GtkWidget *firstentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
169 GtkWidget *middleentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
170 GtkWidget *lastentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
171 GtkWidget *maidenentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
172 GtkWidget *cityentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
173 GtkWidget *stateentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
174 GtkWidget *countryentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
175 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
176
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
177 struct info_dlg {
2773
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
178 struct gaim_connection *gc;
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
179 char *who;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
180 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
181 GtkWidget *text;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
182 };
2773
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
183 static GSList *info_dlgs = NULL;
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
184
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
185 static struct info_dlg *find_info_dlg(struct gaim_connection *gc, char *who)
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
186 {
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
187 GSList *i = info_dlgs;
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
188 while (i) {
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
189 struct info_dlg *d = i->data;
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
190 i = i->next;
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
191 if (d->gc != gc)
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
192 continue;
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
193 if (d->who == NULL)
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
194 continue;
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
195 if (!who)
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
196 continue;
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
197 if (!g_strcasecmp(normalize(who), d->who))
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
198 return d;
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
199 }
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
200 return NULL;
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
201 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
202
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
203 struct set_info_dlg {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
204 GtkWidget *window;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
205 GtkWidget *menu;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
206 struct aim_user *user;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
207 GtkWidget *text;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
208 GtkWidget *save;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
209 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
210 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
211
2344
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
212 struct set_icon_dlg {
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
213 GtkWidget *window;
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
214 struct aim_user *user;
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
215 GtkWidget *ok;
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
216 GtkWidget *cancel;
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
217 GtkWidget *entry;
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
218 };
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
219
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
220 struct set_dir_dlg {
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
221 struct gaim_connection *gc;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
222 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
223 GtkWidget *first;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
224 GtkWidget *middle;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
225 GtkWidget *last;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
226 GtkWidget *maiden;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
227 GtkWidget *city;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
228 GtkWidget *state;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
229 GtkWidget *country;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
230 GtkWidget *web;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
231 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
232 GtkWidget *save;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
233 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
234
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
235 struct linkdlg {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
236 GtkWidget *ok;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
237 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
238 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
239 GtkWidget *url;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
240 GtkWidget *text;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
241 GtkWidget *toggle;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
242 GtkWidget *entry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
243 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
244
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
245 struct passwddlg {
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
246 GtkWidget *window;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
247 GtkWidget *ok;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
248 GtkWidget *cancel;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
249 GtkWidget *original;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
250 GtkWidget *new1;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
251 GtkWidget *new2;
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
252 struct gaim_connection *gc;
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
253 };
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
254
2621
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
255 struct view_log {
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
256 long offset;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
257 int options;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
258 char *name;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
259 GtkWidget *bbox;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
260 GtkWidget *window;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
261 GtkWidget *layout;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
262 };
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
263
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
264 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
265 /* Destroys */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
266 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
267
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
268 static gint delete_event_dialog(GtkWidget *w, GdkEventAny *e, struct conversation *c)
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
269 {
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
270 gchar *object_data;
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
271 object_data = gtk_object_get_user_data(GTK_OBJECT(w));
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
272
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
273 if (GTK_IS_COLOR_SELECTION_DIALOG(w)) {
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
274 set_state_lock(1);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
275 if (w == c->fg_color_dialog) {
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
276 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->fgcolorbtn), FALSE);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
277 c->fg_color_dialog = NULL;
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
278 } else {
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
279 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->bgcolorbtn), FALSE);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
280 c->bg_color_dialog = NULL;
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
281 }
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
282 set_state_lock(0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
283 } else if (GTK_IS_FONT_SELECTION_DIALOG(w)) {
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
284 set_state_lock(1);
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
285 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->font), FALSE);
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
286 set_state_lock(0);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
287 c->font_dialog = NULL;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
288 } else if (!g_strcasecmp(object_data, "smiley dialog")) {
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
289 set_state_lock(1);
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
290 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->smiley), FALSE);
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
291 set_state_lock(0);
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
292 c->smiley_dialog = NULL;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
293 } else if (!g_strcasecmp(object_data, "log dialog")) {
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
294 set_state_lock(1);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
295 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->wood), FALSE);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
296 set_state_lock(0);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
297 c->log_dialog = NULL;
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
298 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
299
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
300 dialogwindows = g_list_remove(dialogwindows, w);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
301 gtk_widget_destroy(w);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
302
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
303 return FALSE;
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
304 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
305
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
306 static void destroy_dialog(GtkWidget *w, GtkWidget *w2)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
307 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
308 GtkWidget *dest;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
309
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
310 if (!GTK_IS_WIDGET(w2))
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
311 dest = w;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
312 else
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
313 dest = w2;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
314
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
315 if (dest == imdialog)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
316 imdialog = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
317
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
318 if (dest == infodialog)
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
319 infodialog = NULL;
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
320
2493
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
321 if (dest == importdialog) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
322 importdialog = NULL;
2493
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
323 importgc = NULL;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
324 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
325
2344
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
326 if (dest == icondlg)
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
327 icondlg = NULL;
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
328
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
329 if (dest == aliasdlg) {
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
330 aliasdlg = NULL;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
331 aliasentry = NULL;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
332 aliasname = NULL;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
333 }
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
334
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
335 if (dest == rename_dialog)
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
336 rename_dialog = NULL;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
337
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
338 if (dest == rename_bud_dialog)
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
339 rename_bud_dialog = NULL;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
340
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
341 dialogwindows = g_list_remove(dialogwindows, dest);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
342 gtk_widget_destroy(dest);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
343
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
344 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
345
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
346
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
347 void destroy_all_dialogs()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
348 {
2621
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
349 while (dialogwindows)
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
350 destroy_dialog(NULL, dialogwindows->data);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
351
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
352 if (awaymessage)
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
353 do_im_back(NULL, NULL);
84
51943f1a97a0 [gaim-migrate @ 94]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
354
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
355 if (imdialog) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
356 destroy_dialog(NULL, imdialog);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
357 imdialog = NULL;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
358 }
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
359
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
360 if (infodialog) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
361 destroy_dialog(NULL, infodialog);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
362 infodialog = NULL;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
363 }
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
364
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
365 if (importdialog) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
366 destroy_dialog(NULL, importdialog);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
367 importdialog = NULL;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
368 }
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
369
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
370 if (icondlg) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
371 destroy_dialog(NULL, icondlg);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
372 icondlg = NULL;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
373 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
374 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
375
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
376 static void do_warn(GtkWidget *widget, struct warning *w)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
377 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
378 serv_warn(w->gc, w->who, (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w->anon))) ? 1 : 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
379
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
380 destroy_dialog(NULL, w->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
381 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
382
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
383 static void free_warn_data(GtkObject *obj, struct warning *w)
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
384 {
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
385 g_free(w);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
386 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
387
976
2586b2a3725e [gaim-migrate @ 986]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 967
diff changeset
388 void show_warn_dialog(struct gaim_connection *gc, char *who)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
389 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
390 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
391 GtkWidget *warn;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
392 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
393 GtkWidget *vbox;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
394 GtkWidget *bbox;
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
395 GtkWidget *frame;
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
396 GtkWidget *fbox;
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
397 char buf[128];
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
398
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
399 struct warning *w = g_new0(struct warning, 1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
400 w->who = who;
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
401 w->gc = gc;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
402
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
403 GAIM_DIALOG(w->window);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
404 dialogwindows = g_list_prepend(dialogwindows, w->window);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
405 gtk_window_set_wmclass(GTK_WINDOW(w->window), "warning", "Gaim");
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
406 gtk_window_set_policy(GTK_WINDOW(w->window), FALSE, FALSE, TRUE);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
407 gtk_window_set_title(GTK_WINDOW(w->window), _("Gaim - Warn user?"));
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
408 gtk_container_set_border_width(GTK_CONTAINER(w->window), 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
409 gtk_signal_connect(GTK_OBJECT(w->window), "delete_event",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
410 GTK_SIGNAL_FUNC(destroy_dialog), w->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
411 gtk_signal_connect(GTK_OBJECT(w->window), "delete_event", GTK_SIGNAL_FUNC(free_warn_data), w);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
412 gtk_widget_realize(w->window);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
413 aol_icon(w->window->window);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
414
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
415 fbox = gtk_vbox_new(FALSE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
416 gtk_container_add(GTK_CONTAINER(w->window), fbox);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
417 gtk_widget_show(fbox);
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
418
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
419 frame = gtk_frame_new(_("Warn"));
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
420 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 5);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
421 gtk_widget_show(frame);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
422
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
423 vbox = gtk_vbox_new(FALSE, 5);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
424 gtk_container_add(GTK_CONTAINER(frame), vbox);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
425 gtk_widget_show(vbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
426
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
427 g_snprintf(buf, 127, _("Do you really want to warn %s?"), who);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
428 label = gtk_label_new(buf);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
429 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
430 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
431
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
432 w->anon = gtk_check_button_new_with_label(_("Warn anonymously?"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
433 gtk_box_pack_start(GTK_BOX(vbox), w->anon, TRUE, TRUE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
434 gtk_widget_show(w->anon);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
435
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
436 label = gtk_label_new(_("Anonymous warnings are less harsh."));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
437 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
438 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
439
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
440 bbox = gtk_hbox_new(TRUE, 10);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
441 gtk_box_pack_start(GTK_BOX(fbox), bbox, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
442 gtk_widget_show(bbox);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
443
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
444 cancel = picture_button(w->window, _("Cancel"), cancel_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
445 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
446 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), w->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
447
2743
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
448 warn = picture_button(w->window, _("Warn"), warn_xpm);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
449 gtk_box_pack_end(GTK_BOX(bbox), warn, FALSE, FALSE, 5);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
450 gtk_signal_connect(GTK_OBJECT(warn), "clicked", GTK_SIGNAL_FUNC(do_warn), w);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
451
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
452 gtk_widget_show(w->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
453 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
454
2743
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
455 void do_remove_buddy(GtkWidget *w, struct buddy *b)
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
456 {
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
457 struct group *g = find_group_by_buddy(b->gc, b->name);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
458 struct gaim_connection *gc = b->gc;
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
459 struct conversation *cv;
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
460
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
461 if (!b)
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
462 return;
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
463
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
464 debug_printf(_("Removing '%s' from buddylist.\n"), b->name);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
465 serv_remove_buddy(b->gc, b->name, g->name);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
466 remove_buddy(gc, g, b);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
467 do_export(gc);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
468 build_edit_tree();
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
469
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
470 cv = find_conversation(b->name);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
471
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
472 if (cv)
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
473 update_convo_add_button(cv);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
474
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
475 }
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
476
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
477 void show_confirm_del(struct gaim_connection *gc, gchar *name)
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
478 {
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
479 struct confirm_del *b = g_new0(struct confirm_del, 1);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
480 struct buddy *bd;
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
481 GtkWidget *hbox;
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
482 GtkWidget *vbox;
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
483 GtkWidget *fbox;
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
484 GtkWidget *frame;
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
485 gchar tmp[2048];
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
486
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
487 GAIM_DIALOG(b->window);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
488 dialogwindows = g_list_prepend(dialogwindows, b->window);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
489
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
490 g_snprintf(tmp, sizeof(tmp), _("Gaim - Remove %s?"), name);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
491 gtk_window_set_title(GTK_WINDOW(b->window), tmp);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
492 gtk_window_set_wmclass(GTK_WINDOW(b->window), "confirm_del", "Gaim");
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
493 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, FALSE, TRUE);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
494 gtk_signal_connect(GTK_OBJECT(b->window), "delete_event",
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
495 GTK_SIGNAL_FUNC(destroy_dialog), b->window);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
496
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
497 gtk_widget_realize(b->window);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
498
2750
3e8004e0df3d [gaim-migrate @ 2763]
Rob Flynn <gaim@robflynn.com>
parents: 2746
diff changeset
499 vbox = gtk_vbox_new(FALSE, 0);
2743
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
500 gtk_container_add(GTK_CONTAINER(b->window), vbox);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
501 gtk_widget_show(vbox);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
502
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
503 frame = gtk_frame_new(_("Remove Buddy"));
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
504 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
505 gtk_container_set_border_width(GTK_CONTAINER(frame), 5);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
506 gtk_widget_show(frame);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
507
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
508 fbox = gtk_vbox_new(FALSE, 5);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
509 gtk_container_add(GTK_CONTAINER(frame), fbox);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
510 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
511 gtk_widget_show(fbox);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
512
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
513 g_snprintf(tmp, sizeof(tmp), _("You are about to remove '%s' from\nyour buddylist. Do you want to continue?"), name);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
514 b->label = gtk_label_new(tmp);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
515 gtk_misc_set_alignment(GTK_MISC(b->label), 0, 0.5);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
516 gtk_label_set_justify(GTK_LABEL(b->label), GTK_JUSTIFY_LEFT);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
517 gtk_box_pack_start(GTK_BOX(fbox), b->label, FALSE, FALSE, 0);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
518 gtk_widget_show(b->label);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
519
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
520 hbox = gtk_hbox_new(FALSE, 5);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
521 gtk_container_set_border_width(GTK_CONTAINER(hbox), 5);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
522 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, FALSE, 0);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
523 gtk_widget_show(hbox);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
524
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
525 b->ok = picture_button(b->window, _("Accept"), ok_xpm);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
526 gtk_box_pack_start(GTK_BOX(hbox), b->ok, FALSE, FALSE, 5);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
527
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
528 bd = find_buddy(gc, name);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
529
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
530 if (bd)
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
531 gtk_signal_connect(GTK_OBJECT(b->ok), "clicked", GTK_SIGNAL_FUNC(do_remove_buddy), bd);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
532
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
533 gtk_signal_connect(GTK_OBJECT(b->ok), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
534
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
535 b->cancel = picture_button(b->window, _("Cancel"), cancel_xpm);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
536 gtk_box_pack_start(GTK_BOX(hbox), b->cancel, FALSE, FALSE, 5);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
537 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
538
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
539 gtk_widget_show(b->window);
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
540 }
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
541
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
542
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
543
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
544 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
545 /* The dialog for getting an error */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
546 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
547
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
548 GtkWidget *do_error_dialog(char *message, char *title)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
549 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
550 GtkWidget *d;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
551 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
552 GtkWidget *close;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
553
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
554
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
555 d = gtk_dialog_new();
463
be7cf1868b76 [gaim-migrate @ 473]
Rob Flynn <gaim@robflynn.com>
parents: 459
diff changeset
556 gtk_window_set_policy(GTK_WINDOW(d), FALSE, FALSE, TRUE);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
557 gtk_widget_realize(d);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
558 label = gtk_label_new(message);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
559 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
560 gtk_widget_show(label);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
561 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->vbox), label, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
562
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
563 close = picture_button(d, _("Close"), cancel_xpm);
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
564
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
565 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->action_area), close, FALSE, FALSE, 5);
463
be7cf1868b76 [gaim-migrate @ 473]
Rob Flynn <gaim@robflynn.com>
parents: 459
diff changeset
566
be7cf1868b76 [gaim-migrate @ 473]
Rob Flynn <gaim@robflynn.com>
parents: 459
diff changeset
567 gtk_container_set_border_width(GTK_CONTAINER(d), 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
568 gtk_window_set_title(GTK_WINDOW(d), title);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
569 gtk_signal_connect(GTK_OBJECT(close), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), d);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
570 aol_icon(d->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
571
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
572 gtk_widget_show(d);
2143
e257c17864eb [gaim-migrate @ 2153]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2137
diff changeset
573 gtk_widget_grab_focus(close);
1817
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1815
diff changeset
574 return d;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
575 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
576
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
577
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
578
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
579 static void do_im(GtkWidget *widget, GtkWidget *imentry)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
580 {
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
581 char *who;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
582 struct conversation *c;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
583
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
584 who = g_strdup(gtk_entry_get_text(GTK_ENTRY(imentry)));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
585 destroy_dialog(NULL, imdialog);
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
586 imdialog = NULL;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
587
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1979
diff changeset
588 if (!g_strcasecmp(who, "")) {
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
589 g_free(who);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
590 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
591 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
592
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
593 c = find_conversation(who);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
594
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
595 if (c == NULL) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
596 c = new_conversation(who);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
597 } else {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
598 gdk_window_raise(c->window->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
599 }
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
600 g_free(who);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
601 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
602
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
603 static void do_info(GtkWidget *widget, GtkWidget *infoentry)
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
604 {
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
605 char *who;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
606
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
607 who = g_strdup(normalize(gtk_entry_get_text(GTK_ENTRY(infoentry))));
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
608 destroy_dialog(NULL, infodialog);
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
609 infodialog = NULL;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
610
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1979
diff changeset
611 if (!g_strcasecmp(who, "")) {
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
612 g_free(who);
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
613 return;
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
614 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
615
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
616 /* what do we want to do about this case? */
1032
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
617 if (connections)
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
618 serv_get_info(connections->data, who);
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
619
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
620 g_free(who);
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
621 }
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
622
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
623 void show_ee_dialog(int ee)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
624 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
625 GtkWidget *ok;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
626 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
627 GtkWidget *box;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
628 GtkWidget *eedialog;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
629
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
630 GAIM_DIALOG(eedialog);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2228
diff changeset
631 gtk_widget_realize(eedialog);
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2228
diff changeset
632 ok = picture_button(eedialog, _("OK"), ok_xpm);
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
633 box = gtk_vbox_new(FALSE, 10);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
634
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
635 if (ee == 0)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
636 label = gtk_label_new("Amazing! Simply Amazing!");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
637 else if (ee == 1)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
638 label = gtk_label_new("Pimpin\' Penguin Style! *Waddle Waddle*");
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
639 else if (ee == 2)
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
640 label = gtk_label_new("You should be me. I'm so cute!");
2472
dd4114ed4c07 [gaim-migrate @ 2485]
Rob Flynn <gaim@robflynn.com>
parents: 2411
diff changeset
641 else if (ee == 3)
dd4114ed4c07 [gaim-migrate @ 2485]
Rob Flynn <gaim@robflynn.com>
parents: 2411
diff changeset
642 label = gtk_label_new("Now that's what I like!");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
643 else
2472
dd4114ed4c07 [gaim-migrate @ 2485]
Rob Flynn <gaim@robflynn.com>
parents: 2411
diff changeset
644 label = gtk_label_new("Ahh, and excellent choice!");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
645
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
646 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
647 gtk_widget_show(ok);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
648
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
649 gtk_box_pack_start(GTK_BOX(box), label, TRUE, TRUE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
650 gtk_box_pack_start(GTK_BOX(box), ok, FALSE, FALSE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
651
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
652 gtk_widget_show(box);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
653
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
654 gtk_container_add(GTK_CONTAINER(eedialog), box);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
655 gtk_window_set_title(GTK_WINDOW(eedialog), "Gaim - SUPRISE!");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
656
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
657 gtk_signal_connect(GTK_OBJECT(ok), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), eedialog);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
658 gtk_widget_realize(eedialog);
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
659 aol_icon(eedialog->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
660
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
661 gtk_widget_show(eedialog);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
662 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
663
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
664 void show_im_dialog()
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
665 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
666 GtkWidget *mainbox;
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
667 GtkWidget *frame;
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
668 GtkWidget *fbox;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
669 GtkWidget *bbox;
455
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
670 GtkWidget *button;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
671 GtkWidget *imentry;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
672 GtkWidget *label;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
673
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
674 if (!imdialog) {
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
675 GAIM_DIALOG(imdialog);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
676 gtk_window_set_wmclass(GTK_WINDOW(imdialog), "imdialog", "Gaim");
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
677 gtk_window_set_policy(GTK_WINDOW(imdialog), FALSE, TRUE, TRUE);
1233
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
678 gtk_window_set_title(GTK_WINDOW(imdialog), _("Gaim - IM user"));
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
679 gtk_signal_connect(GTK_OBJECT(imdialog), "destroy",
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
680 GTK_SIGNAL_FUNC(destroy_dialog), imdialog);
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
681 gtk_widget_realize(imdialog);
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
682 aol_icon(imdialog->window);
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
683
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
684 mainbox = gtk_vbox_new(FALSE, 5);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
685 gtk_container_set_border_width(GTK_CONTAINER(mainbox), 5);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
686 gtk_container_add(GTK_CONTAINER(imdialog), mainbox);
455
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
687
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
688 frame = gtk_frame_new(_("Send Instant Message"));
1233
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
689 gtk_box_pack_start(GTK_BOX(mainbox), frame, TRUE, TRUE, 0);
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
690
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
691 fbox = gtk_hbox_new(FALSE, 5);
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
692 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5);
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
693 gtk_container_add(GTK_CONTAINER(frame), fbox);
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
694
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
695 label = gtk_label_new(_("IM who:"));
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
696 gtk_box_pack_start(GTK_BOX(fbox), label, FALSE, FALSE, 0);
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
697
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
698 imentry = gtk_entry_new();
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
699 gtk_box_pack_start(GTK_BOX(fbox), imentry, TRUE, TRUE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
700 gtk_signal_connect(GTK_OBJECT(imentry), "activate", GTK_SIGNAL_FUNC(do_im), imentry);
1233
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
701 gtk_widget_grab_focus(imentry);
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
702
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
703 bbox = gtk_hbox_new(FALSE, 5);
1233
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
704 gtk_box_pack_start(GTK_BOX(mainbox), bbox, FALSE, FALSE, 0);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
705
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
706 button = picture_button(imdialog, _("Cancel"), cancel_xpm);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
707 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
708 gtk_signal_connect(GTK_OBJECT(button), "clicked",
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
709 GTK_SIGNAL_FUNC(destroy_dialog), imdialog);
455
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
710
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
711 button = picture_button(imdialog, _("OK"), ok_xpm);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
712 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
713 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(do_im), imentry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
714 }
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
715
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
716 gtk_widget_show_all(imdialog);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
717 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
718
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
719 void show_info_dialog()
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
720 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
721 GtkWidget *mainbox;
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
722 GtkWidget *frame;
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
723 GtkWidget *fbox;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
724 GtkWidget *bbox;
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
725 GtkWidget *button;
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
726 GtkWidget *infoentry;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
727 GtkWidget *label;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
728
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
729 if (!infodialog) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
730
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
731 GAIM_DIALOG(infodialog);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
732 gtk_window_set_wmclass(GTK_WINDOW(infodialog), "infodialog", "Gaim");
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
733 gtk_window_set_policy(GTK_WINDOW(infodialog), FALSE, TRUE, TRUE);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
734 gtk_widget_realize(infodialog);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
735
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
736 mainbox = gtk_vbox_new(FALSE, 5);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
737 gtk_container_set_border_width(GTK_CONTAINER(mainbox), 5);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
738 gtk_container_add(GTK_CONTAINER(infodialog), mainbox);
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
739
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
740 frame = gtk_frame_new(_("Get User Info"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
741 gtk_box_pack_start(GTK_BOX(mainbox), frame, TRUE, TRUE, 0);
1225
9c6dc2b2ad61 [gaim-migrate @ 1235]
Rob Flynn <gaim@robflynn.com>
parents: 1224
diff changeset
742
9c6dc2b2ad61 [gaim-migrate @ 1235]
Rob Flynn <gaim@robflynn.com>
parents: 1224
diff changeset
743 fbox = gtk_hbox_new(FALSE, 5);
9c6dc2b2ad61 [gaim-migrate @ 1235]
Rob Flynn <gaim@robflynn.com>
parents: 1224
diff changeset
744 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5);
9c6dc2b2ad61 [gaim-migrate @ 1235]
Rob Flynn <gaim@robflynn.com>
parents: 1224
diff changeset
745 gtk_container_add(GTK_CONTAINER(frame), fbox);
9c6dc2b2ad61 [gaim-migrate @ 1235]
Rob Flynn <gaim@robflynn.com>
parents: 1224
diff changeset
746
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
747 label = gtk_label_new(_("User:"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
748 gtk_box_pack_start(GTK_BOX(fbox), label, FALSE, FALSE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
749 gtk_widget_show(label);
1225
9c6dc2b2ad61 [gaim-migrate @ 1235]
Rob Flynn <gaim@robflynn.com>
parents: 1224
diff changeset
750
9c6dc2b2ad61 [gaim-migrate @ 1235]
Rob Flynn <gaim@robflynn.com>
parents: 1224
diff changeset
751 infoentry = gtk_entry_new();
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
752 gtk_box_pack_start(GTK_BOX(fbox), infoentry, TRUE, TRUE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
753
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
754 /* Handle closes right */
1225
9c6dc2b2ad61 [gaim-migrate @ 1235]
Rob Flynn <gaim@robflynn.com>
parents: 1224
diff changeset
755 gtk_signal_connect(GTK_OBJECT(infoentry), "activate",
9c6dc2b2ad61 [gaim-migrate @ 1235]
Rob Flynn <gaim@robflynn.com>
parents: 1224
diff changeset
756 GTK_SIGNAL_FUNC(do_info), infoentry);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
757 gtk_signal_connect(GTK_OBJECT(infodialog), "destroy",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
758 GTK_SIGNAL_FUNC(destroy_dialog), infodialog);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
759
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
760 /* Buttons */
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
761 bbox = gtk_hbox_new(FALSE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
762 gtk_box_pack_start(GTK_BOX(mainbox), bbox, FALSE, FALSE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
763
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
764 button = picture_button(infodialog, _("Cancel"), cancel_xpm);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
765 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
766 gtk_signal_connect(GTK_OBJECT(button), "clicked",
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
767 GTK_SIGNAL_FUNC(destroy_dialog), infodialog);
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
768
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
769 button = picture_button(infodialog, _("OK"), ok_xpm);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
770 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
771 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(do_info), infoentry);
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
772
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
773 /* Finish up */
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
774 gtk_window_set_title(GTK_WINDOW(infodialog), _("Gaim - Get User Info"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
775 gtk_widget_grab_focus(infoentry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
776
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
777 aol_icon(infodialog->window);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
778 }
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
779 gtk_widget_show_all(infodialog);
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
780 }
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
781
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
782
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
783 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
784 /* The dialog for adding buddies */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
785 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
786
654
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 653
diff changeset
787 extern void add_callback(GtkWidget *, struct conversation *);
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 653
diff changeset
788
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
789 void do_add_buddy(GtkWidget *w, struct addbuddy *a)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
790 {
1151
428372cc1e39 [gaim-migrate @ 1161]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1144
diff changeset
791 char *grp, *who, *whoalias;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
792 struct conversation *c;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
793
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
794 who = gtk_entry_get_text(GTK_ENTRY(a->entry));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
795 grp = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
796 whoalias = gtk_entry_get_text(GTK_ENTRY(a->entry_for_alias));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
797
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
798 c = find_conversation(who);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
799
2598
b2800bca74fe [gaim-migrate @ 2611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
800 add_buddy(a->gc, grp, who, whoalias);
b2800bca74fe [gaim-migrate @ 2611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
801 serv_add_buddy(a->gc, who);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
802
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
803 if (c != NULL) {
1352
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1344
diff changeset
804 update_buttons_by_protocol(c);
654
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 653
diff changeset
805 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
806
1805
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
807 do_export(a->gc);
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
808
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
809 destroy_dialog(NULL, a->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
810 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
811
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
812 void do_add_group(GtkWidget *w, struct addbuddy *a)
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
813 {
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
814 char *grp;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
815
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
816 grp = gtk_entry_get_text(GTK_ENTRY(a->entry));
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
817
2598
b2800bca74fe [gaim-migrate @ 2611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
818 if (!a->gc)
1805
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
819 a->gc = connections->data;
2598
b2800bca74fe [gaim-migrate @ 2611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
820
b2800bca74fe [gaim-migrate @ 2611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
821 add_group(a->gc, grp);
1805
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
822 do_export(a->gc);
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
823
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
824 destroy_dialog(NULL, a->window);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
825 }
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
826
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
827
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
828 static GList *groups_tree(struct gaim_connection *gc)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
829 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
830 GList *tmp = NULL;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
831 char *tmp2;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
832 struct group *g;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
833 GSList *grp = gc->groups;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
834
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
835 if (!grp) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
836 tmp2 = g_strdup(_("Buddies"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
837 tmp = g_list_append(tmp, tmp2);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
838 } else {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
839 while (grp) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
840 g = (struct group *)grp->data;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
841 tmp2 = g->name;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
842 tmp = g_list_append(tmp, tmp2);
940
9fca1293f871 [gaim-migrate @ 950]
Rob Flynn <gaim@robflynn.com>
parents: 935
diff changeset
843 grp = g_slist_next(grp);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
844 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
845 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
846 return tmp;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
847 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
848
825
9108277c95e9 [gaim-migrate @ 835]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 804
diff changeset
849 static void free_dialog(GtkWidget *w, struct addbuddy *a)
9108277c95e9 [gaim-migrate @ 835]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 804
diff changeset
850 {
9108277c95e9 [gaim-migrate @ 835]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 804
diff changeset
851 g_free(a);
9108277c95e9 [gaim-migrate @ 835]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 804
diff changeset
852 }
9108277c95e9 [gaim-migrate @ 835]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 804
diff changeset
853
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
854
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
855 void show_add_group(struct gaim_connection *gc)
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
856 {
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
857 GtkWidget *cancel;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
858 GtkWidget *add;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
859 GtkWidget *label;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
860 GtkWidget *bbox;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
861 GtkWidget *vbox;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
862 GtkWidget *topbox;
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
863 GtkWidget *frame;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
864
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
865 struct addbuddy *a = g_new0(struct addbuddy, 1);
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
866 a->gc = gc;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
867
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
868 GAIM_DIALOG(a->window);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
869 gtk_window_set_wmclass(GTK_WINDOW(a->window), "add_group", "Gaim");
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
870 gtk_window_set_policy(GTK_WINDOW(a->window), FALSE, FALSE, TRUE);
837
113205ae7e72 [gaim-migrate @ 847]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 832
diff changeset
871 gtk_widget_realize(a->window);
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
872 dialogwindows = g_list_prepend(dialogwindows, a->window);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
873
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
874 bbox = gtk_hbox_new(TRUE, 10);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
875 topbox = gtk_hbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
876 vbox = gtk_vbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
877
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
878 a->entry = gtk_entry_new();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
879 /* Put the buttons in the box */
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
880
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
881 add = picture_button(a->window, _("Add"), add_xpm);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
882
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
883 cancel = picture_button(a->window, _("Cancel"), cancel_xpm);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
884
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
885 gtk_box_pack_start(GTK_BOX(bbox), add, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
886 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5);
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
887
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
888 frame = gtk_frame_new(NULL);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
889 gtk_frame_set_label(GTK_FRAME(frame), _("Add Group"));
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
890
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
891 label = gtk_label_new(_("Group"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
892 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
893 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
894 gtk_box_pack_start(GTK_BOX(topbox), a->entry, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
895
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
896 /* And the boxes in the box */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
897 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
898 gtk_box_pack_start(GTK_BOX(vbox), bbox, TRUE, TRUE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
899
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
900 /* Handle closes right */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
901 gtk_signal_connect(GTK_OBJECT(a->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), a->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
902 gtk_signal_connect(GTK_OBJECT(a->window), "destroy", GTK_SIGNAL_FUNC(free_dialog), a);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
903 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), a->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
904 gtk_signal_connect(GTK_OBJECT(add), "clicked", GTK_SIGNAL_FUNC(do_add_group), a);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
905 gtk_signal_connect(GTK_OBJECT(a->entry), "activate", GTK_SIGNAL_FUNC(do_add_group), a);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
906 /* Finish up */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
907 gtk_widget_show(add);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
908 gtk_widget_show(cancel);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
909 gtk_widget_show(a->entry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
910 gtk_widget_show(topbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
911 gtk_widget_show(bbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
912 gtk_widget_show(vbox);
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
913 gtk_widget_show(frame);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
914 gtk_window_set_title(GTK_WINDOW(a->window), _("Gaim - Add Group"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
915 gtk_window_set_focus(GTK_WINDOW(a->window), a->entry);
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
916 gtk_container_add(GTK_CONTAINER(frame), vbox);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
917 gtk_container_add(GTK_CONTAINER(a->window), frame);
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
918 gtk_container_set_border_width(GTK_CONTAINER(a->window), 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
919 gtk_widget_realize(a->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
920 aol_icon(a->window->window);
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
921
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
922 gtk_widget_show(a->window);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
923 }
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
924
2527
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
925 static void addbuddy_select_account(GtkObject *w, struct gaim_connection *gc)
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
926 {
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
927 struct addbuddy *b = gtk_object_get_user_data(w);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
928
2561
f9bdfca15404 [gaim-migrate @ 2574]
Rob Flynn <gaim@robflynn.com>
parents: 2553
diff changeset
929 /* Save our account */
2527
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
930 b->gc = gc;
2561
f9bdfca15404 [gaim-migrate @ 2574]
Rob Flynn <gaim@robflynn.com>
parents: 2553
diff changeset
931
f9bdfca15404 [gaim-migrate @ 2574]
Rob Flynn <gaim@robflynn.com>
parents: 2553
diff changeset
932 /* We also want to update our group list */
2598
b2800bca74fe [gaim-migrate @ 2611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
933 gtk_combo_set_popdown_strings(GTK_COMBO(b->combo), groups_tree(gc));
2527
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
934 }
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
935
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
936 static void create_online_user_names(struct addbuddy *b)
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
937 {
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
938 char buf[2048]; /* Never hurts to be safe ;-) */
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
939 GSList *g = connections;
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
940 struct gaim_connection *c;
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
941 GtkWidget *menu, *opt;
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
942 int count = 0;
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
943 int place = 0;
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
944
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
945 menu = gtk_menu_new();
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
946
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
947 while (g) {
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
948 c = (struct gaim_connection *)g->data;
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
949 g_snprintf(buf, sizeof(buf), "%s (%s)",
2662
b0c5770156e1 [gaim-migrate @ 2675]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2642
diff changeset
950 c->username, c->prpl->name());
2527
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
951 opt = gtk_menu_item_new_with_label(buf);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
952 gtk_object_set_user_data(GTK_OBJECT(opt), b);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
953 gtk_signal_connect(GTK_OBJECT(opt), "activate",
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
954 GTK_SIGNAL_FUNC(addbuddy_select_account),
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
955 c);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
956 gtk_widget_show(opt);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
957 gtk_menu_append(GTK_MENU(menu), opt);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
958
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
959 /* Now check to see if it's our current menu */
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
960 if (c == b->gc) {
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
961 place = count;
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
962 gtk_menu_item_activate(GTK_MENU_ITEM(opt));
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
963 gtk_option_menu_set_history(GTK_OPTION_MENU(b->account), count);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
964
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
965 /* Do the cha cha cha */
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
966 }
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
967
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
968 count++;
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
969
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
970 g = g->next;
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
971 }
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
972
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
973 gtk_option_menu_remove_menu(GTK_OPTION_MENU(b->account));
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
974 gtk_option_menu_set_menu(GTK_OPTION_MENU(b->account), menu);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
975 gtk_option_menu_set_history(GTK_OPTION_MENU(b->account), place);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
976
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
977 gtk_widget_show(b->account);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
978 gtk_widget_show(b->account->parent);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
979
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
980 }
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
981
2582
5efa8077107f [gaim-migrate @ 2595]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2572
diff changeset
982 void show_add_buddy(struct gaim_connection *gc, char *buddy, char *group, char *alias)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
983 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
984 GtkWidget *mainbox;
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
985 GtkWidget *frame;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
986 GtkWidget *table;
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
987 GtkWidget *bbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
988 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
989 GtkWidget *add;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
990 GtkWidget *label;
236
62d470738cc7 [gaim-migrate @ 246]
Rob Flynn <gaim@robflynn.com>
parents: 234
diff changeset
991
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
992 struct addbuddy *a = g_new0(struct addbuddy, 1);
2598
b2800bca74fe [gaim-migrate @ 2611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
993 a->gc = gc ? gc : connections->data;
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
994
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
995 GAIM_DIALOG(a->window);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
996 gtk_window_set_wmclass(GTK_WINDOW(a->window), "add_buddy", "Gaim");
459
fb1d671e168e [gaim-migrate @ 469]
Rob Flynn <gaim@robflynn.com>
parents: 458
diff changeset
997 gtk_window_set_policy(GTK_WINDOW(a->window), FALSE, FALSE, TRUE);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
998 gtk_window_set_title(GTK_WINDOW(a->window), _("Gaim - Add Buddy"));
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
999
837
113205ae7e72 [gaim-migrate @ 847]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 832
diff changeset
1000 gtk_widget_realize(a->window);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1001 aol_icon(a->window->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1002 gtk_signal_connect(GTK_OBJECT(a->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), a->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1003 gtk_signal_connect(GTK_OBJECT(a->window), "destroy", GTK_SIGNAL_FUNC(free_dialog), a);
1151
428372cc1e39 [gaim-migrate @ 1161]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1144
diff changeset
1004 dialogwindows = g_list_prepend(dialogwindows, a->window);
428372cc1e39 [gaim-migrate @ 1161]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1144
diff changeset
1005
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1006 mainbox = gtk_vbox_new(FALSE, 5);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
1007 gtk_container_set_border_width(GTK_CONTAINER(mainbox), 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1008 gtk_container_add(GTK_CONTAINER(a->window), mainbox);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
1009
1151
428372cc1e39 [gaim-migrate @ 1161]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1144
diff changeset
1010 frame = gtk_frame_new(_("Add Buddy"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1011 gtk_box_pack_start(GTK_BOX(mainbox), frame, TRUE, TRUE, 0);
1151
428372cc1e39 [gaim-migrate @ 1161]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1144
diff changeset
1012 gtk_widget_show(frame);
428372cc1e39 [gaim-migrate @ 1161]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1144
diff changeset
1013
2529
44b56faccb22 [gaim-migrate @ 2542]
Rob Flynn <gaim@robflynn.com>
parents: 2527
diff changeset
1014 table = gtk_table_new(4, 2, FALSE);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1015 gtk_table_set_row_spacings(GTK_TABLE(table), 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1016 gtk_table_set_col_spacings(GTK_TABLE(table), 5);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
1017 gtk_container_set_border_width(GTK_CONTAINER(table), 5);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
1018 gtk_container_add(GTK_CONTAINER(frame), table);
1151
428372cc1e39 [gaim-migrate @ 1161]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1144
diff changeset
1019
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1020 label = gtk_label_new(_("Contact"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1021 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1022
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1023 a->entry = gtk_entry_new();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1024 gtk_table_attach_defaults(GTK_TABLE(table), a->entry, 1, 2, 0, 1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1025 gtk_window_set_focus(GTK_WINDOW(a->window), a->entry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1026 if (buddy != NULL)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1027 gtk_entry_set_text(GTK_ENTRY(a->entry), buddy);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1028 gtk_signal_connect(GTK_OBJECT(a->entry), "activate", GTK_SIGNAL_FUNC(do_add_buddy), a);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1029
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1030 label = gtk_label_new(_("Alias"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1031 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1032
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1033 a->entry_for_alias = gtk_entry_new();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1034 gtk_table_attach_defaults(GTK_TABLE(table), a->entry_for_alias, 1, 2, 1, 2);
2582
5efa8077107f [gaim-migrate @ 2595]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2572
diff changeset
1035 if (alias != NULL)
5efa8077107f [gaim-migrate @ 2595]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2572
diff changeset
1036 gtk_entry_set_text(GTK_ENTRY(a->entry_for_alias), alias);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1037
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1038 label = gtk_label_new(_("Group"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1039 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 2, 3);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1040
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1041 a->combo = gtk_combo_new();
2598
b2800bca74fe [gaim-migrate @ 2611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
1042 gtk_combo_set_popdown_strings(GTK_COMBO(a->combo), groups_tree(a->gc));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1043 if (group != NULL)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1044 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry), group);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1045 gtk_table_attach_defaults(GTK_TABLE(table), a->combo, 1, 2, 2, 3);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
1046
2527
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
1047 /* Set up stuff for the account box */
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
1048 label = gtk_label_new(_("Add To"));
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
1049 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 3, 4);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
1050
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
1051 a->account = gtk_option_menu_new();
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
1052 gtk_table_attach_defaults(GTK_TABLE(table), a->account, 1, 2, 3, 4);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
1053
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
1054 create_online_user_names(a);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
1055
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
1056 /* End of account box */
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
1057
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
1058 bbox = gtk_hbox_new(FALSE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1059 gtk_box_pack_start(GTK_BOX(mainbox), bbox, TRUE, TRUE, 0);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
1060
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
1061 cancel = picture_button(a->window, _("Cancel"), cancel_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1062 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1063 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), a->window);
1151
428372cc1e39 [gaim-migrate @ 1161]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1144
diff changeset
1064
428372cc1e39 [gaim-migrate @ 1161]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1144
diff changeset
1065 add = picture_button(a->window, _("Add"), add_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1066 gtk_box_pack_end(GTK_BOX(bbox), add, FALSE, FALSE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1067 gtk_signal_connect(GTK_OBJECT(add), "clicked", GTK_SIGNAL_FUNC(do_add_buddy), a);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1068
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
1069 gtk_widget_show_all(a->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1070 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1071
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1072
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1073 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1074 /* The dialog for new buddy pounces */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1075 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1076
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1077
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1078 void do_new_bp(GtkWidget *w, struct addbp *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1079 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1080 struct buddy_pounce *bp = g_new0(struct buddy_pounce, 1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1081
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1082 if (strlen(gtk_entry_get_text(GTK_ENTRY(b->nameentry))) == 0) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1083 do_error_dialog(_("Please enter a buddy to pounce."), _("Buddy Pounce Error"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1084 g_free(bp);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1085 return;
1292
cb84b5c6d9ab [gaim-migrate @ 1302]
Rob Flynn <gaim@robflynn.com>
parents: 1288
diff changeset
1086 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1087
26
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 25
diff changeset
1088 g_snprintf(bp->name, 80, "%s", gtk_entry_get_text(GTK_ENTRY(b->nameentry)));
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 25
diff changeset
1089 g_snprintf(bp->message, 2048, "%s", gtk_entry_get_text(GTK_ENTRY(b->messentry)));
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1090 g_snprintf(bp->command, 2048, "%s", gtk_entry_get_text(GTK_ENTRY(b->commentry)));
1694
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1091 g_snprintf(bp->sound, 2048, "%s", gtk_entry_get_text(GTK_ENTRY(b->soundentry)));
1139
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
1092 g_snprintf(bp->pouncer, 80, "%s", b->user->username);
26
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 25
diff changeset
1093
1155
f4d4a14752ee [gaim-migrate @ 1165]
Rob Flynn <gaim@robflynn.com>
parents: 1151
diff changeset
1094 bp->protocol = b->user->protocol;
f4d4a14752ee [gaim-migrate @ 1165]
Rob Flynn <gaim@robflynn.com>
parents: 1151
diff changeset
1095
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1096 bp->options = 0;
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1097
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1098 if (GTK_TOGGLE_BUTTON(b->popupnotify)->active)
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1099 bp->options |= OPT_POUNCE_NOTIFY;
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1100
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1101 if (GTK_TOGGLE_BUTTON(b->openwindow)->active)
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1102 bp->options |= OPT_POUNCE_POPUP;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1103
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1104 if (GTK_TOGGLE_BUTTON(b->sendim)->active)
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1105 bp->options |= OPT_POUNCE_SEND_IM;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1106
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1107 if (GTK_TOGGLE_BUTTON(b->command)->active)
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1108 bp->options |= OPT_POUNCE_COMMAND;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1109
1694
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1110 if (GTK_TOGGLE_BUTTON(b->sound)->active)
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1111 bp->options |= OPT_POUNCE_SOUND;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1112
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1113 if (GTK_TOGGLE_BUTTON(b->p_signon)->active)
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1114 bp->options |= OPT_POUNCE_SIGNON;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1115
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1116 if (GTK_TOGGLE_BUTTON(b->p_unaway)->active)
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1117 bp->options |= OPT_POUNCE_UNAWAY;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1118
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1119 if (GTK_TOGGLE_BUTTON(b->p_unidle)->active)
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1120 bp->options |= OPT_POUNCE_UNIDLE;
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1121
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1122 if (GTK_TOGGLE_BUTTON(b->save)->active)
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1123 bp->options |= OPT_POUNCE_SAVE;
26
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 25
diff changeset
1124
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1125 buddy_pounces = g_list_append(buddy_pounces, bp);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1126
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1127 do_bp_menu();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1128
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1129 destroy_dialog(NULL, b->window);
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1130
786
ffb824f6cd24 [gaim-migrate @ 796]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
1131 save_prefs();
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1132 g_free(b);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1133 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1134
1139
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
1135 static void pounce_choose(GtkWidget *opt, struct addbp *b)
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
1136 {
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
1137 struct aim_user *u = gtk_object_get_user_data(GTK_OBJECT(opt));
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
1138 b->user = u;
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
1139 }
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
1140
2564
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2561
diff changeset
1141 static GtkWidget *pounce_user_menu(struct addbp *b, struct gaim_connection *gc)
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1142 {
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1143 GtkWidget *optmenu;
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1144 GtkWidget *menu;
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1145 GtkWidget *opt;
2397
520257562955 [gaim-migrate @ 2410]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2393
diff changeset
1146 GSList *u = aim_users;
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1147 struct aim_user *a;
2564
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2561
diff changeset
1148 int count = 0;
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2561
diff changeset
1149 int place = 0;
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1150
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1151 optmenu = gtk_option_menu_new();
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1152
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1153 menu = gtk_menu_new();
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1154
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1155 while (u) {
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1156 a = (struct aim_user *)u->data;
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1157 opt = gtk_menu_item_new_with_label(a->username);
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1158 gtk_object_set_user_data(GTK_OBJECT(opt), a);
1139
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
1159 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(pounce_choose), b);
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1160 gtk_menu_append(GTK_MENU(menu), opt);
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1161 gtk_widget_show(opt);
2564
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2561
diff changeset
1162
2598
b2800bca74fe [gaim-migrate @ 2611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
1163 if (b->user == a) {
2564
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2561
diff changeset
1164 gtk_menu_item_activate(GTK_MENU_ITEM(opt));
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2561
diff changeset
1165 place = count;
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2561
diff changeset
1166 }
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2561
diff changeset
1167
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2561
diff changeset
1168 count++;
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2561
diff changeset
1169
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1170 u = u->next;
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1171 }
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1172
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1173 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu);
2564
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2561
diff changeset
1174 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), place);
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1175
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1176 b->menu = optmenu;
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1177
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1178 return optmenu;
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1179 }
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1180
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1181
2564
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2561
diff changeset
1182 void show_new_bp(char *name, struct gaim_connection *gc, int idle, int away)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1183 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1184 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1185 GtkWidget *bbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1186 GtkWidget *vbox;
443
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
1187 GtkWidget *button;
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1188 GtkWidget *frame;
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1189 GtkWidget *table;
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1190 GtkWidget *optmenu;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1191
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1192 struct addbp *b = g_new0(struct addbp, 1);
2598
b2800bca74fe [gaim-migrate @ 2611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
1193 b->user = gc ? gc->user : aim_users->data;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1194
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
1195 GAIM_DIALOG(b->window);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1196 dialogwindows = g_list_prepend(dialogwindows, b->window);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1197 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, TRUE, TRUE);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
1198 gtk_window_set_wmclass(GTK_WINDOW(b->window), "new_bp", "Gaim");
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1199 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - New Buddy Pounce"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1200 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
1141
8f4ce8b74901 [gaim-migrate @ 1151]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1140
diff changeset
1201 gtk_widget_realize(b->window);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1202 aol_icon(b->window->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1203
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1204 vbox = gtk_vbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1205 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1206 gtk_container_add(GTK_CONTAINER(b->window), vbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1207 gtk_widget_show(vbox);
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1208
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1209 /* <pounce type="who"> */
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1210 frame = gtk_frame_new(_("Pounce Who"));
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1211 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1212 gtk_widget_show(GTK_WIDGET(frame));
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1213
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1214 table = gtk_table_new(2, 2, FALSE);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1215 gtk_container_add(GTK_CONTAINER(frame), table);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1216 gtk_container_set_border_width(GTK_CONTAINER(table), 5);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1217 gtk_table_set_col_spacings(GTK_TABLE(table), 5);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1218 gtk_table_set_row_spacings(GTK_TABLE(table), 5);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1219 gtk_widget_show(table);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1220
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1221 label = gtk_label_new(_("Account"));
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1222 gtk_misc_set_alignment(GTK_MISC(label), 0, .5);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1223 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1224 gtk_widget_show(label);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1225
2564
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2561
diff changeset
1226 optmenu = pounce_user_menu(b, gc);
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1227 gtk_table_attach(GTK_TABLE(table), optmenu, 1, 2, 0, 1, GTK_FILL | GTK_EXPAND, 0, 0, 0);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1228 gtk_widget_show(optmenu);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1229
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1230 label = gtk_label_new(_("Buddy"));
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1231 gtk_misc_set_alignment(GTK_MISC(label), 0, .5);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1232 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1233 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1234
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1235 b->nameentry = gtk_entry_new();
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1236 gtk_table_attach(GTK_TABLE(table), b->nameentry, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, 0, 0, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1237 if (name !=NULL)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1238 gtk_entry_set_text(GTK_ENTRY(b->nameentry), name);
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1239 gtk_window_set_focus(GTK_WINDOW(b->window), b->nameentry);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1240 gtk_widget_show(b->nameentry);
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1241 /* </pounce type="who"> */
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1242
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1243
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1244 /* <pounce type="when"> */
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1245 frame = gtk_frame_new(_("Pounce When"));
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1246 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1247 gtk_widget_show(GTK_WIDGET(frame));
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1248
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1249 table = gtk_table_new(2, 2, FALSE);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1250 gtk_container_add(GTK_CONTAINER(frame), table);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1251 gtk_container_set_border_width(GTK_CONTAINER(table), 5);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1252 gtk_table_set_col_spacings(GTK_TABLE(table), 5);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1253 gtk_widget_show(table);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1254
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1255 b->p_signon = gtk_check_button_new_with_label(_("Pounce on sign on"));
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1256 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->p_signon), TRUE);
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1257 gtk_table_attach(GTK_TABLE(table), b->p_signon, 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1258 gtk_widget_show(b->p_signon);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1259
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1260 b->p_unaway = gtk_check_button_new_with_label(_("Pounce on return from away"));
2564
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2561
diff changeset
1261 if (away)
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2561
diff changeset
1262 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->p_unaway), TRUE);
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1263 gtk_table_attach(GTK_TABLE(table), b->p_unaway, 1, 2, 0, 1, GTK_FILL | GTK_EXPAND, 0, 0, 0);
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1264 gtk_widget_show(b->p_unaway);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1265
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1266 b->p_unidle = gtk_check_button_new_with_label(_("Pounce on return from idle"));
2564
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2561
diff changeset
1267 if (idle)
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2561
diff changeset
1268 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->p_unidle), TRUE);
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1269 gtk_table_attach(GTK_TABLE(table), b->p_unidle, 0, 1, 1, 2, GTK_FILL, 0, 0, 0);
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1270 gtk_widget_show(b->p_unidle);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1271
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1272 label = gtk_label_new(NULL);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1273 gtk_table_attach(GTK_TABLE(table), label, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, 0, 0, 0);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1274 gtk_widget_show(label);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1275 /* </pounce type="when"> */
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1276
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1277 /* <pounce type="action"> */
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1278 frame = gtk_frame_new(_("Pounce Action"));
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1279 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1280 gtk_widget_show(GTK_WIDGET(frame));
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1281
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1282 table = gtk_table_new(4, 2, FALSE);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1283 gtk_container_add(GTK_CONTAINER(frame), table);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1284 gtk_container_set_border_width(GTK_CONTAINER(table), 5);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1285 gtk_table_set_col_spacings(GTK_TABLE(table), 5);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1286 gtk_table_set_row_spacings(GTK_TABLE(table), 5);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1287 gtk_widget_show(table);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1288
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1289 b->openwindow = gtk_check_button_new_with_label(_("Open IM Window"));
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1290 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->openwindow), FALSE);
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1291 gtk_table_attach(GTK_TABLE(table), b->openwindow, 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1292 gtk_widget_show(b->openwindow);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1293
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1294 b->popupnotify = gtk_check_button_new_with_label(_("Popup Notification"));
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1295 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->popupnotify), FALSE);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1296 gtk_table_attach(GTK_TABLE(table), b->popupnotify, 1, 2, 0, 1, GTK_FILL, 0, 0, 0);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1297 gtk_widget_show(b->popupnotify);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1298
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1299 b->sendim = gtk_check_button_new_with_label(_("Send Message"));
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1300 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->sendim), TRUE);
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1301 gtk_table_attach(GTK_TABLE(table), b->sendim, 0, 1, 1, 2, GTK_FILL, 0, 0, 0);
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1302 gtk_widget_show(b->sendim);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1303
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1304 b->messentry = gtk_entry_new();
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1305 gtk_table_attach(GTK_TABLE(table), b->messentry, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, 0, 0, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1306 gtk_signal_connect(GTK_OBJECT(b->messentry), "activate", GTK_SIGNAL_FUNC(do_new_bp), b);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1307 gtk_widget_show(b->messentry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1308
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1309 gtk_signal_connect(GTK_OBJECT(b->sendim), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive),
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1310 b->messentry);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1311
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1312 b->command = gtk_check_button_new_with_label(_("Execute command on pounce"));
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1313 gtk_table_attach(GTK_TABLE(table), b->command, 0, 1, 2, 3, GTK_FILL, 0, 0, 0);
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1314 gtk_widget_show(b->command);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1315
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1316 b->commentry = gtk_entry_new();
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1317 gtk_table_attach(GTK_TABLE(table), b->commentry, 1, 2, 2, 3, GTK_FILL | GTK_EXPAND, 0, 0, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1318 gtk_signal_connect(GTK_OBJECT(b->commentry), "activate", GTK_SIGNAL_FUNC(do_new_bp), b);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1319 gtk_widget_show(b->commentry);
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1320
1388
7dc0a8bb4dcb [gaim-migrate @ 1398]
Rob Flynn <gaim@robflynn.com>
parents: 1387
diff changeset
1321 gtk_widget_set_sensitive(b->commentry, FALSE);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1322 gtk_signal_connect(GTK_OBJECT(b->command), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1323 b->commentry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1324
1694
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1325 b->sound = gtk_check_button_new_with_label(_("Play sound on pounce"));
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1326 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->sound), FALSE);
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1327 gtk_table_attach(GTK_TABLE(table), b->sound, 0, 1, 3, 4, GTK_FILL, 0, 0, 0);
1694
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1328 gtk_widget_show(b->sound);
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1329
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1330 b->soundentry = gtk_entry_new();
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1331 gtk_table_attach(GTK_TABLE(table), b->soundentry, 1, 2, 3, 4, GTK_FILL | GTK_EXPAND, 0, 0, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1332 gtk_signal_connect(GTK_OBJECT(b->soundentry), "activate", GTK_SIGNAL_FUNC(do_new_bp), b);
1694
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1333 gtk_widget_show(b->soundentry);
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1334
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1335 gtk_widget_set_sensitive(b->soundentry, FALSE);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1336 gtk_signal_connect(GTK_OBJECT(b->sound), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1337 b->soundentry);
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1338 /* </pounce type="action"> */
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1339
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1340 b->save = gtk_check_button_new_with_label(_("Save this pounce after activation"));
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2534
diff changeset
1341 gtk_container_set_border_width(GTK_CONTAINER(b->save), 7);
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1342 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->save), FALSE);
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1343 gtk_box_pack_start(GTK_BOX(vbox), b->save, FALSE, FALSE, 0);
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1344 gtk_widget_show(b->save);
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1345
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1346 bbox = gtk_hbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1347 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1348 gtk_widget_show(bbox);
443
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
1349
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1350 button = picture_button(b->window, _("Cancel"), cancel_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1351 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1352 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1353
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
1354 button = picture_button(b->window, _("OK"), ok_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1355 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(do_new_bp), b);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1356 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
443
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
1357
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1358 gtk_widget_show(b->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1359 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1360
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1361
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1362
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1363 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1364 /* The dialog for SET INFO / SET DIR INFO */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1365 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1366
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1367 void do_save_info(GtkWidget *widget, struct set_info_dlg *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1368 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1369 gchar *junk;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
1370 struct gaim_connection *gc;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1371
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1372 junk = gtk_editable_get_chars(GTK_EDITABLE(b->text), 0, -1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1373
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
1374 if (b->user) {
1292
cb84b5c6d9ab [gaim-migrate @ 1302]
Rob Flynn <gaim@robflynn.com>
parents: 1288
diff changeset
1375 strncpy_withhtml(b->user->user_info, junk, sizeof b->user->user_info);
1074
2cff18c2f9c6 [gaim-migrate @ 1084]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1072
diff changeset
1376 gc = b->user->gc;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1377
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
1378 save_prefs();
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
1379
1292
cb84b5c6d9ab [gaim-migrate @ 1302]
Rob Flynn <gaim@robflynn.com>
parents: 1288
diff changeset
1380 if (gc)
cb84b5c6d9ab [gaim-migrate @ 1302]
Rob Flynn <gaim@robflynn.com>
parents: 1288
diff changeset
1381 serv_set_info(gc, b->user->user_info);
122
521db4bf5f28 [gaim-migrate @ 132]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 84
diff changeset
1382 }
25
c56db1b46b0d [gaim-migrate @ 34]
Rob Flynn <gaim@robflynn.com>
parents: 24
diff changeset
1383 g_free(junk);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1384 destroy_dialog(NULL, b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1385 g_free(b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1386 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1387
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1388 void do_set_dir(GtkWidget *widget, struct set_dir_dlg *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1389 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1390 char *first = gtk_entry_get_text(GTK_ENTRY(b->first));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1391 int web = GTK_TOGGLE_BUTTON(b->web)->active;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1392 char *middle = gtk_entry_get_text(GTK_ENTRY(b->middle));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1393 char *last = gtk_entry_get_text(GTK_ENTRY(b->last));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1394 char *maiden = gtk_entry_get_text(GTK_ENTRY(b->maiden));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1395 char *city = gtk_entry_get_text(GTK_ENTRY(b->city));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1396 char *state = gtk_entry_get_text(GTK_ENTRY(b->state));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1397 char *country = gtk_entry_get_text(GTK_ENTRY(b->country));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1398
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1399 serv_set_dir(b->gc, first, middle, last, maiden, city, state, country, web);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1400
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1401 destroy_dialog(NULL, b->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1402 g_free(b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1403 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1404
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1405 void show_set_dir(struct gaim_connection *gc)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1406 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1407 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1408 GtkWidget *bot;
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1409 GtkWidget *vbox;
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1410 GtkWidget *hbox;
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1411 GtkWidget *frame;
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1412 GtkWidget *fbox;
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1413 char buf[256];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1414
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1415 struct set_dir_dlg *b = g_new0(struct set_dir_dlg, 1);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1416 b->gc = gc;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1417
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
1418 GAIM_DIALOG(b->window);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1419 dialogwindows = g_list_prepend(dialogwindows, b->window);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
1420 gtk_window_set_wmclass(GTK_WINDOW(b->window), "set_dir", "Gaim");
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1421 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, TRUE, TRUE);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1422 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Set Dir Info"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1423 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1424 gtk_widget_realize(b->window);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1425 aol_icon(b->window->window);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1426
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1427 fbox = gtk_vbox_new(FALSE, 5);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1428 gtk_container_add(GTK_CONTAINER(b->window), fbox);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1429 gtk_widget_show(fbox);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1430
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1431 frame = gtk_frame_new(_("Directory Info"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1432 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1433 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 0);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1434 gtk_widget_show(frame);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1435
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1436 vbox = gtk_vbox_new(FALSE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1437 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1438 gtk_container_add(GTK_CONTAINER(frame), vbox);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1439 gtk_widget_show(vbox);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1440
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1441 g_snprintf(buf, sizeof(buf), "Setting Dir Info for %s:", gc->username);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1442 label = gtk_label_new(buf);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1443 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1444 gtk_widget_show(label);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1445
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1446 b->first = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1447 b->middle = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1448 b->last = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1449 b->maiden = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1450 b->city = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1451 b->state = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1452 b->country = gtk_entry_new();
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1453 b->web = gtk_check_button_new_with_label(_("Allow Web Searches To Find Your Info"));
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1454
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1455 /* Line 1 */
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1456 label = gtk_label_new(_("First Name"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1457 gtk_widget_show(label);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1458
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1459 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1460 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1461 gtk_box_pack_end(GTK_BOX(hbox), b->first, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1462
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1463 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1464 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1465
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1466 /* Line 2 */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1467 label = gtk_label_new(_("Middle Name"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1468 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1469
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1470 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1471 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1472 gtk_box_pack_end(GTK_BOX(hbox), b->middle, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1473
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1474 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1475 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1476
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1477
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1478 /* Line 3 */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1479 label = gtk_label_new(_("Last Name"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1480 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1481
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1482 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1483 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1484 gtk_box_pack_end(GTK_BOX(hbox), b->last, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1485
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1486 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1487 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1488
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1489 /* Line 4 */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1490 label = gtk_label_new(_("Maiden Name"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1491 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1492
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1493 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1494 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1495 gtk_box_pack_end(GTK_BOX(hbox), b->maiden, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1496
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1497 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1498 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1499
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1500 /* Line 5 */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1501 label = gtk_label_new(_("City"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1502 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1503
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1504 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1505 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1506 gtk_box_pack_end(GTK_BOX(hbox), b->city, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1507
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1508 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1509 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1510
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1511 /* Line 6 */
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1512 label = gtk_label_new(_("State"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1513 gtk_widget_show(label);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1514
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1515 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1516 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1517 gtk_box_pack_end(GTK_BOX(hbox), b->state, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1518
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1519 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1520 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1521
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1522 /* Line 7 */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1523 label = gtk_label_new(_("Country"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1524 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1525
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1526 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1527 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1528 gtk_box_pack_end(GTK_BOX(hbox), b->country, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1529
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1530 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1531 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1532
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1533 /* Line 8 */
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1534
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1535 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1536 gtk_box_pack_start(GTK_BOX(hbox), b->web, TRUE, TRUE, 0);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1537 gtk_widget_show(hbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1538 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1539
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1540 gtk_widget_show(b->first);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1541 gtk_widget_show(b->middle);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1542 gtk_widget_show(b->last);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1543 gtk_widget_show(b->maiden);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1544 gtk_widget_show(b->city);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1545 gtk_widget_show(b->state);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1546 gtk_widget_show(b->country);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1547 gtk_widget_show(b->web);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1548
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1549 /* And add the buttons */
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1550
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1551 bot = gtk_hbox_new(FALSE, 5);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1552 gtk_box_pack_start(GTK_BOX(fbox), bot, FALSE, FALSE, 0);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1553 gtk_widget_show(bot);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1554
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1555 b->cancel = picture_button(b->window, _("Cancel"), cancel_xpm);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1556 gtk_box_pack_end(GTK_BOX(bot), b->cancel, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1557 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1558
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1559 b->save = picture_button(b->window, _("Save"), save_xpm);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1560 gtk_box_pack_end(GTK_BOX(bot), b->save, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1561 gtk_signal_connect(GTK_OBJECT(b->save), "clicked", GTK_SIGNAL_FUNC(do_set_dir), b);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1562
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1563 gtk_window_set_focus(GTK_WINDOW(b->window), b->first);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1564
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1565 gtk_widget_show(b->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1566 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1567
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1568 void do_change_password(GtkWidget *widget, struct passwddlg *b)
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1569 {
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1570 gchar *orig, *new1, *new2;
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1571
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1572 orig = gtk_entry_get_text(GTK_ENTRY(b->original));
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1573 new1 = gtk_entry_get_text(GTK_ENTRY(b->new1));
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1574 new2 = gtk_entry_get_text(GTK_ENTRY(b->new2));
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1575
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1979
diff changeset
1576 if (g_strcasecmp(new1, new2)) {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1577 do_error_dialog(_("New Passwords Do Not Match"), _("Gaim - Change Password Error"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1578 return;
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1579 }
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1580
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1581 if ((strlen(orig) < 1) || (strlen(new1) < 1) || (strlen(new2) < 1)) {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1582 do_error_dialog(_("Fill out all fields completely"), _("Gaim - Change Password Error"));
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1583 return;
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1584 }
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1585
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1586 serv_change_passwd(b->gc, orig, new1);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1587
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1588 destroy_dialog(NULL, b->window);
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1589 g_free(b);
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1590 }
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1591
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1592 void show_change_passwd(struct gaim_connection *gc)
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1593 {
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1594 GtkWidget *hbox;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1595 GtkWidget *label;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1596 GtkWidget *vbox;
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1597 GtkWidget *fbox;
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1598 GtkWidget *frame;
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1599 char buf[256];
454
c9d87901afff [gaim-migrate @ 464]
Rob Flynn <gaim@robflynn.com>
parents: 452
diff changeset
1600
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1601 struct passwddlg *b = g_new0(struct passwddlg, 1);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1602 b->gc = gc;
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1603
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
1604 GAIM_DIALOG(b->window);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1605 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, TRUE, TRUE);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
1606 gtk_window_set_wmclass(GTK_WINDOW(b->window), "change_passwd", "Gaim");
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1607 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Password Change"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1608 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1609 gtk_widget_realize(b->window);
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1610 aol_icon(b->window->window);
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1611 dialogwindows = g_list_prepend(dialogwindows, b->window);
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1612
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1613 fbox = gtk_vbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1614 gtk_container_border_width(GTK_CONTAINER(fbox), 5);
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1615 gtk_container_add(GTK_CONTAINER(b->window), fbox);
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1616 gtk_widget_show(fbox);
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1617
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1618 frame = gtk_frame_new(_("Change Password"));
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1619 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 0);
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1620 gtk_widget_show(frame);
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1621
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1622 vbox = gtk_vbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1623 gtk_container_border_width(GTK_CONTAINER(vbox), 5);
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1624 gtk_container_add(GTK_CONTAINER(frame), vbox);
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1625 gtk_widget_show(vbox);
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1626
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1627 g_snprintf(buf, sizeof(buf), "Changing password for %s:", gc->username);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1628 label = gtk_label_new(buf);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1629 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1630 gtk_widget_show(label);
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1631
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1632 /* First Line */
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1633 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1634 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1635 gtk_widget_show(hbox);
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1636
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1637 label = gtk_label_new(_("Original Password"));
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1638 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1639 gtk_widget_show(label);
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1640
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1641 b->original = gtk_entry_new();
160
aaa8f0a2140e [gaim-migrate @ 170]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 149
diff changeset
1642 gtk_entry_set_visibility(GTK_ENTRY(b->original), FALSE);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1643 gtk_box_pack_end(GTK_BOX(hbox), b->original, FALSE, FALSE, 0);
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1644 gtk_widget_show(b->original);
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1645
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1646 /* Next Line */
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1647 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1648 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1649 gtk_widget_show(hbox);
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1650
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1651 label = gtk_label_new(_("New Password"));
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1652 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1653 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1654
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1655 b->new1 = gtk_entry_new();
160
aaa8f0a2140e [gaim-migrate @ 170]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 149
diff changeset
1656 gtk_entry_set_visibility(GTK_ENTRY(b->new1), FALSE);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1657 gtk_box_pack_end(GTK_BOX(hbox), b->new1, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1658 gtk_widget_show(b->new1);
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1659
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1660 /* Next Line */
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1661 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1662 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1663 gtk_widget_show(hbox);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1664
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1665 label = gtk_label_new(_("New Password (again)"));
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1666 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1667 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1668
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1669 b->new2 = gtk_entry_new();
160
aaa8f0a2140e [gaim-migrate @ 170]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 149
diff changeset
1670 gtk_entry_set_visibility(GTK_ENTRY(b->new2), FALSE);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1671 gtk_box_pack_end(GTK_BOX(hbox), b->new2, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1672 gtk_widget_show(b->new2);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1673
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1674 /* Now do our row of buttons */
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1675 hbox = gtk_hbox_new(FALSE, 5);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1676 gtk_box_pack_start(GTK_BOX(fbox), hbox, FALSE, FALSE, 0);
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1677 gtk_widget_show(hbox);
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1678
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1679 b->cancel = picture_button(b->window, _("Cancel"), cancel_xpm);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1680 gtk_box_pack_end(GTK_BOX(hbox), b->cancel, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1681 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1682
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1683 b->ok = picture_button(b->window, _("OK"), ok_xpm);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1684 gtk_box_pack_end(GTK_BOX(hbox), b->ok, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1685 gtk_signal_connect(GTK_OBJECT(b->ok), "clicked", GTK_SIGNAL_FUNC(do_change_password), b);
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1686
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1687
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1688 gtk_widget_show(b->window);
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1689 }
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1690
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1691 void show_set_info(struct gaim_connection *gc)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1692 {
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1693 GtkWidget *buttons;
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1694 GtkWidget *label;
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1695 GtkWidget *vbox;
1292
cb84b5c6d9ab [gaim-migrate @ 1302]
Rob Flynn <gaim@robflynn.com>
parents: 1288
diff changeset
1696 gchar *buf;
cb84b5c6d9ab [gaim-migrate @ 1302]
Rob Flynn <gaim@robflynn.com>
parents: 1288
diff changeset
1697 struct aim_user *tmp;
cb84b5c6d9ab [gaim-migrate @ 1302]
Rob Flynn <gaim@robflynn.com>
parents: 1288
diff changeset
1698
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1699 struct set_info_dlg *b = g_new0(struct set_info_dlg, 1);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1700 tmp = gc->user;
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1701 b->user = tmp;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1702
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
1703 GAIM_DIALOG(b->window);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1704 gtk_window_set_wmclass(GTK_WINDOW(b->window), "set_info", "Gaim");
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1705 dialogwindows = g_list_prepend(dialogwindows, b->window);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1706 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Set User Info"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1707 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
1708 gtk_widget_realize(b->window);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1709 aol_icon(b->window->window);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1710
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1711 vbox = gtk_vbox_new(FALSE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1712 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1713 gtk_container_add(GTK_CONTAINER(b->window), vbox);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1714 gtk_widget_show(vbox);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1715
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1716 buf = g_malloc(256);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1717 g_snprintf(buf, 256, "Changing info for %s:", tmp->username);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1718 label = gtk_label_new(buf);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1719 g_free(buf);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1720 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1721 gtk_widget_show(label);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1722
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1723 b->text = gtk_text_new(NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1724 gtk_text_set_word_wrap(GTK_TEXT(b->text), TRUE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1725 gtk_text_set_editable(GTK_TEXT(b->text), TRUE);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1726 gtk_widget_set_usize(b->text, 300, 200);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1727 buf = g_malloc(strlen(tmp->user_info) + 1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1728 strncpy_nohtml(buf, tmp->user_info, strlen(tmp->user_info) + 1);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1729 gtk_text_insert(GTK_TEXT(b->text), NULL, NULL, NULL, buf, -1);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1730 g_free(buf);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1731 gtk_box_pack_start(GTK_BOX(vbox), b->text, TRUE, TRUE, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1732 gtk_widget_show(b->text);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1733 gtk_window_set_focus(GTK_WINDOW(b->window), b->text);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1734
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1735 buttons = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1736 gtk_box_pack_start(GTK_BOX(vbox), buttons, FALSE, FALSE, 0);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1737 gtk_widget_show(buttons);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1738
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1739 b->cancel = picture_button(b->window, _("Cancel"), cancel_xpm);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1740 gtk_box_pack_end(GTK_BOX(buttons), b->cancel, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1741 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1742
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1743 b->save = picture_button(b->window, _("Save"), save_xpm);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1744 gtk_box_pack_end(GTK_BOX(buttons), b->save, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1745 gtk_signal_connect(GTK_OBJECT(b->save), "clicked", GTK_SIGNAL_FUNC(do_save_info), b);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1746
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1747 gtk_widget_show(b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1748
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1749 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1750
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1751 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1752 /* The dialog for the info requests */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1753 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1754
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1755 static void info_dlg_free(GtkWidget *b, struct info_dlg *d)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1756 {
2773
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1757 if (g_slist_find(info_dlgs, d))
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1758 info_dlgs = g_slist_remove(info_dlgs, d);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1759 g_free(d->who);
1051
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1049
diff changeset
1760 g_free(d);
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1049
diff changeset
1761 }
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1049
diff changeset
1762
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1763 gchar **info_img_handler(gchar *url)
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1764 {
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1765 if (!g_strcasecmp(url, "free_icon.gif"))
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1766 return free_icon_xpm;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1767 if (!g_strcasecmp(url, "aol_icon.gif"))
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1768 return aol_icon_xpm;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1769 if (!g_strcasecmp(url, "dt_icon.gif"))
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1770 return dt_icon_xpm;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1771 if (!g_strcasecmp(url, "admin_icon.gif"))
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1772 return admin_icon_xpm;
2679
94aa499ecd39 [gaim-migrate @ 2692]
Adam Fritzler <mid@auk.cx>
parents: 2665
diff changeset
1773 if (!g_strcasecmp(url, "ab_icon.gif"))
94aa499ecd39 [gaim-migrate @ 2692]
Adam Fritzler <mid@auk.cx>
parents: 2665
diff changeset
1774 return ab_xpm;
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1775 return NULL;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1776 }
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1777
2791
8f6365332a05 [gaim-migrate @ 2804]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2785
diff changeset
1778 /* if away is 0, show regardless and try to get away message
8f6365332a05 [gaim-migrate @ 2804]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2785
diff changeset
1779 * 1, don't show if regular info isn't shown
8f6365332a05 [gaim-migrate @ 2804]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2785
diff changeset
1780 * 2, show regardless but don't try to get away message
8f6365332a05 [gaim-migrate @ 2804]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2785
diff changeset
1781 *
8f6365332a05 [gaim-migrate @ 2804]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2785
diff changeset
1782 * i wish this were my client. if i were i wouldn't have to deal with this shit.
8f6365332a05 [gaim-migrate @ 2804]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2785
diff changeset
1783 */
8f6365332a05 [gaim-migrate @ 2804]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2785
diff changeset
1784 void g_show_info_text(struct gaim_connection *gc, char *who, int away, char *info, ...)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1785 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1786 GtkWidget *ok;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1787 GtkWidget *label;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1788 GtkWidget *text;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1789 GtkWidget *bbox;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1790 GtkWidget *sw;
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1791 gint options = 0;
2137
18722ae5b882 [gaim-migrate @ 2147]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
1792 char *more_info;
18722ae5b882 [gaim-migrate @ 2147]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
1793 va_list ap;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1794
2773
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1795 struct info_dlg *b = find_info_dlg(gc, who);
2791
8f6365332a05 [gaim-migrate @ 2804]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2785
diff changeset
1796 if (!b && (away == 1))
2773
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1797 return;
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1798 if (!b) {
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1799 b = g_new0(struct info_dlg, 1);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1800 b->gc = gc;
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1801 b->who = who ? g_strdup(normalize(who)) : NULL;
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1802 info_dlgs = g_slist_append(info_dlgs, b);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1803
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1804 GAIM_DIALOG(b->window);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1805 gtk_window_set_title(GTK_WINDOW(b->window), "Gaim");
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1806 gtk_container_border_width(GTK_CONTAINER(b->window), 5);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1807 gtk_widget_realize(GTK_WIDGET(b->window));
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1808 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", GTK_SIGNAL_FUNC(info_dlg_free), b);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1809 aol_icon(b->window->window);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1810
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1811 bbox = gtk_vbox_new(FALSE, 5);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1812 gtk_container_add(GTK_CONTAINER(b->window), bbox);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1813
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1814 label = gtk_label_new(_("Below are the results of your search: "));
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1815 gtk_box_pack_start(GTK_BOX(bbox), label, FALSE, FALSE, 0);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1816
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1817 sw = gtk_scrolled_window_new(NULL, NULL);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1818 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1819 gtk_box_pack_start(GTK_BOX(bbox), sw, TRUE, TRUE, 0);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1820
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1821 text = gtk_imhtml_new(NULL, NULL);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1822 b->text = text;
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1823 gtk_container_add(GTK_CONTAINER(sw), text);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1824 GTK_LAYOUT(text)->hadjustment->step_increment = 10.0;
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1825 GTK_LAYOUT(text)->vadjustment->step_increment = 10.0;
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1826 gtk_widget_set_usize(sw, 300, 250);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1827 gtk_imhtml_set_img_handler(GTK_IMHTML(text), info_img_handler);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1828 gaim_setup_imhtml(text);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1829
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1830 ok = picture_button(b->window, _("OK"), ok_xpm);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1831 gtk_signal_connect_object(GTK_OBJECT(ok), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy),
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1832 GTK_OBJECT(b->window));
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1833 gtk_box_pack_start(GTK_BOX(bbox), ok, FALSE, FALSE, 0);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1834
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1835 gtk_widget_show_all(b->window);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1836 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1837
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2228
diff changeset
1838 if (convo_options & OPT_CONVO_IGNORE_COLOUR)
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1839 options ^= GTK_IMHTML_NO_COLOURS;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2228
diff changeset
1840 if (convo_options & OPT_CONVO_IGNORE_FONTS)
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1841 options ^= GTK_IMHTML_NO_FONTS;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2228
diff changeset
1842 if (convo_options & OPT_CONVO_IGNORE_SIZES)
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
1843 options ^= GTK_IMHTML_NO_SIZES;
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1844 options ^= GTK_IMHTML_NO_COMMENTS;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1845 options ^= GTK_IMHTML_NO_TITLE;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1846 options ^= GTK_IMHTML_NO_NEWLINE;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1847 options ^= GTK_IMHTML_NO_SCROLL;
2773
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1848
2856
b1e300a85678 [gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2851
diff changeset
1849 gtk_imhtml_append_text(GTK_IMHTML(b->text), info, -1, options);
2773
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1850
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1851 va_start(ap, info);
2137
18722ae5b882 [gaim-migrate @ 2147]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
1852 while ((more_info = va_arg(ap, char *)) != NULL)
2856
b1e300a85678 [gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2851
diff changeset
1853 gtk_imhtml_append_text(GTK_IMHTML(b->text), more_info, -1, options);
2137
18722ae5b882 [gaim-migrate @ 2147]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
1854 va_end(ap);
2773
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1855
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1856 if (away)
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1857 info_dlgs = g_slist_remove(info_dlgs, b);
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1858 else
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
1859 serv_get_away(gc, who);
247
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 245
diff changeset
1860 }
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 245
diff changeset
1861
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1862 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1863 /* The dialog for adding to permit/deny */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1864 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1865
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1866
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1867 static void do_add_perm(GtkWidget *w, struct addperm *p)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1868 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1869
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1870 char *who;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1871 char *name;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1872
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1873
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1874 who = gtk_entry_get_text(GTK_ENTRY(p->entry));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1875
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1876 name = g_malloc(strlen(who) + 2);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1877 g_snprintf(name, strlen(who) + 2, "%s", who);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1878
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1879 if (!p->permit) {
1126
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1880 GSList *d = p->gc->deny;
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1881 char *n;
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1882 n = g_strdup(normalize(name));
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1883 while (d) {
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1979
diff changeset
1884 if (!g_strcasecmp(n, normalize(d->data)))
1126
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1885 break;
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1886 d = d->next;
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1887 }
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1888 g_free(n);
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1889 if (!d) {
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1890 p->gc->deny = g_slist_append(p->gc->deny, name);
2665
b0478af51be0 [gaim-migrate @ 2678]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2662
diff changeset
1891 serv_add_deny(p->gc, name);
1126
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1892 build_block_list();
1805
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
1893 do_export(p->gc);
1126
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1894 } else
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1895 g_free(name);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1896 } else {
1126
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1897 GSList *d = p->gc->permit;
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1898 char *n;
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1899 n = g_strdup(normalize(name));
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1900 while (d) {
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1979
diff changeset
1901 if (!g_strcasecmp(n, normalize(d->data)))
1126
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1902 break;
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1903 d = d->next;
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1904 }
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1905 g_free(n);
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1906 if (!d) {
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1907 p->gc->permit = g_slist_append(p->gc->permit, name);
2665
b0478af51be0 [gaim-migrate @ 2678]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2662
diff changeset
1908 serv_add_permit(p->gc, name);
1126
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1909 build_allow_list();
1805
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
1910 do_export(p->gc);
1126
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1911 } else
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1912 g_free(name);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1913 }
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1914
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1915 destroy_dialog(NULL, p->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1916 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1917
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1918
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1919
1144
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1920 void show_add_perm(struct gaim_connection *gc, char *who, gboolean permit)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1921 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1922 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1923 GtkWidget *add;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1924 GtkWidget *label;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1925 GtkWidget *bbox;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1926 GtkWidget *vbox;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1927 GtkWidget *topbox;
487
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1928 GtkWidget *frame;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1929
486
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1930 struct addperm *p = g_new0(struct addperm, 1);
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
1931 p->gc = gc;
1144
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1932 p->permit = permit;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1933
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
1934 GAIM_DIALOG(p->window);
487
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1935 gtk_container_set_border_width(GTK_CONTAINER(p->window), 5);
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1936 gtk_window_set_policy(GTK_WINDOW(p->window), FALSE, FALSE, TRUE);
1144
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1937 gtk_widget_realize(p->window);
487
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1938
486
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1939 dialogwindows = g_list_prepend(dialogwindows, p->window);
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1940
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1941 bbox = gtk_hbox_new(TRUE, 10);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1942 topbox = gtk_hbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1943 vbox = gtk_vbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1944 p->entry = gtk_entry_new();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1945
1144
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1946 if (permit)
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1947 frame = gtk_frame_new(_("Permit"));
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1948 else
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1949 frame = gtk_frame_new(_("Deny"));
487
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1950
486
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1951 /* Build Add Button */
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1952
1144
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1953 if (permit)
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1954 add = picture_button(p->window, _("Permit"), add_xpm);
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1955 else
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1956 add = picture_button(p->window, _("Deny"), add_xpm);
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
1957 cancel = picture_button(p->window, _("Cancel"), cancel_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1958
486
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1959 /* End of Cancel Button */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1960 if (who != NULL)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1961 gtk_entry_set_text(GTK_ENTRY(p->entry), who);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1962
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1963 /* Put the buttons in the box */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1964
486
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1965 gtk_box_pack_start(GTK_BOX(bbox), add, FALSE, FALSE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1966 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1967
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1968 label = gtk_label_new(_("Add"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1969 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1970 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1971 gtk_box_pack_start(GTK_BOX(topbox), p->entry, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1972 /* And the boxes in the box */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1973 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1974 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 5);
487
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1975 gtk_container_add(GTK_CONTAINER(frame), vbox);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1976
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1977
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1978 /* Handle closes right */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1979 gtk_signal_connect(GTK_OBJECT(p->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), p->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1980 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), p->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1981 gtk_signal_connect(GTK_OBJECT(add), "clicked", GTK_SIGNAL_FUNC(do_add_perm), p);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1982 gtk_signal_connect(GTK_OBJECT(p->entry), "activate", GTK_SIGNAL_FUNC(do_add_perm), p);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1983
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1984 /* Finish up */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1985 gtk_widget_show(add);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1986 gtk_widget_show(cancel);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1987 gtk_widget_show(p->entry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1988 gtk_widget_show(topbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1989 gtk_widget_show(bbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1990 gtk_widget_show(vbox);
487
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1991 gtk_widget_show(frame);
1144
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1992 if (permit)
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1993 gtk_window_set_title(GTK_WINDOW(p->window), _("Gaim - Add Permit"));
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1994 else
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1995 gtk_window_set_title(GTK_WINDOW(p->window), _("Gaim - Add Deny"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1996 gtk_window_set_focus(GTK_WINDOW(p->window), p->entry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1997 gtk_container_add(GTK_CONTAINER(p->window), frame);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1998 gtk_widget_realize(p->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1999 aol_icon(p->window->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2000
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2001 gtk_widget_show(p->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2002 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2003
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2004
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2005 /*------------------------------------------------------------------------*/
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2006 /* Functions Called To Add A Log */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2007 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2008
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2009 void cancel_log(GtkWidget *widget, struct conversation *c)
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2010 {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2011 if (c->wood) {
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2012 set_state_lock(1);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2013 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->wood), FALSE);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2014 set_state_lock(0);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2015 }
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2016 dialogwindows = g_list_remove(dialogwindows, c->log_dialog);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2017 gtk_widget_destroy(c->log_dialog);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2018 c->log_dialog = NULL;
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2019 }
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2020
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2021 void do_log(GtkWidget *w, struct conversation *c)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2022 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2023 struct log_conversation *l;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2024 char buf[128];
1035
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
2025 char *file;
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
2026 char path[PATHSIZE];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2027
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2028 if (!find_log_info(c->name)) {
1035
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
2029 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(c->log_dialog));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2030 strncpy(path, file, PATHSIZE - 1);
1035
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
2031 if (file_is_dir(path, c->log_dialog)) {
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
2032 return;
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
2033 }
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
2034
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2035 l = (struct log_conversation *)g_new0(struct log_conversation, 1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2036 strcpy(l->name, c->name);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2037 strcpy(l->filename, file);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2038 log_conversations = g_list_append(log_conversations, l);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2039
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2040 if (c != NULL) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2041 g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, c->name);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2042 gtk_window_set_title(GTK_WINDOW(c->window), buf);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2043 }
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2044 }
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2045
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2046 save_prefs();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2047 cancel_log(NULL, c);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2048 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2049
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2050 void show_log_dialog(struct conversation *c)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2051 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2052 char *buf = g_malloc(BUF_LEN);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2053
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2054 if (!c->log_dialog) {
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2055 c->log_dialog = gtk_file_selection_new(_("Gaim - Log Conversation"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2056
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2057 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(c->log_dialog));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2058
2798
35046c134b8b [gaim-migrate @ 2811]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2791
diff changeset
2059 g_snprintf(buf, BUF_LEN - 1, "%s/%s.log", getenv("HOME"), normalize(c->name));
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2060 gtk_object_set_user_data(GTK_OBJECT(c->log_dialog), "log dialog");
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2061 gtk_file_selection_set_filename(GTK_FILE_SELECTION(c->log_dialog), buf);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2062 gtk_signal_connect(GTK_OBJECT(c->log_dialog), "delete_event",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2063 GTK_SIGNAL_FUNC(delete_event_dialog), c);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2064 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(c->log_dialog)->ok_button), "clicked",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2065 GTK_SIGNAL_FUNC(do_log), c);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2066 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(c->log_dialog)->cancel_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2067 "clicked", GTK_SIGNAL_FUNC(cancel_log), c);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2068 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2069
25
c56db1b46b0d [gaim-migrate @ 34]
Rob Flynn <gaim@robflynn.com>
parents: 24
diff changeset
2070 g_free(buf);
c56db1b46b0d [gaim-migrate @ 34]
Rob Flynn <gaim@robflynn.com>
parents: 24
diff changeset
2071
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2072 gtk_widget_show(c->log_dialog);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2073 gdk_window_raise(c->log_dialog->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2074 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2075
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2076 /*------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2077 /* Find Buddy By Email */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2078 /*------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2079
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2080 void do_find_info(GtkWidget *w, struct findbyinfo *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2081 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2082 char *first;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2083 char *middle;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2084 char *last;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2085 char *maiden;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2086 char *city;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2087 char *state;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2088 char *country;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2089
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2090 first = gtk_entry_get_text(GTK_ENTRY(b->firstentry));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2091 middle = gtk_entry_get_text(GTK_ENTRY(b->middleentry));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2092 last = gtk_entry_get_text(GTK_ENTRY(b->lastentry));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2093 maiden = gtk_entry_get_text(GTK_ENTRY(b->maidenentry));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2094 city = gtk_entry_get_text(GTK_ENTRY(b->cityentry));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2095 state = gtk_entry_get_text(GTK_ENTRY(b->stateentry));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2096 country = gtk_entry_get_text(GTK_ENTRY(b->countryentry));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2097
2393
a7ecfd3f7714 [gaim-migrate @ 2406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2382
diff changeset
2098 serv_dir_search(b->gc, first, middle, last, maiden, city, state, country, "");
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2099 destroy_dialog(NULL, b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2100 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2101
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2102 void do_find_email(GtkWidget *w, struct findbyemail *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2103 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2104 char *email;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2105
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2106 email = gtk_entry_get_text(GTK_ENTRY(b->emailentry));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2107
2598
b2800bca74fe [gaim-migrate @ 2611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
2108 serv_dir_search(b->gc, "", "", "", "", "", "", "", email);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2109
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2110 destroy_dialog(NULL, b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2111 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2112
2393
a7ecfd3f7714 [gaim-migrate @ 2406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2382
diff changeset
2113 void show_find_info(struct gaim_connection *gc)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2114 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2115 GtkWidget *cancel;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2116 GtkWidget *ok;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2117 GtkWidget *label;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2118 GtkWidget *bbox;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2119 GtkWidget *vbox;
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2120 GtkWidget *hbox;
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2121 GtkWidget *fbox;
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2122 GtkWidget *frame;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2123
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2124 struct findbyinfo *b = g_new0(struct findbyinfo, 1);
2393
a7ecfd3f7714 [gaim-migrate @ 2406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2382
diff changeset
2125 b->gc = gc;
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
2126 GAIM_DIALOG(b->window);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2127 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, TRUE, TRUE);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
2128 gtk_window_set_wmclass(GTK_WINDOW(b->window), "find_info", "Gaim");
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2129 gtk_widget_show(b->window);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2130
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2131 dialogwindows = g_list_prepend(dialogwindows, b->window);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2132
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2133 frame = gtk_frame_new(_("Search for Buddy"));
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2134 fbox = gtk_vbox_new(FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2135
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2136 /* Build OK Button */
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2137
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
2138 ok = picture_button(b->window, _("OK"), ok_xpm);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
2139 cancel = picture_button(b->window, _("Cancel"), cancel_xpm);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2140
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2141 bbox = gtk_hbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2142 vbox = gtk_vbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2143 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2144
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2145 b->firstentry = gtk_entry_new();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2146 b->middleentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2147 b->lastentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2148 b->maidenentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2149 b->cityentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2150 b->stateentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2151 b->countryentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2152
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2153 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2154 gtk_box_pack_end(GTK_BOX(bbox), ok, FALSE, FALSE, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2155
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2156 /* Line 1 */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2157 label = gtk_label_new(_("First Name"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2158 gtk_widget_show(label);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2159
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2160 hbox = gtk_hbox_new(FALSE, 5);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2161 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2162 gtk_box_pack_end(GTK_BOX(hbox), b->firstentry, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2163
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2164 gtk_widget_show(hbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2165 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2166
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2167 /* Line 2 */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2168
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2169 label = gtk_label_new(_("Middle Name"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2170 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2171
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2172 hbox = gtk_hbox_new(FALSE, 5);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2173 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2174 gtk_box_pack_end(GTK_BOX(hbox), b->middleentry, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2175
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2176 gtk_widget_show(hbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2177 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2178
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2179 /* Line 3 */
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2180
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2181 label = gtk_label_new(_("Last Name"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2182 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2183
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2184 hbox = gtk_hbox_new(FALSE, 5);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2185 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2186 gtk_box_pack_end(GTK_BOX(hbox), b->lastentry, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2187
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2188 gtk_widget_show(hbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2189 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2190
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2191 /* Line 4 */
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2192
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2193 label = gtk_label_new(_("Maiden Name"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2194 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2195
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2196 hbox = gtk_hbox_new(FALSE, 5);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2197 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2198 gtk_box_pack_end(GTK_BOX(hbox), b->maidenentry, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2199
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2200 gtk_widget_show(hbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2201 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2202
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2203 /* Line 5 */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2204
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2205 label = gtk_label_new(_("City"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2206 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2207
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2208 hbox = gtk_hbox_new(FALSE, 5);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2209 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2210 gtk_box_pack_end(GTK_BOX(hbox), b->cityentry, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2211
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2212 gtk_widget_show(hbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2213 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2214
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2215 /* Line 6 */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2216 label = gtk_label_new(_("State"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2217 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2218
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2219 hbox = gtk_hbox_new(FALSE, 5);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2220 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2221 gtk_box_pack_end(GTK_BOX(hbox), b->stateentry, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2222
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2223 gtk_widget_show(hbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2224 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2225
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2226 /* Line 7 */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2227 label = gtk_label_new(_("Country"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2228 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2229
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2230 hbox = gtk_hbox_new(FALSE, 5);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2231 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2232 gtk_box_pack_end(GTK_BOX(hbox), b->countryentry, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2233
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2234 gtk_widget_show(hbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2235 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2236
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2237 /* Merge The Boxes */
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2238
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2239 gtk_container_add(GTK_CONTAINER(frame), vbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2240 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2241 gtk_box_pack_start(GTK_BOX(fbox), bbox, FALSE, FALSE, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2242
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2243 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2244 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2245 gtk_signal_connect(GTK_OBJECT(ok), "clicked", GTK_SIGNAL_FUNC(do_find_info), b);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2246
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2247 gtk_widget_show(ok);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2248 gtk_widget_show(cancel);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2249 gtk_widget_show(b->firstentry);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2250 gtk_widget_show(b->middleentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2251 gtk_widget_show(b->lastentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2252 gtk_widget_show(b->maidenentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2253 gtk_widget_show(b->cityentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2254 gtk_widget_show(b->stateentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2255 gtk_widget_show(b->countryentry);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2256 gtk_widget_show(bbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2257 gtk_widget_show(vbox);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2258 gtk_widget_show(frame);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2259 gtk_widget_show(fbox);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2260
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2261 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Find Buddy By Info"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2262 gtk_window_set_focus(GTK_WINDOW(b->window), b->firstentry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2263 gtk_container_add(GTK_CONTAINER(b->window), fbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2264 gtk_container_border_width(GTK_CONTAINER(b->window), 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2265 gtk_widget_realize(b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2266 aol_icon(b->window->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2267
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2268 gtk_widget_show(b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2269 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2270
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1499
diff changeset
2271 void show_find_email(struct gaim_connection *gc)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2272 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2273 GtkWidget *label;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2274 GtkWidget *bbox;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2275 GtkWidget *vbox;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2276 GtkWidget *frame;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2277 GtkWidget *topbox;
444
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2278 GtkWidget *button;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2279
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2280 struct findbyemail *b = g_new0(struct findbyemail, 1);
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1499
diff changeset
2281 if (g_slist_find(connections, gc))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1499
diff changeset
2282 b->gc = gc;
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
2283 GAIM_DIALOG(b->window);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2284 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, TRUE, TRUE);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
2285 gtk_window_set_wmclass(GTK_WINDOW(b->window), "find_email", "Gaim");
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2286 gtk_widget_realize(b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2287 aol_icon(b->window->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2288 dialogwindows = g_list_prepend(dialogwindows, b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2289 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2290 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Find Buddy By Email"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2291
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2292 vbox = gtk_vbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2293 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2294 gtk_container_add(GTK_CONTAINER(b->window), vbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2295
444
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2296 frame = gtk_frame_new(_("Search for Buddy"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2297 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2298
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2299 topbox = gtk_hbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2300 gtk_container_add(GTK_CONTAINER(frame), topbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2301 gtk_container_set_border_width(GTK_CONTAINER(topbox), 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2302
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2303 label = gtk_label_new(_("Email"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2304 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2305
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2306 b->emailentry = gtk_entry_new();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2307 gtk_box_pack_start(GTK_BOX(topbox), b->emailentry, TRUE, TRUE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2308 gtk_signal_connect(GTK_OBJECT(b->emailentry), "activate", GTK_SIGNAL_FUNC(do_find_email), b);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2309 gtk_window_set_focus(GTK_WINDOW(b->window), b->emailentry);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
2310
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2311 bbox = gtk_hbox_new(FALSE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2312 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
444
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2313
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
2314 button = picture_button(b->window, _("Cancel"), cancel_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2315 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2316 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2317
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2318 button = picture_button(b->window, _("OK"), ok_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2319 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(do_find_email), b);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2320 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
444
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2321
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2322 gtk_widget_show_all(b->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2323 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2324
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2325 /*------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2326 /* Link Dialog */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2327 /*------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2328
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2329 void cancel_link(GtkWidget *widget, struct conversation *c)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2330 {
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2331 if (c->link) {
62
03b65653798b [gaim-migrate @ 72]
Rob Flynn <gaim@robflynn.com>
parents: 61
diff changeset
2332 set_state_lock(1);
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2333 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->link), FALSE);
62
03b65653798b [gaim-migrate @ 72]
Rob Flynn <gaim@robflynn.com>
parents: 61
diff changeset
2334 set_state_lock(0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2335 }
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2336 destroy_dialog(NULL, c->link_dialog);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2337 c->link_dialog = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2338 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2339
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2340 void do_add_link(GtkWidget *widget, struct linkdlg *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2341 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2342 char *open_tag;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2343 char *urltext, *showtext;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2344 open_tag = g_malloc(2048);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2345
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2346
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2347 urltext = gtk_entry_get_text(GTK_ENTRY(b->url));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2348 showtext = gtk_entry_get_text(GTK_ENTRY(b->text));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2349
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2350 g_snprintf(open_tag, 2048, "<A HREF=\"%s\">%s", urltext, showtext);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2351 surround(b->entry, open_tag, "</A>");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2352
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2353 g_free(open_tag);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2354 destroy_dialog(NULL, b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2355 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2356
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2357
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2358 void show_add_link(GtkWidget *linky, struct conversation *c)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2359 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2360 GtkWidget *vbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2361 GtkWidget *bbox;
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2362 GtkWidget *hbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2363 GtkWidget *label;
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2364 GtkWidget *frame;
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2365 GtkWidget *fbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2366
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2367 if (!c->link_dialog) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2368 struct linkdlg *b = g_new0(struct linkdlg, 1);
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
2369 GAIM_DIALOG(c->link_dialog);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2370 gtk_window_set_wmclass(GTK_WINDOW(c->link_dialog), "add_link", "Gaim");
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2371 dialogwindows = g_list_prepend(dialogwindows, c->link_dialog);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2372
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2373 gtk_widget_set_usize(c->link_dialog, 270, 165);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2374 gtk_window_set_policy(GTK_WINDOW(c->link_dialog), FALSE, FALSE, TRUE);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2375 gtk_widget_show(c->link_dialog);
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2376
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2377 vbox = gtk_vbox_new(FALSE, 10);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2378 bbox = gtk_hbox_new(TRUE, 10);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2379 frame = gtk_frame_new(_("Insert Link"));
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2380 fbox = gtk_vbox_new(FALSE, 5);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2381
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2382 /* Build OK Button */
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2383
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2384 b->ok = picture_button(c->link_dialog, _("OK"), ok_xpm);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2385 b->cancel = picture_button(c->link_dialog, _("Cancel"), cancel_xpm);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2386
651
650687b7ca0e [gaim-migrate @ 661]
Rob Flynn <gaim@robflynn.com>
parents: 650
diff changeset
2387 gtk_widget_set_usize(b->ok, 75, 30);
650687b7ca0e [gaim-migrate @ 661]
Rob Flynn <gaim@robflynn.com>
parents: 650
diff changeset
2388 gtk_widget_set_usize(b->cancel, 75, 30);
650687b7ca0e [gaim-migrate @ 661]
Rob Flynn <gaim@robflynn.com>
parents: 650
diff changeset
2389
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2390 gtk_box_pack_start(GTK_BOX(bbox), b->ok, FALSE, FALSE, 10);
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2391 gtk_box_pack_end(GTK_BOX(bbox), b->cancel, FALSE, FALSE, 10);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2392 gtk_widget_show(bbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2393
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2394 b->url = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2395 b->text = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2396
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2397 hbox = gtk_hbox_new(FALSE, 5);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2398 label = gtk_label_new(_("URL"));
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2399 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2400 gtk_box_pack_end(GTK_BOX(hbox), b->url, FALSE, FALSE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2401 gtk_widget_show(label);
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2402 gtk_widget_show(hbox);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2403 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2404
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2405 hbox = gtk_hbox_new(FALSE, 5);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2406 label = gtk_label_new(_("Description"));
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2407 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2408 gtk_box_pack_end(GTK_BOX(hbox), b->text, FALSE, FALSE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2409 gtk_widget_show(label);
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2410 gtk_widget_show(hbox);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2411 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2412
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2413 gtk_widget_show(b->url);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2414 gtk_widget_show(b->text);
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2415 gtk_widget_show(frame);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2416 gtk_widget_show(fbox);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2417
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2418 gtk_container_add(GTK_CONTAINER(frame), vbox);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2419 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 5);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2420 gtk_box_pack_start(GTK_BOX(fbox), bbox, TRUE, TRUE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2421 gtk_widget_show(vbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2422
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2423 gtk_signal_connect(GTK_OBJECT(c->link_dialog), "destroy",
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2424 GTK_SIGNAL_FUNC(cancel_link), c);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2425 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked", GTK_SIGNAL_FUNC(cancel_link), c);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2426 gtk_signal_connect(GTK_OBJECT(b->ok), "clicked", GTK_SIGNAL_FUNC(do_add_link), b);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2427
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2428 gtk_container_add(GTK_CONTAINER(c->link_dialog), fbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2429 gtk_container_border_width(GTK_CONTAINER(c->link_dialog), 10);
2534
2bc6ee172103 [gaim-migrate @ 2547]
Rob Flynn <gaim@robflynn.com>
parents: 2530
diff changeset
2430 gtk_window_set_title(GTK_WINDOW(c->link_dialog), _("Gaim - Add URL"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2431 gtk_window_set_focus(GTK_WINDOW(c->link_dialog), b->url);
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2432 b->window = c->link_dialog;
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2433 b->toggle = linky;
611
0f7e5ff95f71 [gaim-migrate @ 621]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 609
diff changeset
2434 b->entry = c->entry;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2435 gtk_widget_realize(c->link_dialog);
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2436 aol_icon(c->link_dialog->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2437
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2438 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2439
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2440 gtk_widget_show(c->link_dialog);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2441 gdk_window_raise(c->link_dialog->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2442 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2443
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2444
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2445 /*------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2446 /* Color Selection Dialog */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2447 /*------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2448
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2449 static GtkWidget *fgcseld = NULL;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2450 static GtkWidget *bgcseld = NULL;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2451
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2452 void cancel_fgcolor(GtkWidget *widget, struct conversation *c)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2453 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2454 if (c->fgcolorbtn && widget) {
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2455 set_state_lock(1);
854
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 843
diff changeset
2456 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->fgcolorbtn), FALSE);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2457 set_state_lock(0);
61
72e6a6eb1852 [gaim-migrate @ 71]
Rob Flynn <gaim@robflynn.com>
parents: 38
diff changeset
2458 }
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2459 dialogwindows = g_list_remove(dialogwindows, c->fg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2460 gtk_widget_destroy(c->fg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2461 c->fg_color_dialog = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2462 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2463
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2464 void cancel_bgcolor(GtkWidget *widget, struct conversation *c)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2465 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2466 if (c->bgcolorbtn && widget) {
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2467 set_state_lock(1);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2468 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->bgcolorbtn), FALSE);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2469 set_state_lock(0);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2470 }
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2471 dialogwindows = g_list_remove(dialogwindows, c->bg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2472 gtk_widget_destroy(c->bg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2473 c->bg_color_dialog = NULL;
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2474 }
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2475
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2476 void do_fgcolor(GtkWidget *widget, GtkColorSelection *colorsel)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2477 {
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2478 gdouble color[3];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2479 GdkColor text_color;
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2480 struct conversation *c;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2481 char *open_tag;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2482
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2483 open_tag = g_malloc(30);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2484
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2485 gtk_color_selection_get_color(colorsel, color);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2486
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2487 c = gtk_object_get_user_data(GTK_OBJECT(colorsel));
411
a330017b3aa4 [gaim-migrate @ 421]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 401
diff changeset
2488 /* GTK_IS_EDITABLE(c->entry); huh? */
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2489
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2490 text_color.red = ((guint16)(color[0] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2491 text_color.green = ((guint16)(color[1] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2492 text_color.blue = ((guint16)(color[2] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2493
699
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
2494 c->fgcol = text_color;
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
2495 c->hasfg = 1;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2496 g_snprintf(open_tag, 23, "<FONT COLOR=\"#%02X%02X%02X\">", text_color.red, text_color.green,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2497 text_color.blue);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2498 surround(c->entry, open_tag, "</FONT>");
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1238
diff changeset
2499 debug_printf("#%02X%02X%02X\n", text_color.red, text_color.green, text_color.blue);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2500 g_free(open_tag);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2501 cancel_fgcolor(NULL, c);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2502 }
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2503
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2504 void do_bgcolor(GtkWidget *widget, GtkColorSelection *colorsel)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2505 {
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2506 gdouble color[3];
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2507 GdkColor text_color;
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2508 struct conversation *c;
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2509 char *open_tag;
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2510
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2511 open_tag = g_malloc(30);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2512
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2513 gtk_color_selection_get_color(colorsel, color);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2514
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2515 c = gtk_object_get_user_data(GTK_OBJECT(colorsel));
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2516 /* GTK_IS_EDITABLE(c->entry); huh? */
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2517
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2518 text_color.red = ((guint16)(color[0] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2519 text_color.green = ((guint16)(color[1] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2520 text_color.blue = ((guint16)(color[2] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2521
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2522 c->bgcol = text_color;
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2523 c->hasbg = 1;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2524 g_snprintf(open_tag, 25, "<BODY BGCOLOR=\"#%02X%02X%02X\">", text_color.red, text_color.green,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2525 text_color.blue);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2526 surround(c->entry, open_tag, "</BODY>");
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1238
diff changeset
2527 debug_printf("#%02X%02X%02X\n", text_color.red, text_color.green, text_color.blue);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2528 g_free(open_tag);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2529 cancel_bgcolor(NULL, c);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2530 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2531
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2532 static void destroy_colorsel(GtkWidget *w, gpointer d)
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2533 {
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2534 if (d) {
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2535 gtk_widget_destroy(fgcseld);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2536 fgcseld = NULL;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2537 } else {
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2538 gtk_widget_destroy(bgcseld);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2539 bgcseld = NULL;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2540 }
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2541 }
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2542
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2543 static void apply_color_dlg(GtkWidget *w, gpointer d)
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2544 {
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2545 gdouble color[3];
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2546 if ((int)d == 1) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2547 gtk_color_selection_get_color(GTK_COLOR_SELECTION
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2548 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), color);
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2549 destroy_colorsel(NULL, (void *)1);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2550
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2551 fgcolor.red = ((guint16)(color[0] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2552 fgcolor.green = ((guint16)(color[1] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2553 fgcolor.blue = ((guint16)(color[2] * 65535)) >> 8;
873
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 858
diff changeset
2554 update_color(NULL, pref_fg_picture);
1759
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1748
diff changeset
2555 update_convo_color(TRUE);
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2556 } else {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2557 gtk_color_selection_get_color(GTK_COLOR_SELECTION
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2558 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), color);
675
b77c039c9d3d [gaim-migrate @ 685]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 666
diff changeset
2559 destroy_colorsel(NULL, (void *)0);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2560
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2561 bgcolor.red = ((guint16)(color[0] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2562 bgcolor.green = ((guint16)(color[1] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2563 bgcolor.blue = ((guint16)(color[2] * 65535)) >> 8;
873
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 858
diff changeset
2564 update_color(NULL, pref_bg_picture);
1759
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1748
diff changeset
2565 update_convo_color(FALSE);
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2566 }
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2567 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2568
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2569 void show_fgcolor_dialog(struct conversation *c, GtkWidget *color)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2570 {
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2571 GtkWidget *colorsel;
2209
9b8b32ae3b41 [gaim-migrate @ 2219]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2143
diff changeset
2572 gdouble fgclr[3];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2573
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2574 if (color == NULL) { /* we came from the prefs */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2575 if (fgcseld)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2576 return;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2577 fgclr[0] = (gdouble)(fgcolor.red) / 255;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2578 fgclr[1] = (gdouble)(fgcolor.green) / 255;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2579 fgclr[2] = (gdouble)(fgcolor.blue) / 255;
2209
9b8b32ae3b41 [gaim-migrate @ 2219]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2143
diff changeset
2580
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2581 fgcseld = gtk_color_selection_dialog_new(_("Select Text Color"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2582 gtk_color_selection_set_color(GTK_COLOR_SELECTION
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2583 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), fgclr);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2584 gtk_signal_connect(GTK_OBJECT(fgcseld), "delete_event",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2585 GTK_SIGNAL_FUNC(destroy_colorsel), (void *)1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2586 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(fgcseld)->cancel_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2587 "clicked", GTK_SIGNAL_FUNC(destroy_colorsel), (void *)1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2588 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(fgcseld)->ok_button), "clicked",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2589 GTK_SIGNAL_FUNC(apply_color_dlg), (void *)1);
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2590 gtk_widget_realize(fgcseld);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2591 aol_icon(fgcseld->window);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2592 gtk_widget_show(fgcseld);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2593 gdk_window_raise(fgcseld->window);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2594 return;
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2595 }
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2596
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2597 if (!c->fg_color_dialog) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2598 fgclr[0] = (gdouble)(c->fgcol.red) / 255;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2599 fgclr[1] = (gdouble)(c->fgcol.green) / 255;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2600 fgclr[2] = (gdouble)(c->fgcol.blue) / 255;
2209
9b8b32ae3b41 [gaim-migrate @ 2219]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2143
diff changeset
2601
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2602 c->fg_color_dialog = gtk_color_selection_dialog_new(_("Select Text Color"));
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2603 colorsel = GTK_COLOR_SELECTION_DIALOG(c->fg_color_dialog)->colorsel;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2604 gtk_color_selection_set_color(GTK_COLOR_SELECTION(colorsel), fgclr);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2605 gtk_object_set_user_data(GTK_OBJECT(colorsel), c);
2209
9b8b32ae3b41 [gaim-migrate @ 2219]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2143
diff changeset
2606
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2607 gtk_signal_connect(GTK_OBJECT(c->fg_color_dialog), "delete_event",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2608 GTK_SIGNAL_FUNC(delete_event_dialog), c);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2609 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(c->fg_color_dialog)->ok_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2610 "clicked", GTK_SIGNAL_FUNC(do_fgcolor), colorsel);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2611 gtk_signal_connect(GTK_OBJECT
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2612 (GTK_COLOR_SELECTION_DIALOG(c->fg_color_dialog)->cancel_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2613 "clicked", GTK_SIGNAL_FUNC(cancel_fgcolor), c);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2614
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2615 gtk_widget_realize(c->fg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2616 aol_icon(c->fg_color_dialog->window);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2617 }
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2618
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2619 gtk_widget_show(c->fg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2620 gdk_window_raise(c->fg_color_dialog->window);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2621 }
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2622
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2623 void show_bgcolor_dialog(struct conversation *c, GtkWidget *color)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2624 {
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2625 GtkWidget *colorsel;
2209
9b8b32ae3b41 [gaim-migrate @ 2219]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2143
diff changeset
2626 gdouble bgclr[3];
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2627
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2628 if (color == NULL) { /* we came from the prefs */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2629 if (bgcseld)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2630 return;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2631 bgclr[0] = (gdouble)(bgcolor.red) / 255;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2632 bgclr[1] = (gdouble)(bgcolor.green) / 255;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2633 bgclr[2] = (gdouble)(bgcolor.blue) / 255;
2209
9b8b32ae3b41 [gaim-migrate @ 2219]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2143
diff changeset
2634
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2635 bgcseld = gtk_color_selection_dialog_new(_("Select Background Color"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2636 gtk_color_selection_set_color(GTK_COLOR_SELECTION
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2637 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), bgclr);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2638 gtk_signal_connect(GTK_OBJECT(bgcseld), "delete_event",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2639 GTK_SIGNAL_FUNC(destroy_colorsel), NULL);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2640 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(bgcseld)->cancel_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2641 "clicked", GTK_SIGNAL_FUNC(destroy_colorsel), NULL);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2642 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(bgcseld)->ok_button), "clicked",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2643 GTK_SIGNAL_FUNC(apply_color_dlg), (void *)2);
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2644 gtk_widget_realize(bgcseld);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2645 aol_icon(bgcseld->window);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2646 gtk_widget_show(bgcseld);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2647 gdk_window_raise(bgcseld->window);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2648 return;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2649 }
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2650
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2651 if (!c->bg_color_dialog) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2652 bgclr[0] = (gdouble)(c->bgcol.red) / 255;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2653 bgclr[1] = (gdouble)(c->bgcol.green) / 255;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2654 bgclr[2] = (gdouble)(c->bgcol.blue) / 255;
2209
9b8b32ae3b41 [gaim-migrate @ 2219]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2143
diff changeset
2655
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2656 c->bg_color_dialog = gtk_color_selection_dialog_new(_("Select Text Color"));
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2657 colorsel = GTK_COLOR_SELECTION_DIALOG(c->bg_color_dialog)->colorsel;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2658 gtk_color_selection_set_color(GTK_COLOR_SELECTION(colorsel), bgclr);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2659 gtk_object_set_user_data(GTK_OBJECT(colorsel), c);
2209
9b8b32ae3b41 [gaim-migrate @ 2219]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2143
diff changeset
2660
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2661 gtk_signal_connect(GTK_OBJECT(c->bg_color_dialog), "delete_event",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2662 GTK_SIGNAL_FUNC(delete_event_dialog), c);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2663 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(c->bg_color_dialog)->ok_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2664 "clicked", GTK_SIGNAL_FUNC(do_bgcolor), colorsel);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2665 gtk_signal_connect(GTK_OBJECT
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2666 (GTK_COLOR_SELECTION_DIALOG(c->bg_color_dialog)->cancel_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2667 "clicked", GTK_SIGNAL_FUNC(cancel_bgcolor), c);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2668
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2669 gtk_widget_realize(c->bg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2670 aol_icon(c->bg_color_dialog->window);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2671 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2672
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2673 gtk_widget_show(c->bg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2674 gdk_window_raise(c->bg_color_dialog->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2675 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2676
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2677 /*------------------------------------------------------------------------*/
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2678 /* Font Selection Dialog */
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2679 /*------------------------------------------------------------------------*/
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2680
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2681 void cancel_font(GtkWidget *widget, struct conversation *c)
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2682 {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2683 if (c->font && widget) {
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2684 set_state_lock(1);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2685 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->font), FALSE);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2686 set_state_lock(0);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2687 }
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2688 dialogwindows = g_list_remove(dialogwindows, c->font_dialog);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2689 gtk_widget_destroy(c->font_dialog);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2690 c->font_dialog = NULL;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2691 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2692
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2693 void apply_font(GtkWidget *widget, GtkFontSelection *fontsel)
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2694 {
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2695 /* this could be expanded to include font size, weight, etc.
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2696 but for now only works with font face */
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2697 int i, j = 0, k = 0;
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2698 char *fontname;
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2699 struct conversation *c = gtk_object_get_user_data(GTK_OBJECT(fontsel));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2700
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2701 if (c) {
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2702 fontname = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(fontsel));
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2703
2763
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
2704 set_font_face(fontname, c);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2705 } else {
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2706 fontname = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(fontsel));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2707
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2708 for (i = 0; i < strlen(fontname); i++) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2709 if (fontname[i] == '-') {
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2710 if (++j > 2)
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2711 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2712 } else if (j == 2)
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2713 fontface[k++] = fontname[i];
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2714 }
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2715 fontface[k] = '\0';
2763
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
2716
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
2717 g_snprintf(fontxfld, sizeof(fontxfld), "%s", fontname);
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2718 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2719
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2720 cancel_font(NULL, c);
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2721 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2722
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2723 static GtkWidget *fontseld;
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2724
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2725 void destroy_fontsel(GtkWidget *w, gpointer d)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2726 {
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2727 gtk_widget_destroy(fontseld);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2728 fontseld = NULL;
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2729 }
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2730
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2731 void apply_font_dlg(GtkWidget *w, GtkWidget *f)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2732 {
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2733 int i, j = 0, k = 0;
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2734 char *fontname;
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2735
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2736 fontname = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(fontseld));
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2737 destroy_fontsel(0, 0);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2738 for (i = 0; i < strlen(fontname); i++) {
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2739 if (fontname[i] == '-') {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2740 if (++j > 2)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2741 break;
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2742 } else if (j == 2)
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2743 fontface[k++] = fontname[i];
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2744 }
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2745 fontface[k] = '\0';
2763
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
2746 g_snprintf(fontxfld, sizeof(fontxfld), "%s", fontname);
1759
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1748
diff changeset
2747 update_convo_font();
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2748 }
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2749
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2750 void show_font_dialog(struct conversation *c, GtkWidget *font)
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2751 {
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2752
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2753 if (!font) { /* we came from the prefs dialog */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2754 if (fontseld)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2755 return;
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2756 fontseld = gtk_font_selection_dialog_new(_("Select Font"));
2763
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
2757 if (fontxfld[0]) {
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
2758 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(fontseld),
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
2759 fontxfld);
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
2760 } else {
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
2761 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(fontseld),
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
2762 DEFAULT_FONT_XFLD);
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
2763 }
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2764
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2765 gtk_object_set_user_data(GTK_OBJECT(fontseld), NULL);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2766 gtk_signal_connect(GTK_OBJECT(fontseld), "delete_event",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2767 GTK_SIGNAL_FUNC(destroy_fontsel), NULL);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2768 gtk_signal_connect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(fontseld)->cancel_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2769 "clicked", GTK_SIGNAL_FUNC(destroy_fontsel), NULL);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2770 gtk_signal_connect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(fontseld)->ok_button), "clicked",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2771 GTK_SIGNAL_FUNC(apply_font_dlg), NULL);
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2772 gtk_widget_realize(fontseld);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2773 aol_icon(fontseld->window);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2774 gtk_widget_show(fontseld);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2775 gdk_window_raise(fontseld->window);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2776 return;
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2777 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2778
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2779 if (!c->font_dialog) {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2780 c->font_dialog = gtk_font_selection_dialog_new(_("Select Font"));
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2781
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2782 if (font)
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2783 gtk_object_set_user_data(GTK_OBJECT(c->font_dialog), c);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2784 else
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2785 gtk_object_set_user_data(GTK_OBJECT(c->font_dialog), NULL);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2786
2763
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
2787 if (c->fontxfld[0]) {
2785
501de8a3b09f [gaim-migrate @ 2798]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2788 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(c->font_dialog),
2763
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
2789 c->fontxfld);
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
2790 } else {
2785
501de8a3b09f [gaim-migrate @ 2798]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2791 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(c->font_dialog),
2763
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
2792 DEFAULT_FONT_XFLD);
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
2793 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2794
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2795 gtk_signal_connect(GTK_OBJECT(c->font_dialog), "delete_event",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2796 GTK_SIGNAL_FUNC(delete_event_dialog), c);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2797 gtk_signal_connect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(c->font_dialog)->ok_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2798 "clicked", GTK_SIGNAL_FUNC(apply_font), c->font_dialog);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2799 gtk_signal_connect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(c->font_dialog)->cancel_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2800 "clicked", GTK_SIGNAL_FUNC(cancel_font), c);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2801
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2802 gtk_widget_realize(c->font_dialog);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2803
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2804 aol_icon(c->font_dialog->window);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2805 }
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2806 gtk_widget_show(c->font_dialog);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2807 gdk_window_raise(c->font_dialog->window);
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2808 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2809
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2810 /*------------------------------------------------------------------------*/
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2811 /* The dialog for import/export */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2812 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2813
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2814 static void do_import_dialog(GtkWidget *w, struct gaim_connection *gc)
229
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2815 {
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2816 char *file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(importdialog));
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2817 if (file_is_dir(file, importdialog)) {
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2818 return;
229
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2819 }
2598
b2800bca74fe [gaim-migrate @ 2611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
2820 if (g_slist_find(connections, importgc)) {
b2800bca74fe [gaim-migrate @ 2611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
2821 do_import(importgc, file);
b2800bca74fe [gaim-migrate @ 2611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
2822 do_export(importgc);
b2800bca74fe [gaim-migrate @ 2611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
2823 }
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2824 destroy_dialog(NULL, importdialog);
2493
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2825 }
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2826
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2827 static void set_import_gc(gpointer data, struct gaim_connection *gc)
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2828 {
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2829 importgc = gc;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2830 }
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2831
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2832 static void create_import_dropdown(GtkFileSelection *fs)
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2833 {
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2834 GtkWidget *hbox;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2835 GtkWidget *label;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2836 GSList *g = connections;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2837 struct gaim_connection *c;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2838 GtkWidget *optmenu;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2839 GtkWidget *menu;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2840 char buf[256];
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2841 GtkWidget *opt;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2842
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2843 if (!connections)
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2844 return;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2845 importgc = connections->data;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2846 if (!connections->next)
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2847 return;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2848
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2849 hbox = gtk_hbox_new(FALSE, 0);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2850 gtk_box_pack_end(GTK_BOX(fs->action_area), hbox, FALSE, FALSE, 0);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2851 gtk_widget_show(hbox);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2852
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2853 optmenu = gtk_option_menu_new();
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2854 gtk_box_pack_end(GTK_BOX(hbox), optmenu, FALSE, FALSE, 5);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2855 gtk_widget_show(optmenu);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2856
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2857 label = gtk_label_new(_("Import to:"));
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2858 gtk_box_pack_end(GTK_BOX(hbox), label, FALSE, FALSE, 5);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2859 gtk_widget_show(label);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2860
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2861 menu = gtk_menu_new();
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2862
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2863 while (g) {
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2864 c = (struct gaim_connection *)g->data;
2662
b0c5770156e1 [gaim-migrate @ 2675]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2642
diff changeset
2865 g_snprintf(buf, sizeof buf, "%s (%s)", c->username, c->prpl->name());
2493
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2866 opt = gtk_menu_item_new_with_label(buf);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2867 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(set_import_gc), c);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2868 gtk_widget_show(opt);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2869 gtk_menu_append(GTK_MENU(menu), opt);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2870 g = g->next;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2871 }
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2872
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2873 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2874 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), 0);
229
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2875 }
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2876
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2877 void show_import_dialog()
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2878 {
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2879 char *buf = g_malloc(BUF_LEN);
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2880 if (!importdialog) {
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2881 importdialog = gtk_file_selection_new(_("Gaim - Import Buddy List"));
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2882
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2883 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(importdialog));
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2884
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2885 g_snprintf(buf, BUF_LEN - 1, "%s/", getenv("HOME"));
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2886
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2887 gtk_file_selection_set_filename(GTK_FILE_SELECTION(importdialog), buf);
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2888 gtk_signal_connect(GTK_OBJECT(importdialog), "destroy",
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2889 GTK_SIGNAL_FUNC(destroy_dialog), importdialog);
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2890
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2891 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(importdialog)->ok_button),
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2892 "clicked", GTK_SIGNAL_FUNC(do_import_dialog), NULL);
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2893 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(importdialog)->cancel_button),
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2894 "clicked", GTK_SIGNAL_FUNC(destroy_dialog), importdialog);
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2895
2493
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2896 create_import_dropdown(GTK_FILE_SELECTION(importdialog));
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2897 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
2898
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2899 g_free(buf);
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2900 gtk_widget_show(importdialog);
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2901 gdk_window_raise(importdialog->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2902 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2903
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2904 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2905 /* The dialog for new away messages */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2906 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2907
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2908 static struct away_message *save_away_message(struct create_away *ca)
717
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2909 {
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2910 struct away_message *am;
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2911 guint text_len;
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2912 gchar *away_message;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2913
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2914 if (!ca->mess)
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2915 am = g_new0(struct away_message, 1);
2851
6eb5bf5089f0 [gaim-migrate @ 2864]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2827
diff changeset
2916 else {
6eb5bf5089f0 [gaim-migrate @ 2864]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2827
diff changeset
2917 #ifdef USE_APPLET
6eb5bf5089f0 [gaim-migrate @ 2864]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2827
diff changeset
2918 char *awayname = g_strdup_printf("away/%s", ca->mess->name);
6eb5bf5089f0 [gaim-migrate @ 2864]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2827
diff changeset
2919 applet_widget_unregister_callback(APPLET_WIDGET(applet), awayname);
6eb5bf5089f0 [gaim-migrate @ 2864]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2827
diff changeset
2920 g_free(awayname);
6eb5bf5089f0 [gaim-migrate @ 2864]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2827
diff changeset
2921 #endif
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2922 am = ca->mess;
2851
6eb5bf5089f0 [gaim-migrate @ 2864]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2827
diff changeset
2923 }
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2924
717
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2925 g_snprintf(am->name, sizeof(am->name), "%s", gtk_entry_get_text(GTK_ENTRY(ca->entry)));
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2926 text_len = gtk_text_get_length(GTK_TEXT(ca->text));
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2927 away_message = gtk_editable_get_chars(GTK_EDITABLE(ca->text), 0, text_len);
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2928
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2929 g_snprintf(am->message, sizeof(am->message), "%s", away_message);
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2930 g_free(away_message);
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2931
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2932 if (!ca->mess) {
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2933 away_messages = g_slist_insert_sorted(away_messages, am, sort_awaymsg_list);
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2934 }
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2935
717
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2936 save_prefs();
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2937 do_away_menu();
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2938 if (prefs_away_list != NULL)
940
9fca1293f871 [gaim-migrate @ 950]
Rob Flynn <gaim@robflynn.com>
parents: 935
diff changeset
2939 gtk_list_select_item(GTK_LIST(prefs_away_list), g_slist_index(away_messages, am));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2940
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2941 return am;
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2942 }
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2943
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2944 int check_away_mess(struct create_away *ca, int type)
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2945 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2946 if ((strlen(gtk_entry_get_text(GTK_ENTRY(ca->entry))) == 0) && (type == 1)) {
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2947 /* We shouldn't allow a blank title */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2948 do_error_dialog(_("You cannot create an away message with a blank title"),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2949 _("Gaim - Error"));
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2950 return 0;
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2951 }
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2952
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2953 if ((gtk_text_get_length(GTK_TEXT(ca->text)) == 0) && (type <= 1)) {
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2954 /* We shouldn't allow a blank message */
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2955 do_error_dialog(_("You cannot create an empty away message"), _("Gaim - Error"));
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2956 return 0;
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2957 }
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2958
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2959 return 1;
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2960 }
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2961
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2962 void save_away_mess(GtkWidget *widget, struct create_away *ca)
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2963 {
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2964 if (!check_away_mess(ca, 1))
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2965 return;
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2966
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2967 save_away_message(ca);
717
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2968 destroy_dialog(NULL, ca->window);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2969 g_free(ca);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2970 }
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2971
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2972 void use_away_mess(GtkWidget *widget, struct create_away *ca)
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2973 {
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2974 static struct away_message am;
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2975 guint text_len;
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2976 gchar *away_message;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2977
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2978 if (!check_away_mess(ca, 0))
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2979 return;
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2980
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2981 g_snprintf(am.name, sizeof(am.name), "%s", gtk_entry_get_text(GTK_ENTRY(ca->entry)));
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2982 text_len = gtk_text_get_length(GTK_TEXT(ca->text));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2983 if (text_len < 0)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2984 return;
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2985 away_message = gtk_editable_get_chars(GTK_EDITABLE(ca->text), 0, text_len);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2986
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2987 g_snprintf(am.message, sizeof(am.message), "%s", away_message);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2988 g_free(away_message);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2989
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2990 do_away_message(NULL, &am);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2991
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2992 destroy_dialog(NULL, ca->window);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2993 g_free(ca);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2994 }
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2995
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2996 void su_away_mess(GtkWidget *widget, struct create_away *ca)
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2997 {
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2998 if (!check_away_mess(ca, 1))
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2999 return;
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3000 do_away_message(NULL, save_away_message(ca));
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3001 destroy_dialog(NULL, ca->window);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3002 g_free(ca);
717
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
3003 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3004
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3005 void create_away_mess(GtkWidget *widget, void *dummy)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3006 {
439
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
3007 GtkWidget *hbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3008 GtkWidget *titlebox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3009 GtkWidget *tbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3010 GtkWidget *sw;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3011 GtkWidget *label;
439
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
3012 GtkWidget *frame;
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
3013 GtkWidget *fbox;
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
3014 GtkWidget *button;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3015
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3016 struct create_away *ca = g_new0(struct create_away, 1);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
3017
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3018 /* Set up window */
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
3019 GAIM_DIALOG(ca->window);
1369
0b4278a90323 [gaim-migrate @ 1379]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1365
diff changeset
3020 gtk_widget_set_usize(ca->window, -1, 250);
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
3021 gtk_container_border_width(GTK_CONTAINER(ca->window), 5);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
3022 gtk_window_set_wmclass(GTK_WINDOW(ca->window), "away_mess", "Gaim");
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
3023 gtk_window_set_title(GTK_WINDOW(ca->window), _("Gaim - New away message"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3024 gtk_signal_connect(GTK_OBJECT(ca->window), "delete_event",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3025 GTK_SIGNAL_FUNC(destroy_dialog), ca->window);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3026 gtk_widget_realize(ca->window);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3027 aol_icon(ca->window->window);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
3028
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
3029 tbox = gtk_vbox_new(FALSE, 5);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
3030 gtk_container_add(GTK_CONTAINER(ca->window), tbox);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3031 gtk_widget_show(tbox);
439
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
3032
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
3033 frame = gtk_frame_new(_("New away message"));
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
3034 gtk_box_pack_start(GTK_BOX(tbox), frame, TRUE, TRUE, 0);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3035 gtk_widget_show(frame);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3036
1172
4135d8fc7b4e [gaim-migrate @ 1182]
Rob Flynn <gaim@robflynn.com>
parents: 1171
diff changeset
3037 fbox = gtk_vbox_new(FALSE, 5);
1224
0bbe3aaa6a3e [gaim-migrate @ 1234]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1216
diff changeset
3038 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
3039 gtk_container_add(GTK_CONTAINER(frame), fbox);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3040 gtk_widget_show(fbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
3041
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
3042 titlebox = gtk_hbox_new(FALSE, 5);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3043 gtk_box_pack_start(GTK_BOX(fbox), titlebox, FALSE, FALSE, 0);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3044 gtk_widget_show(titlebox);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3045
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
3046 label = gtk_label_new(_("Away title: "));
1172
4135d8fc7b4e [gaim-migrate @ 1182]
Rob Flynn <gaim@robflynn.com>
parents: 1171
diff changeset
3047 gtk_box_pack_start(GTK_BOX(titlebox), label, FALSE, FALSE, 0);
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
3048 gtk_widget_show(label);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
3049
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3050 ca->entry = gtk_entry_new();
1172
4135d8fc7b4e [gaim-migrate @ 1182]
Rob Flynn <gaim@robflynn.com>
parents: 1171
diff changeset
3051 gtk_box_pack_start(GTK_BOX(titlebox), ca->entry, TRUE, TRUE, 0);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3052 gtk_widget_grab_focus(ca->entry);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3053 gtk_widget_show(ca->entry);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3054
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3055 sw = gtk_scrolled_window_new(NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3056 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3057 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3058 gtk_box_pack_start(GTK_BOX(fbox), sw, TRUE, TRUE, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3059 gtk_widget_show(sw);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3060
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3061 ca->text = gtk_text_new(NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3062 gtk_text_set_word_wrap(GTK_TEXT(ca->text), TRUE);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
3063 gtk_text_set_editable(GTK_TEXT(ca->text), TRUE);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3064 gtk_container_add(GTK_CONTAINER(sw), ca->text);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3065 gtk_widget_show(ca->text);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3066
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
3067 if (dummy && GTK_LIST(prefs_away_list)->selection) {
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
3068 GtkWidget *item = GTK_LIST(prefs_away_list)->selection->data;
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
3069 struct away_message *amt = gtk_object_get_user_data(GTK_OBJECT(item));
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
3070 int pos = 0;
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
3071 gtk_entry_set_text(GTK_ENTRY(ca->entry), amt->name);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3072 gtk_editable_insert_text(GTK_EDITABLE(ca->text), amt->message,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3073 strlen(amt->message), &pos);
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
3074 ca->mess = amt;
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
3075 }
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
3076
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3077 hbox = gtk_hbox_new(FALSE, 5);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3078 gtk_box_pack_start(GTK_BOX(tbox), hbox, FALSE, FALSE, 0);
439
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
3079 gtk_widget_show(hbox);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3080
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3081 button = picture_button(ca->window, _("Cancel"), cancel_xpm);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3082 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), ca->window);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3083 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3084
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3085 button = picture_button(ca->window, _("Use"), gnome_preferences_xpm);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3086 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(use_away_mess), ca);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3087 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3088
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3089 button = picture_button(ca->window, _("Save & Use"), add_xpm);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3090 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(su_away_mess), ca);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3091 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3092
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3093 button = picture_button(ca->window, _("Save"), ok_xpm);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3094 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(save_away_mess), ca);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3095 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3096
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
3097 gtk_widget_show(ca->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3098 }
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3099
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3100 /* smiley dialog */
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3101
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3102 void close_smiley_dialog(GtkWidget *widget, struct conversation *c)
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3103 {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3104 if (c->smiley) {
570
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 567
diff changeset
3105 set_state_lock(1);
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 567
diff changeset
3106 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->smiley), FALSE);
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 567
diff changeset
3107 set_state_lock(0);
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 567
diff changeset
3108 }
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3109 dialogwindows = g_list_remove(dialogwindows, c->smiley_dialog);
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3110 gtk_widget_destroy(c->smiley_dialog);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3111 c->smiley_dialog = NULL;
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3112 }
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3113
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3114 void set_smiley_array(GtkWidget *widget, int smiley_type)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3115 {
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3116 int i;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3117
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3118 for (i = 0; i < FACE_TOTAL; i++)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3119 smiley_array[i] = 0;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3120
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3121 smiley_array[smiley_type] = 1;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3122
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3123 return;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3124 }
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3125
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3126 void insert_smiley_text(GtkWidget *widget, struct conversation *c)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3127 {
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3128 char *smiley_text;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3129 int i;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3130
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3131 for (i = 0; i < FACE_TOTAL; i++)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3132 if (smiley_array[i] == 1)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3133 break;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3134
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3135 switch (i) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3136 case (FACE_ANGEL):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3137 smiley_text = g_strndup("O:-)", strlen("O:-)"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3138 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3139 case (FACE_BIGSMILE):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3140 smiley_text = g_strndup(":-D", strlen(":-D"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3141 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3142 case (FACE_BURP):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3143 smiley_text = g_strndup(":-!", strlen(":-!"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3144 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3145 case (FACE_CROSSEDLIPS):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3146 smiley_text = g_strndup(":-X", strlen(":-X"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3147 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3148 case (FACE_CRY):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3149 smiley_text = g_strndup(":'(", strlen(":'("));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3150 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3151 case (FACE_EMBARRASSED):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3152 smiley_text = g_strndup(":-[", strlen(":-["));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3153 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3154 case (FACE_KISS):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3155 smiley_text = g_strndup(":-*", strlen(":-*"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3156 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3157 case (FACE_MONEYMOUTH):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3158 smiley_text = g_strndup(":-$", strlen(":-$"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3159 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3160 case (FACE_SAD):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3161 smiley_text = g_strndup(":-(", strlen(":-("));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3162 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3163 case (FACE_SCREAM):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3164 smiley_text = g_strndup("=-O", strlen("=-O"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3165 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3166 case (FACE_SMILE):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3167 smiley_text = g_strndup(":-)", strlen(":-)"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3168 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3169 case (FACE_SMILE8):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3170 smiley_text = g_strndup("8-)", strlen("8-)"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3171 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3172 case (FACE_THINK):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3173 smiley_text = g_strndup(":-/", strlen(":-/"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3174 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3175 case (FACE_TONGUE):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3176 smiley_text = g_strndup(":-P", strlen(":-p"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3177 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3178 case (FACE_WINK):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3179 smiley_text = g_strndup(";-)", strlen(";-)"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3180 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3181 case (FACE_YELL):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3182 smiley_text = g_strndup(">:o", strlen(">:o"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3183 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3184 default:
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3185 smiley_text = g_strndup(":-)", strlen(":-)"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3186 break;
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3187 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3188
751
a022b57ed84a [gaim-migrate @ 761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
3189 /* surround(c->entry, smiley_text, ""); */
a022b57ed84a [gaim-migrate @ 761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
3190
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
3191 if (GTK_OLD_EDITABLE(c->entry)->has_selection) {
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
3192 int finish = GTK_OLD_EDITABLE(c->entry)->selection_end_pos;
751
a022b57ed84a [gaim-migrate @ 761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
3193 gtk_editable_insert_text(GTK_EDITABLE(c->entry),
a022b57ed84a [gaim-migrate @ 761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
3194 smiley_text, strlen(smiley_text), &finish);
a022b57ed84a [gaim-migrate @ 761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
3195 } else {
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
3196 int pos = GTK_OLD_EDITABLE(c->entry)->current_pos;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3197 gtk_editable_insert_text(GTK_EDITABLE(c->entry), smiley_text, strlen(smiley_text), &pos);
751
a022b57ed84a [gaim-migrate @ 761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
3198 }
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3199
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3200 g_free(smiley_text);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3201
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3202 close_smiley_dialog(NULL, c);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3203
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3204 return;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3205 }
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3206
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3207 static void toolbar_add_smiley(struct conversation *c, GtkWidget *bar, char **xpm, GtkWidget *win,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3208 int face)
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3209 {
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3210 GtkWidget *tpm;
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3211 GdkBitmap *mask;
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3212 GdkPixmap *dpm;
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3213 GtkWidget *button;
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3214
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3215 dpm = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, xpm);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3216 tpm = gtk_pixmap_new(dpm, mask);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3217 gtk_widget_show(tpm);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
3218 gdk_pixmap_unref(dpm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 786
diff changeset
3219 gdk_bitmap_unref(mask);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3220 button =
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3221 gtk_toolbar_append_element(GTK_TOOLBAR(bar), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, NULL,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3222 NULL, tpm, GTK_SIGNAL_FUNC(set_smiley_array), (int *)face);
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3223 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3224
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
3225 /* these look really weird with borders */
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
3226 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3227 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3228
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3229 void show_smiley_dialog(struct conversation *c, GtkWidget *widget)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3230 {
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3231 GtkWidget *dialog;
584
56f7cb624e9e [gaim-migrate @ 594]
Todd Kulesza <fflewddur>
parents: 582
diff changeset
3232 GtkWidget *vbox, *smiley_box_1, *smiley_box_2, *smiley_box_3, *smiley_box_4;
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3233 GtkWidget *win;
582
7409d7ae6621 [gaim-migrate @ 592]
Rob Flynn <gaim@robflynn.com>
parents: 579
diff changeset
3234 GtkWidget *bbox;
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3235
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3236 if (c->smiley_dialog)
558
f1b8f03db83f [gaim-migrate @ 568]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 555
diff changeset
3237 return;
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3238
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3239 win = c->window;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3240
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
3241 GAIM_DIALOG(dialog);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
3242 gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, FALSE, TRUE);
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
3243 gtk_window_set_wmclass(GTK_WINDOW(dialog), "smiley_dialog", "Gaim");
934
e5da96def4bd [gaim-migrate @ 944]
Rob Flynn <gaim@robflynn.com>
parents: 928
diff changeset
3244 gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE);
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3245
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3246 /* setup boxes */
582
7409d7ae6621 [gaim-migrate @ 592]
Rob Flynn <gaim@robflynn.com>
parents: 579
diff changeset
3247 vbox = gtk_vbox_new(TRUE, 5);
7409d7ae6621 [gaim-migrate @ 592]
Rob Flynn <gaim@robflynn.com>
parents: 579
diff changeset
3248 bbox = gtk_hbox_new(FALSE, 5);
7409d7ae6621 [gaim-migrate @ 592]
Rob Flynn <gaim@robflynn.com>
parents: 579
diff changeset
3249
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3250 smiley_box_1 = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3251 smiley_box_2 = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3252 smiley_box_3 = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3253 smiley_box_4 = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3254
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3255 /* setup buttons */
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3256
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3257 /* pack buttons */
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3258 toolbar_add_smiley(c, smiley_box_1, angel_xpm, win, FACE_ANGEL);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3259 toolbar_add_smiley(c, smiley_box_1, bigsmile_xpm, win, FACE_BIGSMILE);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3260 toolbar_add_smiley(c, smiley_box_1, burp_xpm, win, FACE_BURP);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3261 toolbar_add_smiley(c, smiley_box_1, crossedlips_xpm, win, FACE_CROSSEDLIPS);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3262
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3263 toolbar_add_smiley(c, smiley_box_2, cry_xpm, win, FACE_CRY);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3264 toolbar_add_smiley(c, smiley_box_2, embarrassed_xpm, win, FACE_EMBARRASSED);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3265 toolbar_add_smiley(c, smiley_box_2, kiss_xpm, win, FACE_KISS);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3266 toolbar_add_smiley(c, smiley_box_2, moneymouth_xpm, win, FACE_MONEYMOUTH);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3267
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3268 toolbar_add_smiley(c, smiley_box_3, sad_xpm, win, FACE_SAD);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3269 toolbar_add_smiley(c, smiley_box_3, scream_xpm, win, FACE_SCREAM);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3270 toolbar_add_smiley(c, smiley_box_3, smile_xpm, win, FACE_SMILE);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3271 toolbar_add_smiley(c, smiley_box_3, smile8_xpm, win, FACE_SMILE8);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3272
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3273 toolbar_add_smiley(c, smiley_box_4, think_xpm, win, FACE_THINK);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3274 toolbar_add_smiley(c, smiley_box_4, tongue_xpm, win, FACE_TONGUE);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3275 toolbar_add_smiley(c, smiley_box_4, wink_xpm, win, FACE_WINK);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3276 toolbar_add_smiley(c, smiley_box_4, yell_xpm, win, FACE_YELL);
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3277
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3278 /* pack containers */
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3279 gtk_box_pack_start(GTK_BOX(vbox), smiley_box_1, TRUE, TRUE, 0);
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3280 gtk_box_pack_start(GTK_BOX(vbox), smiley_box_2, TRUE, TRUE, 0);
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3281 gtk_box_pack_start(GTK_BOX(vbox), smiley_box_3, TRUE, TRUE, 0);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3282 gtk_box_pack_start(GTK_BOX(vbox), smiley_box_4, TRUE, TRUE, 0);
582
7409d7ae6621 [gaim-migrate @ 592]
Rob Flynn <gaim@robflynn.com>
parents: 579
diff changeset
3283
7409d7ae6621 [gaim-migrate @ 592]
Rob Flynn <gaim@robflynn.com>
parents: 579
diff changeset
3284 gtk_container_add(GTK_CONTAINER(dialog), vbox);
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3285 gtk_container_set_border_width(GTK_CONTAINER(dialog), 5);
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3286
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
3287 /* connect signals */
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
3288 gtk_object_set_user_data(GTK_OBJECT(dialog), "smiley dialog");
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
3289 gtk_signal_connect(GTK_OBJECT(dialog), "delete_event", GTK_SIGNAL_FUNC(delete_event_dialog), c);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3290
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3291 /* show everything */
567
102afb84ce45 [gaim-migrate @ 577]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 558
diff changeset
3292 gtk_window_set_title(GTK_WINDOW(dialog), _("Smile!"));
584
56f7cb624e9e [gaim-migrate @ 594]
Todd Kulesza <fflewddur>
parents: 582
diff changeset
3293 gtk_widget_show_all(dialog);
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3294
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3295 c->smiley_dialog = dialog;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3296
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3297 return;
558
f1b8f03db83f [gaim-migrate @ 568]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 555
diff changeset
3298 }
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3299
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3300 static void do_alias_bud(GtkWidget *w, struct buddy *b)
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3301 {
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3302 char *al = gtk_entry_get_text(GTK_ENTRY(aliasname));
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3303 g_snprintf(b->show, sizeof(b->show), "%s", (al && strlen(al)) ? al : b->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3304 handle_buddy_rename(b, b->name);
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3305 destroy_dialog(aliasdlg, aliasdlg);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3306 }
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3307
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3308 void alias_dialog_bud(struct buddy *b)
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3309 {
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3310 GtkWidget *frame;
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3311 GtkWidget *vbox;
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3312 GtkWidget *bbox;
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3313 GtkWidget *cancel;
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3314 static GtkWidget *add = NULL;
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3315 GtkWidget *label;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3316 GtkWidget *topbox;
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3317 static int a, c;
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3318
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3319 if (aliasdlg)
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3320 gtk_widget_destroy(aliasdlg);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3321
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
3322 GAIM_DIALOG(aliasdlg);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3323 gtk_window_set_policy(GTK_WINDOW(aliasdlg), FALSE, FALSE, TRUE);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3324 gtk_window_set_wmclass(GTK_WINDOW(aliasdlg), "alias_dialog", "Gaim");
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3325 gtk_widget_realize(aliasdlg);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3326 dialogwindows = g_list_prepend(dialogwindows, aliasdlg);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3327
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3328 bbox = gtk_hbox_new(TRUE, 10);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3329 topbox = gtk_hbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3330 vbox = gtk_vbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3331
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3332 aliasentry = gtk_entry_new();
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3333 aliasname = gtk_entry_new();
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3334 /* Put the buttons in the box */
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3335
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3336 add = picture_button(aliasdlg, _("Alias"), add_xpm);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3337
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3338 cancel = picture_button(aliasdlg, _("Cancel"), cancel_xpm);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3339
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3340 gtk_box_pack_start(GTK_BOX(bbox), add, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3341 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3342
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3343 frame = gtk_frame_new(NULL);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3344 gtk_frame_set_label(GTK_FRAME(frame), _("Alias Buddy"));
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3345
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3346 label = gtk_label_new(_("Buddy"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3347 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3348 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3349 gtk_box_pack_start(GTK_BOX(topbox), aliasentry, FALSE, FALSE, 5);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3350 gtk_entry_set_editable(GTK_ENTRY(aliasentry), FALSE);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3351 label = gtk_label_new(_("Alias"));
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3352 gtk_widget_show(label);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3353 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3354 gtk_box_pack_start(GTK_BOX(topbox), aliasname, FALSE, FALSE, 5);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3355
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3356 gtk_entry_set_text(GTK_ENTRY(aliasentry), b->name);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3357 gtk_entry_set_text(GTK_ENTRY(aliasname), b->show);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3358
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3359 /* And the boxes in the box */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3360 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3361 gtk_box_pack_start(GTK_BOX(vbox), bbox, TRUE, TRUE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3362
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3363 /* Handle closes right */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3364 gtk_signal_connect(GTK_OBJECT(aliasdlg), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), aliasdlg);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3365 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), aliasdlg);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3366 a = gtk_signal_connect(GTK_OBJECT(add), "clicked", GTK_SIGNAL_FUNC(do_alias_bud), b);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3367 c = gtk_signal_connect(GTK_OBJECT(aliasname), "activate", GTK_SIGNAL_FUNC(do_alias_bud), b);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3368 /* Finish up */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3369 gtk_widget_show(add);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3370 gtk_widget_show(cancel);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3371 gtk_widget_show(aliasentry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3372 gtk_widget_show(aliasname);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3373 gtk_widget_show(topbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3374 gtk_widget_show(bbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3375 gtk_widget_show(vbox);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3376 gtk_widget_show(frame);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3377 gtk_window_set_title(GTK_WINDOW(aliasdlg), _("Gaim - Alias Buddy"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3378 gtk_window_set_focus(GTK_WINDOW(aliasdlg), aliasentry);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3379 gtk_container_add(GTK_CONTAINER(frame), vbox);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3380 gtk_container_add(GTK_CONTAINER(aliasdlg), frame);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3381 gtk_container_set_border_width(GTK_CONTAINER(aliasdlg), 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3382 gtk_widget_realize(aliasdlg);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3383 aol_icon(aliasdlg->window);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3384
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3385 gtk_widget_show(aliasdlg);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3386 }
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3387
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3388
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3389 static gboolean dont_destroy(gpointer a, gpointer b, gpointer c)
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3390 {
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3391 return TRUE;
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3392 }
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3393
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3394 static void do_save_log(GtkWidget *w, GtkWidget *filesel)
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3395 {
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3396 char *file;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3397 char path[PATHSIZE];
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3398 char buf[BUF_LONG];
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3399 char error[BUF_LEN];
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3400 FILE *fp_old, *fp_new;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3401 char filename[PATHSIZE];
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3402 char *name;
1722
1edc8b545d6f [gaim-migrate @ 1732]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
3403 char *tmp;
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3404
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3405 name = gtk_object_get_user_data(GTK_OBJECT(filesel));
1722
1edc8b545d6f [gaim-migrate @ 1732]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
3406 tmp = gaim_user_dir();
1897
97b1667e1255 [gaim-migrate @ 1907]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1841
diff changeset
3407 g_snprintf(filename, PATHSIZE, "%s/logs/%s%s", tmp,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3408 name ? normalize(name) : "system", name ? ".log" : "");
1722
1edc8b545d6f [gaim-migrate @ 1732]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
3409 g_free(tmp);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3410
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3411 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(filesel));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3412 strncpy(path, file, PATHSIZE - 1);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3413 if (file_is_dir(path, filesel))
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3414 return;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3415
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3416 if ((fp_new = fopen(path, "w")) == NULL) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3417 g_snprintf(error, BUF_LONG,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3418 "Can't open file %s for writing - %s", path, strerror(errno));
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3419 do_error_dialog(error, "Error");
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3420 return;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3421 }
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3422
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3423 if ((fp_old = fopen(filename, "r")) == NULL) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3424 g_snprintf(error, BUF_LONG,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3425 "Can't open file %s for reading - %s", filename, strerror(errno));
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3426 do_error_dialog(error, "Error");
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3427 fclose(fp_new);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3428 return;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3429 }
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3430
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3431 while (fgets(buf, BUF_LONG, fp_old))
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3432 fputs(buf, fp_new);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3433 fclose(fp_old);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3434 fclose(fp_new);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3435
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3436 gtk_widget_destroy(filesel);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3437
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3438 return;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3439 }
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3440
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3441 static void show_save_log(GtkWidget *w, gchar *name)
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3442 {
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3443 GtkWidget *filesel;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3444 gchar buf[BUF_LEN];
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3445
1897
97b1667e1255 [gaim-migrate @ 1907]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1841
diff changeset
3446 g_snprintf(buf, BUF_LEN - 1, "%s/%s%s", getenv("HOME"),
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3447 name ? normalize(name) : "system", name ? ".log" : "");
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3448
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3449 filesel = gtk_file_selection_new(_("Gaim - Save Log File"));
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3450 gtk_signal_connect(GTK_OBJECT(filesel), "delete_event",
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3451 GTK_SIGNAL_FUNC(destroy_dialog), filesel);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3452
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3453 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(filesel));
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3454 gtk_file_selection_set_filename(GTK_FILE_SELECTION(filesel), buf);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3455 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(filesel)->ok_button),
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3456 "clicked", GTK_SIGNAL_FUNC(do_save_log), filesel);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3457 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(filesel)->cancel_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3458 "clicked", GTK_SIGNAL_FUNC(destroy_dialog), filesel);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3459 gtk_object_set_user_data(GTK_OBJECT(filesel), name);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3460
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3461 gtk_widget_realize(filesel);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3462 aol_icon(filesel->window);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3463 gtk_widget_show(filesel);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3464
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3465 return;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3466 }
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3467
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3468 static void do_clear_log_file(GtkWidget *w, gchar *name)
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3469 {
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3470 gchar buf[256];
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3471 gchar filename[256];
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3472 GtkWidget *window;
1722
1edc8b545d6f [gaim-migrate @ 1732]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
3473 char *tmp;
1edc8b545d6f [gaim-migrate @ 1732]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
3474
1edc8b545d6f [gaim-migrate @ 1732]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
3475 tmp = gaim_user_dir();
1897
97b1667e1255 [gaim-migrate @ 1907]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1841
diff changeset
3476 g_snprintf(filename, 256, "%s/logs/%s%s", tmp,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3477 name ? normalize(name) : "system", name ? ".log" : "");
1722
1edc8b545d6f [gaim-migrate @ 1732]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
3478 g_free(tmp);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3479
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3480 if ((remove(filename)) == -1) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3481 g_snprintf(buf, 256, _("Unable to remove file %s - %s"), filename, strerror(errno));
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3482 do_error_dialog(buf, _("Error"));
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3483 }
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3484
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3485 window = gtk_object_get_user_data(GTK_OBJECT(w));
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3486 destroy_dialog(NULL, window);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3487 }
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3488
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3489 static void show_clear_log(GtkWidget *w, gchar *name)
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3490 {
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3491 GtkWidget *window;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3492 GtkWidget *box;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3493 GtkWidget *hbox;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3494 GtkWidget *button;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3495 GtkWidget *label;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3496 GtkWidget *hsep;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3497
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
3498 GAIM_DIALOG(window);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3499 gtk_window_set_wmclass(GTK_WINDOW(window), "dialog", "Gaim");
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3500 gtk_container_set_border_width(GTK_CONTAINER(window), 10);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3501 gtk_window_set_policy(GTK_WINDOW(window), TRUE, TRUE, TRUE);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3502 gtk_signal_connect(GTK_OBJECT(window), "delete_event", GTK_SIGNAL_FUNC(destroy_dialog), window);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3503 gtk_widget_realize(window);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3504 aol_icon(window->window);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3505
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3506 box = gtk_vbox_new(FALSE, 5);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3507 gtk_container_add(GTK_CONTAINER(window), box);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3508
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3509 label = gtk_label_new(_("Really clear log?"));
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3510 gtk_box_pack_start(GTK_BOX(box), label, TRUE, TRUE, 15);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3511
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3512 hsep = gtk_hseparator_new();
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3513 gtk_box_pack_start(GTK_BOX(box), hsep, FALSE, FALSE, 0);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3514
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3515 hbox = gtk_hbox_new(FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3516 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3517 gtk_widget_show(hbox);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3518
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3519 button = picture_button(window, _("Cancel"), cancel_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3520 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), window);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3521 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3522 gtk_widget_show(button);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3523
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3524 button = picture_button(window, _("Okay"), ok_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3525 gtk_object_set_user_data(GTK_OBJECT(button), gtk_object_get_user_data(GTK_OBJECT(w)));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3526 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(do_clear_log_file), name);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3527 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), window);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3528 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3529 gtk_widget_show(button);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3530
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3531 gtk_widget_show_all(window);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3532
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3533 return;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3534 }
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3535
2621
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3536 static void log_show_convo(GtkWidget *w, struct view_log *view)
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3537 {
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3538 gchar buf[BUF_LONG];
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3539 FILE *fp;
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3540 char filename[256];
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3541 int i=0;
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3542 GString *string;
2602
c9192dea2bb1 [gaim-migrate @ 2615]
Rob Flynn <gaim@robflynn.com>
parents: 2598
diff changeset
3543 guint block;
c9192dea2bb1 [gaim-migrate @ 2615]
Rob Flynn <gaim@robflynn.com>
parents: 2598
diff changeset
3544
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3545 string = g_string_new("");
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3546
2621
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3547 if (view->name) {
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
3548 char *tmp = gaim_user_dir();
2621
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3549 g_snprintf(filename, 256, "%s/logs/%s.log", tmp, normalize(view->name));
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
3550 g_free(tmp);
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
3551 } else {
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
3552 char *tmp = gaim_user_dir();
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
3553 g_snprintf(filename, 256, "%s/logs/system", tmp);
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
3554 g_free(tmp);
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
3555 }
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3556 if ((fp = fopen(filename, "r")) == NULL) {
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3557 g_snprintf(buf, BUF_LONG, "Unable to open log file %s", filename);
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3558 do_error_dialog(buf, "Error!");
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3559 return;
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3560 }
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3561
2621
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3562 gtk_widget_set_sensitive(view->bbox, FALSE);
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3563 gtk_signal_disconnect_by_func(GTK_OBJECT(view->window),
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3564 GTK_SIGNAL_FUNC(destroy_dialog), view->window);
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3565 block = gtk_signal_connect(GTK_OBJECT(view->window), "delete_event",
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3566 GTK_SIGNAL_FUNC(dont_destroy), view->window);
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3567
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3568 fseek(fp, view->offset, SEEK_SET);
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3569 gtk_imhtml_clear(GTK_IMHTML(view->layout));
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3570 /*
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3571 while (gtk_events_pending())
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3572 gtk_main_iteration();
2621
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3573 */
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3574
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3575 while (fgets(buf, BUF_LONG, fp) && !strstr(buf, "---- New C")) {
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3576 i++;
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3577 if (strlen(buf) >= 5 && (!strncmp(buf + strlen(buf) - 5, "<BR>\n", 5)))
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3578 /* take off the \n */
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3579 buf[strlen(buf) - 1] = '\0';
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3580
2642
b6cf22276d4b [gaim-migrate @ 2655]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2623
diff changeset
3581 /* don't lose the thirtieth line of conversation. thanks FeRD */
b6cf22276d4b [gaim-migrate @ 2655]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2623
diff changeset
3582 g_string_append(string, buf);
b6cf22276d4b [gaim-migrate @ 2655]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2623
diff changeset
3583
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3584 if (i == 30) {
2856
b1e300a85678 [gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2851
diff changeset
3585 gtk_imhtml_append_text(GTK_IMHTML(view->layout), string->str, -1, view->options);
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3586 g_string_free(string, TRUE);
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3587 string = g_string_new("");
2621
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3588 /* you can't have these anymore. if someone clicks on another item while one is
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3589 * drawing, it will try to move to that item, and that causes problems here.
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3590 while (gtk_events_pending())
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3591 gtk_main_iteration();
2621
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3592 */
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3593 i = 0;
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3594 }
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3595
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3596 }
2856
b1e300a85678 [gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2851
diff changeset
3597 gtk_imhtml_append_text(GTK_IMHTML(view->layout), string->str, -1, view->options);
b1e300a85678 [gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2851
diff changeset
3598 gtk_imhtml_append_text(GTK_IMHTML(view->layout), "<BR>", -1, view->options);
2621
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3599
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3600 gtk_widget_set_sensitive(view->bbox, TRUE);
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3601 gtk_signal_disconnect(GTK_OBJECT(view->window), block);
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3602 gtk_signal_connect(GTK_OBJECT(view->window), "delete_event",
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3603 GTK_SIGNAL_FUNC(destroy_dialog), view->window);
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3604 g_string_free(string, TRUE);
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3605 fclose(fp);
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3606 }
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3607
2621
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3608 static void des_view_item(GtkObject *obj, struct view_log *view)
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3609 {
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3610 if (view->name)
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3611 g_free(view->name);
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3612 g_free(view);
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3613 }
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3614
2623
66164831c228 [gaim-migrate @ 2636]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2621
diff changeset
3615 static void des_log_win(GtkObject *win, gpointer data)
66164831c228 [gaim-migrate @ 2636]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2621
diff changeset
3616 {
66164831c228 [gaim-migrate @ 2636]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2621
diff changeset
3617 char *x = gtk_object_get_user_data(win);
66164831c228 [gaim-migrate @ 2636]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2621
diff changeset
3618 if (x)
66164831c228 [gaim-migrate @ 2636]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2621
diff changeset
3619 g_free(x);
66164831c228 [gaim-migrate @ 2636]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2621
diff changeset
3620 }
66164831c228 [gaim-migrate @ 2636]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2621
diff changeset
3621
66164831c228 [gaim-migrate @ 2636]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2621
diff changeset
3622 void show_log(char *nm)
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3623 {
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3624 gchar filename[256];
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3625 gchar buf[BUF_LONG];
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3626 FILE *fp;
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3627 GtkWidget *window;
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3628 GtkWidget *box;
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3629 GtkWidget *hbox;
2602
c9192dea2bb1 [gaim-migrate @ 2615]
Rob Flynn <gaim@robflynn.com>
parents: 2598
diff changeset
3630 GtkWidget *bbox;
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3631 GtkWidget *sw;
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3632 GtkWidget *layout;
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3633 GtkWidget *close_button;
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3634 GtkWidget *clear_button;
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3635 GtkWidget *save_button;
2572
ad0d7c423669 [gaim-migrate @ 2585]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2571
diff changeset
3636 GtkWidget *list = NULL;
2612
7938953630fa [gaim-migrate @ 2625]
Rob Flynn <gaim@robflynn.com>
parents: 2607
diff changeset
3637 GList *item_list = NULL;
7938953630fa [gaim-migrate @ 2625]
Rob Flynn <gaim@robflynn.com>
parents: 2607
diff changeset
3638 GtkWidget *item = NULL;
7938953630fa [gaim-migrate @ 2625]
Rob Flynn <gaim@robflynn.com>
parents: 2607
diff changeset
3639 GtkWidget *last = NULL;
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3640 GtkWidget *frame;
2621
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3641 struct view_log *view;
2623
66164831c228 [gaim-migrate @ 2636]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2621
diff changeset
3642 char *name = nm ? g_strdup(nm) : NULL;
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3643
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3644 int options;
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3645 guint block;
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3646 char convo_start[32];
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3647 long offset = 0;
2612
7938953630fa [gaim-migrate @ 2625]
Rob Flynn <gaim@robflynn.com>
parents: 2607
diff changeset
3648 unsigned int i = 0;
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3649
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3650 options = GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_TITLE | GTK_IMHTML_NO_SCROLL;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2228
diff changeset
3651 if (convo_options & OPT_CONVO_IGNORE_COLOUR)
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3652 options ^= GTK_IMHTML_NO_COLOURS;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2228
diff changeset
3653 if (convo_options & OPT_CONVO_IGNORE_FONTS)
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3654 options ^= GTK_IMHTML_NO_FONTS;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2228
diff changeset
3655 if (convo_options & OPT_CONVO_IGNORE_SIZES)
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3656 options ^= GTK_IMHTML_NO_SIZES;
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3657
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3658 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
2623
66164831c228 [gaim-migrate @ 2636]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2621
diff changeset
3659 gtk_object_set_user_data(GTK_OBJECT(window), name);
66164831c228 [gaim-migrate @ 2636]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2621
diff changeset
3660 gtk_signal_connect(GTK_OBJECT(window), "destroy", GTK_SIGNAL_FUNC(des_log_win), NULL);
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3661 gtk_window_set_wmclass(GTK_WINDOW(window), "log", "Gaim");
1648
09445224e2d9 [gaim-migrate @ 1658]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1634
diff changeset
3662 if (name)
09445224e2d9 [gaim-migrate @ 1658]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1634
diff changeset
3663 g_snprintf(buf, BUF_LONG, "Gaim - Conversations with %s", name);
09445224e2d9 [gaim-migrate @ 1658]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1634
diff changeset
3664 else
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3665 g_snprintf(buf, BUF_LONG, "Gaim - System Log");
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3666 gtk_window_set_title(GTK_WINDOW(window), buf);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3667 gtk_container_set_border_width(GTK_CONTAINER(window), 10);
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3668 gtk_window_set_policy(GTK_WINDOW(window), TRUE, TRUE, TRUE);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3669 block = gtk_signal_connect(GTK_OBJECT(window), "delete_event",
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3670 GTK_SIGNAL_FUNC(dont_destroy), window);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3671 gtk_widget_realize(window);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3672 aol_icon(window->window);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3673
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3674 layout = gtk_imhtml_new(NULL, NULL);
2602
c9192dea2bb1 [gaim-migrate @ 2615]
Rob Flynn <gaim@robflynn.com>
parents: 2598
diff changeset
3675 bbox = gtk_hbox_new(FALSE, 0);
c9192dea2bb1 [gaim-migrate @ 2615]
Rob Flynn <gaim@robflynn.com>
parents: 2598
diff changeset
3676
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3677 box = gtk_vbox_new(FALSE, 5);
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3678 gtk_container_add(GTK_CONTAINER(window), box);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3679
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3680 hbox = gtk_hbox_new(FALSE, 5);
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3681 gtk_box_pack_start(GTK_BOX(box), hbox, TRUE, TRUE, 0);
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3682
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3683 if (name) {
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3684 char *tmp = gaim_user_dir();
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3685 g_snprintf(filename, 256, "%s/logs/%s.log", tmp, normalize(name));
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3686 g_free(tmp);
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3687 if ((fp = fopen(filename, "r")) == NULL) {
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3688 g_snprintf(buf, BUF_LONG, "Unable to open log file %s", filename);
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3689 do_error_dialog(buf, "Error!");
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3690 return;
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3691 }
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3692
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3693 list = gtk_list_new();
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3694
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3695 frame = gtk_frame_new(_("Date"));
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3696 gtk_widget_show(frame);
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3697
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3698 sw = gtk_scrolled_window_new(NULL, NULL);
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3699 gtk_container_set_border_width(GTK_CONTAINER(sw), 5);
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3700 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), list);
2613
6f7e1fc3e132 [gaim-migrate @ 2626]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2612
diff changeset
3701 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
6f7e1fc3e132 [gaim-migrate @ 2626]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2612
diff changeset
3702 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
2571
f25885510dd2 [gaim-migrate @ 2584]
Rob Flynn <gaim@robflynn.com>
parents: 2570
diff changeset
3703 gtk_widget_set_usize(sw, 220, 220);
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3704 gtk_container_add(GTK_CONTAINER(frame), sw);
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3705 gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 0);
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3706
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3707 while (fgets(buf, BUF_LONG, fp)) {
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3708 if (strstr(buf, "---- New C")) {
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3709 int length;
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3710 char *temp = strchr(buf, '@');
2612
7938953630fa [gaim-migrate @ 2625]
Rob Flynn <gaim@robflynn.com>
parents: 2607
diff changeset
3711
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3712 if (temp == NULL || strlen(temp) < 2)
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3713 continue;
2612
7938953630fa [gaim-migrate @ 2625]
Rob Flynn <gaim@robflynn.com>
parents: 2607
diff changeset
3714
2613
6f7e1fc3e132 [gaim-migrate @ 2626]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2612
diff changeset
3715 if (i == 1 && item_list) {
6f7e1fc3e132 [gaim-migrate @ 2626]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2612
diff changeset
3716 item_list = g_list_remove(item_list, last);
6f7e1fc3e132 [gaim-migrate @ 2626]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2612
diff changeset
3717 last = NULL;
2612
7938953630fa [gaim-migrate @ 2625]
Rob Flynn <gaim@robflynn.com>
parents: 2607
diff changeset
3718 }
7938953630fa [gaim-migrate @ 2625]
Rob Flynn <gaim@robflynn.com>
parents: 2607
diff changeset
3719
7938953630fa [gaim-migrate @ 2625]
Rob Flynn <gaim@robflynn.com>
parents: 2607
diff changeset
3720 i = 0;
7938953630fa [gaim-migrate @ 2625]
Rob Flynn <gaim@robflynn.com>
parents: 2607
diff changeset
3721
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3722 temp++;
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3723 length = strcspn(temp, "-");
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3724 if (length > 31) length = 31;
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3725
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3726 offset = ftell(fp);
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3727 g_snprintf(convo_start, length, "%s", temp);
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3728 item = gtk_list_item_new_with_label(convo_start);
2621
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3729 view = g_new0(struct view_log, 1);
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3730 view->options = options;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3731 view->offset = offset;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3732 view->name = g_strdup(name);
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3733 view->bbox = bbox;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3734 view->window = window;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3735 view->layout = layout;
2613
6f7e1fc3e132 [gaim-migrate @ 2626]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2612
diff changeset
3736 gtk_signal_connect(GTK_OBJECT(item), "select",
2621
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3737 GTK_SIGNAL_FUNC(log_show_convo), view);
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3738 gtk_signal_connect(GTK_OBJECT(item), "destroy",
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3739 GTK_SIGNAL_FUNC(des_view_item), view);
2612
7938953630fa [gaim-migrate @ 2625]
Rob Flynn <gaim@robflynn.com>
parents: 2607
diff changeset
3740 last = item;
7938953630fa [gaim-migrate @ 2625]
Rob Flynn <gaim@robflynn.com>
parents: 2607
diff changeset
3741 item_list = g_list_append(item_list, item);
2613
6f7e1fc3e132 [gaim-migrate @ 2626]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2612
diff changeset
3742
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3743 gtk_widget_show(item);
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3744 }
2612
7938953630fa [gaim-migrate @ 2625]
Rob Flynn <gaim@robflynn.com>
parents: 2607
diff changeset
3745 i++;
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3746 }
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3747 fclose(fp);
2613
6f7e1fc3e132 [gaim-migrate @ 2626]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2612
diff changeset
3748 if (i == 1 && item_list)
6f7e1fc3e132 [gaim-migrate @ 2626]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2612
diff changeset
3749 item_list = g_list_remove(item_list, item);
6f7e1fc3e132 [gaim-migrate @ 2626]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2612
diff changeset
3750
2612
7938953630fa [gaim-migrate @ 2625]
Rob Flynn <gaim@robflynn.com>
parents: 2607
diff changeset
3751 if (item_list)
2613
6f7e1fc3e132 [gaim-migrate @ 2626]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2612
diff changeset
3752 gtk_list_insert_items(GTK_LIST(list), item_list, 0 );
2612
7938953630fa [gaim-migrate @ 2625]
Rob Flynn <gaim@robflynn.com>
parents: 2607
diff changeset
3753 }
7938953630fa [gaim-migrate @ 2625]
Rob Flynn <gaim@robflynn.com>
parents: 2607
diff changeset
3754
2602
c9192dea2bb1 [gaim-migrate @ 2615]
Rob Flynn <gaim@robflynn.com>
parents: 2598
diff changeset
3755 gtk_signal_disconnect(GTK_OBJECT(window), block);
c9192dea2bb1 [gaim-migrate @ 2615]
Rob Flynn <gaim@robflynn.com>
parents: 2598
diff changeset
3756 gtk_signal_connect(GTK_OBJECT(window), "delete_event", GTK_SIGNAL_FUNC(destroy_dialog), window);
c9192dea2bb1 [gaim-migrate @ 2615]
Rob Flynn <gaim@robflynn.com>
parents: 2598
diff changeset
3757
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3758 frame = gtk_frame_new(_("Conversation"));
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3759 gtk_widget_show(frame);
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3760
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3761 sw = gtk_scrolled_window_new(NULL, NULL);
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3762 gtk_container_set_border_width(GTK_CONTAINER(sw), 5);
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3763 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3764 gtk_widget_set_usize(sw, 390, 220);
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3765 gtk_container_add(GTK_CONTAINER(frame), sw);
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3766 gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 0);
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3767
2827
51999a36c0b1 [gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2798
diff changeset
3768 gtk_signal_connect(GTK_OBJECT(layout), "url_clicked", GTK_SIGNAL_FUNC(open_url), NULL);
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3769 gtk_container_add(GTK_CONTAINER(sw), layout);
2906
538c58b43eff [gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2856
diff changeset
3770 GTK_LAYOUT(layout)->hadjustment->step_increment = 10.0;
538c58b43eff [gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2856
diff changeset
3771 GTK_LAYOUT(layout)->vadjustment->step_increment = 10.0;
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1805
diff changeset
3772 gaim_setup_imhtml(layout);
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3773
2602
c9192dea2bb1 [gaim-migrate @ 2615]
Rob Flynn <gaim@robflynn.com>
parents: 2598
diff changeset
3774 gtk_box_pack_start(GTK_BOX(box), bbox, FALSE, FALSE, 0);
c9192dea2bb1 [gaim-migrate @ 2615]
Rob Flynn <gaim@robflynn.com>
parents: 2598
diff changeset
3775 gtk_widget_set_sensitive(bbox, FALSE);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3776
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3777 close_button = picture_button(window, _("Close"), cancel_xpm);
2602
c9192dea2bb1 [gaim-migrate @ 2615]
Rob Flynn <gaim@robflynn.com>
parents: 2598
diff changeset
3778 gtk_box_pack_end(GTK_BOX(bbox), close_button, FALSE, FALSE, 5);
c9192dea2bb1 [gaim-migrate @ 2615]
Rob Flynn <gaim@robflynn.com>
parents: 2598
diff changeset
3779 gtk_signal_connect(GTK_OBJECT(close_button), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), window);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3780
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3781 clear_button = picture_button(window, _("Clear"), close_xpm);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3782 gtk_object_set_user_data(GTK_OBJECT(clear_button), window);
2602
c9192dea2bb1 [gaim-migrate @ 2615]
Rob Flynn <gaim@robflynn.com>
parents: 2598
diff changeset
3783 gtk_box_pack_end(GTK_BOX(bbox), clear_button, FALSE, FALSE, 5);
c9192dea2bb1 [gaim-migrate @ 2615]
Rob Flynn <gaim@robflynn.com>
parents: 2598
diff changeset
3784 gtk_signal_connect(GTK_OBJECT(clear_button), "clicked", GTK_SIGNAL_FUNC(show_clear_log), name);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3785
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3786 save_button = picture_button(window, _("Save"), save_xpm);
2602
c9192dea2bb1 [gaim-migrate @ 2615]
Rob Flynn <gaim@robflynn.com>
parents: 2598
diff changeset
3787 gtk_box_pack_end(GTK_BOX(bbox), save_button, FALSE, FALSE, 5);
c9192dea2bb1 [gaim-migrate @ 2615]
Rob Flynn <gaim@robflynn.com>
parents: 2598
diff changeset
3788 gtk_signal_connect(GTK_OBJECT(save_button), "clicked", GTK_SIGNAL_FUNC(show_save_log), name);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3789
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3790 gtk_widget_show_all(window);
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3791
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3792 if (!name) {
2621
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3793 view = g_new0(struct view_log, 1);
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3794 view->options = options;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3795 view->name = NULL;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3796 view->bbox = bbox;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3797 view->window = window;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3798 view->layout = layout;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3799 log_show_convo(layout, view);
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
3800 gtk_signal_connect(GTK_OBJECT(layout), "destroy", GTK_SIGNAL_FUNC(des_view_item), view);
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3801 } else {
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3802 gtk_list_select_item(GTK_LIST(list), 0);
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3803 }
2570
075011d08d1d [gaim-migrate @ 2583]
Rob Flynn <gaim@robflynn.com>
parents: 2564
diff changeset
3804
2602
c9192dea2bb1 [gaim-migrate @ 2615]
Rob Flynn <gaim@robflynn.com>
parents: 2598
diff changeset
3805 gtk_widget_set_sensitive(bbox, TRUE);
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3806
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3807 return;
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3808 }
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3809
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3810 /*------------------------------------------------------------------------*/
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3811 /* The dialog for renaming groups */
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3812 /*------------------------------------------------------------------------*/
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3813
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3814 static void do_rename_group(GtkObject *obj, GtkWidget *entry)
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3815 {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3816 char *new_name;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3817 struct group *g;
1748
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3818 struct group *orig;
1841
93f0629d4099 [gaim-migrate @ 1851]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
3819 struct gaim_connection *gc;
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3820
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3821 new_name = gtk_entry_get_text(GTK_ENTRY(entry));
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3822 g = gtk_object_get_user_data(obj);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3823
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3824 if (new_name && (strlen(new_name) != 0) && strcmp(new_name, g->name)) {
1748
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3825 char *prevname;
1841
93f0629d4099 [gaim-migrate @ 1851]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
3826 gc = g->gc;
1748
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3827 if ((orig = find_group(g->gc, new_name)) != NULL) {
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3828 orig->members = g_slist_concat(orig->members, g->members);
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3829 handle_group_rename(orig, g->name);
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3830 g->gc->groups = g_slist_remove(g->gc->groups, g);
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3831 /* FIXME, i don't like calling this. it's sloppy. */ build_edit_tree();
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3832 g_free(g);
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3833 } else {
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3834 prevname = g_strdup(g->name);
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3835 g_snprintf(g->name, sizeof(g->name), "%s", new_name);
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3836 handle_group_rename(g, prevname);
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3837 g_free(prevname);
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3838 }
1841
93f0629d4099 [gaim-migrate @ 1851]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
3839 do_export(gc);
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3840 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3841
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3842 destroy_dialog(rename_dialog, rename_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3843 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3844
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3845 void show_rename_group(GtkWidget *unused, struct group *g)
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3846 {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3847 GtkWidget *mainbox;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3848 GtkWidget *frame;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3849 GtkWidget *fbox;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3850 GtkWidget *bbox;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3851 GtkWidget *button;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3852 GtkWidget *name_entry;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3853 GtkWidget *label;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3854
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3855 if (!rename_dialog) {
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
3856 GAIM_DIALOG(rename_dialog);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3857 gtk_window_set_wmclass(GTK_WINDOW(rename_dialog), "rename_dialog", "Gaim");
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3858 gtk_window_set_policy(GTK_WINDOW(rename_dialog), FALSE, TRUE, TRUE);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3859 gtk_window_set_title(GTK_WINDOW(rename_dialog), _("Gaim - Rename Group"));
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3860 gtk_signal_connect(GTK_OBJECT(rename_dialog), "destroy",
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3861 GTK_SIGNAL_FUNC(destroy_dialog), rename_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3862 gtk_widget_realize(rename_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3863 aol_icon(rename_dialog->window);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3864
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3865 mainbox = gtk_vbox_new(FALSE, 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3866 gtk_container_set_border_width(GTK_CONTAINER(mainbox), 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3867 gtk_container_add(GTK_CONTAINER(rename_dialog), mainbox);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3868
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3869 frame = gtk_frame_new(_("Rename Group"));
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3870 gtk_box_pack_start(GTK_BOX(mainbox), frame, TRUE, TRUE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3871
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3872 fbox = gtk_hbox_new(FALSE, 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3873 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3874 gtk_container_add(GTK_CONTAINER(frame), fbox);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3875
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3876 label = gtk_label_new(_("New name:"));
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3877 gtk_box_pack_start(GTK_BOX(fbox), label, FALSE, FALSE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3878
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3879 name_entry = gtk_entry_new();
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3880 gtk_box_pack_start(GTK_BOX(fbox), name_entry, TRUE, TRUE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3881 gtk_object_set_user_data(GTK_OBJECT(name_entry), g);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3882 gtk_entry_set_text(GTK_ENTRY(name_entry), g->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3883 gtk_signal_connect(GTK_OBJECT(name_entry), "activate",
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3884 GTK_SIGNAL_FUNC(do_rename_group), name_entry);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3885 gtk_widget_grab_focus(name_entry);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3886
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3887 bbox = gtk_hbox_new(FALSE, 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3888 gtk_box_pack_start(GTK_BOX(mainbox), bbox, FALSE, FALSE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3889
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3890 button = picture_button(rename_dialog, _("Cancel"), cancel_xpm);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3891 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3892 gtk_signal_connect(GTK_OBJECT(button), "clicked",
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3893 GTK_SIGNAL_FUNC(destroy_dialog), rename_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3894
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3895 button = picture_button(rename_dialog, _("OK"), ok_xpm);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3896 gtk_object_set_user_data(GTK_OBJECT(button), g);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3897 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3898 gtk_signal_connect(GTK_OBJECT(button), "clicked",
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3899 GTK_SIGNAL_FUNC(do_rename_group), name_entry);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3900 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3901
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3902 gtk_widget_show_all(rename_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3903 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3904
2743
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
3905
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3906 /*------------------------------------------------------------------------*/
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3907 /* The dialog for renaming buddies */
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3908 /*------------------------------------------------------------------------*/
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3909
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3910 static void do_rename_buddy(GtkObject *obj, GtkWidget *entry)
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3911 {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3912 char *new_name;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3913 struct buddy *b;
2681
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3914 GSList *gr;
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3915
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3916 new_name = gtk_entry_get_text(GTK_ENTRY(entry));
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3917 b = gtk_object_get_user_data(obj);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3918
2681
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3919 if (!g_slist_find(connections, b->gc)) {
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3920 destroy_dialog(rename_bud_dialog, rename_bud_dialog);
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3921 return;
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3922 }
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3923
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3924 gr = b->gc->groups;
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3925 while (gr) {
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3926 if (g_slist_find(((struct group *)gr->data)->members, b))
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3927 break;
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3928 gr = gr->next;
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3929 }
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3930 if (!gr) {
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3931 destroy_dialog(rename_bud_dialog, rename_bud_dialog);
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3932 return;
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3933 }
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3934
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3935 if (new_name && (strlen(new_name) != 0) && strcmp(new_name, b->name)) {
2681
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3936 struct group *g = find_group_by_buddy(b->gc, b->name);
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3937 char *prevname = g_strdup(b->name);
2681
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3938 if (g)
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2679
diff changeset
3939 serv_remove_buddy(b->gc, b->name, g->name);
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3940 if (!strcmp(b->name, b->show))
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3941 g_snprintf(b->show, sizeof(b->show), "%s", new_name);
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3942 g_snprintf(b->name, sizeof(b->name), "%s", new_name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3943 serv_add_buddy(b->gc, b->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3944 handle_buddy_rename(b, prevname);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3945 g_free(prevname);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3946 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3947
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3948 destroy_dialog(rename_bud_dialog, rename_bud_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3949 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3950
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3951 void show_rename_buddy(GtkWidget *unused, struct buddy *b)
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3952 {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3953 GtkWidget *mainbox;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3954 GtkWidget *frame;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3955 GtkWidget *fbox;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3956 GtkWidget *bbox;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3957 GtkWidget *button;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3958 GtkWidget *name_entry;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3959 GtkWidget *label;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3960
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3961 if (!rename_bud_dialog) {
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
3962 GAIM_DIALOG(rename_bud_dialog);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3963 gtk_window_set_wmclass(GTK_WINDOW(rename_bud_dialog), "rename_bud_dialog", "Gaim");
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3964 gtk_window_set_policy(GTK_WINDOW(rename_bud_dialog), FALSE, TRUE, TRUE);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3965 gtk_window_set_title(GTK_WINDOW(rename_bud_dialog), _("Gaim - Rename Buddy"));
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3966 gtk_signal_connect(GTK_OBJECT(rename_bud_dialog), "destroy",
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3967 GTK_SIGNAL_FUNC(destroy_dialog), rename_bud_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3968 gtk_widget_realize(rename_bud_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3969 aol_icon(rename_bud_dialog->window);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3970
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3971 mainbox = gtk_vbox_new(FALSE, 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3972 gtk_container_set_border_width(GTK_CONTAINER(mainbox), 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3973 gtk_container_add(GTK_CONTAINER(rename_bud_dialog), mainbox);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3974
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3975 frame = gtk_frame_new(_("Rename Buddy"));
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3976 gtk_box_pack_start(GTK_BOX(mainbox), frame, TRUE, TRUE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3977
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3978 fbox = gtk_hbox_new(FALSE, 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3979 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3980 gtk_container_add(GTK_CONTAINER(frame), fbox);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3981
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3982 label = gtk_label_new(_("New name:"));
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3983 gtk_box_pack_start(GTK_BOX(fbox), label, FALSE, FALSE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3984
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3985 name_entry = gtk_entry_new();
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3986 gtk_box_pack_start(GTK_BOX(fbox), name_entry, TRUE, TRUE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3987 gtk_object_set_user_data(GTK_OBJECT(name_entry), b);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3988 gtk_entry_set_text(GTK_ENTRY(name_entry), b->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3989 gtk_signal_connect(GTK_OBJECT(name_entry), "activate",
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3990 GTK_SIGNAL_FUNC(do_rename_buddy), name_entry);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3991 gtk_widget_grab_focus(name_entry);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3992
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3993 bbox = gtk_hbox_new(FALSE, 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3994 gtk_box_pack_start(GTK_BOX(mainbox), bbox, FALSE, FALSE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3995
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3996 button = picture_button(rename_bud_dialog, _("Cancel"), cancel_xpm);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3997 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3998 gtk_signal_connect(GTK_OBJECT(button), "clicked",
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3999 GTK_SIGNAL_FUNC(destroy_dialog), rename_bud_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
4000
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
4001 button = picture_button(rename_bud_dialog, _("OK"), ok_xpm);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
4002 gtk_object_set_user_data(GTK_OBJECT(button), b);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
4003 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
4004 gtk_signal_connect(GTK_OBJECT(button), "clicked",
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
4005 GTK_SIGNAL_FUNC(do_rename_buddy), name_entry);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
4006 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
4007
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
4008 gtk_widget_show_all(rename_bud_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
4009 }
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4010
2377
466b29d35b85 [gaim-migrate @ 2390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
4011 #ifdef USE_PERL
466b29d35b85 [gaim-migrate @ 2390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
4012
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
4013 static GtkWidget *perl_config = NULL;
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4014 static char *perl_last_dir = NULL;
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4015
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
4016 static void cfdes(GtkWidget *m, gpointer n)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
4017 {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
4018 if (perl_config)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
4019 gtk_widget_destroy(perl_config);
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4020 perl_config = NULL;
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4021 }
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4022
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
4023 static void do_load(GtkWidget *m, gpointer n)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
4024 {
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4025 const char *file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(perl_config));
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4026 gchar *f = NULL;
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4027 if (!file || !strlen(file)) {
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4028 return;
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4029 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
4030
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4031 if (file_is_dir(file, perl_config)) {
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4032 return;
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4033 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
4034
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4035 if (perl_last_dir) {
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4036 g_free(perl_last_dir);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4037 }
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4038 perl_last_dir = g_dirname(file);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4039
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4040 debug_printf("Loading perl script: %s\n", file);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
4041
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4042 f = g_strdup(file);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4043 perl_load_file(f);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4044 g_free(f);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4045 cfdes(perl_config, NULL);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4046 }
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4047
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4048 void load_perl_script()
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4049 {
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4050 char *buf, *temp;
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4051
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4052 if (perl_config) {
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4053 gtk_widget_show(perl_config);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4054 gdk_window_raise(perl_config->window);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4055 return;
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4056 }
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4057
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4058 /* Below is basically stolen from plugins.c */
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4059 perl_config = gtk_file_selection_new(_("Gaim - Select Perl Script"));
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4060
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4061 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(perl_config));
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4062
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4063 if (!perl_last_dir) {
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4064 temp = gaim_user_dir();
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4065 buf = g_strconcat(temp, G_DIR_SEPARATOR_S, NULL);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4066 g_free(temp);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4067 } else {
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4068 buf = g_strconcat(perl_last_dir, G_DIR_SEPARATOR_S, NULL);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4069 }
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4070
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4071 gtk_file_selection_set_filename(GTK_FILE_SELECTION(perl_config), buf);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
4072 gtk_file_selection_complete(GTK_FILE_SELECTION(perl_config), "*.pl");
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
4073 gtk_signal_connect(GTK_OBJECT(perl_config), "destroy", GTK_SIGNAL_FUNC(cfdes), perl_config);
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4074
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4075 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(perl_config)->ok_button),
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
4076 "clicked", GTK_SIGNAL_FUNC(do_load), NULL);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
4077
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4078 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(perl_config)->cancel_button),
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
4079 "clicked", GTK_SIGNAL_FUNC(cfdes), NULL);
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4080
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4081 g_free(buf);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4082 gtk_widget_show(perl_config);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4083 gdk_window_raise(perl_config->window);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
4084 }
2377
466b29d35b85 [gaim-migrate @ 2390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
4085
466b29d35b85 [gaim-migrate @ 2390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
4086 #endif /* USE_PERL */
2379
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4087
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4088 static GdkPixmap *icon_pm = NULL;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4089 static GdkBitmap *icon_bm = NULL;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4090
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4091 void aol_icon(GdkWindow *w)
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4092 {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4093 #ifndef _WIN32
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4094 if (icon_pm == NULL) {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4095 icon_pm = gdk_pixmap_create_from_xpm_d(w, &icon_bm, NULL, (gchar **)aimicon_xpm);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4096 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4097 gdk_window_set_icon(w, NULL, icon_pm, icon_bm);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4098 if (mainwindow)
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4099 gdk_window_set_group(w, mainwindow->window);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4100 #endif
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4101 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4102
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4103 GtkWidget *picture_button(GtkWidget *window, char *text, char **xpm)
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4104 {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4105 GtkWidget *button;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4106 GtkWidget *button_box, *button_box_2, *button_box_3;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4107 GtkWidget *label;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4108 GdkBitmap *mask;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4109 GdkPixmap *pm;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4110 GtkWidget *pixmap;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4111
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4112 button = gtk_button_new();
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4113 if (misc_options & OPT_MISC_COOL_LOOK)
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4114 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4115
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4116 button_box = gtk_hbox_new(FALSE, 5);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4117 gtk_container_add(GTK_CONTAINER(button), button_box);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4118
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4119 button_box_2 = gtk_hbox_new(FALSE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4120 button_box_3 = gtk_hbox_new(FALSE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4121 gtk_box_pack_start(GTK_BOX(button_box), button_box_2, TRUE, TRUE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4122 gtk_box_pack_start(GTK_BOX(button_box), button_box_3, TRUE, TRUE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4123 pm = gdk_pixmap_create_from_xpm_d(window->window, &mask, NULL, xpm);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4124 pixmap = gtk_pixmap_new(pm, mask);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4125 gtk_box_pack_end(GTK_BOX(button_box_2), pixmap, FALSE, FALSE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4126
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4127 if (text) {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4128 label = gtk_label_new(text);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4129 gtk_box_pack_start(GTK_BOX(button_box_3), label, FALSE, FALSE, 2);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4130 gtk_widget_show(label);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4131 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4132
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4133 gtk_widget_show(pixmap);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4134 gtk_widget_show(button_box_2);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4135 gtk_widget_show(button_box_3);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4136 gtk_widget_show(button_box);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4137
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4138 /* this causes clipping on lots of buttons with long text */
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4139 /* gtk_widget_set_usize(button, 75, 30);*/
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4140 gtk_widget_show(button);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4141 gdk_pixmap_unref(pm);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4142 gdk_bitmap_unref(mask);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4143
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4144 return button;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4145 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4146
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4147 static GtkTooltips *button_tips = NULL;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4148 GtkWidget *picture_button2(GtkWidget *window, char *text, char **xpm, short dispstyle)
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4149 {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4150 GtkWidget *button;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4151 GtkWidget *button_box, *button_box_2;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4152 GdkBitmap *mask;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4153 GdkPixmap *pm;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4154 GtkWidget *pixmap;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4155 GtkWidget *label;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4156
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4157 if (!button_tips)
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4158 button_tips = gtk_tooltips_new();
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4159 button = gtk_button_new();
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4160 if (misc_options & OPT_MISC_COOL_LOOK)
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4161 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4162
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4163 button_box = gtk_hbox_new(FALSE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4164 gtk_container_add(GTK_CONTAINER(button), button_box);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4165
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4166 button_box_2 = gtk_vbox_new(FALSE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4167
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4168 gtk_box_pack_start(GTK_BOX(button_box), button_box_2, TRUE, TRUE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4169 gtk_widget_show(button_box_2);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4170 gtk_widget_show(button_box);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4171 if (dispstyle == 2 || dispstyle == 0) {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4172 pm = gdk_pixmap_create_from_xpm_d(window->window, &mask, NULL, xpm);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4173 pixmap = gtk_pixmap_new(pm, mask);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4174 gtk_box_pack_start(GTK_BOX(button_box_2), pixmap, FALSE, FALSE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4175
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4176 gtk_widget_show(pixmap);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4177
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4178 gdk_pixmap_unref(pm);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4179 gdk_bitmap_unref(mask);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4180 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4181
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4182 if (dispstyle == 2 || dispstyle == 1) {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4183 label = gtk_label_new(text);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4184 gtk_widget_show(label);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4185 gtk_box_pack_end(GTK_BOX(button_box_2), label, FALSE, FALSE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4186 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4187
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4188 gtk_tooltips_set_tip(button_tips, button, text, "Gaim");
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4189 gtk_widget_show(button);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4190 return button;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4191 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4192
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4193 int file_is_dir(const char *path, GtkWidget *w)
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4194 {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4195 struct stat st;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4196 char *name;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4197
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4198 if (stat(path, &st) == 0 && S_ISDIR(st.st_mode)) {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4199 /* append a / if needed */
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4200 if (path[strlen(path) - 1] != '/') {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4201 name = g_strconcat(path, "/", NULL);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4202 } else {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4203 name = g_strdup(path);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4204 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4205 gtk_file_selection_set_filename(GTK_FILE_SELECTION(w), name);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4206 g_free(name);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4207 return 1;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4208 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4209
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4210 return 0;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
4211 }