Mercurial > pidgin
annotate plugins/iconaway.c @ 5129:c19cc54f4df6
[gaim-migrate @ 5492]
Stuff I did (in order from most important to least):
-Made set away message and set profile count the number of bytes
rather than the number of characters. This fixes the lack of a
warning dialog when setting info that needs an encoding other than
ascii or iso8859-1. (Because "hi" in UCS-2BE is 4 bytes but "hi"
in utf8 is only 2.)
-Created an oscar_encoding_to_utf8 function to convert from a given
encoding to utf8. This is AIM/ICQ specific.
-Added a "Profile:" and "Away Message:" line to the get info response
window. Is it better this way or without it? I thought it would be
good if there was a way for users to tell which text was the away
message and which was the info, but I also think this solution could
be nicer looking.
-Added a little check for some server icon stuff because someone
reported an obscure crash.
-Shuffled some stuff around in oscar.c
-Bouldered on the little wall outside of the gym today. It's much
more difficult than climbing inside. I think my forearms are just
a bit too weak. The holds are tiny, though.
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Mon, 14 Apr 2003 04:52:42 +0000 |
| parents | 0b1c01fd68f1 |
| children | fefad67de2c7 |
| rev | line source |
|---|---|
|
4202
59751fe608c5
[gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents:
4113
diff
changeset
|
1 #include "config.h" |
|
59751fe608c5
[gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents:
4113
diff
changeset
|
2 |
|
59751fe608c5
[gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents:
4113
diff
changeset
|
3 #ifndef GAIM_PLUGINS |
| 3630 | 4 #define GAIM_PLUGINS |
|
4202
59751fe608c5
[gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents:
4113
diff
changeset
|
5 #endif |
|
59751fe608c5
[gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents:
4113
diff
changeset
|
6 |
| 133 | 7 #include "gaim.h" |
| 8 | |
| 3472 | 9 #include <gtk/gtk.h> |
| 133 | 10 |
| 3630 | 11 #ifdef _WIN32 |
| 12 #include "win32dep.h" | |
| 13 #endif | |
| 14 | |
| 133 | 15 void *handle; |
| 16 | |
| 3630 | 17 G_MODULE_IMPORT GtkWidget *imaway; |
|
4726
0b1c01fd68f1
[gaim-migrate @ 5039]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4585
diff
changeset
|
18 /*G_MODULE_IMPORT GtkWidget *blist;*/ |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
19 /* XXX G_MODULE_IMPORT GtkWidget *all_chats; */ |
|
4726
0b1c01fd68f1
[gaim-migrate @ 5039]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4585
diff
changeset
|
20 /*G_MODULE_IMPORT GtkWidget *all_convos;*/ |
| 133 | 21 |
|
147
ec301cfcaebf
[gaim-migrate @ 157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
138
diff
changeset
|
22 #ifdef USE_APPLET |
|
ec301cfcaebf
[gaim-migrate @ 157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
138
diff
changeset
|
23 extern void applet_destroy_buddy(); |
|
ec301cfcaebf
[gaim-migrate @ 157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
138
diff
changeset
|
24 #endif |
| 133 | 25 |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
26 void iconify_windows(struct gaim_connection *gc, char *state, |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
27 char *message, void *data) { |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
28 struct gaim_window *win; |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
29 GList *windows; |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
30 |
|
2395
c014fd611443
[gaim-migrate @ 2408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2098
diff
changeset
|
31 if (!imaway || !gc->away) |
|
1406
cabde2947ba4
[gaim-migrate @ 1416]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1405
diff
changeset
|
32 return; |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
33 |
| 3472 | 34 gtk_window_iconify(GTK_WINDOW(imaway)); |
|
4726
0b1c01fd68f1
[gaim-migrate @ 5039]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4585
diff
changeset
|
35 gaim_blist_set_visible(FALSE); |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
36 |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
37 for (windows = gaim_get_windows(); |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
38 windows != NULL; |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
39 windows = windows->next) { |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
40 |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
41 win = (struct gaim_window *)windows->data; |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
42 |
|
4476
62c1e5e656d0
[gaim-migrate @ 4751]
Christian Hammond <chipx86@chipx86.com>
parents:
4468
diff
changeset
|
43 if (GAIM_IS_GTK_WINDOW(win)) { |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
44 struct gaim_gtk_window *gtkwin; |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
45 |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
46 gtkwin = GAIM_GTK_WINDOW(win); |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
47 |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
48 gtk_window_iconify(GTK_WINDOW(gtkwin->window)); |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
49 } |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
50 } |
| 133 | 51 } |
| 52 | |
| 3630 | 53 /* |
| 54 * EXPORTED FUNCTIONS | |
| 55 */ | |
| 56 | |
| 57 G_MODULE_EXPORT char *gaim_plugin_init(GModule *h) { | |
| 133 | 58 handle = h; |
| 59 | |
| 60 gaim_signal_connect(handle, event_away, iconify_windows, NULL); | |
|
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
147
diff
changeset
|
61 |
|
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
147
diff
changeset
|
62 return NULL; |
| 133 | 63 } |
| 64 | |
| 3551 | 65 struct gaim_plugin_description desc; |
| 3630 | 66 G_MODULE_EXPORT struct gaim_plugin_description *gaim_plugin_desc() { |
| 3551 | 67 desc.api_version = PLUGIN_API_VERSION; |
| 4113 | 68 desc.name = g_strdup(_("Iconify on away")); |
| 3551 | 69 desc.version = g_strdup(VERSION); |
| 4113 | 70 desc.description = g_strdup(_("Iconifies the away box and the buddy list when you go away.")); |
| 3551 | 71 desc.authors = g_strdup("Eric Warmenhoven <eric@warmenhoven.org>"); |
| 72 desc.url = g_strdup(WEBSITE); | |
| 73 return &desc; | |
| 74 } | |
| 75 | |
| 3630 | 76 G_MODULE_EXPORT char *name() { |
| 4585 | 77 return _("Iconify on away"); |
| 133 | 78 } |
| 79 | |
| 3630 | 80 G_MODULE_EXPORT char *description() { |
| 4113 | 81 return _("Iconifies the away box and the buddy list when you go away."); |
| 133 | 82 } |
