Mercurial > pidgin.yaz
comparison pidgin/gtkstatusbox.c @ 28835:61fd49ad0def
Disable 'Remove' when no icon set.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Fri, 30 Oct 2009 01:41:49 +0000 |
parents | a5c7229981be |
children | 5c2bbeef2eb8 e3206d6da6c7 |
comparison
equal
deleted
inserted
replaced
28834:6100cb11bae8 | 28835:61fd49ad0def |
---|---|
310 static gboolean | 310 static gboolean |
311 icon_box_press_cb(GtkWidget *widget, GdkEventButton *event, PidginStatusBox *box) | 311 icon_box_press_cb(GtkWidget *widget, GdkEventButton *event, PidginStatusBox *box) |
312 { | 312 { |
313 if (event->button == 3) { | 313 if (event->button == 3) { |
314 GtkWidget *menu_item; | 314 GtkWidget *menu_item; |
315 const char *path; | |
315 | 316 |
316 if (box->icon_box_menu) | 317 if (box->icon_box_menu) |
317 gtk_widget_destroy(box->icon_box_menu); | 318 gtk_widget_destroy(box->icon_box_menu); |
318 | 319 |
319 box->icon_box_menu = gtk_menu_new(); | 320 box->icon_box_menu = gtk_menu_new(); |
323 box, 0, 0, NULL); | 324 box, 0, 0, NULL); |
324 | 325 |
325 menu_item = pidgin_new_item_from_stock(box->icon_box_menu, _("Remove"), GTK_STOCK_REMOVE, | 326 menu_item = pidgin_new_item_from_stock(box->icon_box_menu, _("Remove"), GTK_STOCK_REMOVE, |
326 G_CALLBACK(remove_buddy_icon_cb), | 327 G_CALLBACK(remove_buddy_icon_cb), |
327 box, 0, 0, NULL); | 328 box, 0, 0, NULL); |
328 if (purple_prefs_get_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon") == NULL) | 329 if (!(path = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon")) |
330 || !*path) | |
329 gtk_widget_set_sensitive(menu_item, FALSE); | 331 gtk_widget_set_sensitive(menu_item, FALSE); |
330 | 332 |
331 gtk_menu_popup(GTK_MENU(box->icon_box_menu), NULL, NULL, NULL, NULL, | 333 gtk_menu_popup(GTK_MENU(box->icon_box_menu), NULL, NULL, NULL, NULL, |
332 event->button, event->time); | 334 event->button, event->time); |
333 | 335 |