Mercurial > pidgin
changeset 19555:858d279314b2
merge of '493b97b58c0685edae9397f741d0171f9bcc7d2e'
and '6f5c855ee2435b317e7ddb8c9551fd17cd0328fe'
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Fri, 31 Aug 2007 17:57:50 +0000 |
parents | 5d178cf627e9 (diff) c07a9c6f0263 (current diff) |
children | 11de4598b4c5 |
files | |
diffstat | 3 files changed, 50 insertions(+), 40 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/gtkblist.c Thu Aug 30 18:38:15 2007 +0000 +++ b/pidgin/gtkblist.c Fri Aug 31 17:57:50 2007 +0000 @@ -3209,6 +3209,7 @@ { GdkPixbuf *ret; const char *protoname = NULL; + const char *icon = NULL; struct _pidgin_blist_node *gtknode = node->ui_data; struct _pidgin_blist_node *gtkbuddynode = NULL; PurpleBuddy *buddy = NULL; @@ -3257,62 +3258,54 @@ purple_buddy_get_name(buddy), purple_buddy_get_account(buddy)); PurplePresence *p; + gboolean trans; + if(conv != NULL) { PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); - if(gtkconv != NULL && pidgin_conv_is_hidden(gtkconv) && size == PIDGIN_STATUS_ICON_SMALL) { + if((gtkconv == NULL || pidgin_conv_is_hidden(gtkconv)) && size == PIDGIN_STATUS_ICON_SMALL) { return gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_MESSAGE, icon_size, "GtkTreeView"); } } + p = purple_buddy_get_presence(buddy); + trans = (purple_presence_is_idle(p) && size == PIDGIN_STATUS_ICON_SMALL); if (PURPLE_BUDDY_IS_ONLINE(buddy) && gtkbuddynode && gtkbuddynode->recent_signonoff) - ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_LOGIN, - icon_size, "GtkTreeView"); + icon = PIDGIN_STOCK_STATUS_LOGIN; else if (gtkbuddynode && gtkbuddynode->recent_signonoff) - ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_LOGOUT, - icon_size, "GtkTreeView"); + icon = PIDGIN_STOCK_STATUS_LOGOUT; else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_UNAVAILABLE)) - if (purple_presence_is_idle(p) && size == PIDGIN_STATUS_ICON_SMALL) - ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_BUSY_I, - icon_size, "GtkTreeView"); + if (trans) + icon = PIDGIN_STOCK_STATUS_BUSY_I; else - ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_BUSY, - icon_size, "GtkTreeView"); + icon = PIDGIN_STOCK_STATUS_BUSY; else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_AWAY)) - if (purple_presence_is_idle(p) && size == PIDGIN_STATUS_ICON_SMALL) - ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_AWAY_I, - icon_size, "GtkTreeView"); + if (trans) + icon = PIDGIN_STOCK_STATUS_AWAY_I; else - ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_AWAY, - icon_size, "GtkTreeView"); + icon = PIDGIN_STOCK_STATUS_AWAY; else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_EXTENDED_AWAY)) - if (purple_presence_is_idle(p) && size == PIDGIN_STATUS_ICON_SMALL) - ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_XA_I, - icon_size, "GtkTreeView"); + if (trans) + icon = PIDGIN_STOCK_STATUS_XA_I; else - ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_XA, - icon_size, "GtkTreeView"); + icon = PIDGIN_STOCK_STATUS_XA; else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_OFFLINE)) - ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_OFFLINE, - icon_size, "GtkTreeView"); - else if (purple_presence_is_idle(p) && size == PIDGIN_STATUS_ICON_SMALL) - ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_AVAILABLE_I, - icon_size, "GtkTreeView"); + icon = PIDGIN_STOCK_STATUS_OFFLINE; + else if (trans) + icon = PIDGIN_STOCK_STATUS_AVAILABLE_I; else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_INVISIBLE)) - ret = gtk_widget_render_icon(GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_INVISIBLE, - icon_size, "GtkTreeView"); + icon = PIDGIN_STOCK_STATUS_INVISIBLE; else - ret = gtk_widget_render_icon(GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_AVAILABLE, - icon_size, "GtkTreeView"); + icon = PIDGIN_STOCK_STATUS_AVAILABLE; } else if (chat) { - ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_CHAT, - icon_size, "GtkTreeView"); + icon = PIDGIN_STOCK_STATUS_CHAT; } else { - ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_PERSON, - icon_size, "GtkTreeView"); - } - + icon = PIDGIN_STOCK_STATUS_PERSON; + } + + ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), icon, + icon_size, "GtkTreeView"); return ret; } @@ -3335,7 +3328,7 @@ if(conv != NULL) { gtkconv = PIDGIN_CONVERSATION(conv); - if(gtkconv != NULL && pidgin_conv_is_hidden(gtkconv)) { + if(gtkconv == NULL || pidgin_conv_is_hidden(gtkconv)) { hidden_conv = TRUE; } }
--- a/pidgin/gtkimhtmltoolbar.c Thu Aug 30 18:38:15 2007 +0000 +++ b/pidgin/gtkimhtmltoolbar.c Fri Aug 31 17:57:50 2007 +0000 @@ -786,6 +786,7 @@ gtk_widget_set_sensitive(GTK_WIDGET(toolbar->bold), buttons & GTK_IMHTML_BOLD); gtk_widget_set_sensitive(GTK_WIDGET(toolbar->italic), buttons & GTK_IMHTML_ITALIC); gtk_widget_set_sensitive(GTK_WIDGET(toolbar->underline), buttons & GTK_IMHTML_UNDERLINE); + gtk_widget_set_sensitive(GTK_WIDGET(toolbar->strikethrough), buttons & GTK_IMHTML_STRIKE); gtk_widget_set_sensitive(GTK_WIDGET(toolbar->larger_size), buttons & GTK_IMHTML_GROW); gtk_widget_set_sensitive(GTK_WIDGET(toolbar->smaller_size), buttons & GTK_IMHTML_SHRINK); @@ -798,6 +799,7 @@ (buttons & GTK_IMHTML_BOLD || buttons & GTK_IMHTML_ITALIC || buttons & GTK_IMHTML_UNDERLINE || + buttons & GTK_IMHTML_STRIKE || buttons & GTK_IMHTML_GROW || buttons & GTK_IMHTML_SHRINK || buttons & GTK_IMHTML_FACE || @@ -831,7 +833,7 @@ static void update_buttons(GtkIMHtmlToolbar *toolbar) { - gboolean bold, italic, underline; + gboolean bold, italic, underline, strike; char *tmp; char *tmp2; GtkLabel *label = g_object_get_data(G_OBJECT(toolbar), "font_label"); @@ -840,6 +842,7 @@ gtk_imhtml_get_current_format(GTK_IMHTML(toolbar->imhtml), &bold, &italic, &underline); + strike = GTK_IMHTML(toolbar->imhtml)->edit.strike; if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toolbar->bold)) != bold) toggle_button_set_active_block(GTK_TOGGLE_BUTTON(toolbar->bold), bold, @@ -847,10 +850,12 @@ if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toolbar->italic)) != italic) toggle_button_set_active_block(GTK_TOGGLE_BUTTON(toolbar->italic), italic, toolbar); - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toolbar->underline)) != underline) toggle_button_set_active_block(GTK_TOGGLE_BUTTON(toolbar->underline), underline, toolbar); + if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toolbar->strikethrough)) != strike) + toggle_button_set_active_block(GTK_TOGGLE_BUTTON(toolbar->strikethrough), + strike, toolbar); /* These buttons aren't ever "active". */ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toolbar->smaller_size), FALSE); @@ -874,6 +879,12 @@ gtk_label_set_markup_with_mnemonic(label, markup); g_free(markup); } + if (strike) { + gchar *markup = g_strdup_printf("<s>%s</s>", + gtk_label_get_label(label)); + gtk_label_set_markup_with_mnemonic(label, markup); + g_free(markup); + } tmp = gtk_imhtml_get_current_fontface(GTK_IMHTML(toolbar->imhtml)); toggle_button_set_active_block(GTK_TOGGLE_BUTTON(toolbar->font),
--- a/pidgin/plugins/notify.c Thu Aug 30 18:38:15 2007 +0000 +++ b/pidgin/plugins/notify.c Fri Aug 31 17:57:50 2007 +0000 @@ -167,7 +167,7 @@ gboolean has_focus; PidginWindow *purplewin = NULL; - if (conv == NULL) + if (conv == NULL || PIDGIN_CONVERSATION(conv) == NULL) return 0; /* We want to remove the notifications, but not reset the counter */ @@ -224,6 +224,8 @@ PidginWindow *purplewin = NULL; g_return_if_fail(conv != NULL); + if (PIDGIN_CONVERSATION(conv) == NULL) + return; purplewin = PIDGIN_CONVERSATION(conv)->win; active_conv = pidgin_conv_window_get_active_conversation(purplewin); @@ -417,10 +419,14 @@ deleting_conv(PurpleConversation *conv) { PidginWindow *purplewin = NULL; + PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); + + if (gtkconv == NULL) + return; detach_signals(conv); - purplewin = PIDGIN_CONVERSATION(conv)->win; + purplewin = gtkconv->win; handle_urgent(purplewin, FALSE); purple_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(0));