Mercurial > pidgin.yaz
diff pidgin/gtkaccount.c @ 17712:43a55528ff26
propagate from branch 'im.pidgin.pidgin' (head b5c55520ae8ff7186733fd82db23a6e4452976cc)
to branch 'im.pidgin.soc.2007.finchfeat' (head 93037197c5356731d62e75b4050ca7d01b1017d6)
author | Eric Polino <aluink@pidgin.im> |
---|---|
date | Mon, 04 Jun 2007 15:12:50 +0000 |
parents | 0d65b1438d99 |
children | 84c7b697adcd 38a72d6dce7f 678d78b7fa34 |
line wrap: on
line diff
--- a/pidgin/gtkaccount.c Mon Jun 04 05:05:42 2007 +0000 +++ b/pidgin/gtkaccount.c Mon Jun 04 15:12:50 2007 +0000 @@ -184,6 +184,7 @@ gtk_size_group_add_widget(dialog->sg, label); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), widget); gtk_widget_show(label); gtk_box_pack_start(GTK_BOX(hbox), widget, TRUE, TRUE, PIDGIN_HIG_BORDER); @@ -388,6 +389,8 @@ GtkWidget *hbox; GtkWidget *vbox; GtkWidget *entry; + GtkWidget *menu; + GtkWidget *item; GList *user_splits; GList *l, *l2; char *username = NULL; @@ -424,15 +427,18 @@ gtk_widget_ref(dialog->protocol_menu); } - hbox = add_pref_box(dialog, vbox, _("Protocol:"), dialog->protocol_menu); + hbox = add_pref_box(dialog, vbox, _("Pro_tocol:"), dialog->protocol_menu); g_object_set_data(G_OBJECT(dialog->protocol_menu), "container", hbox); gtk_widget_unref(dialog->protocol_menu); /* Screen name */ dialog->screenname_entry = gtk_entry_new(); - - add_pref_box(dialog, vbox, _("Screen name:"), dialog->screenname_entry); +#if GTK_CHECK_VERSION(2,10,0) + g_object_set(G_OBJECT(dialog->screenname_entry), "truncate-multiline", TRUE, NULL); +#endif + + add_pref_box(dialog, vbox, _("Screen _name:"), dialog->screenname_entry); g_signal_connect(G_OBJECT(dialog->screenname_entry), "changed", G_CALLBACK(screenname_changed_cb), dialog); @@ -474,7 +480,7 @@ GtkWidget *entry = l->data; PurpleAccountUserSplit *split = l2->data; - const char *value = NULL; + const char *value = NULL, *protocol = NULL; char *c; if (dialog->account != NULL) { @@ -488,10 +494,17 @@ value = c; } } - if (value == NULL) value = purple_account_user_split_get_default_value(split); + /* Google Talk default domain hackery! */ + menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(dialog->protocol_menu)); + item = gtk_menu_get_active(GTK_MENU(menu)); + protocol = g_object_get_data(G_OBJECT(item), "protocol"); + if (value == NULL && protocol != NULL && !strcmp(protocol, "prpl-fake") && + !strcmp(purple_account_user_split_get_text(split), _("Domain"))) + value = "gmail.com"; + if (value != NULL) gtk_entry_set_text(GTK_ENTRY(entry), value); } @@ -507,16 +520,16 @@ gtk_entry_set_visibility(GTK_ENTRY(dialog->password_entry), FALSE); if (gtk_entry_get_invisible_char(GTK_ENTRY(dialog->password_entry)) == '*') gtk_entry_set_invisible_char(GTK_ENTRY(dialog->password_entry), PIDGIN_INVISIBLE_CHAR); - dialog->password_box = add_pref_box(dialog, vbox, _("Password:"), + dialog->password_box = add_pref_box(dialog, vbox, _("_Password:"), dialog->password_entry); /* Alias */ dialog->alias_entry = gtk_entry_new(); - add_pref_box(dialog, vbox, _("Local alias:"), dialog->alias_entry); + add_pref_box(dialog, vbox, _("Local _alias:"), dialog->alias_entry); /* Remember Password */ dialog->remember_pass_check = - gtk_check_button_new_with_label(_("Remember password")); + gtk_check_button_new_with_mnemonic(_("Remember pass_word")); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->remember_pass_check), FALSE); gtk_box_pack_start(GTK_BOX(vbox), dialog->remember_pass_check, @@ -587,12 +600,12 @@ /* New mail notifications */ dialog->new_mail_check = - gtk_check_button_new_with_label(_("New mail notifications")); + gtk_check_button_new_with_mnemonic(_("New _mail notifications")); gtk_box_pack_start(GTK_BOX(vbox), dialog->new_mail_check, FALSE, FALSE, 0); gtk_widget_show(dialog->new_mail_check); /* Buddy icon */ - dialog->icon_check = gtk_check_button_new_with_label(_("Use this buddy icon for this account:")); + dialog->icon_check = gtk_check_button_new_with_mnemonic(_("Use this buddy _icon for this account:")); g_signal_connect(G_OBJECT(dialog->icon_check), "toggled", G_CALLBACK(icon_check_cb), dialog); gtk_widget_show(dialog->icon_check); gtk_box_pack_start(GTK_BOX(vbox), dialog->icon_check, FALSE, FALSE, 0); @@ -680,7 +693,7 @@ { PurpleAccountOption *option; PurpleAccount *account; - GtkWidget *frame, *vbox, *check, *entry, *combo; + GtkWidget *frame, *vbox, *check, *entry, *combo, *menu, *item; const GList *list, *node; gint i, idx, int_value; GtkListStore *model; @@ -690,7 +703,7 @@ GList *l; char buf[1024]; char *title; - const char *str_value; + const char *str_value, *protocol; gboolean bool_value; if (dialog->protocol_frame != NULL) { @@ -813,6 +826,14 @@ gtk_entry_set_invisible_char(GTK_ENTRY(entry), PIDGIN_INVISIBLE_CHAR); } + /* Google Talk default domain hackery! */ + menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(dialog->protocol_menu)); + item = gtk_menu_get_active(GTK_MENU(menu)); + protocol = g_object_get_data(G_OBJECT(item), "protocol"); + if (str_value == NULL && protocol != NULL && !strcmp(protocol, "prpl-fake") && + !strcmp(_("Connect server"), purple_account_option_get_text(option))) + str_value = "talk.google.com"; + if (str_value != NULL) gtk_entry_set_text(GTK_ENTRY(entry), str_value); @@ -1003,7 +1024,7 @@ if (dialog->proxy_frame != NULL) gtk_widget_destroy(dialog->proxy_frame); - frame = pidgin_make_frame(parent, _("Proxy Options")); + frame = pidgin_make_frame(parent, _("Pro_xy Options")); dialog->proxy_frame = gtk_widget_get_parent(gtk_widget_get_parent(frame)); gtk_box_reorder_child(GTK_BOX(parent), dialog->proxy_frame, 1); @@ -2007,19 +2028,26 @@ { GdkPixbuf *pixbuf, *buddyicon = NULL; PurpleStoredImage *img = NULL; + PurplePlugin *prpl; + PurplePluginProtocolInfo *prpl_info = NULL; pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_MEDIUM); if ((pixbuf != NULL) && purple_account_is_disconnected(account)) gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf, 0.0, FALSE); - if (purple_account_get_bool(account, "use-global-buddyicon", TRUE)) { - if (global_buddyicon != NULL) - buddyicon = g_object_ref(G_OBJECT(global_buddyicon)); - /* This is for when set_account() is called for a single account */ - else + prpl = purple_find_prpl(purple_account_get_protocol_id(account)); + if (prpl != NULL) + prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); + if (prpl_info != NULL && prpl_info->icon_spec.format != NULL) { + if (purple_account_get_bool(account, "use-global-buddyicon", TRUE)) { + if (global_buddyicon != NULL) + buddyicon = g_object_ref(G_OBJECT(global_buddyicon)); + /* This is for when set_account() is called for a single account */ + else + img = purple_buddy_icons_find_account_icon(account); + } else { img = purple_buddy_icons_find_account_icon(account); - } else { - img = purple_buddy_icons_find_account_icon(account); + } } if (img != NULL) {