src/gtkblist.c

changeset 5438
1cdcbc2739a3
parent 5427
a45fa07ef20d
child 5439
ff403c91a5f8
equal deleted inserted replaced
5437:4bd5c5d271e6 5438:1cdcbc2739a3
868 868
869 if(g_slist_length(connections) > 1) 869 if(g_slist_length(connections) > 1)
870 accounttext = g_markup_escape_text(b->account->username, -1); 870 accounttext = g_markup_escape_text(b->account->username, -1);
871 871
872 text = g_strdup_printf("<span size='larger' weight='bold'>%s</span>" 872 text = g_strdup_printf("<span size='larger' weight='bold'>%s</span>"
873 "%s %s" /* Account */ 873 "%s %s" /* Account */
874 "%s %s" /* Alias */ 874 "%s %s" /* Alias */
875 "%s %s" /* Nickname */ 875 "%s %s" /* Nickname */
876 "%s %s" /* Idle */ 876 "%s %s" /* Idle */
877 "%s %s" /* Warning */ 877 "%s %s" /* Warning */
878 "%s%s" /* Status */ 878 "%s%s" /* Status */
879 "%s", 879 "%s",
880 b->name, 880 b->name,
881 accounttext ? _("\n<b>Account:</b>") : "", accounttext ? accounttext : "", 881 accounttext ? _("\n<b>Account:</b>") : "", accounttext ? accounttext : "",
882 aliastext ? _("\n<b>Alias:</b>") : "", aliastext ? aliastext : "", 882 aliastext ? _("\n<b>Alias:</b>") : "", aliastext ? aliastext : "",
883 nicktext ? _("\n<b>Nickname:</b>") : "", nicktext ? nicktext : "", 883 nicktext ? _("\n<b>Nickname:</b>") : "", nicktext ? nicktext : "",
884 idletime ? _("\n<b>Idle:</b>") : "", idletime ? idletime : "", 884 idletime ? _("\n<b>Idle:</b>") : "", idletime ? idletime : "",
885 b->evil ? _("\n<b>Warned:</b>") : "", b->evil ? warning : "", 885 b->evil ? _("\n<b>Warned:</b>") : "", b->evil ? warning : "",
886 statustext ? "\n" : "", statustext ? statustext : "", 886 statustext ? "\n" : "", statustext ? statustext : "",
887 !g_ascii_strcasecmp(b->name, "robflynn") ? _("\n<b>Description:</b> Spooky") : ""); 887 !g_ascii_strcasecmp(b->name, "robflynn") ? _("\n<b>Description:</b> Spooky") :
888 !g_ascii_strcasecmp(b->name, "seanegn") ? _("\n<b>Status</b>: Awesome") : "");
888 889
889 if(warning) 890 if(warning)
890 g_free(warning); 891 g_free(warning);
891 if(idletime) 892 if(idletime)
892 g_free(idletime); 893 g_free(idletime);
1317 return _(path); 1318 return _(path);
1318 } 1319 }
1319 1320
1320 void gaim_gtk_blist_setup_sort_methods() 1321 void gaim_gtk_blist_setup_sort_methods()
1321 { 1322 {
1322 gaim_gtk_blist_sort_method_reg("None", sort_method_none); 1323 gaim_gtk_blist_sort_method_reg(_("None"), sort_method_none);
1323 gaim_gtk_blist_sort_method_reg("Alphabetical", sort_method_alphabetical); 1324 gaim_gtk_blist_sort_method_reg(_("Alphabetical"), sort_method_alphabetical);
1324 gaim_gtk_blist_sort_method_reg("By status", sort_method_status); 1325 gaim_gtk_blist_sort_method_reg(_("By status"), sort_method_status);
1325 gaim_gtk_blist_sort_method_reg("By log size", sort_method_log); 1326 gaim_gtk_blist_sort_method_reg(_("By log size"), sort_method_log);
1326 gaim_gtk_blist_sort_method_set(sort_method[0] ? sort_method : "None"); 1327 gaim_gtk_blist_sort_method_set(sort_method[0] ? sort_method : _("None"));
1327 } 1328 }
1328 1329
1329 1330
1330 static void gaim_gtk_blist_show(struct gaim_buddy_list *list) 1331 static void gaim_gtk_blist_show(struct gaim_buddy_list *list)
1331 { 1332 {
2227 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &more_z, NODE_COLUMN, &val); 2228 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &more_z, NODE_COLUMN, &val);
2228 n = g_value_get_pointer(&val); 2229 n = g_value_get_pointer(&val);
2229 2230
2230 if (n && GAIM_BLIST_NODE_IS_BUDDY(n)) { 2231 if (n && GAIM_BLIST_NODE_IS_BUDDY(n)) {
2231 struct buddy *new = (struct buddy*)node, *it = (struct buddy*)n; 2232 struct buddy *new = (struct buddy*)node, *it = (struct buddy*)n;
2232 if (it->idle > new->idle) 2233 printf("Add %s (%d) before %s (%d)... ", new->name, new->idle, it->name, it->idle);
2234 /* This is the worst if statement ever. */
2235 if ((it->present < new->present) ||
2236 ((it->present == new->present) && (it->uc & UC_UNAVAILABLE) > (new->uc & UC_UNAVAILABLE)) ||
2237 ((it->present == new->present) && ((it->uc & UC_UNAVAILABLE) == (new->uc & UC_UNAVAILABLE)) &&
2238 ((it->idle && !new->idle) || (it->idle && (it->idle < new->idle)))) ||
2239 ((it->present == new->present) && (it->uc & UC_UNAVAILABLE) == (new->uc & UC_UNAVAILABLE) && (it->idle == new->idle) &&
2240 (gaim_utf8_strcasecmp(gaim_get_buddy_alias((struct buddy*)node), gaim_get_buddy_alias((struct buddy*)n)) < 0)))
2233 { 2241 {
2234 printf("Inserting %s before %s\n", new->name, it->name); 2242 printf("yes\n");
2235 gtk_tree_store_insert_before(gtkblist->treemodel, &iter, &groupiter, &more_z); 2243 gtk_tree_store_insert_before(gtkblist->treemodel, &iter, &groupiter, &more_z);
2236 newpath = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter); 2244 newpath = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter);
2237 gtknode->row = gtk_tree_row_reference_new(GTK_TREE_MODEL(gtkblist->treemodel), newpath); 2245 gtknode->row = gtk_tree_row_reference_new(GTK_TREE_MODEL(gtkblist->treemodel), newpath);
2238 gtk_tree_path_free(newpath); 2246 gtk_tree_path_free(newpath);
2239 return iter; 2247 return iter;
2240 } 2248 }
2249 printf("no\n");
2241 g_value_unset(&val); 2250 g_value_unset(&val);
2242 } 2251 }
2243 } while (gtk_tree_model_iter_next (GTK_TREE_MODEL(gtkblist->treemodel), &more_z)); 2252 } while (gtk_tree_model_iter_next (GTK_TREE_MODEL(gtkblist->treemodel), &more_z));
2244 2253
2245 gtk_tree_store_append(gtkblist->treemodel, &iter, &groupiter); 2254 gtk_tree_store_append(gtkblist->treemodel, &iter, &groupiter);

mercurial