annotate src/away.c @ 157:aad89d9bce85

[gaim-migrate @ 167] Uh huh committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 24 Apr 2000 03:06:25 +0000
parents 4e91b92f91a7
children 83dd297aa363
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
22 #ifdef USE_APPLET
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
23 #include <gnome.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
24 #include <applet-widget.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
25 #include "gnome_applet_mgr.h"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
26 #endif /* USE_APPLET */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
27 #include <string.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
28 #include <stdio.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
29 #include <stdlib.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
30 #include <time.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
31
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
32 #include <gtk/gtk.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
33 #include "gaim.h"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
34
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
35 GtkWidget *imaway=NULL;
84
51943f1a97a0 [gaim-migrate @ 94]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
36 #ifdef USE_APPLET
51943f1a97a0 [gaim-migrate @ 94]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
37 extern enum gaim_user_states MRI_user_status;
51943f1a97a0 [gaim-migrate @ 94]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
38 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
39
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
40 GtkWidget *awaymenu;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
41 struct away_message *awaymessage = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
42
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
43 static void destroy_im_away()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
44 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
45 if (imaway)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
46 gtk_widget_destroy(imaway);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
47 imaway=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
48 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
49
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
50 void do_im_back(GtkWidget *w, GtkWidget *x)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
51 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
52 #ifdef USE_APPLET
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
53 if(!blist) applet_widget_unregister_callback(APPLET_WIDGET(applet),"buddy");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
54 applet_widget_unregister_callback(APPLET_WIDGET(applet),"away");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
55 if(!blist) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
56 applet_widget_register_callback(APPLET_WIDGET(applet),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
57 "buddy",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
58 _("Buddy List"),
107
55faf2e3a134 [gaim-migrate @ 117]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 84
diff changeset
59 (AppletCallbackFunc)createOnlinePopup,
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
60 NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
61 }
84
51943f1a97a0 [gaim-migrate @ 94]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
62 MRI_user_status = online;
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
63 insert_applet_away();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
64 #endif /* USE_APPLET */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
65 if (imaway) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
66 gtk_widget_destroy(imaway);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
67 imaway=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
68 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
69
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
70 serv_set_away(NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
71 awaymessage = NULL;
136
4e91b92f91a7 [gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 133
diff changeset
72 #ifdef GAIM_PLUGINS
4e91b92f91a7 [gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 133
diff changeset
73 {
4e91b92f91a7 [gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 133
diff changeset
74 GList *c = callbacks;
4e91b92f91a7 [gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 133
diff changeset
75 struct gaim_callback *g;
4e91b92f91a7 [gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 133
diff changeset
76 void (*function)(void *);
4e91b92f91a7 [gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 133
diff changeset
77 while (c) {
4e91b92f91a7 [gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 133
diff changeset
78 g = (struct gaim_callback *)c->data;
4e91b92f91a7 [gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 133
diff changeset
79 if (g->event == event_back && g->function != NULL) {
4e91b92f91a7 [gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 133
diff changeset
80 function = g->function;
4e91b92f91a7 [gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 133
diff changeset
81 (*function)(g->data);
4e91b92f91a7 [gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 133
diff changeset
82 }
4e91b92f91a7 [gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 133
diff changeset
83 c = c->next;
4e91b92f91a7 [gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 133
diff changeset
84 }
4e91b92f91a7 [gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 133
diff changeset
85 }
4e91b92f91a7 [gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 133
diff changeset
86 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
87 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
88
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
89 void do_away_message(GtkWidget *w, struct away_message *a)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
90 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
91 GtkWidget *back;
136
4e91b92f91a7 [gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 133
diff changeset
92 GtkWidget *awaytext;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
93 GtkWidget *vscrollbar;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
94 GtkWidget *bbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
95 GtkWidget *vbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
96 GtkWidget *topbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
97 char *buf2;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
98 char buf[BUF_LONG];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
99 GList *cnv = conversations;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
100 struct conversation *c;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
101
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
102 #ifdef USE_APPLET
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
103 if(!blist) applet_widget_unregister_callback(APPLET_WIDGET(applet),"buddy");
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
104 remove_applet_away();
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
105 if(!blist) applet_widget_register_callback(APPLET_WIDGET(applet),
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
106 "buddy",
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
107 _("Buddy List"),
107
55faf2e3a134 [gaim-migrate @ 117]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 84
diff changeset
108 (AppletCallbackFunc)createOnlinePopup,
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
109 NULL);
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
110 applet_widget_register_callback(APPLET_WIDGET(applet),
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
111 "away",
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
112 _("Back"),
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
113 (AppletCallbackFunc) do_im_back,
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
114 NULL);
84
51943f1a97a0 [gaim-migrate @ 94]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
115 MRI_user_status = away;
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
116 #endif
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
117
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
118 if (!imaway) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
119 imaway = gtk_window_new(GTK_WINDOW_DIALOG);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
120 gtk_widget_realize(imaway);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
121 aol_icon(imaway->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
122 back = gtk_button_new_with_label("I'm Back!");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
123 bbox = gtk_hbox_new(TRUE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
124 topbox = gtk_hbox_new(FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
125 vbox = gtk_vbox_new(FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
126
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
127 awaytext = gtk_text_new(NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
128 g_snprintf(buf, sizeof(buf), "%s", a->message);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
129 vscrollbar = gtk_vscrollbar_new(GTK_TEXT(awaytext)->vadj);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
130 gtk_widget_show(vscrollbar);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
131 gtk_widget_set_usize(awaytext, 225, 75);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
132 gtk_text_set_word_wrap(GTK_TEXT(awaytext), TRUE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
133 gtk_widget_show(awaytext);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
134 gtk_text_freeze(GTK_TEXT(awaytext));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
135 gtk_text_insert(GTK_TEXT(awaytext), NULL, NULL, NULL, buf, -1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
136 gtk_widget_show(awaytext);
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 /* Put the buttons in the box */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
140 gtk_box_pack_start(GTK_BOX(bbox), back, TRUE, TRUE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
141
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
142 gtk_box_pack_start(GTK_BOX(topbox), awaytext, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
143
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
144 /* And the boxes in the box */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
145 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
146 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
147
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
148 /* Handle closes right */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
149 gtk_signal_connect(GTK_OBJECT(imaway), "destroy",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
150 GTK_SIGNAL_FUNC(destroy_im_away), imaway);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
151 gtk_signal_connect(GTK_OBJECT(back), "clicked",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
152 GTK_SIGNAL_FUNC(do_im_back), imaway);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
153
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
154 /* Finish up */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
155 gtk_widget_show(back);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
156 gtk_widget_show(topbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
157 gtk_widget_show(bbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
158 gtk_widget_show(vbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
159 if (strlen(a->name))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
160 gtk_window_set_title(GTK_WINDOW(imaway), a->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
161 else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
162 gtk_window_set_title(GTK_WINDOW(imaway), "Gaim - Away!");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
163 gtk_window_set_focus(GTK_WINDOW(imaway), back);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
164 gtk_container_add(GTK_CONTAINER(imaway), vbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
165 awaymessage = a;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
166
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
167 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
168
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
169 /* New away message... Clear out the old sent_aways */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
170 while(cnv) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
171 c = (struct conversation *)cnv->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
172 c->sent_away = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
173 cnv = cnv->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
174 }
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
79
bfdc427b936d [gaim-migrate @ 89]
Rob Flynn <gaim@robflynn.com>
parents: 22
diff changeset
177 buf2 = g_malloc(strlen(awaymessage->message)*4 + 1);
bfdc427b936d [gaim-migrate @ 89]
Rob Flynn <gaim@robflynn.com>
parents: 22
diff changeset
178 strcpy(buf2, awaymessage->message);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
179 escape_text(buf2);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
180 serv_set_away(buf2);
79
bfdc427b936d [gaim-migrate @ 89]
Rob Flynn <gaim@robflynn.com>
parents: 22
diff changeset
181 g_free(buf2);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
182 gtk_widget_show(imaway);
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
183 #ifdef GAIM_PLUGINS
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
184 {
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
185 GList *c = callbacks;
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
186 struct gaim_callback *g;
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
187 void (*function)(void *);
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
188 while (c) {
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
189 g = (struct gaim_callback *)c->data;
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
190 if (g->event == event_away && g->function != NULL) {
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
191 function = g->function;
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
192 (*function)(g->data);
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
193 }
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
194 c = c->next;
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
195 }
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
196 }
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
197 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
198 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
199
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
200 void rem_away_mess(GtkWidget *w, struct away_message *a)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
201 {
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
202 #ifdef USE_APPLET
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
203 char *awayname;
79
bfdc427b936d [gaim-migrate @ 89]
Rob Flynn <gaim@robflynn.com>
parents: 22
diff changeset
204 awayname = g_malloc(sizeof (*awayname) * (6 + strlen(a->name)));
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
205 awayname[0] = '\0';
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
206 strcat(awayname, "away/");
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
207 strcat(awayname, a->name);
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
208 applet_widget_unregister_callback(APPLET_WIDGET(applet), awayname);
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
209 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
210 away_messages = g_list_remove(away_messages, a);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
211 g_free(a);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
212 do_away_menu();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
213 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
214
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
215
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
216 void do_away_menu()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
217 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
218 GtkWidget *menuitem;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
219 static GtkWidget *remmenu;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
220 GtkWidget *remitem;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
221 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
222 GtkWidget *sep;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
223 GList *l;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
224 GtkWidget *list_item;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
225 GList *awy = away_messages;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
226 struct away_message *a;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
227
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
228 #ifdef USE_APPLET
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
229 remove_applet_away();
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
230 if (imaway)
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
231 applet_widget_register_callback(APPLET_WIDGET(applet),
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
232 "away",
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
233 _("Back"),
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
234 (AppletCallbackFunc)do_im_back,
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
235 NULL);
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
236 else
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
237 insert_applet_away();
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
238 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
239
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
240 if (pd != NULL) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
241 gtk_list_clear_items(GTK_LIST(pd->away_list), 0, -1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
242 while(awy) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
243 a = (struct away_message *)awy->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
244 label = gtk_label_new(a->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
245 list_item = gtk_list_item_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
246 gtk_container_add(GTK_CONTAINER(list_item), label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
247 gtk_signal_connect(GTK_OBJECT(list_item), "select", GTK_SIGNAL_FUNC(away_list_clicked), a);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
248 gtk_signal_connect(GTK_OBJECT(list_item), "deselect", GTK_SIGNAL_FUNC(away_list_unclicked), a);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
249 gtk_object_set_user_data(GTK_OBJECT(list_item), a);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
250
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
251 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
252 gtk_container_add(GTK_CONTAINER(pd->away_list), list_item);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
253 gtk_widget_show(list_item);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
254
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
255 awy = awy->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
256 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
257 if (away_messages != NULL)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
258 gtk_list_select_item(GTK_LIST(pd->away_list), 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
259 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
260
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
261
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
262 l = gtk_container_children(GTK_CONTAINER(awaymenu));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
263
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
264 while(l) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
265 gtk_widget_destroy(GTK_WIDGET(l->data));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
266 l = l->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
267 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
268
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
269
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
270 remmenu = gtk_menu_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
271
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
272
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
273
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
274 menuitem = gtk_menu_item_new_with_label("New Away Message");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
275 gtk_menu_append(GTK_MENU(awaymenu), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
276 gtk_widget_show(menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
277 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(create_away_mess), NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
278
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
279
22
e23783a60a7f [gaim-migrate @ 31]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 18
diff changeset
280 awy = away_messages;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
281 while(awy) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
282 a = (struct away_message *)awy->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
283
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
284 remitem = gtk_menu_item_new_with_label(a->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
285 gtk_menu_append(GTK_MENU(remmenu), remitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
286 gtk_widget_show(remitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
287 gtk_signal_connect(GTK_OBJECT(remitem), "activate", GTK_SIGNAL_FUNC(rem_away_mess), a);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
288
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
289 awy = awy->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
290
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
291 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
292
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
293 menuitem = gtk_menu_item_new_with_label("Remove Away Message");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
294 gtk_menu_append(GTK_MENU(awaymenu), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
295 gtk_widget_show(menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
296 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), remmenu);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
297 gtk_widget_show(remmenu);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
298
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
299
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
300 sep = gtk_hseparator_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
301 menuitem = gtk_menu_item_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
302 gtk_menu_append(GTK_MENU(awaymenu), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
303 gtk_container_add(GTK_CONTAINER(menuitem), sep);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
304 gtk_widget_set_sensitive(menuitem, FALSE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
305 gtk_widget_show(menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
306 gtk_widget_show(sep);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
307
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
308 awy = away_messages;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
309
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
310 while(awy) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
311 a = (struct away_message *)awy->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
312
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
313 menuitem = gtk_menu_item_new_with_label(a->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
314 gtk_menu_append(GTK_MENU(awaymenu), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
315 gtk_widget_show(menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
316 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(do_away_message), a);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
317
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
318 awy = awy->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
319
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
320 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
321
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
322 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
323
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
324
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
325
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
326
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
327
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
328