From: <the...@us...> - 2006-05-08 17:13:38
|
Revision: 16148 Author: thekingant Date: 2006-05-07 14:19:46 -0700 (Sun, 07 May 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16148&view=rev Log Message: ----------- Don't set the statusbox icon before it's created Modified Paths: -------------- trunk/src/gtkstatusbox.c Modified: trunk/src/gtkstatusbox.c =================================================================== --- trunk/src/gtkstatusbox.c 2006-05-07 20:43:44 UTC (rev 16147) +++ trunk/src/gtkstatusbox.c 2006-05-07 21:19:46 UTC (rev 16148) @@ -914,7 +914,6 @@ gtk_cell_view_set_model(GTK_CELL_VIEW(status_box->cell_view), GTK_TREE_MODEL(status_box->store)); gtk_combo_box_set_wrap_width(GTK_COMBO_BOX(status_box), 0); gtk_list_store_append(status_box->store, &(status_box->iter)); - gtk_gaim_status_box_refresh(status_box); gtk_container_add(GTK_CONTAINER(status_box->toggle_button), status_box->hbox); gtk_box_pack_start(GTK_BOX(status_box->hbox), status_box->cell_view, TRUE, TRUE, 0); @@ -985,6 +984,7 @@ cache_pixbufs(status_box); gtk_gaim_status_box_regenerate(status_box); + gtk_gaim_status_box_refresh(status_box); gaim_prefs_connect_callback(status_box, "/core/savedstatus/current", current_status_pref_changed_cb, status_box); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-05-09 01:26:02
|
Revision: 16150 Author: thekingant Date: 2006-05-07 18:54:52 -0700 (Sun, 07 May 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16150&view=rev Log Message: ----------- I think this gets rid of an odd assertion failure. I didn't bother to track down exactly what was going on, but I THINK this should fix it. It certainly shouldn't cause any harm. Modified Paths: -------------- trunk/src/gtkstatusbox.c Modified: trunk/src/gtkstatusbox.c =================================================================== --- trunk/src/gtkstatusbox.c 2006-05-07 21:45:42 UTC (rev 16149) +++ trunk/src/gtkstatusbox.c 2006-05-08 01:54:52 UTC (rev 16150) @@ -1377,10 +1377,10 @@ return; } - activate_currently_selected_status(status_box); - g_source_remove(status_box->typing); status_box->typing = 0; + + activate_currently_selected_status(status_box); gtk_gaim_status_box_refresh(status_box); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-06-06 01:49:57
|
Revision: 16215 Author: rlaager Date: 2006-06-04 00:40:13 -0700 (Sun, 04 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16215&view=rev Log Message: ----------- Part of SF Patch #1500267 from Sadrul 'Fix for a couple of showstopper bugs on status + RFE "Changing from a saved status based on "Available" with a couple accounts Offline to the primitive "Available" didn't do anything. It showed Available - Typing, I think, but then didn't change my status. deryni confirmed this."' Modified Paths: -------------- trunk/src/gtkstatusbox.c Modified: trunk/src/gtkstatusbox.c =================================================================== --- trunk/src/gtkstatusbox.c 2006-06-04 06:37:25 UTC (rev 16214) +++ trunk/src/gtkstatusbox.c 2006-06-04 07:40:13 UTC (rev 16215) @@ -1267,7 +1267,8 @@ /* Has the status really been changed? */ saved_status = gaim_savedstatus_get_current(); - if (gaim_savedstatus_get_type(saved_status) == GPOINTER_TO_INT(data)) + if (gaim_savedstatus_get_type(saved_status) == GPOINTER_TO_INT(data) && + !gaim_savedstatus_has_substatuses(saved_status)) { if (!message_changed(gaim_savedstatus_get_message(saved_status), message)) changed = FALSE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-06-06 02:55:17
|
Revision: 16217 Author: rlaager Date: 2006-06-04 01:19:51 -0700 (Sun, 04 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16217&view=rev Log Message: ----------- The last of SF Patch #1500267 from Sadrul "if you press Escape when changing the status, it discards the changes and restores the statusbox to reflect current status." Modified Paths: -------------- trunk/src/gtkstatusbox.c Modified: trunk/src/gtkstatusbox.c =================================================================== --- trunk/src/gtkstatusbox.c 2006-06-04 08:14:25 UTC (rev 16216) +++ trunk/src/gtkstatusbox.c 2006-06-04 08:19:51 UTC (rev 16217) @@ -738,6 +738,16 @@ } if (!status_box->typing != 0) return FALSE; + + /* Reset the status if Escape was pressed */ + if (event->keyval == GDK_Escape) + { + g_source_remove(status_box->typing); + status_box->typing = 0; + status_menu_refresh_iter(status_box); + return TRUE; + } + gtk_gaim_status_box_pulse_typing(status_box); g_source_remove(status_box->typing); status_box->typing = g_timeout_add(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, status_box); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-06-06 02:55:20
|
Revision: 16216 Author: rlaager Date: 2006-06-04 01:14:25 -0700 (Sun, 04 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16216&view=rev Log Message: ----------- Part of SF Patch #1500267 from Sadrul 'Fix for a couple of showstopper bugs on status + RFE "The message should be cleared when changing statuses, not saved as it is now." Modified Paths: -------------- trunk/src/gtkstatusbox.c Modified: trunk/src/gtkstatusbox.c =================================================================== --- trunk/src/gtkstatusbox.c 2006-06-04 07:40:13 UTC (rev 16215) +++ trunk/src/gtkstatusbox.c 2006-06-04 08:14:25 UTC (rev 16216) @@ -1465,18 +1465,12 @@ { if (status_box->imhtml_visible) { - GtkTextBuffer *buf; - GtkTextIter start, end; gtk_widget_show_all(status_box->vbox); if (GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(status_box))) { status_box->typing = g_timeout_add(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, status_box); } gtk_widget_grab_focus(status_box->imhtml); - buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(status_box->imhtml)); - gtk_text_buffer_get_start_iter(buf, &start); - gtk_text_buffer_get_end_iter(buf, &end); - gtk_text_buffer_move_mark_by_name(buf, "insert", &end); - gtk_text_buffer_move_mark_by_name(buf, "selection_bound", &start); + gtk_imhtml_clear(GTK_IMHTML(status_box->imhtml)); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-06-19 04:48:55
|
Revision: 16279 Author: rlaager Date: 2006-06-18 21:48:50 -0700 (Sun, 18 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16279&view=rev Log Message: ----------- SF Patch #1508370 from Sadrul "I had overlooked the changes that were necessary to behave properly when Escape is pressed in the per-account status selectors. This patch amends that." Modified Paths: -------------- trunk/src/gtkstatusbox.c Modified: trunk/src/gtkstatusbox.c =================================================================== --- trunk/src/gtkstatusbox.c 2006-06-18 22:46:32 UTC (rev 16278) +++ trunk/src/gtkstatusbox.c 2006-06-19 04:48:50 UTC (rev 16279) @@ -744,7 +744,11 @@ { g_source_remove(status_box->typing); status_box->typing = 0; - status_menu_refresh_iter(status_box); + if (status_box->account != NULL) + update_to_reflect_account_status(status_box, status_box->account, + gaim_account_get_active_status(status_box->account)); + else + status_menu_refresh_iter(status_box); return TRUE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-08-16 17:27:00
|
Revision: 16794 Author: seanegan Date: 2006-08-16 10:26:57 -0700 (Wed, 16 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16794&view=rev Log Message: ----------- Only one file selector Modified Paths: -------------- trunk/src/gtkstatusbox.c Modified: trunk/src/gtkstatusbox.c =================================================================== --- trunk/src/gtkstatusbox.c 2006-08-16 17:10:36 UTC (rev 16793) +++ trunk/src/gtkstatusbox.c 2006-08-16 17:26:57 UTC (rev 16794) @@ -947,14 +947,12 @@ static gboolean icon_box_press_cb(GtkWidget *widget, GdkEventButton *event, GtkGaimStatusBox *box) { - GtkWidget *filesel; - if (box->buddy_icon_sel) { gtk_window_present(GTK_WINDOW(box->buddy_icon_sel)); return FALSE; } - filesel = gaim_gtk_buddy_icon_chooser_new(NULL, icon_choose_cb, box); + box->buddy_icon_sel = gaim_gtk_buddy_icon_chooser_new(NULL, icon_choose_cb, box); gtk_widget_show_all(filesel); return FALSE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-08-16 17:31:35
|
Revision: 16795 Author: seanegan Date: 2006-08-16 10:31:29 -0700 (Wed, 16 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16795&view=rev Log Message: ----------- Now with 'compiling' feature Modified Paths: -------------- trunk/src/gtkstatusbox.c Modified: trunk/src/gtkstatusbox.c =================================================================== --- trunk/src/gtkstatusbox.c 2006-08-16 17:26:57 UTC (rev 16794) +++ trunk/src/gtkstatusbox.c 2006-08-16 17:31:29 UTC (rev 16795) @@ -953,7 +953,7 @@ } box->buddy_icon_sel = gaim_gtk_buddy_icon_chooser_new(NULL, icon_choose_cb, box); - gtk_widget_show_all(filesel); + gtk_widget_show_all(box->buddy_icon_sel); return FALSE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-08-16 19:05:13
|
Revision: 16797 Author: seanegan Date: 2006-08-16 12:05:07 -0700 (Wed, 16 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16797&view=rev Log Message: ----------- fixes Modified Paths: -------------- trunk/src/gtkstatusbox.c Modified: trunk/src/gtkstatusbox.c =================================================================== --- trunk/src/gtkstatusbox.c 2006-08-16 18:55:17 UTC (rev 16796) +++ trunk/src/gtkstatusbox.c 2006-08-16 19:05:07 UTC (rev 16797) @@ -989,7 +989,6 @@ status_box->vsep = gtk_vseparator_new(); status_box->arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE); - status_box->buddy_icon = gdk_pixbuf_new_from_file("/home/seanegan/p1120233.jpg", NULL); status_box->icon = gtk_image_new_from_pixbuf(status_box->buddy_icon); status_box->icon_box = gtk_event_box_new(); status_box->hand_cursor = gdk_cursor_new (GDK_HAND2); @@ -1184,6 +1183,7 @@ { scaled = gdk_pixbuf_new_from_file_at_scale(status_box->buddy_icon_path, icon_alc.height, icon_alc.width, FALSE, NULL); + g_object_unref(status_box->buddy_icon_hover); status_box->buddy_icon_hover = gdk_pixbuf_copy(scaled); do_colorshift(status_box->buddy_icon_hover, status_box->buddy_icon_hover, 30); g_object_unref(status_box->buddy_icon); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-16 19:39:01
|
Revision: 16799 Author: sadrul Date: 2006-08-16 12:38:57 -0700 (Wed, 16 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16799&view=rev Log Message: ----------- Use the proper setting-name. "seanegan: sadrul: Looks good. You may want to set the non-global-buddyicon account setting if use-global-buddyicon is not set" Also, if the user sets the buddy-icon from a per-account box, it unsets the use-global-budduicon setting for that account. Modified Paths: -------------- trunk/src/gtkstatusbox.c Modified: trunk/src/gtkstatusbox.c =================================================================== --- trunk/src/gtkstatusbox.c 2006-08-16 19:21:04 UTC (rev 16798) +++ trunk/src/gtkstatusbox.c 2006-08-16 19:38:57 UTC (rev 16799) @@ -253,7 +253,8 @@ static void setup_icon_box(GtkGaimStatusBox *status_box) { - if (status_box->account) + if (status_box->account && + !gaim_account_get_ui_bool(status_box->account, GAIM_GTK_UI, "use-global-buddyicon", TRUE)) { char *string = gaim_buddy_icons_get_full_path(gaim_account_get_buddy_icon(status_box->account)); gtk_gaim_status_box_set_buddy_icon(status_box, string); @@ -1002,13 +1003,14 @@ char *icon = gaim_gtk_convert_buddy_icon(plug, filename); gaim_account_set_buddy_icon(box->account, icon); g_free(icon); + gaim_account_set_ui_bool(box->account, GAIM_GTK_UI, "use-global-buddyicon", FALSE); } } else { for (accounts = gaim_accounts_get_all(); accounts != NULL; accounts = accounts->next) { GaimAccount *account = accounts->data; GaimPlugin *plug = gaim_find_prpl(gaim_account_get_protocol_id(account)); GaimPluginProtocolInfo *prplinfo = GAIM_PLUGIN_PROTOCOL_INFO(plug); - if (gaim_account_get_ui_bool(account, GAIM_GTK_UI, "use-global-buddy-icon", TRUE) && + if (gaim_account_get_ui_bool(account, GAIM_GTK_UI, "use-global-buddyicon", TRUE) && prplinfo->icon_spec.format) { char *icon = gaim_gtk_convert_buddy_icon(plug, filename); gaim_account_set_buddy_icon(account, icon); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-08-16 20:50:21
|
Revision: 16800 Author: seanegan Date: 2006-08-16 13:50:16 -0700 (Wed, 16 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16800&view=rev Log Message: ----------- segfault fix Modified Paths: -------------- trunk/src/gtkstatusbox.c Modified: trunk/src/gtkstatusbox.c =================================================================== --- trunk/src/gtkstatusbox.c 2006-08-16 19:38:57 UTC (rev 16799) +++ trunk/src/gtkstatusbox.c 2006-08-16 20:50:16 UTC (rev 16800) @@ -998,23 +998,28 @@ if (box->account) { GaimPlugin *plug = gaim_find_prpl(gaim_account_get_protocol_id(box->account)); - GaimPluginProtocolInfo *prplinfo = GAIM_PLUGIN_PROTOCOL_INFO(plug); - if (prplinfo->icon_spec.format) { - char *icon = gaim_gtk_convert_buddy_icon(plug, filename); - gaim_account_set_buddy_icon(box->account, icon); - g_free(icon); - gaim_account_set_ui_bool(box->account, GAIM_GTK_UI, "use-global-buddyicon", FALSE); + if (plug) { + GaimPluginProtocolInfo *prplinfo = GAIM_PLUGIN_PROTOCOL_INFO(plug); + if (prplinfo && prplinfo->icon_spec.format) { + char *icon = gaim_gtk_convert_buddy_icon(plug, filename); + gaim_account_set_buddy_icon(box->account, icon); + g_free(icon); + gaim_account_set_ui_bool(box->account, GAIM_GTK_UI, "use-global-buddyicon", FALSE); + } } } else { for (accounts = gaim_accounts_get_all(); accounts != NULL; accounts = accounts->next) { GaimAccount *account = accounts->data; GaimPlugin *plug = gaim_find_prpl(gaim_account_get_protocol_id(account)); - GaimPluginProtocolInfo *prplinfo = GAIM_PLUGIN_PROTOCOL_INFO(plug); - if (gaim_account_get_ui_bool(account, GAIM_GTK_UI, "use-global-buddyicon", TRUE) && - prplinfo->icon_spec.format) { - char *icon = gaim_gtk_convert_buddy_icon(plug, filename); - gaim_account_set_buddy_icon(account, icon); - g_free(icon); + if (plug) { + GaimPluginProtocolInfo *prplinfo = GAIM_PLUGIN_PROTOCOL_INFO(plug); + if (prplinfo != NULL && + gaim_account_get_ui_bool(account, GAIM_GTK_UI, "use-global-buddyicon", TRUE) && + prplinfo->icon_spec.format) { + char *icon = gaim_gtk_convert_buddy_icon(plug, filename); + gaim_account_set_buddy_icon(account, icon); + g_free(icon); + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-18 00:19:22
|
Revision: 16822 Author: sadrul Date: 2006-08-17 17:19:18 -0700 (Thu, 17 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16822&view=rev Log Message: ----------- Patch #1541742 ("Add boolean property \"iconsel\" for Statusbox"): "This adds a boolean property "iconsel" for statusbox. Setting the property to TRUE shows the icon-selector, setting it to FALSE removes it. It would allow plugins like mystatusbox to better control the statusboxes, especially the per-account ones." Modified Paths: -------------- trunk/src/gtkstatusbox.c Modified: trunk/src/gtkstatusbox.c =================================================================== --- trunk/src/gtkstatusbox.c 2006-08-18 00:15:25 UTC (rev 16821) +++ trunk/src/gtkstatusbox.c 2006-08-18 00:19:18 UTC (rev 16822) @@ -115,7 +115,8 @@ enum { PROP_0, - PROP_ACCOUNT + PROP_ACCOUNT, + PROP_ICON_SEL, }; GtkComboBoxClass *parent_class = NULL; @@ -163,6 +164,9 @@ case PROP_ACCOUNT: g_value_set_pointer(value, statusbox->account); break; + case PROP_ICON_SEL: + g_value_set_boolean(value, statusbox->icon_box != NULL); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, param_id, psec); break; @@ -253,6 +257,9 @@ static void setup_icon_box(GtkGaimStatusBox *status_box) { + if (status_box->icon_box != NULL) + return; + if (status_box->account && !gaim_account_get_ui_bool(status_box->account, GAIM_GTK_UI, "use-global-buddyicon", TRUE)) { @@ -280,12 +287,54 @@ } static void +destroy_icon_box(GtkGaimStatusBox *statusbox) +{ + if (statusbox->icon_box == NULL) + return; + + gtk_widget_destroy(statusbox->icon_box); + gdk_cursor_unref(statusbox->hand_cursor); + gdk_cursor_unref(statusbox->arrow_cursor); + + g_object_unref(G_OBJECT(statusbox->buddy_icon)); + g_object_unref(G_OBJECT(statusbox->buddy_icon_hover)); + + if (statusbox->buddy_icon_sel) + gtk_widget_destroy(statusbox->buddy_icon_sel); + + g_free(statusbox->buddy_icon_path); + + statusbox->icon_box = NULL; + statusbox->buddy_icon_path = NULL; + statusbox->buddy_icon = NULL; + statusbox->buddy_icon_hover = NULL; + statusbox->hand_cursor = NULL; + statusbox->arrow_cursor = NULL; +} + +static void gtk_gaim_status_box_set_property(GObject *object, guint param_id, const GValue *value, GParamSpec *pspec) { GtkGaimStatusBox *statusbox = GTK_GAIM_STATUS_BOX(object); switch (param_id) { + case PROP_ICON_SEL: + if (g_value_get_boolean(value)) { + if (statusbox->account) { + GaimPlugin *plug = gaim_plugins_find_with_id(gaim_account_get_protocol_id(statusbox->account)); + if (plug) { + GaimPluginProtocolInfo *prplinfo = GAIM_PLUGIN_PROTOCOL_INFO(plug); + if (prplinfo && prplinfo->icon_spec.format != NULL) + setup_icon_box(statusbox); + } + } else { + setup_icon_box(statusbox); + } + } else { + destroy_icon_box(statusbox); + } + break; case PROP_ACCOUNT: statusbox->account = g_value_get_pointer(value); @@ -296,16 +345,9 @@ } if (statusbox->account) { - GaimPlugin *plug = gaim_plugins_find_with_id(gaim_account_get_protocol_id(statusbox->account)); - GaimPluginProtocolInfo *prplinfo = GAIM_PLUGIN_PROTOCOL_INFO(plug); - if (prplinfo && prplinfo->icon_spec.format != NULL) { - setup_icon_box(statusbox); - } statusbox->status_changed_signal = gaim_signal_connect(gaim_accounts_get_handle(), "account-status-changed", statusbox, GAIM_CALLBACK(account_status_changed_cb), statusbox); - } else { - setup_icon_box(statusbox); } gtk_gaim_status_box_regenerate(statusbox); @@ -365,6 +407,7 @@ combo_box_forall = container_class->forall; container_class->forall = gtk_gaim_status_box_forall; + container_class->remove = NULL; object_class = (GObjectClass *)klass; @@ -381,6 +424,15 @@ G_PARAM_READWRITE ) ); + g_object_class_install_property(object_class, + PROP_ICON_SEL, + g_param_spec_boolean("iconsel", + "Icon Selector", + "Whether the icon selector should be displayed or not.", + FALSE, + G_PARAM_READWRITE + ) + ); } /** @@ -1005,6 +1057,7 @@ gaim_account_set_buddy_icon(box->account, icon); g_free(icon); gaim_account_set_ui_bool(box->account, GAIM_GTK_UI, "use-global-buddyicon", FALSE); + gaim_account_set_ui_string(box->account, GAIM_GTK_UI, "non-global-buddyicon", icon); } } } else { @@ -1251,7 +1304,8 @@ GtkGaimStatusBox *status_box = GTK_GAIM_STATUS_BOX(widget); gtk_container_propagate_expose(GTK_CONTAINER(widget), status_box->vbox, event); gtk_container_propagate_expose(GTK_CONTAINER(widget), status_box->toggle_button, event); - gtk_container_propagate_expose(GTK_CONTAINER(widget), status_box->icon_box, event); + if (status_box->icon_box) + gtk_container_propagate_expose(GTK_CONTAINER(widget), status_box->icon_box, event); return FALSE; } @@ -1278,13 +1332,15 @@ GtkWidget * gtk_gaim_status_box_new() { - return g_object_new(GTK_GAIM_TYPE_STATUS_BOX, "account", NULL, NULL); + return g_object_new(GTK_GAIM_TYPE_STATUS_BOX, "account", NULL, + "iconsel", TRUE, NULL); } GtkWidget * gtk_gaim_status_box_new_with_account(GaimAccount *account) { - return g_object_new(GTK_GAIM_TYPE_STATUS_BOX, "account", account, NULL); + return g_object_new(GTK_GAIM_TYPE_STATUS_BOX, "account", account, + "iconsel", TRUE, NULL); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-08-18 03:50:03
|
Revision: 16826 Author: datallah Date: 2006-08-17 20:49:38 -0700 (Thu, 17 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16826&view=rev Log Message: ----------- Fix asserts at startup. Modified Paths: -------------- trunk/src/gtkstatusbox.c Modified: trunk/src/gtkstatusbox.c =================================================================== --- trunk/src/gtkstatusbox.c 2006-08-18 02:24:39 UTC (rev 16825) +++ trunk/src/gtkstatusbox.c 2006-08-18 03:49:38 UTC (rev 16826) @@ -1280,10 +1280,12 @@ { scaled = gdk_pixbuf_new_from_file_at_scale(status_box->buddy_icon_path, icon_alc.height, icon_alc.width, FALSE, NULL); - g_object_unref(status_box->buddy_icon_hover); + if (status_box->buddy_icon_hover) + g_object_unref(status_box->buddy_icon_hover); status_box->buddy_icon_hover = gdk_pixbuf_copy(scaled); do_colorshift(status_box->buddy_icon_hover, status_box->buddy_icon_hover, 30); - g_object_unref(status_box->buddy_icon); + if (status_box->buddy_icon) + g_object_unref(status_box->buddy_icon); status_box->buddy_icon = scaled; gtk_image_set_from_pixbuf(GTK_IMAGE(status_box->icon), status_box->buddy_icon); } @@ -1444,14 +1446,18 @@ { if (box->buddy_icon != NULL) g_object_unref(box->buddy_icon); - scaled = gdk_pixbuf_new_from_file_at_scale(filename, - box->icon_size, box->icon_size, FALSE, NULL); - if (scaled != NULL) - { - box->buddy_icon_hover = gdk_pixbuf_copy(scaled); - do_colorshift(box->buddy_icon_hover, box->buddy_icon_hover, 30); - box->buddy_icon = scaled; - gtk_image_set_from_pixbuf(GTK_IMAGE(box->icon), box->buddy_icon); + + /* This will get called before the box is shown and will not have a size */ + if (box->icon_size > 0) { + scaled = gdk_pixbuf_new_from_file_at_scale(filename, + box->icon_size, box->icon_size, FALSE, NULL); + if (scaled != NULL) + { + box->buddy_icon_hover = gdk_pixbuf_copy(scaled); + do_colorshift(box->buddy_icon_hover, box->buddy_icon_hover, 30); + box->buddy_icon = scaled; + gtk_image_set_from_pixbuf(GTK_IMAGE(box->icon), box->buddy_icon); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-08-18 05:56:14
|
Revision: 16828 Author: thekingant Date: 2006-08-17 22:56:10 -0700 (Thu, 17 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16828&view=rev Log Message: ----------- Get rid of an assertion failure when the selected icon is not a valid image Modified Paths: -------------- trunk/src/gtkstatusbox.c Modified: trunk/src/gtkstatusbox.c =================================================================== --- trunk/src/gtkstatusbox.c 2006-08-18 03:59:01 UTC (rev 16827) +++ trunk/src/gtkstatusbox.c 2006-08-18 05:56:10 UTC (rev 16828) @@ -1275,19 +1275,22 @@ if (status_box->icon_size != icon_alc.height) { + if (status_box->buddy_icon_hover) + g_object_unref(status_box->buddy_icon_hover); if ((status_box->buddy_icon_path != NULL) && (*status_box->buddy_icon_path != '\0')) { scaled = gdk_pixbuf_new_from_file_at_scale(status_box->buddy_icon_path, icon_alc.height, icon_alc.width, FALSE, NULL); - if (status_box->buddy_icon_hover) - g_object_unref(status_box->buddy_icon_hover); - status_box->buddy_icon_hover = gdk_pixbuf_copy(scaled); - do_colorshift(status_box->buddy_icon_hover, status_box->buddy_icon_hover, 30); - if (status_box->buddy_icon) - g_object_unref(status_box->buddy_icon); - status_box->buddy_icon = scaled; - gtk_image_set_from_pixbuf(GTK_IMAGE(status_box->icon), status_box->buddy_icon); + if (scaled != NULL) + { + status_box->buddy_icon_hover = gdk_pixbuf_copy(scaled); + do_colorshift(status_box->buddy_icon_hover, status_box->buddy_icon_hover, 30); + if (status_box->buddy_icon) + g_object_unref(status_box->buddy_icon); + status_box->buddy_icon = scaled; + gtk_image_set_from_pixbuf(GTK_IMAGE(status_box->icon), status_box->buddy_icon); + } } status_box->icon_size = icon_alc.height; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |