Mercurial > pidgin.yaz
comparison src/buddy.c @ 5135:102135caa225
[gaim-migrate @ 5499]
make use of KingAnt's uber-cool new notauthorized emblem, and let the prpls
stick text into the status line of the buddy to replace "Offline" if they
care to do so
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Tue, 15 Apr 2003 03:45:31 +0000 |
parents | feda37d46e17 |
children | 94f11800cac5 |
comparison
equal
deleted
inserted
replaced
5134:2acc2ee66597 | 5135:102135caa225 |
---|---|
393 gaim_gtk_blist_refresh(gaim_get_blist()); | 393 gaim_gtk_blist_refresh(gaim_get_blist()); |
394 } | 394 } |
395 | 395 |
396 static void gaim_gtk_blist_edit_mode_cb(gpointer callback_data, guint callback_action, | 396 static void gaim_gtk_blist_edit_mode_cb(gpointer callback_data, guint callback_action, |
397 GtkWidget *checkitem) { | 397 GtkWidget *checkitem) { |
398 GdkCursor *cursor = gdk_cursor_new(GDK_WATCH); | 398 if(gtkblist->window->window) { |
399 gdk_window_set_cursor(gtkblist->window->window, cursor); | 399 GdkCursor *cursor = gdk_cursor_new(GDK_WATCH); |
400 while (gtk_events_pending()) | 400 gdk_window_set_cursor(gtkblist->window->window, cursor); |
401 gtk_main_iteration(); | 401 while (gtk_events_pending()) |
402 gtk_main_iteration(); | |
403 gdk_cursor_unref(cursor); | |
404 } | |
405 | |
402 if(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(checkitem))) | 406 if(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(checkitem))) |
403 blist_options |= OPT_BLIST_SHOW_OFFLINE; | 407 blist_options |= OPT_BLIST_SHOW_OFFLINE; |
404 else | 408 else |
405 blist_options &= ~OPT_BLIST_SHOW_OFFLINE; | 409 blist_options &= ~OPT_BLIST_SHOW_OFFLINE; |
406 save_prefs(); | 410 save_prefs(); |
407 gdk_cursor_unref(cursor); | 411 |
408 cursor = gdk_cursor_new(GDK_LEFT_PTR); | 412 if(gtkblist->window->window) { |
409 gdk_window_set_cursor(gtkblist->window->window, cursor); | 413 GdkCursor *cursor = gdk_cursor_new(GDK_LEFT_PTR); |
410 gdk_cursor_unref(cursor); | 414 gdk_window_set_cursor(gtkblist->window->window, cursor); |
415 gdk_cursor_unref(cursor); | |
416 } | |
417 | |
411 gaim_gtk_blist_refresh(gaim_get_blist()); | 418 gaim_gtk_blist_refresh(gaim_get_blist()); |
412 } | 419 } |
413 | 420 |
414 static void gaim_gtk_blist_drag_data_get_cb (GtkWidget *widget, | 421 static void gaim_gtk_blist_drag_data_get_cb (GtkWidget *widget, |
415 GdkDragContext *dc, | 422 GdkDragContext *dc, |
1001 } | 1008 } |
1002 | 1009 |
1003 if (b->evil > 0) | 1010 if (b->evil > 0) |
1004 warning = g_strdup_printf(_("Warned (%d%%) "), b->evil); | 1011 warning = g_strdup_printf(_("Warned (%d%%) "), b->evil); |
1005 | 1012 |
1013 if(!GAIM_BUDDY_IS_ONLINE(b) && !statustext) | |
1014 statustext = g_strdup("Offline "); | |
1015 | |
1006 if (b->idle && blist_options & OPT_BLIST_GREY_IDLERS && !selected) { | 1016 if (b->idle && blist_options & OPT_BLIST_GREY_IDLERS && !selected) { |
1007 text = g_strdup_printf("<span color='dim grey'>%s</span>\n" | 1017 text = g_strdup_printf("<span color='dim grey'>%s</span>\n" |
1008 "<span color='dim grey' size='smaller'>%s%s%s%s</span>", | 1018 "<span color='dim grey' size='smaller'>%s%s%s</span>", |
1009 esc, | 1019 esc, |
1010 statustext != NULL ? statustext : "", | 1020 statustext != NULL ? statustext : "", |
1011 idletime != NULL ? idletime : "", | 1021 idletime != NULL ? idletime : "", |
1012 warning != NULL ? warning : "", | 1022 warning != NULL ? warning : ""); |
1013 !GAIM_BUDDY_IS_ONLINE(b) ? _("Offline ") : ""); | |
1014 } else if (statustext == NULL && idletime == NULL && warning == NULL && GAIM_BUDDY_IS_ONLINE(b)) { | 1023 } else if (statustext == NULL && idletime == NULL && warning == NULL && GAIM_BUDDY_IS_ONLINE(b)) { |
1015 text = g_strdup(esc); | 1024 text = g_strdup(esc); |
1016 } else { | 1025 } else { |
1017 text = g_strdup_printf("%s\n" | 1026 text = g_strdup_printf("%s\n" |
1018 "<span %s size='smaller'>%s%s%s%s</span>", esc, | 1027 "<span %s size='smaller'>%s%s%s</span>", esc, |
1019 selected ? "" : "color='dim grey'", | 1028 selected ? "" : "color='dim grey'", |
1020 statustext != NULL ? statustext : "", | 1029 statustext != NULL ? statustext : "", |
1021 idletime != NULL ? idletime : "", | 1030 idletime != NULL ? idletime : "", |
1022 warning != NULL ? warning : "", | 1031 warning != NULL ? warning : ""); |
1023 !GAIM_BUDDY_IS_ONLINE(b) ? _("Offline ") : ""); | |
1024 } | 1032 } |
1025 if (idletime) | 1033 if (idletime) |
1026 g_free(idletime); | 1034 g_free(idletime); |
1027 if (warning) | 1035 if (warning) |
1028 g_free(warning); | 1036 g_free(warning); |