You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(106) |
Oct
(334) |
Nov
(246) |
Dec
(145) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(42) |
Feb
(53) |
Mar
(232) |
Apr
(109) |
May
(137) |
Jun
(63) |
Jul
(26) |
Aug
(263) |
Sep
(193) |
Oct
(507) |
Nov
(440) |
Dec
(241) |
2003 |
Jan
(567) |
Feb
(195) |
Mar
(504) |
Apr
(481) |
May
(524) |
Jun
(522) |
Jul
(594) |
Aug
(502) |
Sep
(643) |
Oct
(508) |
Nov
(430) |
Dec
(377) |
2004 |
Jan
(361) |
Feb
(251) |
Mar
(219) |
Apr
(499) |
May
(461) |
Jun
(419) |
Jul
(314) |
Aug
(519) |
Sep
(416) |
Oct
(247) |
Nov
(305) |
Dec
(382) |
2005 |
Jan
(267) |
Feb
(282) |
Mar
(327) |
Apr
(338) |
May
(189) |
Jun
(400) |
Jul
(462) |
Aug
(530) |
Sep
(316) |
Oct
(523) |
Nov
(481) |
Dec
(650) |
2006 |
Jan
(536) |
Feb
(361) |
Mar
(287) |
Apr
(146) |
May
(101) |
Jun
(169) |
Jul
(221) |
Aug
(498) |
Sep
(300) |
Oct
(236) |
Nov
(209) |
Dec
(205) |
2007 |
Jan
(30) |
Feb
(23) |
Mar
(26) |
Apr
(15) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ev...@us...> - 2006-12-20 20:38:30
|
Revision: 18033 http://svn.sourceforge.net/gaim/?rev=18033&view=rev Author: evands Date: 2006-12-20 12:38:20 -0800 (Wed, 20 Dec 2006) Log Message: ----------- Hunted down a spare * in my garage and put it somewhere appropriate. Modified Paths: -------------- trunk/libgaim/protocols/oscar/oscar.c Modified: trunk/libgaim/protocols/oscar/oscar.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar.c 2006-12-20 20:29:11 UTC (rev 18032) +++ trunk/libgaim/protocols/oscar/oscar.c 2006-12-20 20:38:20 UTC (rev 18033) @@ -427,7 +427,7 @@ if (ret == NULL) ret = gaim_plugin_oscar_convert_to_utf8(data, datalen, charsetstr2, TRUE); if (ret == NULL) { - char *str, *salvage, tmp; + char *str, *salvage, *tmp; str = g_malloc(datalen + 1); strncpy(str, data, datalen); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-12-20 20:29:15
|
Revision: 18032 http://svn.sourceforge.net/gaim/?rev=18032&view=rev Author: evands Date: 2006-12-20 12:29:11 -0800 (Wed, 20 Dec 2006) Log Message: ----------- snactypes.h defines constants for these subtypes (and others). Changed the magic numbers to use the constants, increasing readability. The same should be done for the other families, as well. Modified Paths: -------------- trunk/libgaim/protocols/oscar/family_buddy.c Modified: trunk/libgaim/protocols/oscar/family_buddy.c =================================================================== --- trunk/libgaim/protocols/oscar/family_buddy.c 2006-12-20 20:06:47 UTC (rev 18031) +++ trunk/libgaim/protocols/oscar/family_buddy.c 2006-12-20 20:29:11 UTC (rev 18032) @@ -19,7 +19,7 @@ */ /* - * Family 0x0003 - Old-style Buddylist Management (non-SSI). + * Family 0x0003 (SNAC_FAMILY_BUDDY) - Old-style Buddylist Management (non-SSI). * */ @@ -36,7 +36,7 @@ void aim_buddylist_reqrights(OscarData *od, FlapConnection *conn) { - aim_genericreq_n_snacid(od, conn, 0x0003, 0x0002); + aim_genericreq_n_snacid(od, conn, SNAC_FAMILY_BUDDY, SNAC_SUBTYPE_BUDDY_REQRIGHTS); } /* @@ -88,7 +88,7 @@ } /* - * Subtype 0x0004 - Add buddy to list. + * Subtype 0x0004 (SNAC_SUBTYPE_BUDDY_ADDBUDDY) - Add buddy to list. * * Adds a single buddy to your buddy list after login. * XXX This should just be an extension of setbuddylist() @@ -117,7 +117,7 @@ } /* - * Subtype 0x0004 - Add multiple buddies to your buddy list. + * Subtype 0x0004 (SNAC_SUBTYPE_BUDDY_ADDBUDDY) - Add multiple buddies to your buddy list. * * This just builds the "set buddy list" command then queues it. * @@ -168,7 +168,7 @@ } /* - * Subtype 0x0005 - Remove buddy from list. + * Subtype 0x0005 (SNAC_SUBTYPE_BUDDY_REMBUDDY) - Remove buddy from list. * * XXX generalise to support removing multiple buddies (basically, its * the same as setbuddylist() but with a different snac subtype). @@ -197,7 +197,7 @@ } /* - * Subtypes 0x000b and 0x000c - Change in buddy status + * Subtypes 0x000b (SNAC_SUBTYPE_BUDDY_ONCOMING) and 0x000c (SNAC_SUBTYPE_BUDDY_OFFGOING) - Change in buddy status * * Oncoming Buddy notifications contain a subset of the * user information structure. It's close enough to run @@ -219,7 +219,7 @@ if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) ret = userfunc(od, conn, frame, &userinfo); - if (snac->subtype == 0x000b) + if (snac->subtype == SNAC_SUBTYPE_BUDDY_ONCOMING) aim_locate_requestuserinfo(od, userinfo.sn); aim_info_free(&userinfo); @@ -229,9 +229,9 @@ static int snachandler(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs) { - if (snac->subtype == 0x0003) + if (snac->subtype == SNAC_SUBTYPE_BUDDY_RIGHTSINFO) return rights(od, conn, mod, frame, snac, bs); - else if ((snac->subtype == 0x000b) || (snac->subtype == 0x000c)) + else if ((snac->subtype == SNAC_SUBTYPE_BUDDY_ONCOMING) || (snac->subtype == SNAC_SUBTYPE_BUDDY_OFFGOING)) return buddychange(od, conn, mod, frame, snac, bs); return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-12-20 20:06:50
|
Revision: 18031 http://svn.sourceforge.net/gaim/?rev=18031&view=rev Author: evands Date: 2006-12-20 12:06:47 -0800 (Wed, 20 Dec 2006) Log Message: ----------- * Improved gaim_plugin_oscar_decode_im_part()'s error message; "the buddy you are talking to" is awkward and wrong, and "the buddy to whom you are talking" is just silly. Use the buddy's screenname instead. * Pass the screen name to gaim_plugin_oscar_decode_im_part() in incomingim_chan4() as is done elsewhere rather than passing "1" as the name. Modified Paths: -------------- trunk/libgaim/protocols/oscar/oscar.c Modified: trunk/libgaim/protocols/oscar/oscar.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar.c 2006-12-20 09:35:24 UTC (rev 18030) +++ trunk/libgaim/protocols/oscar/oscar.c 2006-12-20 20:06:47 UTC (rev 18031) @@ -427,17 +427,19 @@ if (ret == NULL) ret = gaim_plugin_oscar_convert_to_utf8(data, datalen, charsetstr2, TRUE); if (ret == NULL) { - char *str, *salvage; + char *str, *salvage, tmp; str = g_malloc(datalen + 1); strncpy(str, data, datalen); str[datalen] = '\0'; salvage = gaim_utf8_salvage(str); - ret = g_strdup_printf("%s %s", salvage, - _("(There was an error receiving this message. Either you and the buddy you are speaking to have a different encoding selected, or the buddy has a buggy client.)")); + tmp = g_strdup_printf(_("(There was an error receiving this message. Either you and %s have different encodings selected, or %s has a buggy client.)"), + sourcesn, sourcesn); + ret = g_strdup_printf("%s %s", salvage, tmp); + g_free(tmp); g_free(str); g_free(salvage); - } + } return ret; } @@ -2295,9 +2297,12 @@ for (numtoks=0; msg1[numtoks]; numtoks++); msg2 = (gchar **)g_malloc((numtoks+1)*sizeof(gchar *)); for (i=0; msg1[i]; i++) { + gchar *uin = g_strdup_printf("%u", args->uin); + gaim_str_strip_char(msg1[i], '\r'); /* TODO: Should use an encoding other than ASCII? */ - msg2[i] = gaim_plugin_oscar_decode_im_part(account, "1", AIM_CHARSET_ASCII, 0x0000, msg1[i], strlen(msg1[i])); + msg2[i] = gaim_plugin_oscar_decode_im_part(account, uin, AIM_CHARSET_ASCII, 0x0000, msg1[i], strlen(msg1[i])); + g_free(uin); } msg2[i] = NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-20 09:35:28
|
Revision: 18030 http://svn.sourceforge.net/gaim/?rev=18030&view=rev Author: thekingant Date: 2006-12-20 01:35:24 -0800 (Wed, 20 Dec 2006) Log Message: ----------- Fix a rather large oversight on my part: I wasn't allowing people to set icons at all for protocols that didn't have a max icon file size. Modified Paths: -------------- trunk/gtk/gtkutils.c Modified: trunk/gtk/gtkutils.c =================================================================== --- trunk/gtk/gtkutils.c 2006-12-20 09:31:11 UTC (rev 18029) +++ trunk/gtk/gtkutils.c 2006-12-20 09:35:24 UTC (rev 18030) @@ -2646,7 +2646,8 @@ * the prpl supported jpeg, and then we could convert to that * and use a lower quality setting. */ - if (st.st_size > prpl_info->icon_spec.max_filesize) + if ((prpl_info->icon_spec.max_filesize != 0) && + (st.st_size > prpl_info->icon_spec.max_filesize)) { gchar *tmp; tmp = g_strdup_printf(_("The file '%s' is too large for %s. Please try a smaller image.\n"), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-20 09:31:18
|
Revision: 18029 http://svn.sourceforge.net/gaim/?rev=18029&view=rev Author: thekingant Date: 2006-12-20 01:31:11 -0800 (Wed, 20 Dec 2006) Log Message: ----------- A better fix for the bugs I introduced in revision 18012, that was partially fixed by sf patch #1618871. Revision Links: -------------- http://svn.sourceforge.net/gaim/?rev=18012&view=rev Modified Paths: -------------- trunk/ChangeLog.API trunk/gtk/gtkaccount.c trunk/gtk/gtkconv.c trunk/gtk/gtkutils.c trunk/gtk/gtkutils.h Modified: trunk/ChangeLog.API =================================================================== --- trunk/ChangeLog.API 2006-12-20 09:28:29 UTC (rev 18028) +++ trunk/ChangeLog.API 2006-12-20 09:31:11 UTC (rev 18029) @@ -147,11 +147,13 @@ avoid accessing it directly. * notify_userinfo() UI op is passed a GaimNotifyUserInfo instead of a char* for the user information - * gaim_buddy_icon_get_scale_size() and - gaim_gtk_buddy_icon_get_scale_size() were changed to ALWAYS scale + * gaim_buddy_icon_get_scale_size() and was changed to ALWAYS scale the icon instead of only when icon_spec->scale_rules contains GAIM_ICON_SCALE_DISPLAY. Callers should be changed to check the scale_rules before calling this function. + * gaim_gtk_buddy_icon_get_scale_size() was changed to accept an + additional parameter which is used to determine what kind of + scaling should be done, if any. Removed: * gaim_gtk_sound_{get,set}_mute() (replaced by the /gaim/gtk/sound/mute Modified: trunk/gtk/gtkaccount.c =================================================================== --- trunk/gtk/gtkaccount.c 2006-12-20 09:28:29 UTC (rev 18028) +++ trunk/gtk/gtkaccount.c 2006-12-20 09:31:11 UTC (rev 18029) @@ -218,9 +218,8 @@ int width, height; GdkPixbuf *scale; - if (dialog->prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_DISPLAY) - gaim_gtk_buddy_icon_get_scale_size(pixbuf, - &dialog->prpl_info->icon_spec, &width, &height); + gaim_gtk_buddy_icon_get_scale_size(pixbuf, &dialog->prpl_info->icon_spec, + GAIM_ICON_SCALE_DISPLAY, &width, &height); scale = gdk_pixbuf_scale_simple(pixbuf, width, height, GDK_INTERP_BILINEAR); g_object_unref(G_OBJECT(pixbuf)); Modified: trunk/gtk/gtkconv.c =================================================================== --- trunk/gtk/gtkconv.c 2006-12-20 09:28:29 UTC (rev 18028) +++ trunk/gtk/gtkconv.c 2006-12-20 09:31:11 UTC (rev 18029) @@ -2308,9 +2308,8 @@ gdk_pixbuf_animation_iter_advance(gtkconv->u.im->iter, NULL); buf = gdk_pixbuf_animation_iter_get_pixbuf(gtkconv->u.im->iter); - if (prpl_info && prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_DISPLAY) - gaim_gtk_buddy_icon_get_scale_size(buf, &prpl_info->icon_spec, - &scale_width, &scale_height); + gaim_gtk_buddy_icon_get_scale_size(buf, &prpl_info->icon_spec, + GAIM_ICON_SCALE_DISPLAY, &scale_width, &scale_height); /* this code is ugly, and scares me */ scale = gdk_pixbuf_scale_simple(buf, @@ -6070,14 +6069,8 @@ start_anim(NULL, gtkconv); } - if (prpl_info && prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_DISPLAY) { - gaim_gtk_buddy_icon_get_scale_size(buf, &prpl_info->icon_spec, - &scale_width, &scale_height); - } else { - scale_width = gdk_pixbuf_get_width(buf); - scale_height = gdk_pixbuf_get_height(buf); - } - + gaim_gtk_buddy_icon_get_scale_size(buf, &prpl_info->icon_spec, + GAIM_ICON_SCALE_DISPLAY, &scale_width, &scale_height); scale = gdk_pixbuf_scale_simple(buf, MAX(gdk_pixbuf_get_width(buf) * scale_width / gdk_pixbuf_animation_get_width(gtkconv->u.im->anim), 1), Modified: trunk/gtk/gtkutils.c =================================================================== --- trunk/gtk/gtkutils.c 2006-12-20 09:28:29 UTC (rev 18028) +++ trunk/gtk/gtkutils.c 2006-12-20 09:31:11 UTC (rev 18029) @@ -1525,11 +1525,14 @@ g_list_free(files); } -void gaim_gtk_buddy_icon_get_scale_size(GdkPixbuf *buf, GaimBuddyIconSpec *spec, int *width, int *height) +void gaim_gtk_buddy_icon_get_scale_size(GdkPixbuf *buf, GaimBuddyIconSpec *spec, GaimIconScaleRules rules, int *width, int *height) { *width = gdk_pixbuf_get_width(buf); *height = gdk_pixbuf_get_height(buf); + if ((spec == NULL) || !(spec->scale_rules & rules)) + return; + gaim_buddy_icon_get_scale_size(spec, width, height); /* and now for some arbitrary sanity checks */ Modified: trunk/gtk/gtkutils.h =================================================================== --- trunk/gtk/gtkutils.h 2006-12-20 09:28:29 UTC (rev 18028) +++ trunk/gtk/gtkutils.h 2006-12-20 09:31:11 UTC (rev 18029) @@ -362,7 +362,7 @@ /** * Convenience wrapper for gaim_buddy_icon_get_scale_size */ -void gaim_gtk_buddy_icon_get_scale_size(GdkPixbuf *buf, GaimBuddyIconSpec *spec, int *width, int *height); +void gaim_gtk_buddy_icon_get_scale_size(GdkPixbuf *buf, GaimBuddyIconSpec *spec, GaimIconScaleRules rules, int *width, int *height); /** * Returns the base image to represent the account, based on This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-12-20 09:28:42
|
Revision: 18028 http://svn.sourceforge.net/gaim/?rev=18028&view=rev Author: sadrul Date: 2006-12-20 01:28:29 -0800 (Wed, 20 Dec 2006) Log Message: ----------- Draw a small "close-button" in the buddylist-headline when the cursor is moved over it. I was drawing the close button all the time first, but showing it only on hover seemed like a better idea. Clicking the close-button will close the headline box without triggering the callback. Modified Paths: -------------- trunk/gtk/gtkblist.c trunk/gtk/gtkblist.h Modified: trunk/gtk/gtkblist.c =================================================================== --- trunk/gtk/gtkblist.c 2006-12-20 05:50:49 UTC (rev 18027) +++ trunk/gtk/gtkblist.c 2006-12-20 09:28:29 UTC (rev 18028) @@ -61,6 +61,8 @@ #include <gtk/gtk.h> #include <gdk/gdk.h> +#define HEADLINE_CLOSE_SIZE 12 + typedef struct { GaimAccount *account; @@ -268,6 +270,8 @@ gaim_prefs_set_int("/gaim/gtk/blist/width", event->width); gaim_prefs_set_int("/gaim/gtk/blist/height", event->height); + gtk_widget_set_size_request(gtkblist->headline_label, + gaim_prefs_get_int("/gaim/gtk/blist/width")-25,-1); /* continue to handle event normally */ return FALSE; } @@ -3673,16 +3677,63 @@ } static gboolean +headline_hover_close(int x, int y) +{ + GtkWidget *w = gtkblist->headline_hbox; + if (x <= w->allocation.width && x >= w->allocation.width - HEADLINE_CLOSE_SIZE && + y >= 0 && y <= HEADLINE_CLOSE_SIZE) + return TRUE; + return FALSE; +} + +static gboolean headline_box_enter_cb(GtkWidget *widget, GdkEventCrossing *event, GaimGtkBuddyList *gtkblist) { gdk_window_set_cursor(widget->window, gtkblist->hand_cursor); + + if (gtkblist->headline_close) { +#if GTK_CHECK_VERSION(2,2,0) + gdk_draw_pixbuf(widget->window, NULL, gtkblist->headline_close, +#else + gdk_pixbuf_render_to_drawable(gtkblist->headline_close, + GDK_DRAWABLE(widget->window), NULL, +#endif + 0, 0, + widget->allocation.width - 2 - HEADLINE_CLOSE_SIZE, 2, + HEADLINE_CLOSE_SIZE, HEADLINE_CLOSE_SIZE, + GDK_RGB_DITHER_NONE, 0, 0); + gtk_paint_focus(widget->style, widget->window, GTK_STATE_PRELIGHT, + NULL, widget, NULL, + widget->allocation.width - HEADLINE_CLOSE_SIZE - 3, 1, + HEADLINE_CLOSE_SIZE + 2, HEADLINE_CLOSE_SIZE + 2); + } + return FALSE; } +#if 0 static gboolean +headline_box_motion_cb(GtkWidget *widget, GdkEventMotion *event, GaimGtkBuddyList *gtkblist) +{ + gaim_debug_fatal("motion", "%d %d\n", (int)event->x, (int)event->y); + if (headline_hover_close((int)event->x, (int)event->y)) + gtk_paint_focus(widget->style, widget->window, GTK_STATE_PRELIGHT, + NULL, widget, NULL, + widget->allocation.width - HEADLINE_CLOSE_SIZE - 3, 1, + HEADLINE_CLOSE_SIZE + 2, HEADLINE_CLOSE_SIZE + 2); + return FALSE; +} +#endif + +static gboolean headline_box_leave_cb(GtkWidget *widget, GdkEventCrossing *event, GaimGtkBuddyList *gtkblist) { gdk_window_set_cursor(widget->window, gtkblist->arrow_cursor); + if (gtkblist->headline_close) { + GdkRectangle rect = {widget->allocation.width - 3 - HEADLINE_CLOSE_SIZE, 1, + HEADLINE_CLOSE_SIZE + 2, HEADLINE_CLOSE_SIZE + 2}; + gdk_window_invalidate_rect(widget->window, &rect, TRUE); + } return FALSE; } @@ -3697,7 +3748,7 @@ headline_box_press_cb(GtkWidget *widget, GdkEventButton *event, GaimGtkBuddyList *gtkblist) { gtk_widget_hide(gtkblist->headline_hbox); - if (gtkblist->headline_callback) + if (gtkblist->headline_callback && !headline_hover_close((int)event->x, (int)event->y)) g_idle_add((GSourceFunc)headline_click_callback, gtkblist->headline_data); return TRUE; } @@ -3824,9 +3875,9 @@ static gboolean paint_headline_hbox (GtkWidget *widget, GdkEventExpose *event, - gpointer user_data) + gpointer user_data) { - gtk_paint_flat_box (widget->style, + gtk_paint_flat_box (widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, @@ -3837,8 +3888,7 @@ widget->allocation.y + 1, widget->allocation.width - 2, widget->allocation.height - 2); - - return FALSE; + return FALSE; } static void @@ -4044,11 +4094,27 @@ NULL); gtk_widget_set_name(gtkblist->headline_hbox, "gtk-tooltips"); + gtkblist->headline_close = gtk_widget_render_icon(ebox, GTK_STOCK_CLOSE, -1, NULL); + if (gtkblist->headline_close) { + GdkPixbuf *scale = gdk_pixbuf_scale_simple(gtkblist->headline_close, + HEADLINE_CLOSE_SIZE, HEADLINE_CLOSE_SIZE, GDK_INTERP_BILINEAR); + gdk_pixbuf_unref(gtkblist->headline_close); + gtkblist->headline_close = scale; + } + gtkblist->hand_cursor = gdk_cursor_new (GDK_HAND2); gtkblist->arrow_cursor = gdk_cursor_new (GDK_LEFT_PTR); + g_signal_connect(G_OBJECT(ebox), "enter-notify-event", G_CALLBACK(headline_box_enter_cb), gtkblist); g_signal_connect(G_OBJECT(ebox), "leave-notify-event", G_CALLBACK(headline_box_leave_cb), gtkblist); g_signal_connect(G_OBJECT(ebox), "button-press-event", G_CALLBACK(headline_box_press_cb), gtkblist); +#if 0 + /* I couldn't get this to work. The idea was to draw the focus-border only + * when hovering over the close image. So for now, the focus-border is + * always there. -- sad */ + gtk_widget_set_events(ebox, gtk_widget_get_events(ebox) | GDK_POINTER_MOTION_HINT_MASK); + g_signal_connect(G_OBJECT(ebox), "motion-notify-event", G_CALLBACK(headline_box_motion_cb), gtkblist); +#endif /****************************** GtkTreeView **********************************/ sw = gtk_scrolled_window_new(NULL,NULL); @@ -4833,6 +4899,9 @@ gaim_signals_disconnect_by_handle(gtkblist); + if (gtkblist->headline_close) + gdk_pixbuf_unref(gtkblist->headline_close); + gtk_widget_destroy(gtkblist->window); gaim_gtk_blist_tooltip_destroy(); Modified: trunk/gtk/gtkblist.h =================================================================== --- trunk/gtk/gtkblist.h 2006-12-20 05:50:49 UTC (rev 18027) +++ trunk/gtk/gtkblist.h 2006-12-20 09:28:29 UTC (rev 18028) @@ -103,6 +103,7 @@ GtkWidget *headline_hbox; /**< Hbox for headline notification */ GtkWidget *headline_label; /**< Label for headline notifications */ GtkWidget *headline_image; /**< Image for headline notifications */ + GdkPixbuf *headline_close; /**< Close image for closing the headline without triggering the callback */ GCallback headline_callback; /**< Callback for headline notifications */ gpointer headline_data; /**< User data for headline notifications */ gboolean changing_style; /**< True when changing GTK+ theme style */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <amc...@us...> - 2006-12-20 05:50:52
|
Revision: 18027 http://svn.sourceforge.net/gaim/?rev=18027&view=rev Author: amc_grim Date: 2006-12-19 21:50:49 -0800 (Tue, 19 Dec 2006) Log Message: ----------- This fixes a bug I was hitting, that datallah mentioned was assigned to him (1618871). Datallah, feel free to close that bug.. Modified Paths: -------------- trunk/gtk/gtkconv.c Modified: trunk/gtk/gtkconv.c =================================================================== --- trunk/gtk/gtkconv.c 2006-12-20 05:43:51 UTC (rev 18026) +++ trunk/gtk/gtkconv.c 2006-12-20 05:50:49 UTC (rev 18027) @@ -6070,9 +6070,14 @@ start_anim(NULL, gtkconv); } - if (prpl_info && prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_DISPLAY) + if (prpl_info && prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_DISPLAY) { gaim_gtk_buddy_icon_get_scale_size(buf, &prpl_info->icon_spec, &scale_width, &scale_height); + } else { + scale_width = gdk_pixbuf_get_width(buf); + scale_height = gdk_pixbuf_get_height(buf); + } + scale = gdk_pixbuf_scale_simple(buf, MAX(gdk_pixbuf_get_width(buf) * scale_width / gdk_pixbuf_animation_get_width(gtkconv->u.im->anim), 1), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-12-20 05:43:52
|
Revision: 18026 http://svn.sourceforge.net/gaim/?rev=18026&view=rev Author: datallah Date: 2006-12-19 21:43:51 -0800 (Tue, 19 Dec 2006) Log Message: ----------- Sean came up with the idea to give the windows folks an easy way to browse to the logs directory. I implemented it. Hopefully this will avoid a FAQ or two. I also noticed and plugged a small and rarely encountered leak. Modified Paths: -------------- trunk/gtk/gtklog.c trunk/gtk/win32/gtkwin32dep.c trunk/gtk/win32/gtkwin32dep.h Modified: trunk/gtk/gtklog.c =================================================================== --- trunk/gtk/gtklog.c 2006-12-19 18:52:18 UTC (rev 18025) +++ trunk/gtk/gtklog.c 2006-12-20 05:43:51 UTC (rev 18026) @@ -163,9 +163,18 @@ gaim_gtk_clear_cursor(lv->window); } -static gboolean destroy_cb(GtkWidget *w, gint resp, struct log_viewer_hash_t *ht) { +static void destroy_cb(GtkWidget *w, gint resp, struct log_viewer_hash_t *ht) { GaimGtkLogViewer *lv = syslog_viewer; +#ifdef _WIN32 + if (resp == GTK_RESPONSE_HELP) { + char *logdir = g_build_filename(gaim_user_dir(), "logs", NULL); + gtkwgaim_shell_execute(logdir, "explore", NULL); + g_free(logdir); + return; + } +#endif + if (ht != NULL) { lv = g_hash_table_lookup(log_viewers, ht); g_hash_table_remove(log_viewers, ht); @@ -182,8 +191,6 @@ g_free(lv); gtk_widget_destroy(w); - - return TRUE; } static void log_row_activated_cb(GtkTreeView *tv, GtkTreePath *path, GtkTreeViewColumn *col, GaimGtkLogViewer *viewer) { @@ -345,6 +352,10 @@ /* Window ***********/ lv->window = gtk_dialog_new_with_buttons(title, NULL, 0, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); +#ifdef _WIN32 + /* Steal the "HELP" response and use it to trigger browsing to the logs folder */ + gtk_dialog_add_button(GTK_DIALOG(lv->window), _("_Browse logs folder"), GTK_RESPONSE_HELP); +#endif gtk_container_set_border_width (GTK_CONTAINER(lv->window), GAIM_HIG_BOX_SPACE); gtk_dialog_set_has_separator(GTK_DIALOG(lv->window), FALSE); gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(lv->window)->vbox), 0); @@ -450,7 +461,7 @@ } void gaim_gtk_log_show(GaimLogType type, const char *screenname, GaimAccount *account) { - struct log_viewer_hash_t *ht = g_new0(struct log_viewer_hash_t, 1); + struct log_viewer_hash_t *ht; GaimGtkLogViewer *lv = NULL; const char *name = screenname; char *title; @@ -458,6 +469,8 @@ g_return_if_fail(account != NULL); g_return_if_fail(screenname != NULL); + ht = g_new0(struct log_viewer_hash_t, 1); + ht->type = type; ht->screenname = g_strdup(screenname); ht->account = account; @@ -466,6 +479,7 @@ log_viewers = g_hash_table_new(log_viewer_hash, log_viewer_equal); } else if ((lv = g_hash_table_lookup(log_viewers, ht))) { gtk_window_present(GTK_WINDOW(lv->window)); + g_free(ht->screenname); g_free(ht); return; } Modified: trunk/gtk/win32/gtkwin32dep.c =================================================================== --- trunk/gtk/win32/gtkwin32dep.c 2006-12-19 18:52:18 UTC (rev 18025) +++ trunk/gtk/win32/gtkwin32dep.c 2006-12-20 05:43:51 UTC (rev 18026) @@ -119,7 +119,7 @@ if(untar(tmpfile, destdir, UNTAR_FORCE | UNTAR_QUIET)) ret = 1; else { - gaim_debug_error("gtkwgaim_gz_untar", "Failure untaring %s\n", tmpfile); + gaim_debug_error("gtkwgaim_gz_untar", "Failure untarring %s\n", tmpfile); ret = 0; } g_unlink(tmpfile); @@ -131,53 +131,68 @@ } } -void gtkwgaim_notify_uri(const char *uri) { +void gtkwgaim_shell_execute(const char *target, const char *verb, const char *clazz) { - /* We'll allow whatever URI schemes are supported by the - * default http browser. - */ + g_return_if_fail(target != NULL); + g_return_if_fail(verb != NULL); if (G_WIN32_HAVE_WIDECHAR_API()) { SHELLEXECUTEINFOW wsinfo; - wchar_t *w_uri; + wchar_t *w_uri, *w_verb, *w_clazz = NULL; - w_uri = g_utf8_to_utf16(uri, -1, NULL, NULL, NULL); + w_uri = g_utf8_to_utf16(target, -1, NULL, NULL, NULL); + w_verb = g_utf8_to_utf16(verb, -1, NULL, NULL, NULL); memset(&wsinfo, 0, sizeof(wsinfo)); wsinfo.cbSize = sizeof(wsinfo); - wsinfo.fMask = SEE_MASK_CLASSNAME; - wsinfo.lpVerb = L"open"; + wsinfo.lpVerb = w_verb; wsinfo.lpFile = w_uri; wsinfo.nShow = SW_SHOWNORMAL; - wsinfo.lpClass = L"http"; + if (clazz != NULL) { + w_clazz = g_utf8_to_utf16(clazz, -1, NULL, NULL, NULL); + wsinfo.fMask |= SEE_MASK_CLASSNAME; + wsinfo.lpClass = w_clazz; + } if(!ShellExecuteExW(&wsinfo)) gaim_debug_error("gtkwgaim", "Error opening URI: %s error: %d\n", - uri, (int) wsinfo.hInstApp); + target, (int) wsinfo.hInstApp); g_free(w_uri); + g_free(w_verb); + g_free(w_clazz); } else { SHELLEXECUTEINFOA sinfo; gchar *locale_uri; - locale_uri = g_locale_from_utf8(uri, -1, NULL, NULL, NULL); + locale_uri = g_locale_from_utf8(target, -1, NULL, NULL, NULL); memset(&sinfo, 0, sizeof(sinfo)); sinfo.cbSize = sizeof(sinfo); - sinfo.fMask = SEE_MASK_CLASSNAME; - sinfo.lpVerb = "open"; + sinfo.lpVerb = verb; sinfo.lpFile = locale_uri; sinfo.nShow = SW_SHOWNORMAL; - sinfo.lpClass = "http"; + if (clazz != NULL) { + sinfo.fMask |= SEE_MASK_CLASSNAME; + sinfo.lpClass = clazz; + } if(!ShellExecuteExA(&sinfo)) gaim_debug_error("gtkwgaim", "Error opening URI: %s error: %d\n", - uri, (int) sinfo.hInstApp); + target, (int) sinfo.hInstApp); g_free(locale_uri); } + } +void gtkwgaim_notify_uri(const char *uri) { + /* We'll allow whatever URI schemes are supported by the + * default http browser. + */ + gtkwgaim_shell_execute(uri, "open", "http"); +} + #define WM_FOCUS_REQUEST (WM_APP + 13) static LRESULT CALLBACK message_window_handler(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { Modified: trunk/gtk/win32/gtkwin32dep.h =================================================================== --- trunk/gtk/win32/gtkwin32dep.h 2006-12-19 18:52:18 UTC (rev 18025) +++ trunk/gtk/win32/gtkwin32dep.h 2006-12-20 05:43:51 UTC (rev 18026) @@ -34,6 +34,7 @@ /* Misc */ void gtkwgaim_notify_uri(const char *uri); +void gtkwgaim_shell_execute(const char *target, const char *verb, const char *clazz); void gtkwgaim_ensure_onscreen(GtkWidget *win); void gtkwgaim_conv_blink(GaimConversation *conv, GaimMessageFlags flags); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-19 18:52:34
|
Revision: 18025 http://svn.sourceforge.net/gaim/?rev=18025&view=rev Author: thekingant Date: 2006-12-19 10:52:18 -0800 (Tue, 19 Dec 2006) Log Message: ----------- Fix an assertion failure when browsing for a file in the pounce editor Modified Paths: -------------- trunk/gtk/gtkrequest.c Modified: trunk/gtk/gtkrequest.c =================================================================== --- trunk/gtk/gtkrequest.c 2006-12-19 05:28:06 UTC (rev 18024) +++ trunk/gtk/gtkrequest.c 2006-12-19 18:52:18 UTC (rev 18025) @@ -1528,7 +1528,7 @@ current_folder = gaim_prefs_get_string("/gaim/gtk/filelocations/last_open_folder"); } - if (filename != NULL) { + if ((filename != NULL) && (*filename != '\0')) { if (savedialog) gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(filesel), filename); else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-12-19 05:28:10
|
Revision: 18024 http://svn.sourceforge.net/gaim/?rev=18024&view=rev Author: rlaager Date: 2006-12-18 21:28:06 -0800 (Mon, 18 Dec 2006) Log Message: ----------- Fix SF Bug #1613448 Typing "M&" auto-corrects to "AM&", which makes it hard to talk about the world's greatest candy! Modified Paths: -------------- trunk/gtk/plugins/spellchk.c Modified: trunk/gtk/plugins/spellchk.c =================================================================== --- trunk/gtk/plugins/spellchk.c 2006-12-19 01:36:20 UTC (rev 18023) +++ trunk/gtk/plugins/spellchk.c 2006-12-19 05:28:06 UTC (rev 18024) @@ -355,6 +355,8 @@ return output; } + else if (c == '&') + return TRUE; return FALSE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-12-19 01:36:23
|
Revision: 18023 http://svn.sourceforge.net/gaim/?rev=18023&view=rev Author: seanegan Date: 2006-12-18 17:36:20 -0800 (Mon, 18 Dec 2006) Log Message: ----------- Adil's statusbox-imhtml-resizing behavior, now in the conversation. This shouldn't affect anything at all, except that if you're typing a real long message, you'll be able to see more of it, while keeping your default size small. Everything else should be exactly the same. Modified Paths: -------------- trunk/gtk/gtkconv.c Modified: trunk/gtk/gtkconv.c =================================================================== --- trunk/gtk/gtkconv.c 2006-12-19 00:09:38 UTC (rev 18022) +++ trunk/gtk/gtkconv.c 2006-12-19 01:36:20 UTC (rev 18023) @@ -3957,6 +3957,47 @@ gtk_menu_shell_insert(GTK_MENU_SHELL(menu), menuitem, 1); } + +static void resize_imhtml_cb(GaimGtkConversation *gtkconv) +{ + GtkTextBuffer *buffer; + GtkTextIter iter; + int wrapped_lines; + int lines; + GdkRectangle oneline; + GtkRequisition sr; + int height; + int pad_top, pad_inside, pad_bottom; + + buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry)); + + wrapped_lines = 1; + gtk_text_buffer_get_start_iter(buffer, &iter); + gtk_text_view_get_iter_location(GTK_TEXT_VIEW(gtkconv->entry), &iter, &oneline); + while (gtk_text_view_forward_display_line(GTK_TEXT_VIEW(gtkconv->entry), &iter)) + wrapped_lines++; + + lines = gtk_text_buffer_get_line_count(buffer); + + /* Show a maximum of 4 lines */ + lines = MIN(lines, 4); + wrapped_lines = MIN(wrapped_lines, 4); + + pad_top = gtk_text_view_get_pixels_above_lines(GTK_TEXT_VIEW(gtkconv->entry)); + pad_bottom = gtk_text_view_get_pixels_below_lines(GTK_TEXT_VIEW(gtkconv->entry)); + pad_inside = gtk_text_view_get_pixels_inside_wrap(GTK_TEXT_VIEW(gtkconv->entry)); + + height = (oneline.height + pad_top + pad_bottom) * lines; + height += (oneline.height + pad_inside) * (wrapped_lines - lines); + + gtk_widget_size_request(gtkconv->lower_hbox, &sr); + if (sr.height < height + GAIM_HIG_BOX_SPACE) { + gtkconv->auto_resize = TRUE; + gtk_widget_set_size_request(gtkconv->lower_hbox, -1, height + GAIM_HIG_BOX_SPACE); + g_idle_add(reset_auto_resize_cb, gtkconv); + } +} + static GtkWidget * setup_chat_pane(GaimGtkConversation *gtkconv) { @@ -4149,7 +4190,9 @@ gtkconv->entry_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry)); g_object_set_data(G_OBJECT(gtkconv->entry_buffer), "user_data", gtkconv); - + g_signal_connect_swapped(G_OBJECT(gtkconv->entry_buffer), "changed", + G_CALLBACK(resize_imhtml_cb), gtkconv); + g_signal_connect(G_OBJECT(gtkconv->entry), "key_press_event", G_CALLBACK(entry_key_press_cb), gtkconv); g_signal_connect_after(G_OBJECT(gtkconv->entry), "message_send", @@ -4260,6 +4303,8 @@ G_CALLBACK(insert_text_cb), gtkconv); g_signal_connect(G_OBJECT(gtkconv->entry_buffer), "delete_range", G_CALLBACK(delete_text_cb), gtkconv); + g_signal_connect_swapped(G_OBJECT(gtkconv->entry_buffer), "changed", + G_CALLBACK(resize_imhtml_cb), gtkconv); /* had to move this after the imtoolbar is attached so that the * signals get fired to toggle the buttons on the toolbar as well. @@ -6053,7 +6098,6 @@ /* Reset the size request to allow the buddy icon to resize */ gtk_widget_set_size_request(gtkconv->lower_hbox, -1, -1); g_idle_add(reset_auto_resize_cb, gtkconv); - printf("Auto resize true\n"); gtk_widget_set_size_request(gtkconv->u.im->icon, scale_width, scale_height); gtk_container_add(GTK_CONTAINER(event), gtkconv->u.im->icon); gtk_widget_show(gtkconv->u.im->icon); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2006-12-19 00:09:38
|
Revision: 18022 http://svn.sourceforge.net/gaim/?rev=18022&view=rev Author: boler Date: 2006-12-18 16:09:38 -0800 (Mon, 18 Dec 2006) Log Message: ----------- gg: Include status message in "Get Info" output. Modified Paths: -------------- trunk/libgaim/protocols/gg/gg.c Modified: trunk/libgaim/protocols/gg/gg.c =================================================================== --- trunk/libgaim/protocols/gg/gg.c 2006-12-18 20:29:45 UTC (rev 18021) +++ trunk/libgaim/protocols/gg/gg.c 2006-12-19 00:09:38 UTC (rev 18022) @@ -1014,6 +1014,7 @@ GGPSearchForm *form) { GaimNotifyUserInfo *user_info; + GaimBuddy *buddy; char *val, *who; user_info = gaim_notify_user_info_new(); @@ -1044,13 +1045,29 @@ } g_free(val); - val = ggp_buddy_get_name(gc, ggp_str_to_uin(who)); - g_free(who); + /* + * Include a status message, if exists and buddy is in the blist. + */ + buddy = gaim_find_buddy(gaim_connection_get_account(gc), who); + if (NULL != buddy) { + GaimStatus *status; + const char *msg; + char *text; -/* val = gaim_strdup_withhtml(text->str); */ + status = gaim_presence_get_active_status(gaim_buddy_get_presence(buddy)); + msg = gaim_status_get_attr_string(status, "message"); + if (msg != NULL) { + text = g_markup_escape_text(msg, -1); + gaim_notify_user_info_add_pair(user_info, _("Message"), text); + g_free(text); + } + } + + val = ggp_buddy_get_name(gc, ggp_str_to_uin(who)); gaim_notify_userinfo(gc, val, user_info, ggp_sr_close_cb, form); g_free(val); + g_free(who); gaim_notify_user_info_destroy(user_info); } /* }}} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-12-18 20:29:46
|
Revision: 18021 http://svn.sourceforge.net/gaim/?rev=18021&view=rev Author: seanegan Date: 2006-12-18 12:29:45 -0800 (Mon, 18 Dec 2006) Log Message: ----------- typo Modified Paths: -------------- trunk/libgaim/protocols/jabber/auth.c Modified: trunk/libgaim/protocols/jabber/auth.c =================================================================== --- trunk/libgaim/protocols/jabber/auth.c 2006-12-18 19:41:38 UTC (rev 18020) +++ trunk/libgaim/protocols/jabber/auth.c 2006-12-18 20:29:45 UTC (rev 18021) @@ -65,7 +65,7 @@ xmlnode_set_namespace(auth, "urn:ietf:params:xml:ns:xmpp-sasl"); xmlnode_set_attrib(auth, "xmlns:ga", "http://www.google.com/talk/protocol/auth"); - xmlnode_set_attrib(auth, "ga:client-users-full-bind-result", "true"); + xmlnode_set_attrib(auth, "ga:client-uses-full-bind-result", "true"); response = g_string_new(""); response = g_string_append_len(response, "\0", 1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-12-18 19:41:46
|
Revision: 18020 http://svn.sourceforge.net/gaim/?rev=18020&view=rev Author: sadrul Date: 2006-12-18 11:41:38 -0800 (Mon, 18 Dec 2006) Log Message: ----------- text-changed signal for GntEntry. Not used anywhere yet, but will be in the future. Modified Paths: -------------- trunk/console/libgnt/gntentry.c trunk/console/libgnt/gntentry.h Modified: trunk/console/libgnt/gntentry.c =================================================================== --- trunk/console/libgnt/gntentry.c 2006-12-17 21:12:18 UTC (rev 18019) +++ trunk/console/libgnt/gntentry.c 2006-12-18 19:41:38 UTC (rev 18020) @@ -9,11 +9,15 @@ enum { - SIGS = 1, + SIG_TEXT_CHANGED, + SIGS, }; +static guint signals[SIGS] = { 0 }; static GntWidgetClass *parent_class = NULL; +static void gnt_entry_set_text_internal(GntEntry *entry, const char *text); + static void destroy_suggest(GntEntry *entry) { @@ -157,6 +161,12 @@ gnt_widget_queue_update(widget); } +static void +entry_text_changed(GntEntry *entry) +{ + g_signal_emit(entry, signals[SIG_TEXT_CHANGED], 0); +} + static gboolean move_back(GntBindable *bind, GList *null) { @@ -203,6 +213,7 @@ entry_redraw(GNT_WIDGET(entry)); if (entry->ddown) show_suggest_dropdown(entry); + entry_text_changed(entry); return TRUE; } @@ -222,6 +233,7 @@ if (entry->ddown) show_suggest_dropdown(entry); + entry_text_changed(entry); return TRUE; } @@ -253,8 +265,9 @@ if (entry->histlength && entry->history->prev) { entry->history = entry->history->prev; - gnt_entry_set_text(entry, entry->history->data); + gnt_entry_set_text_internal(entry, entry->history->data); destroy_suggest(entry); + entry_text_changed(entry); return TRUE; } @@ -276,8 +289,9 @@ } entry->history = entry->history->next; - gnt_entry_set_text(entry, entry->history->data); + gnt_entry_set_text_internal(entry, entry->history->data); destroy_suggest(entry); + entry_text_changed(entry); return TRUE; } @@ -316,11 +330,14 @@ del_to_home(GntBindable *bind, GList *null) { GntEntry *entry = GNT_ENTRY(bind); + if (entry->cursor <= entry->start) + return TRUE; memmove(entry->start, entry->cursor, entry->end - entry->cursor); entry->end -= (entry->cursor - entry->start); entry->cursor = entry->scroll = entry->start; memset(entry->end, '\0', entry->buffer - (entry->end - entry->start)); entry_redraw(GNT_WIDGET(bind)); + entry_text_changed(entry); return TRUE; } @@ -328,9 +345,12 @@ del_to_end(GntBindable *bind, GList *null) { GntEntry *entry = GNT_ENTRY(bind); + if (entry->end <= entry->cursor) + return TRUE; entry->end = entry->cursor; memset(entry->end, '\0', entry->buffer - (entry->end - entry->start)); entry_redraw(GNT_WIDGET(bind)); + entry_text_changed(entry); return TRUE; } @@ -410,6 +430,7 @@ } memset(entry->end, '\0', entry->buffer - (entry->end - entry->start)); entry_redraw(widget); + entry_text_changed(entry); return TRUE; } @@ -434,11 +455,14 @@ GntWidget *widget = GNT_WIDGET(bind); char *iter = (char *)next_begin_word(entry->cursor, entry->end); int len = entry->end - iter + 1; + if (len <= 0) + return TRUE; memmove(entry->cursor, iter, len); len = iter - entry->cursor; entry->end -= len; memset(entry->end, '\0', len); entry_redraw(widget); + entry_text_changed(entry); return TRUE; } @@ -484,9 +508,10 @@ } else { - gnt_entry_set_text(entry, text); + gnt_entry_set_text_internal(entry, text); } g_free(text); + entry_text_changed(entry); return TRUE; } @@ -519,7 +544,7 @@ { /* This will cause the buffer to grow */ char *tmp = g_strdup_printf("%s%*s", entry->start, len, ""); - gnt_entry_set_text(entry, tmp); + gnt_entry_set_text_internal(entry, tmp); g_free(tmp); } @@ -543,6 +568,7 @@ show_suggest_dropdown(entry); } entry_redraw(widget); + entry_text_changed(entry); return TRUE; } } @@ -597,6 +623,15 @@ parent_class->key_pressed = gnt_entry_key_pressed; parent_class->lost_focus = gnt_entry_lost_focus; + signals[SIG_TEXT_CHANGED] = + g_signal_new("text_changed", + G_TYPE_FROM_CLASS(klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(GntEntryClass, text_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + gnt_bindable_class_register_action(bindable, "cursor-home", move_start, GNT_KEY_CTRL_A, NULL); gnt_bindable_register_binding(bindable, "cursor-home", GNT_KEY_HOME, NULL); @@ -703,12 +738,13 @@ GntWidget *widget = g_object_new(GNT_TYPE_ENTRY, NULL); GntEntry *entry = GNT_ENTRY(widget); - gnt_entry_set_text(entry, text); + gnt_entry_set_text_internal(entry, text); return widget; } -void gnt_entry_set_text(GntEntry *entry, const char *text) +static void +gnt_entry_set_text_internal(GntEntry *entry, const char *text) { int len; int scroll, cursor; @@ -741,6 +777,18 @@ entry_redraw(GNT_WIDGET(entry)); } +void gnt_entry_set_text(GntEntry *entry, const char *text) +{ + gboolean changed = TRUE; + if (text == NULL && entry->start == NULL) + changed = FALSE; + if (text && entry->start && g_utf8_collate(text, entry->start) == 0) + changed = FALSE; + gnt_entry_set_text_internal(entry, text); + if (changed) + entry_text_changed(entry); +} + void gnt_entry_set_max(GntEntry *entry, int max) { entry->max = max; @@ -759,10 +807,11 @@ void gnt_entry_clear(GntEntry *entry) { - gnt_entry_set_text(entry, NULL); + gnt_entry_set_text_internal(entry, NULL); entry->scroll = entry->cursor = entry->end = entry->start; entry_redraw(GNT_WIDGET(entry)); destroy_suggest(entry); + entry_text_changed(entry); } void gnt_entry_set_masked(GntEntry *entry, gboolean set) Modified: trunk/console/libgnt/gntentry.h =================================================================== --- trunk/console/libgnt/gntentry.h 2006-12-17 21:12:18 UTC (rev 18019) +++ trunk/console/libgnt/gntentry.h 2006-12-18 19:41:38 UTC (rev 18020) @@ -64,6 +64,7 @@ { GntWidgetClass parent; + void (*text_changed)(GntEntry *entry); void (*gnt_reserved1)(void); void (*gnt_reserved2)(void); void (*gnt_reserved3)(void); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2006-12-17 21:12:31
|
Revision: 18019 http://svn.sourceforge.net/gaim/?rev=18019&view=rev Author: boler Date: 2006-12-17 13:12:18 -0800 (Sun, 17 Dec 2006) Log Message: ----------- gg: Fixed double free() in ggp_pubdir_handle_info(). Modified Paths: -------------- trunk/libgaim/protocols/gg/gg.c Modified: trunk/libgaim/protocols/gg/gg.c =================================================================== --- trunk/libgaim/protocols/gg/gg.c 2006-12-17 20:14:41 UTC (rev 18018) +++ trunk/libgaim/protocols/gg/gg.c 2006-12-17 21:12:18 UTC (rev 18019) @@ -1046,13 +1046,11 @@ val = ggp_buddy_get_name(gc, ggp_str_to_uin(who)); g_free(who); - who = val; /* val = gaim_strdup_withhtml(text->str); */ - gaim_notify_userinfo(gc, who, user_info, ggp_sr_close_cb, form); + gaim_notify_userinfo(gc, val, user_info, ggp_sr_close_cb, form); g_free(val); - g_free(who); gaim_notify_user_info_destroy(user_info); } /* }}} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-12-17 20:14:42
|
Revision: 18018 http://svn.sourceforge.net/gaim/?rev=18018&view=rev Author: datallah Date: 2006-12-17 12:14:41 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Fix a crash when an invalid (or at least I think it is) upnp response is received. Modified Paths: -------------- trunk/libgaim/upnp.c Modified: trunk/libgaim/upnp.c =================================================================== --- trunk/libgaim/upnp.c 2006-12-17 19:17:36 UTC (rev 18017) +++ trunk/libgaim/upnp.c 2006-12-17 20:14:41 UTC (rev 18018) @@ -339,7 +339,7 @@ } tmp = xmlnode_get_data(controlURLNode); - if(!gaim_str_has_prefix(tmp, "http://") && + if(baseURL && !gaim_str_has_prefix(tmp, "http://") && !gaim_str_has_prefix(tmp, "HTTP://")) { controlURL = g_strdup_printf("%s%s", baseURL, tmp); g_free(tmp); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-17 19:17:42
|
Revision: 18017 http://svn.sourceforge.net/gaim/?rev=18017&view=rev Author: thekingant Date: 2006-12-17 11:17:36 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Print an error and don't set the icon if the file is too big Modified Paths: -------------- trunk/gtk/gtkutils.c Modified: trunk/gtk/gtkutils.c =================================================================== --- trunk/gtk/gtkutils.c 2006-12-17 13:07:25 UTC (rev 18016) +++ trunk/gtk/gtkutils.c 2006-12-17 19:17:36 UTC (rev 18017) @@ -2455,13 +2455,12 @@ } #endif -/* TODO: Use icon_spec.filesize */ char * gaim_gtk_convert_buddy_icon(GaimPlugin *plugin, const char *path) { GaimPluginProtocolInfo *prpl_info; +#if GTK_CHECK_VERSION(2,2,0) char **prpl_formats; -#if GTK_CHECK_VERSION(2,2,0) int width, height; char **pixbuf_formats = NULL; GdkPixbufFormat *format; @@ -2475,16 +2474,13 @@ const char *dirname; char *random; char *filename; + struct stat st; prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(plugin); g_return_val_if_fail(prpl_info->icon_spec.format != NULL, NULL); - prpl_formats = g_strsplit(prpl_info->icon_spec.format,",",0); dirname = gaim_buddy_icons_get_cache_dir(); - random = g_strdup_printf("%x", g_random_int()); - filename = g_build_filename(dirname, random, NULL); - if (!g_file_test(dirname, G_FILE_TEST_IS_DIR)) { gaim_debug_info("buddyicon", "Creating icon cache directory.\n"); @@ -2492,16 +2488,16 @@ gaim_debug_error("buddyicon", "Unable to create directory %s: %s\n", dirname, strerror(errno)); - g_strfreev(prpl_formats); - g_free(random); - g_free(filename); return NULL; } } + random = g_strdup_printf("%x", g_random_int()); + filename = g_build_filename(dirname, random, NULL); + #if GTK_CHECK_VERSION(2,2,0) #if GTK_CHECK_VERSION(2,4,0) - format = gdk_pixbuf_get_file_info (path, &width, &height); + format = gdk_pixbuf_get_file_info(path, &width, &height); #else loader = gdk_pixbuf_loader_new(); if (g_file_get_contents(path, &contents, &length, NULL)) { @@ -2517,8 +2513,9 @@ #endif if (format == NULL) return NULL; - pixbuf_formats = gdk_pixbuf_format_get_extensions(format); + pixbuf_formats = gdk_pixbuf_format_get_extensions(format); + prpl_formats = g_strsplit(prpl_info->icon_spec.format,",",0); if (str_array_match(pixbuf_formats, prpl_formats) && /* This is an acceptable format AND */ (!(prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_SEND) || /* The prpl doesn't scale before it sends OR */ (prpl_info->icon_spec.min_width <= width && @@ -2568,9 +2565,6 @@ #if GTK_CHECK_VERSION(2,2,0) && !GTK_CHECK_VERSION(2,4,0) g_object_unref(G_OBJECT(pixbuf)); #endif - - g_free(filename); - return random; } #if GTK_CHECK_VERSION(2,2,0) else @@ -2578,9 +2572,19 @@ int i; GError *error = NULL; GdkPixbuf *scale; + g_strfreev(pixbuf_formats); + pixbuf = gdk_pixbuf_new_from_file(path, &error); - g_strfreev(pixbuf_formats); - if (!error && (prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_SEND) && + if (error) { + gaim_debug_error("buddyicon", "Could not open icon for conversion: %s\n", error->message); + g_error_free(error); + g_free(random); + g_free(filename); + g_strfreev(prpl_formats); + return NULL; + } + + if ((prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_SEND) && (width < prpl_info->icon_spec.min_width || width > prpl_info->icon_spec.max_width || height < prpl_info->icon_spec.min_height || @@ -2591,42 +2595,79 @@ gaim_buddy_icon_get_scale_size(&prpl_info->icon_spec, &new_width, &new_height); - scale = gdk_pixbuf_scale_simple (pixbuf, new_width, new_height, + scale = gdk_pixbuf_scale_simple(pixbuf, new_width, new_height, GDK_INTERP_HYPER); g_object_unref(G_OBJECT(pixbuf)); pixbuf = scale; } - if (error) { - g_free(random); - g_free(filename); - gaim_debug_error("buddyicon", "Could not open icon for conversion: %s\n", error->message); - g_error_free(error); - g_strfreev(prpl_formats); - return NULL; - } for (i = 0; prpl_formats[i]; i++) { gaim_debug_info("buddyicon", "Converting buddy icon to %s as %s\n", prpl_formats[i], filename); - if (gdk_pixbuf_save(pixbuf, filename, prpl_formats[i], &error, NULL)) + if (strcmp(prpl_formats[i], "png") == 0) { + if (gdk_pixbuf_save(pixbuf, filename, prpl_formats[i], + &error, "compression", "9", NULL)) /* Success! */ break; + } else if (gdk_pixbuf_save(pixbuf, filename, prpl_formats[i], + &error, NULL)) { + /* Success! */ + break; + } gaim_debug_warning("buddyicon", "Could not convert to %s: %s\n", prpl_formats[i], error->message); g_error_free(error); error = NULL; } g_strfreev(prpl_formats); - if (!error) { - g_object_unref(G_OBJECT(pixbuf)); - g_free(filename); - return random; - } else { + g_object_unref(G_OBJECT(pixbuf)); + if (error) { gaim_debug_error("buddyicon", "Could not convert icon to usable format: %s\n", error->message); g_error_free(error); + g_free(random); + g_free(filename); + return NULL; } + } + + if (g_stat(filename, &st) != 0) { + gaim_debug_error("buddyicon", + "Could not stat '%s', which we just wrote to disk: %s\n", + filename, strerror(errno)); g_free(random); g_free(filename); - g_object_unref(G_OBJECT(pixbuf)); + return NULL; } + + /* Check the file size */ + /* + * TODO: If the file is too big, it would be cool if we checked if + * the prpl supported jpeg, and then we could convert to that + * and use a lower quality setting. + */ + if (st.st_size > prpl_info->icon_spec.max_filesize) + { + gchar *tmp; + tmp = g_strdup_printf(_("The file '%s' is too large for %s. Please try a smaller image.\n"), + path, plugin->info->name); + gaim_notify_error(NULL, _("Icon Error"), + _("Could not set icon"), tmp); + gaim_debug_info("buddyicon", + "'%s' was converted to an image which is %" G_GSIZE_FORMAT + " bytes, but the maximum icon size for %s is %" G_GSIZE_FORMAT + " bytes\n", path, st.st_size, plugin->info->name, + prpl_info->icon_spec.max_filesize); + g_free(tmp); + g_free(random); + g_free(filename); + return NULL; + } + + g_free(filename); + return random; +#else + /* + * The chosen icon wasn't the right size, and we're using + * GTK+ 2.0 so we can't scale it. + */ return NULL; #endif } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2006-12-17 13:07:27
|
Revision: 18016 http://svn.sourceforge.net/gaim/?rev=18016&view=rev Author: boler Date: 2006-12-17 05:07:25 -0800 (Sun, 17 Dec 2006) Log Message: ----------- gg: Don't crash with unexpected buddy list format. (Fixes #1609482) Modified Paths: -------------- trunk/libgaim/protocols/gg/buddylist.c trunk/libgaim/protocols/gg/gg-utils.c trunk/libgaim/protocols/gg/gg-utils.h Modified: trunk/libgaim/protocols/gg/buddylist.c =================================================================== --- trunk/libgaim/protocols/gg/buddylist.c 2006-12-17 12:59:04 UTC (rev 18015) +++ trunk/libgaim/protocols/gg/buddylist.c 2006-12-17 13:07:25 UTC (rev 18016) @@ -90,10 +90,8 @@ gchar **users_tbl; int i; - /* - * XXX: Limit of entries in a buddylist that will be imported. - */ - users_tbl = g_strsplit(buddylist, "\r\n", 200); + /* Don't limit a number of records in a buddylist. */ + users_tbl = g_strsplit(buddylist, "\r\n", -1); for (i = 0; users_tbl[i] != NULL; i++) { gchar **data_tbl; @@ -103,17 +101,23 @@ continue; data_tbl = g_strsplit(users_tbl[i], ";", 8); + if (ggp_array_size(data_tbl) < 8) { + gaim_debug_warning("gg", + "Something is wrong on line %d of the buddylist. Skipping.\n", + i + 1); + continue; + } show = charset_convert(data_tbl[3], "CP1250", "UTF-8"); name = data_tbl[6]; - if (NULL == name || '\0' == *name) { + if ('\0' == *name) { gaim_debug_warning("gg", "Something is wrong on line %d of the buddylist. Skipping.\n", i + 1); continue; } - if (NULL == show || '\0' == *show) { + if ('\0' == *show) { show = g_strdup(name); } @@ -127,10 +131,11 @@ g = g_strdup("Gadu-Gadu"); - if (strlen(data_tbl[5])) { + if ('\0' != data_tbl[5]) { + /* XXX: Probably buddy should be added to all the groups. */ /* Hard limit to at most 50 groups */ gchar **group_tbl = g_strsplit(data_tbl[5], ",", 50); - if (strlen(group_tbl[0]) > 0) { + if (ggp_array_size(group_tbl) > 0) { g_free(g); g = g_strdup(group_tbl[0]); } Modified: trunk/libgaim/protocols/gg/gg-utils.c =================================================================== --- trunk/libgaim/protocols/gg/gg-utils.c 2006-12-17 12:59:04 UTC (rev 18015) +++ trunk/libgaim/protocols/gg/gg-utils.c 2006-12-17 13:07:25 UTC (rev 18016) @@ -50,6 +50,18 @@ } /* }}} */ +/* unsigned int ggp_array_size(char **array) {{{ */ +unsigned int ggp_array_size(char **array) +{ + unsigned int i; + + for (i = 0; array[i] != NULL && i < UINT_MAX; i++) + {} + + return i; +} +/* }}} */ + /* char *charset_convert(const gchar *locstr, const char *encsrc, const char *encdst) {{{ */ char *charset_convert(const gchar *locstr, const char *encsrc, const char *encdst) { Modified: trunk/libgaim/protocols/gg/gg-utils.h =================================================================== --- trunk/libgaim/protocols/gg/gg-utils.h 2006-12-17 12:59:04 UTC (rev 18015) +++ trunk/libgaim/protocols/gg/gg-utils.h 2006-12-17 13:07:25 UTC (rev 18016) @@ -38,16 +38,27 @@ #include "gg.h" -/* +/** * Convert a base 10 string to a UIN. * * @param str The string to convert - * @return UIN or 0 if an error occurred. + * + * @return UIN or 0 if an error occurred. */ uin_t ggp_str_to_uin(const char *str); /** + * Calculate size of a NULL-terminated array. + * + * @param array The array. + * + * @return Size of the array. + */ +unsigned int +ggp_array_size(char **array); + +/** * Convert enconding of a given string. * * @param locstr Input string. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2006-12-17 12:59:07
|
Revision: 18015 http://svn.sourceforge.net/gaim/?rev=18015&view=rev Author: boler Date: 2006-12-17 04:59:04 -0800 (Sun, 17 Dec 2006) Log Message: ----------- gg: Don't send messages exceeding GG_MSG_MAXSIZE. (Fixes #1614894) Modified Paths: -------------- trunk/libgaim/protocols/gg/gg.c Modified: trunk/libgaim/protocols/gg/gg.c =================================================================== --- trunk/libgaim/protocols/gg/gg.c 2006-12-17 08:06:48 UTC (rev 18014) +++ trunk/libgaim/protocols/gg/gg.c 2006-12-17 12:59:04 UTC (rev 18015) @@ -1761,24 +1761,31 @@ { GGPInfo *info = gc->proto_data; char *tmp, *plain; + int ret = 0; - if (strlen(msg) == 0) - return 1; + if (strlen(msg) == 0) { + return 0; + } + gaim_debug_info("gg", "ggp_send_im: msg = %s\n", msg); plain = gaim_unescape_html(msg); - gaim_debug_info("gg", "ggp_send_im: msg = %s\n", msg); tmp = charset_convert(plain, "UTF-8", "CP1250"); - g_free(plain); - if (tmp != NULL && strlen(tmp) > 0) { - if (gg_send_message(info->session, GG_CLASS_CHAT, + if (NULL == tmp || strlen(tmp) == 0) { + ret = 0; + } else if (strlen(tmp) > GG_MSG_MAXSIZE) { + ret = -E2BIG; + } else if (gg_send_message(info->session, GG_CLASS_CHAT, ggp_str_to_uin(who), (unsigned char *)tmp) < 0) { - return -1; - } + ret = -1; + } else { + ret = 1; } + + g_free(plain); g_free(tmp); - return 1; + return ret; } /* }}} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-17 08:10:16
|
Revision: 18014 http://svn.sourceforge.net/gaim/?rev=18014&view=rev Author: thekingant Date: 2006-12-17 00:06:48 -0800 (Sun, 17 Dec 2006) Log Message: ----------- This started throwing an assertion failure for me recently Modified Paths: -------------- trunk/gtk/gtkblist.c Modified: trunk/gtk/gtkblist.c =================================================================== --- trunk/gtk/gtkblist.c 2006-12-17 05:38:48 UTC (rev 18013) +++ trunk/gtk/gtkblist.c 2006-12-17 08:06:48 UTC (rev 18014) @@ -6316,7 +6316,7 @@ GtkWidget *sortmenu; const char *m = gaim_prefs_get_string("/gaim/gtk/blist/sort_type"); - if (gtkblist == NULL) + if ((gtkblist == NULL) || (gtkblist->ift == NULL)) return; sortmenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Buddies/Sort Buddies")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-17 05:44:56
|
Revision: 18013 http://svn.sourceforge.net/gaim/?rev=18013&view=rev Author: thekingant Date: 2006-12-16 21:38:48 -0800 (Sat, 16 Dec 2006) Log Message: ----------- sf patch #1613563, from Ari Pollak, the spunkiest Debian packager this side of Soleil Moon Frye "This patch should fix at least one gstreamer crash, and it also fixes a potential memory leak." Modified Paths: -------------- trunk/gtk/gtksound.c Modified: trunk/gtk/gtksound.c =================================================================== --- trunk/gtk/gtksound.c 2006-12-17 05:04:23 UTC (rev 18012) +++ trunk/gtk/gtksound.c 2006-12-17 05:38:48 UTC (rev 18013) @@ -394,6 +394,7 @@ char *uri; GstElement *sink = NULL; GstElement *play = NULL; + GstBus *bus = NULL; #endif if (gaim_prefs_get_bool("/gaim/gtk/sound/mute")) @@ -434,9 +435,8 @@ command = g_strdup_printf("%s %s", sound_cmd, filename); if(!g_spawn_command_line_async(command, &error)) { - char *tmp = g_strdup_printf("sound command could not be launched: %s\n", error->message); - gaim_debug_error("gtksound", tmp); - g_free(tmp); + gaim_debug_error("gtksound", "sound command could not be launched: %s\n", error->message); + g_free(command); g_error_free(error); } @@ -453,21 +453,35 @@ } if (!sink) sink = gst_element_factory_make("autoaudiosink", "sink"); + if (!sink) { + gaim_debug_error("sound", "Unable to create GStreamer audiosink.\n"); + return; + } } else if (!strcmp(method, "esd")) { sink = gst_element_factory_make("esdsink", "sink"); + if (!sink) { + gaim_debug_error("sound", "Unable to create GStreamer audiosink.\n"); + return; + } + } else { + gaim_debug_error("sound", "Unknown sound method '%s'\n", method); + return; } - uri = g_strdup_printf("file://%s", filename); play = gst_element_factory_make("playbin", "play"); + uri = g_strdup_printf("file://%s", filename); + g_object_set(G_OBJECT(play), "uri", uri, "volume", volume, "audio-sink", sink, NULL); - gst_bus_add_watch(gst_pipeline_get_bus(GST_PIPELINE(play)), - bus_call, play); + bus = gst_pipeline_get_bus(GST_PIPELINE(play)); + gst_bus_add_watch(bus, bus_call, play); + gst_element_set_state(play, GST_STATE_PLAYING); + gst_object_unref(bus); g_free(uri); #else /* USE_GSTREAMER */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-17 05:09:17
|
Revision: 18012 http://svn.sourceforge.net/gaim/?rev=18012&view=rev Author: thekingant Date: 2006-12-16 21:04:23 -0800 (Sat, 16 Dec 2006) Log Message: ----------- * Get rid of an assertion failure that I think was happening when you added a new account without setting a custom icon for it, and you still had the Accounts window open * A little code-reuse in some buddy icon scaling code * An minor memleak that could happen when unable open a new file in $HOME/.gaim/icons/ Modified Paths: -------------- trunk/ChangeLog.API trunk/gtk/gtkaccount.c trunk/gtk/gtkblist.c trunk/gtk/gtkconv.c trunk/gtk/gtkutils.c trunk/libgaim/buddyicon.c Modified: trunk/ChangeLog.API =================================================================== --- trunk/ChangeLog.API 2006-12-17 04:55:12 UTC (rev 18011) +++ trunk/ChangeLog.API 2006-12-17 05:04:23 UTC (rev 18012) @@ -145,8 +145,13 @@ * gaim_gtk_set_custom_buddy_icon() sets custom icon for a user. * Hid the definition of _GaimStringref, which already had a warning to avoid accessing it directly. - * notify_userinfo() UI op is passed a GaimNotifyUserInfo instead of a char* - for the user information + * notify_userinfo() UI op is passed a GaimNotifyUserInfo instead of a char* + for the user information + * gaim_buddy_icon_get_scale_size() and + gaim_gtk_buddy_icon_get_scale_size() were changed to ALWAYS scale + the icon instead of only when icon_spec->scale_rules contains + GAIM_ICON_SCALE_DISPLAY. Callers should be changed to check the + scale_rules before calling this function. Removed: * gaim_gtk_sound_{get,set}_mute() (replaced by the /gaim/gtk/sound/mute Modified: trunk/gtk/gtkaccount.c =================================================================== --- trunk/gtk/gtkaccount.c 2006-12-17 04:55:12 UTC (rev 18011) +++ trunk/gtk/gtkaccount.c 2006-12-17 05:04:23 UTC (rev 18012) @@ -218,8 +218,9 @@ int width, height; GdkPixbuf *scale; - gaim_gtk_buddy_icon_get_scale_size(pixbuf, - &dialog->prpl_info->icon_spec, &width, &height); + if (dialog->prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_DISPLAY) + gaim_gtk_buddy_icon_get_scale_size(pixbuf, + &dialog->prpl_info->icon_spec, &width, &height); scale = gdk_pixbuf_scale_simple(pixbuf, width, height, GDK_INTERP_BILINEAR); g_object_unref(G_OBJECT(pixbuf)); @@ -614,7 +615,7 @@ if (!(dialog->prpl_info->options & OPT_PROTO_MAIL_CHECK)) gtk_widget_hide(dialog->new_mail_check); - if (!(dialog->prpl_info->icon_spec.format != NULL)) + if (dialog->prpl_info->icon_spec.format == NULL) gtk_widget_hide(dialog->icon_hbox); } @@ -1974,6 +1975,7 @@ static void set_account(GtkListStore *store, GtkTreeIter *iter, GaimAccount *account) { + const char *path; GdkPixbuf *pixbuf; GdkPixbuf *statusicon_pixbuf; GdkPixbuf *statusicon_pixbuf_scaled; @@ -1982,7 +1984,12 @@ if ((pixbuf != NULL) && gaim_account_is_disconnected(account)) gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf, 0.0, FALSE); - statusicon_pixbuf = gdk_pixbuf_new_from_file(gaim_account_get_ui_string(account, GAIM_GTK_UI, "non-global-buddyicon-path", NULL), NULL); + path = gaim_account_get_ui_string(account, GAIM_GTK_UI, "non-global-buddyicon-path", NULL); + if (path != NULL) + statusicon_pixbuf = gdk_pixbuf_new_from_file(path, NULL); + else + statusicon_pixbuf = NULL; + if (statusicon_pixbuf) { statusicon_pixbuf_scaled = gdk_pixbuf_scale_simple(statusicon_pixbuf, 16, 16, GDK_INTERP_HYPER); } else { Modified: trunk/gtk/gtkblist.c =================================================================== --- trunk/gtk/gtkblist.c 2006-12-17 04:55:12 UTC (rev 18011) +++ trunk/gtk/gtkblist.c 2006-12-17 05:04:23 UTC (rev 18012) @@ -2068,7 +2068,8 @@ scale_width = orig_width = gdk_pixbuf_get_width(buf); scale_height = orig_height = gdk_pixbuf_get_height(buf); - gaim_buddy_icon_get_scale_size(prpl_info ? &prpl_info->icon_spec : NULL, &scale_width, &scale_height); + if (prpl_info && prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_DISPLAY) + gaim_buddy_icon_get_scale_size(&prpl_info->icon_spec, &scale_width, &scale_height); if (scaled) { if(scale_height > scale_width) { Modified: trunk/gtk/gtkconv.c =================================================================== --- trunk/gtk/gtkconv.c 2006-12-17 04:55:12 UTC (rev 18011) +++ trunk/gtk/gtkconv.c 2006-12-17 05:04:23 UTC (rev 18012) @@ -2308,8 +2308,9 @@ gdk_pixbuf_animation_iter_advance(gtkconv->u.im->iter, NULL); buf = gdk_pixbuf_animation_iter_get_pixbuf(gtkconv->u.im->iter); - gaim_gtk_buddy_icon_get_scale_size(buf, prpl_info ? &prpl_info->icon_spec : - NULL, &scale_width, &scale_height); + if (prpl_info && prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_DISPLAY) + gaim_gtk_buddy_icon_get_scale_size(buf, &prpl_info->icon_spec, + &scale_width, &scale_height); /* this code is ugly, and scares me */ scale = gdk_pixbuf_scale_simple(buf, @@ -6024,8 +6025,9 @@ start_anim(NULL, gtkconv); } - gaim_gtk_buddy_icon_get_scale_size(buf, prpl_info ? &prpl_info->icon_spec : - NULL, &scale_width, &scale_height); + if (prpl_info && prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_DISPLAY) + gaim_gtk_buddy_icon_get_scale_size(buf, &prpl_info->icon_spec, + &scale_width, &scale_height); scale = gdk_pixbuf_scale_simple(buf, MAX(gdk_pixbuf_get_width(buf) * scale_width / gdk_pixbuf_animation_get_width(gtkconv->u.im->anim), 1), Modified: trunk/gtk/gtkutils.c =================================================================== --- trunk/gtk/gtkutils.c 2006-12-17 04:55:12 UTC (rev 18011) +++ trunk/gtk/gtkutils.c 2006-12-17 05:04:23 UTC (rev 18012) @@ -2455,6 +2455,7 @@ } #endif +/* TODO: Use icon_spec.filesize */ char * gaim_gtk_convert_buddy_icon(GaimPlugin *plugin, const char *path) { @@ -2467,11 +2468,10 @@ GdkPixbuf *pixbuf; #if !GTK_CHECK_VERSION(2,4,0) GdkPixbufLoader *loader; - FILE *file; - struct stat st; - void *data = NULL; #endif #endif + gchar *contents; + gsize length; const char *dirname; char *random; char *filename; @@ -2504,12 +2504,9 @@ format = gdk_pixbuf_get_file_info (path, &width, &height); #else loader = gdk_pixbuf_loader_new(); - if (!g_stat(path, &st) && (file = g_fopen(path, "rb")) != NULL) { - data = g_malloc(st.st_size); - fread(data, 1, st.st_size, file); - fclose(file); - gdk_pixbuf_loader_write(loader, data, st.st_size, NULL); - g_free(data); + if (g_file_get_contents(path, &contents, &length, NULL)) { + gdk_pixbuf_loader_write(loader, contents, length, NULL); + g_free(contents); } gdk_pixbuf_loader_close(loader, NULL); pixbuf = gdk_pixbuf_loader_get_pixbuf(loader); @@ -2530,8 +2527,6 @@ prpl_info->icon_spec.max_height >= height))) /* The icon is the correct size */ #endif { - gchar *contents; - gsize length; FILE *image; #if GTK_CHECK_VERSION(2,2,0) @@ -2539,13 +2534,15 @@ g_strfreev(pixbuf_formats); #endif - /* Copy the image to the cache folder as "filename". */ + /* We don't need to scale the image, so copy it to the cache folder verbatim */ + contents = NULL; if (!g_file_get_contents(path, &contents, &length, NULL) || (image = g_fopen(filename, "wb")) == NULL) { g_free(random); g_free(filename); + g_free(contents); #if GTK_CHECK_VERSION(2,2,0) && !GTK_CHECK_VERSION(2,4,0) g_object_unref(G_OBJECT(pixbuf)); #endif @@ -2592,23 +2589,8 @@ int new_width = width; int new_height = height; - if(new_width > prpl_info->icon_spec.max_width) - new_width = prpl_info->icon_spec.max_width; - else if(new_width < prpl_info->icon_spec.min_width) - new_width = prpl_info->icon_spec.min_width; - if(new_height > prpl_info->icon_spec.max_height) - new_height = prpl_info->icon_spec.max_height; - else if(new_height < prpl_info->icon_spec.min_height) - new_height = prpl_info->icon_spec.min_height; + gaim_buddy_icon_get_scale_size(&prpl_info->icon_spec, &new_width, &new_height); - /* preserve aspect ratio */ - if ((double)height * (double)new_width > - (double)width * (double)new_height) { - new_width = 0.5 + (double)width * (double)new_height / (double)height; - } else { - new_height = 0.5 + (double)height * (double)new_width / (double)width; - } - scale = gdk_pixbuf_scale_simple (pixbuf, new_width, new_height, GDK_INTERP_HYPER); g_object_unref(G_OBJECT(pixbuf)); @@ -2625,10 +2607,9 @@ for (i = 0; prpl_formats[i]; i++) { gaim_debug_info("buddyicon", "Converting buddy icon to %s as %s\n", prpl_formats[i], filename); - /* The gdk-pixbuf documentation is wrong. gdk_pixbuf_save returns TRUE if it was successful, - * FALSE if an error was set. */ - if (gdk_pixbuf_save (pixbuf, filename, prpl_formats[i], &error, NULL) == TRUE) - break; + if (gdk_pixbuf_save(pixbuf, filename, prpl_formats[i], &error, NULL)) + /* Success! */ + break; gaim_debug_warning("buddyicon", "Could not convert to %s: %s\n", prpl_formats[i], error->message); g_error_free(error); error = NULL; Modified: trunk/libgaim/buddyicon.c =================================================================== --- trunk/libgaim/buddyicon.c 2006-12-17 04:55:12 UTC (rev 18011) +++ trunk/libgaim/buddyicon.c 2006-12-17 05:04:23 UTC (rev 18012) @@ -546,32 +546,30 @@ void gaim_buddy_icon_get_scale_size(GaimBuddyIconSpec *spec, int *width, int *height) { - if(spec && spec->scale_rules & GAIM_ICON_SCALE_DISPLAY) { - int new_width, new_height; + int new_width, new_height; - new_width = *width; - new_height = *height; + new_width = *width; + new_height = *height; - if(*width < spec->min_width) - new_width = spec->min_width; - else if(*width > spec->max_width) - new_width = spec->max_width; + if (*width < spec->min_width) + new_width = spec->min_width; + else if (*width > spec->max_width) + new_width = spec->max_width; - if(*height < spec->min_height) - new_height = spec->min_height; - else if(*height > spec->max_height) - new_height = spec->max_height; + if (*height < spec->min_height) + new_height = spec->min_height; + else if (*height > spec->max_height) + new_height = spec->max_height; - /* preserve aspect ratio */ - if ((double)*height * (double)new_width > - (double)*width * (double)new_height) { - new_width = 0.5 + (double)*width * (double)new_height / (double)*height; - } else { - new_height = 0.5 + (double)*height * (double)new_width / (double)*width; - } - - *width = new_width; - *height = new_height; + /* preserve aspect ratio */ + if ((double)*height * (double)new_width > + (double)*width * (double)new_height) { + new_width = 0.5 + (double)*width * (double)new_height / (double)*height; + } else { + new_height = 0.5 + (double)*height * (double)new_width / (double)*width; } + + *width = new_width; + *height = new_height; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-17 04:59:39
|
Revision: 18011 http://svn.sourceforge.net/gaim/?rev=18011&view=rev Author: thekingant Date: 2006-12-16 20:55:12 -0800 (Sat, 16 Dec 2006) Log Message: ----------- I think this'll fix an occasional "invalid read of size 1 bytes" message from valgrind. I'm not sure when it happens... it seems like it would only happen for invalid packets (ones that don't end in 0xc0 80 or whatever it is) Modified Paths: -------------- trunk/libgaim/protocols/yahoo/yahoo_packet.c Modified: trunk/libgaim/protocols/yahoo/yahoo_packet.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo_packet.c 2006-12-16 09:58:26 UTC (rev 18010) +++ trunk/libgaim/protocols/yahoo/yahoo_packet.c 2006-12-17 04:55:12 UTC (rev 18011) @@ -155,8 +155,8 @@ pair->key = strtol(key, NULL, 10); accept = x; /* if x is 0 there was no key, so don't accept it */ - if (pos > len) { - /* Truncated. Garbage or something. */ + if (pos + 1 > len) { + /* Malformed packet! (Truncated--garbage or something) */ accept = FALSE; } @@ -164,7 +164,7 @@ delimiter = (const guchar *)strstr((char *)&data[pos], "\xc0\x80"); if (delimiter == NULL) { - /* Malformed packet! (it doesn't end in 0xc0 0x80) */ + /* Malformed packet! (It doesn't end in 0xc0 0x80) */ g_free(pair); pos = len; continue; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-12-16 09:58:26
|
Revision: 18010 http://svn.sourceforge.net/gaim/?rev=18010&view=rev Author: sadrul Date: 2006-12-16 01:58:26 -0800 (Sat, 16 Dec 2006) Log Message: ----------- Do not use gtkblist after freeing and setting it to NULL. Disconnect from the all signals when uniniting. Modified Paths: -------------- trunk/gtk/gtkblist.c Modified: trunk/gtk/gtkblist.c =================================================================== --- trunk/gtk/gtkblist.c 2006-12-15 10:35:18 UTC (rev 18009) +++ trunk/gtk/gtkblist.c 2006-12-16 09:58:26 UTC (rev 18010) @@ -4794,6 +4794,8 @@ static void gaim_gtk_blist_update(GaimBuddyList *list, GaimBlistNode *node) { + if (list) + gtkblist = GAIM_GTK_BLIST(list); if(!gtkblist || !node) return; @@ -4828,10 +4830,7 @@ if (!gtkblist) return; - gaim_signal_disconnect(gaim_connections_get_handle(), "signed-on", - gtkblist, GAIM_CALLBACK(sign_on_off_cb)); - gaim_signal_disconnect(gaim_connections_get_handle(), "signed-off", - gtkblist, GAIM_CALLBACK(sign_on_off_cb)); + gaim_signals_disconnect_by_handle(gtkblist); gtk_widget_destroy(gtkblist->window); @@ -4851,15 +4850,15 @@ gtkblist->window = gtkblist->vbox = gtkblist->treeview = NULL; gtkblist->treemodel = NULL; g_object_unref(G_OBJECT(gtkblist->ift)); - g_free(gtkblist); - accountmenu = NULL; - gtkblist = NULL; gdk_cursor_unref(gtkblist->hand_cursor); gdk_cursor_unref(gtkblist->arrow_cursor); gtkblist->hand_cursor = NULL; gtkblist->arrow_cursor = NULL; + g_free(gtkblist); + accountmenu = NULL; + gtkblist = NULL; gaim_prefs_disconnect_by_handle(gaim_gtk_blist_get_handle()); } @@ -5684,6 +5683,7 @@ void gaim_gtk_blist_uninit(void) { gaim_signals_unregister_by_instance(gaim_gtk_blist_get_handle()); + gaim_signals_disconnect_by_handle(gaim_gtk_blist_get_handle()); } /********************************************************************* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-15 10:39:18
|
Revision: 18009 http://svn.sourceforge.net/gaim/?rev=18009&view=rev Author: thekingant Date: 2006-12-15 02:35:18 -0800 (Fri, 15 Dec 2006) Log Message: ----------- Add a max_filesize attribute to the icon_spec struct. It's not actually used yet--I'll update the UI to do that later. Modified Paths: -------------- trunk/libgaim/protocols/bonjour/bonjour.c trunk/libgaim/protocols/jabber/jabber.c trunk/libgaim/protocols/msn/msn.c trunk/libgaim/protocols/oscar/libaim.c trunk/libgaim/protocols/oscar/libicq.c trunk/libgaim/protocols/qq/qq.c trunk/libgaim/protocols/silc/silc.c trunk/libgaim/protocols/yahoo/yahoo.c trunk/libgaim/prpl.h Modified: trunk/libgaim/protocols/bonjour/bonjour.c =================================================================== --- trunk/libgaim/protocols/bonjour/bonjour.c 2006-12-15 08:39:53 UTC (rev 18008) +++ trunk/libgaim/protocols/bonjour/bonjour.c 2006-12-15 10:35:18 UTC (rev 18009) @@ -356,7 +356,7 @@ OPT_PROTO_NO_PASSWORD, NULL, /* user_splits */ NULL, /* protocol_options */ - /* {"png", 0, 0, 96, 96, GAIM_ICON_SCALE_DISPLAY}, */ /* icon_spec */ + /* {"png", 0, 0, 96, 96, 0, GAIM_ICON_SCALE_DISPLAY}, */ /* icon_spec */ NO_BUDDY_ICONS, /* not yet */ /* icon_spec */ bonjour_list_icon, /* list_icon */ bonjour_list_emblems, /* list_emblems */ Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-12-15 08:39:53 UTC (rev 18008) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-12-15 10:35:18 UTC (rev 18009) @@ -1852,7 +1852,7 @@ OPT_PROTO_CHAT_TOPIC | OPT_PROTO_UNIQUE_CHATNAME | OPT_PROTO_MAIL_CHECK, NULL, /* user_splits */ NULL, /* protocol_options */ - {"png,gif,jpeg", 32, 32, 96, 96, GAIM_ICON_SCALE_SEND | GAIM_ICON_SCALE_DISPLAY}, /* icon_spec */ + {"png,gif,jpeg", 32, 32, 96, 96, 8191, GAIM_ICON_SCALE_SEND | GAIM_ICON_SCALE_DISPLAY}, /* icon_spec */ jabber_list_icon, /* list_icon */ jabber_list_emblems, /* list_emblems */ jabber_status_text, /* status_text */ Modified: trunk/libgaim/protocols/msn/msn.c =================================================================== --- trunk/libgaim/protocols/msn/msn.c 2006-12-15 08:39:53 UTC (rev 18008) +++ trunk/libgaim/protocols/msn/msn.c 2006-12-15 10:35:18 UTC (rev 18009) @@ -1954,7 +1954,7 @@ OPT_PROTO_MAIL_CHECK, NULL, /* user_splits */ NULL, /* protocol_options */ - {"png", 0, 0, 96, 96, GAIM_ICON_SCALE_SEND}, /* icon_spec */ + {"png", 0, 0, 96, 96, 0, GAIM_ICON_SCALE_SEND}, /* icon_spec */ msn_list_icon, /* list_icon */ msn_list_emblems, /* list_emblems */ msn_status_text, /* status_text */ Modified: trunk/libgaim/protocols/oscar/libaim.c =================================================================== --- trunk/libgaim/protocols/oscar/libaim.c 2006-12-15 08:39:53 UTC (rev 18008) +++ trunk/libgaim/protocols/oscar/libaim.c 2006-12-15 10:35:18 UTC (rev 18009) @@ -32,7 +32,7 @@ NULL, /* user_splits */ NULL, /* protocol_options */ /* The mimimum icon size below is not needed in AIM 6.0 */ - {"gif,jpeg,bmp,ico", 48, 48, 50, 50, + {"gif,jpeg,bmp,ico", 48, 48, 50, 50, 7168, GAIM_ICON_SCALE_SEND | GAIM_ICON_SCALE_DISPLAY}, /* icon_spec */ oscar_list_icon_aim, /* list_icon */ oscar_list_emblems, /* list_emblems */ Modified: trunk/libgaim/protocols/oscar/libicq.c =================================================================== --- trunk/libgaim/protocols/oscar/libicq.c 2006-12-15 08:39:53 UTC (rev 18008) +++ trunk/libgaim/protocols/oscar/libicq.c 2006-12-15 10:35:18 UTC (rev 18009) @@ -32,7 +32,7 @@ OPT_PROTO_MAIL_CHECK | OPT_PROTO_IM_IMAGE, NULL, /* user_splits */ NULL, /* protocol_options */ - {"gif,jpeg,bmp,ico", 48, 48, 50, 50, + {"gif,jpeg,bmp,ico", 48, 48, 50, 50, 7168, GAIM_ICON_SCALE_SEND | GAIM_ICON_SCALE_DISPLAY}, /* icon_spec */ oscar_list_icon_icq, /* list_icon */ oscar_list_emblems, /* list_emblems */ Modified: trunk/libgaim/protocols/qq/qq.c =================================================================== --- trunk/libgaim/protocols/qq/qq.c 2006-12-15 08:39:53 UTC (rev 18008) +++ trunk/libgaim/protocols/qq/qq.c 2006-12-15 10:35:18 UTC (rev 18009) @@ -653,7 +653,7 @@ OPT_PROTO_CHAT_TOPIC | OPT_PROTO_USE_POINTSIZE, NULL, /* user_splits */ NULL, /* protocol_options */ - {"png", 96, 96, 96, 96, GAIM_ICON_SCALE_SEND}, /* icon_spec */ + {"png", 96, 96, 96, 96, 0, GAIM_ICON_SCALE_SEND}, /* icon_spec */ _qq_list_icon, /* list_icon */ _qq_list_emblems, /* list_emblems */ _qq_status_text, /* status_text */ Modified: trunk/libgaim/protocols/silc/silc.c =================================================================== --- trunk/libgaim/protocols/silc/silc.c 2006-12-15 08:39:53 UTC (rev 18008) +++ trunk/libgaim/protocols/silc/silc.c 2006-12-15 10:35:18 UTC (rev 18009) @@ -1734,7 +1734,7 @@ NULL, /* user_splits */ NULL, /* protocol_options */ #ifdef SILC_ATTRIBUTE_USER_ICON - {"jpeg,gif,png,bmp", 0, 0, 96, 96, GAIM_ICON_SCALE_DISPLAY}, /* icon_spec */ + {"jpeg,gif,png,bmp", 0, 0, 96, 96, 0, GAIM_ICON_SCALE_DISPLAY}, /* icon_spec */ #else NO_BUDDY_ICONS, #endif Modified: trunk/libgaim/protocols/yahoo/yahoo.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo.c 2006-12-15 08:39:53 UTC (rev 18008) +++ trunk/libgaim/protocols/yahoo/yahoo.c 2006-12-15 10:35:18 UTC (rev 18009) @@ -3821,7 +3821,7 @@ OPT_PROTO_MAIL_CHECK | OPT_PROTO_CHAT_TOPIC, NULL, /* user_splits */ NULL, /* protocol_options */ - {"png,gif,jpeg", 96, 96, 96, 96, GAIM_ICON_SCALE_SEND}, + {"png,gif,jpeg", 96, 96, 96, 96, 0, GAIM_ICON_SCALE_SEND}, yahoo_list_icon, yahoo_list_emblems, yahoo_status_text, Modified: trunk/libgaim/prpl.h =================================================================== --- trunk/libgaim/prpl.h 2006-12-15 08:39:53 UTC (rev 18008) +++ trunk/libgaim/prpl.h 2006-12-15 10:35:18 UTC (rev 18009) @@ -46,23 +46,16 @@ * it should give this prpl, and what kind of image file it should expect back. * Dimensions less than 1 should be ignored and the image not scaled. */ -typedef struct { - char *format; /**< This is a comma-delimited list of image formats or NULL if icons are not supported. - * Neither the core nor the prpl will actually check to see if the data it's given matches this; it's - * entirely up to the UI to do what it wants */ - int min_width; /**< The minimum width of this icon */ - int min_height; /**< The minimum height of this icon */ - int max_width; /**< The maximum width of this icon */ - int max_height; /**< The maximum height of this icon */ - GaimIconScaleRules scale_rules; /**< How to stretch this icon */ -} GaimBuddyIconSpec; +typedef struct _GaimBuddyIconSpec GaimBuddyIconSpec; /** * This \#define exists just to make it easier to fill out the buddy icon * field in the prpl info struct for protocols that couldn't care less. */ -#define NO_BUDDY_ICONS {NULL, 0, 0, 0, 0, 0} +#define NO_BUDDY_ICONS {NULL, 0, 0, 0, 0, 0, 0} +#include <unistd.h> + #include "blist.h" #include "conversation.h" #include "ft.h" @@ -73,6 +66,18 @@ #include "status.h" #include "whiteboard.h" +struct _GaimBuddyIconSpec { + char *format; /**< This is a comma-delimited list of image formats or NULL if icons are not supported. + * Neither the core nor the prpl will actually check to see if the data it's given matches this; it's + * entirely up to the UI to do what it wants */ + int min_width; /**< The minimum width of this icon */ + int min_height; /**< The minimum height of this icon */ + int max_width; /**< The maximum width of this icon */ + int max_height; /**< The maximum height of this icon */ + size_t max_filesize; /**< The maximum number of bytes */ + GaimIconScaleRules scale_rules; /**< How to stretch this icon */ +}; + struct proto_chat_entry { const char *label; const char *identifier; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |