pidgin/gtkaccount.c

branch
next.minor
changeset 29686
f9dee36112d0
parent 29226
88232e6c5591
parent 29500
1e0464dad92b
child 30635
e9893ecc9057
child 32388
9fc7219b95cc
equal deleted inserted replaced
29285:3180b88b4c1b 29686:f9dee36112d0
472 gtk_widget_unref(dialog->protocol_menu); 472 gtk_widget_unref(dialog->protocol_menu);
473 #endif 473 #endif
474 474
475 /* Username */ 475 /* Username */
476 dialog->username_entry = gtk_entry_new(); 476 dialog->username_entry = gtk_entry_new();
477 #if GTK_CHECK_VERSION(2,10,0)
478 g_object_set(G_OBJECT(dialog->username_entry), "truncate-multiline", TRUE, NULL); 477 g_object_set(G_OBJECT(dialog->username_entry), "truncate-multiline", TRUE, NULL);
479 #endif
480 478
481 add_pref_box(dialog, vbox, _("_Username:"), dialog->username_entry); 479 add_pref_box(dialog, vbox, _("_Username:"), dialog->username_entry);
482 480
483 if (dialog->account != NULL) 481 if (dialog->account != NULL)
484 username = g_strdup(purple_account_get_username(dialog->account)); 482 username = g_strdup(purple_account_get_username(dialog->account));
2079 g_object_unref(G_OBJECT(global_buddyicon)); 2077 g_object_unref(G_OBJECT(global_buddyicon));
2080 2078
2081 return ret; 2079 return ret;
2082 } 2080 }
2083 2081
2084 #if !GTK_CHECK_VERSION(2,2,0)
2085 static void
2086 get_selected_helper(GtkTreeModel *model, GtkTreePath *path,
2087 GtkTreeIter *iter, gpointer user_data)
2088 {
2089 *((gboolean *)user_data) = TRUE;
2090 }
2091 #endif
2092
2093 static void 2082 static void
2094 account_selected_cb(GtkTreeSelection *sel, AccountsWindow *dialog) 2083 account_selected_cb(GtkTreeSelection *sel, AccountsWindow *dialog)
2095 { 2084 {
2096 gboolean selected = FALSE; 2085 gboolean selected = FALSE;
2097 2086
2098 #if GTK_CHECK_VERSION(2,2,0)
2099 selected = (gtk_tree_selection_count_selected_rows(sel) > 0); 2087 selected = (gtk_tree_selection_count_selected_rows(sel) > 0);
2100 #else
2101 gtk_tree_selection_selected_foreach(sel, get_selected_helper, &selected);
2102 #endif
2103 2088
2104 gtk_widget_set_sensitive(dialog->modify_button, selected); 2089 gtk_widget_set_sensitive(dialog->modify_button, selected);
2105 gtk_widget_set_sensitive(dialog->delete_button, selected); 2090 gtk_widget_set_sensitive(dialog->delete_button, selected);
2106 } 2091 }
2107 2092

mercurial