Mercurial > pidgin
annotate plugins/lagmeter.c @ 2351:4e2d8992774e
[gaim-migrate @ 2364]
handle jabber better. sigh.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sun, 23 Sep 2001 20:32:16 +0000 |
parents | c9c20663e05b |
children | abdf5f081b29 |
rev | line source |
---|---|
193 | 1 #define GAIM_PLUGINS |
2 #include "gaim.h" | |
2351
4e2d8992774e
[gaim-migrate @ 2364]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
3 #include "prpl.h" |
193 | 4 |
5 #include <time.h> | |
6 #include <sys/types.h> | |
7 #include <sys/time.h> | |
1167
5d1ded9f88b7
[gaim-migrate @ 1177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1122
diff
changeset
|
8 #include <string.h> |
193 | 9 #include <unistd.h> |
10 #include <math.h> | |
11 | |
12 #define MY_LAG_STRING "ZYXCHECKLAGXYZ" | |
13 | |
1122
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
14 GModule *handle; |
1377
569835fcabc3
[gaim-migrate @ 1387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1295
diff
changeset
|
15 GtkWidget *lagbox = NULL; |
193 | 16 GtkWidget *my_lagometer; |
17 struct timeval my_lag_tv; | |
1122
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
18 guint check_timeout = 0; |
193 | 19 guint delay = 10; |
1377
569835fcabc3
[gaim-migrate @ 1387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1295
diff
changeset
|
20 static GtkWidget *confdlg = NULL; |
1122
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
21 struct gaim_connection *my_gc = NULL; |
193 | 22 |
1122
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
23 static void avail_now(struct gaim_connection *, void *); |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
24 |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
25 static void update_lag(int us) { |
193 | 26 double pct; |
27 | |
28 if (lagbox == NULL) { | |
29 /* guess we better build it then :P */ | |
30 GtkWidget *label = gtk_label_new("Lag-O-Meter: "); | |
31 GList *tmp = gtk_container_children(GTK_CONTAINER(blist)); | |
32 GtkWidget *vbox2 = (GtkWidget *)tmp->data; | |
33 lagbox = gtk_hbox_new(FALSE, 0); | |
34 my_lagometer = gtk_progress_bar_new(); | |
35 | |
36 gtk_box_pack_start(GTK_BOX(lagbox), label, FALSE, FALSE, 5); | |
37 gtk_box_pack_start(GTK_BOX(lagbox), my_lagometer, TRUE, TRUE, 5); | |
38 gtk_widget_set_usize(my_lagometer, 5, 5); | |
39 | |
40 gtk_widget_show(label); | |
41 gtk_widget_show(my_lagometer); | |
42 | |
43 gtk_box_pack_start(GTK_BOX(vbox2), lagbox, FALSE, TRUE, 0); | |
44 gtk_box_reorder_child(GTK_BOX(vbox2), lagbox, 1); | |
45 gtk_widget_show(lagbox); | |
46 } | |
47 | |
48 pct = us/100000; | |
49 if (pct > 0) | |
50 pct = 25 * log(pct); | |
51 if (pct < 0) | |
52 pct = 0; | |
53 if (pct > 100) | |
54 pct = 100; | |
55 pct /= 100; | |
56 | |
57 gtk_progress_bar_update(GTK_PROGRESS_BAR(my_lagometer), pct); | |
58 } | |
59 | |
1122
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
60 static void check_lag(struct gaim_connection *gc, char **who, char **message, void *m) { |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
61 char *name; |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
62 if (gc != my_gc) |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
63 return; |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
64 |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
65 name = g_strdup(normalize(*who)); |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
983
diff
changeset
|
66 if (!strcasecmp(normalize(gc->username), name) && |
983 | 67 (*message != NULL) && |
193 | 68 !strcmp(*message, MY_LAG_STRING)) { |
69 struct timeval tv; | |
70 int ms; | |
71 | |
72 gettimeofday(&tv, NULL); | |
73 | |
74 ms = 1000000 * (tv.tv_sec - my_lag_tv.tv_sec); | |
75 | |
76 ms += tv.tv_usec - my_lag_tv.tv_usec; | |
77 | |
78 update_lag(ms); | |
79 *message = NULL; | |
80 } | |
81 g_free(name); | |
82 } | |
83 | |
1377
569835fcabc3
[gaim-migrate @ 1387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1295
diff
changeset
|
84 static gint send_lag() { |
193 | 85 gettimeofday(&my_lag_tv, NULL); |
1377
569835fcabc3
[gaim-migrate @ 1387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1295
diff
changeset
|
86 if (g_slist_find(connections, my_gc)) { |
1295
13e68fb13744
[gaim-migrate @ 1305]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1167
diff
changeset
|
87 char *m = g_strdup(MY_LAG_STRING); |
2351
4e2d8992774e
[gaim-migrate @ 2364]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
88 if (my_gc->protocol == PROTO_JABBER) { |
4e2d8992774e
[gaim-migrate @ 2364]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
89 if (!strchr(my_gc->username, '@')) { |
4e2d8992774e
[gaim-migrate @ 2364]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
90 char buf = g_strconcat(my_gc->username, "@jabber.org/GAIM", NULL); |
4e2d8992774e
[gaim-migrate @ 2364]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
91 serv_send_im(my_gc, buf, m, 1); |
4e2d8992774e
[gaim-migrate @ 2364]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
92 g_free(buf); |
4e2d8992774e
[gaim-migrate @ 2364]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
93 } else if (!strchr(my_gc->username, '/')) { |
4e2d8992774e
[gaim-migrate @ 2364]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
94 char buf = g_strconcat(my_gc->username, "@jabber.org/GAIM", NULL); |
4e2d8992774e
[gaim-migrate @ 2364]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
95 serv_send_im(my_gc, buf, m, 1); |
4e2d8992774e
[gaim-migrate @ 2364]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
96 g_free(buf); |
4e2d8992774e
[gaim-migrate @ 2364]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
97 } else |
4e2d8992774e
[gaim-migrate @ 2364]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
98 serv_send_im(my_gc, my_gc->username, m, 1); |
4e2d8992774e
[gaim-migrate @ 2364]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
99 } else |
4e2d8992774e
[gaim-migrate @ 2364]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
100 serv_send_im(my_gc, my_gc->username, m, 1); |
1295
13e68fb13744
[gaim-migrate @ 1305]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1167
diff
changeset
|
101 g_free(m); |
1122
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
102 return TRUE; |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
103 } else { |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
104 debug_printf("LAGMETER: send_lag called for connection that no longer exists\n"); |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
105 check_timeout = 0; |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
106 return FALSE; |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
107 } |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
108 } |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
109 |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
110 static void got_signoff(struct gaim_connection *gc, void *m) { |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
111 if (gc != my_gc) |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
112 return; |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
113 |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
114 if (check_timeout > 0) |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
115 gtk_timeout_remove(check_timeout); |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
116 check_timeout = 0; |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
117 |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
118 if (confdlg) |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
119 gtk_widget_destroy(confdlg); |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
120 confdlg = NULL; |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
121 |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
122 if (lagbox) |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
123 gtk_widget_destroy(lagbox); |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
124 lagbox = NULL; |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
125 |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
126 if (g_slist_length(connections) > 1) { |
1377
569835fcabc3
[gaim-migrate @ 1387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1295
diff
changeset
|
127 if (connections->data == my_gc) { |
569835fcabc3
[gaim-migrate @ 1387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1295
diff
changeset
|
128 my_gc = NULL; |
1122
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
129 avail_now(connections->next->data, NULL); |
1377
569835fcabc3
[gaim-migrate @ 1387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1295
diff
changeset
|
130 } else { |
569835fcabc3
[gaim-migrate @ 1387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1295
diff
changeset
|
131 my_gc = NULL; |
1122
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
132 avail_now(connections->data, NULL); |
1377
569835fcabc3
[gaim-migrate @ 1387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1295
diff
changeset
|
133 } |
1122
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
134 } else { |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
135 my_gc = NULL; |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
136 } |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
137 } |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
138 |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
139 static void avail_now(struct gaim_connection *gc, void *m) { |
1377
569835fcabc3
[gaim-migrate @ 1387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1295
diff
changeset
|
140 if (my_gc) |
569835fcabc3
[gaim-migrate @ 1387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1295
diff
changeset
|
141 return; |
1122
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
142 update_lag(0); |
1377
569835fcabc3
[gaim-migrate @ 1387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1295
diff
changeset
|
143 check_timeout = gtk_timeout_add(1000 * delay, (GtkFunction)send_lag, NULL); |
1122
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
144 my_gc = gc; |
193 | 145 } |
146 | |
147 void gaim_plugin_remove() { | |
1122
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
148 if (check_timeout > 0) |
848
5f19ec4a91f7
[gaim-migrate @ 858]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
193
diff
changeset
|
149 gtk_timeout_remove(check_timeout); |
1122
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
150 check_timeout = 0; |
193 | 151 if (confdlg) |
152 gtk_widget_destroy(confdlg); | |
983 | 153 if (lagbox) |
154 gtk_widget_destroy(lagbox); | |
155 | |
193 | 156 confdlg = NULL; |
983 | 157 lagbox = NULL; |
1122
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
158 my_gc = NULL; |
193 | 159 } |
160 | |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
161 char *gaim_plugin_init(GModule *h) { |
193 | 162 handle = h; |
163 | |
983 | 164 confdlg = NULL; |
165 lagbox = NULL; | |
1377
569835fcabc3
[gaim-migrate @ 1387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1295
diff
changeset
|
166 my_gc = NULL; |
983 | 167 |
1377
569835fcabc3
[gaim-migrate @ 1387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1295
diff
changeset
|
168 gaim_signal_connect(handle, event_signon, avail_now, NULL); |
1122
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
169 gaim_signal_connect(handle, event_im_recv, check_lag, NULL); |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
170 gaim_signal_connect(handle, event_signoff, got_signoff, NULL); |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
171 |
1377
569835fcabc3
[gaim-migrate @ 1387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1295
diff
changeset
|
172 if (connections) |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
983
diff
changeset
|
173 avail_now(connections->data, NULL); |
1073
6b013aff4de3
[gaim-migrate @ 1083]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
174 |
6b013aff4de3
[gaim-migrate @ 1083]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
175 return NULL; |
193 | 176 } |
177 | |
1122
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
178 static void adjust_timeout(GtkWidget *button, GtkWidget *spinner) { |
193 | 179 delay = CLAMP(gtk_spin_button_get_value_as_int( |
180 GTK_SPIN_BUTTON(spinner)), 0, 3600); | |
1122
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
181 debug_printf("LAGMETER: new updates: %d\n", delay); |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
182 if (check_timeout > 0) |
848
5f19ec4a91f7
[gaim-migrate @ 858]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
193
diff
changeset
|
183 gtk_timeout_remove(check_timeout); |
1122
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
184 check_timeout = 0; |
889ca2b8697b
[gaim-migrate @ 1132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1073
diff
changeset
|
185 if (my_gc) |
1377
569835fcabc3
[gaim-migrate @ 1387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1295
diff
changeset
|
186 check_timeout = gtk_timeout_add(1000 * delay, (GtkFunction)send_lag, NULL); |
193 | 187 gtk_widget_destroy(confdlg); |
188 confdlg = NULL; | |
189 } | |
190 | |
191 void gaim_plugin_config() { | |
192 GtkWidget *label; | |
193 GtkAdjustment *adj; | |
194 GtkWidget *spinner; | |
195 GtkWidget *button; | |
196 GtkWidget *box; | |
197 | |
198 if (confdlg) { | |
983 | 199 gtk_widget_show_all(confdlg); |
193 | 200 return; |
201 } | |
202 | |
1956
c9c20663e05b
[gaim-migrate @ 1966]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1943
diff
changeset
|
203 confdlg = gtk_window_new(GTK_WINDOW_DIALOG); |
193 | 204 gtk_window_set_title(GTK_WINDOW(confdlg), "Gaim Lag Delay"); |
205 | |
206 box = gtk_hbox_new(FALSE, 0); | |
207 gtk_container_set_border_width(GTK_CONTAINER(box), 5); | |
208 gtk_container_add(GTK_CONTAINER(confdlg), box); | |
209 | |
210 label = gtk_label_new("Delay between updates: "); | |
211 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
212 gtk_box_pack_start(GTK_BOX(box), label, FALSE, TRUE, 0); | |
213 | |
214 adj = (GtkAdjustment *)gtk_adjustment_new(delay, 0, 3600, 1, 0, 0); | |
215 spinner = gtk_spin_button_new(GTK_ADJUSTMENT(adj), 0, 0); | |
216 gtk_box_pack_start(GTK_BOX(box), spinner, TRUE, TRUE, 0); | |
217 | |
218 button = gtk_button_new_with_label("OK"); | |
219 gtk_signal_connect(GTK_OBJECT(button), "clicked", | |
220 (GtkSignalFunc)adjust_timeout, spinner); | |
221 gtk_box_pack_start(GTK_BOX(box), button, FALSE, TRUE, 0); | |
222 | |
983 | 223 gtk_widget_show_all(confdlg); |
193 | 224 } |
225 | |
226 char *name() { | |
227 return "Lag-O-Meter, Pluggified"; | |
228 } | |
229 | |
230 char *description() { | |
231 return "Your old familiar Lag-O-Meter, in a brand new form."; | |
232 } |