pidgin/gtkaccount.c

branch
soc.2008.masterpassword
changeset 34145
fa72f1e5cd77
parent 34111
85b5efb9a873
child 34304
faf0414a8b51
child 34585
cc4b9443deb9
equal deleted inserted replaced
34144:34e5e09a6291 34145:fa72f1e5cd77
116 116
117 /* Login Options */ 117 /* Login Options */
118 GtkWidget *login_frame; 118 GtkWidget *login_frame;
119 GtkWidget *protocol_menu; 119 GtkWidget *protocol_menu;
120 GtkWidget *password_box; 120 GtkWidget *password_box;
121 char *password; 121 gchar *password;
122 GtkWidget *username_entry; 122 GtkWidget *username_entry;
123 #if GTK_CHECK_VERSION(3,0,0) 123 #if GTK_CHECK_VERSION(3,0,0)
124 GdkRGBA username_entry_hint_color; 124 GdkRGBA username_entry_hint_color;
125 #else 125 #else
126 GdkColor *username_entry_hint_color; 126 GdkColor *username_entry_hint_color;
731 FALSE, FALSE, 0); 731 FALSE, FALSE, 0);
732 gtk_widget_show(dialog->remember_pass_check); 732 gtk_widget_show(dialog->remember_pass_check);
733 733
734 /* Set the fields. */ 734 /* Set the fields. */
735 if (dialog->account != NULL) { 735 if (dialog->account != NULL) {
736 if (dialog->password && 736 if (dialog->password && purple_account_get_remember_password(
737 purple_account_get_remember_password(dialog->account)) 737 dialog->account)) {
738 gtk_entry_set_text(GTK_ENTRY(dialog->password_entry), 738 gtk_entry_set_text(GTK_ENTRY(dialog->password_entry),
739 dialog->password); 739 dialog->password);
740 }
740 741
741 gtk_toggle_button_set_active( 742 gtk_toggle_button_set_active(
742 GTK_TOGGLE_BUTTON(dialog->remember_pass_check), 743 GTK_TOGGLE_BUTTON(dialog->remember_pass_check),
743 purple_account_get_remember_password(dialog->account)); 744 purple_account_get_remember_password(dialog->account));
744 } 745 }
1380 if (dialog->icon_filesel) 1381 if (dialog->icon_filesel)
1381 gtk_widget_destroy(dialog->icon_filesel); 1382 gtk_widget_destroy(dialog->icon_filesel);
1382 1383
1383 purple_signals_disconnect_by_handle(dialog); 1384 purple_signals_disconnect_by_handle(dialog);
1384 1385
1385 g_free(dialog->password); 1386 purple_str_wipe(dialog->password);
1386 1387
1387 g_free(dialog); 1388 g_free(dialog);
1388 return FALSE; 1389 return FALSE;
1389 } 1390 }
1390 1391
1525 } 1526 }
1526 } 1527 }
1527 1528
1528 1529
1529 /* Remember Password */ 1530 /* Remember Password */
1530 remember = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->remember_pass_check)); 1531 remember = gtk_toggle_button_get_active(
1532 GTK_TOGGLE_BUTTON(dialog->remember_pass_check));
1531 if(!remember) 1533 if(!remember)
1532 purple_keyring_set_password(account, NULL, NULL, NULL); 1534 purple_keyring_set_password(account, NULL, NULL, NULL);
1533 1535
1534 purple_account_set_remember_password(account, remember); 1536 purple_account_set_remember_password(account, remember);
1535 1537
1693 {"STRING", 0, 2} 1695 {"STRING", 0, 2}
1694 }; 1696 };
1695 1697
1696 static void 1698 static void
1697 pidgin_account_dialog_show_continue(PurpleAccount *account, 1699 pidgin_account_dialog_show_continue(PurpleAccount *account,
1698 const char *password, 1700 const gchar *password, GError *error, gpointer _type)
1699 GError *error, 1701 {
1700 gpointer data) 1702 PidginAccountDialogType type = GPOINTER_TO_INT(_type);
1701 {
1702 PidginAccountDialogType type = (PidginAccountDialogType)GPOINTER_TO_INT(data);
1703 AccountPrefsDialog *dialog; 1703 AccountPrefsDialog *dialog;
1704 GtkWidget *win; 1704 GtkWidget *win;
1705 GtkWidget *main_vbox; 1705 GtkWidget *main_vbox;
1706 GtkWidget *vbox; 1706 GtkWidget *vbox;
1707 GtkWidget *dbox; 1707 GtkWidget *dbox;
1720 if (accounts_window != NULL && account != NULL) 1720 if (accounts_window != NULL && account != NULL)
1721 { 1721 {
1722 g_hash_table_insert(account_pref_wins, account, dialog); 1722 g_hash_table_insert(account_pref_wins, account, dialog);
1723 } 1723 }
1724 1724
1725 dialog->account = account; 1725 dialog->account = account;
1726 dialog->password = g_strdup(password); 1726 dialog->password = g_strdup(password);
1727 dialog->type = type; 1727 dialog->type = type;
1728 dialog->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); 1728 dialog->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
1729 1729
1730 if (dialog->account == NULL) { 1730 if (dialog->account == NULL) {
1731 /* Select the first prpl in the list*/ 1731 /* Select the first prpl in the list*/
1732 GList *prpl_list = purple_plugins_get_protocols(); 1732 GList *prpl_list = purple_plugins_get_protocols();
1733 if (prpl_list != NULL) 1733 if (prpl_list != NULL)
1819 if (!account) 1819 if (!account)
1820 gtk_widget_grab_focus(dialog->protocol_menu); 1820 gtk_widget_grab_focus(dialog->protocol_menu);
1821 } 1821 }
1822 1822
1823 void 1823 void
1824 pidgin_account_dialog_show(PidginAccountDialogType type, 1824 pidgin_account_dialog_show(PidginAccountDialogType type, PurpleAccount *account)
1825 PurpleAccount *account)
1826 { 1825 {
1827 /* this is to make sure the password will be cached */ 1826 /* this is to make sure the password will be cached */
1828 purple_account_get_password(account, 1827 purple_account_get_password(account,
1829 pidgin_account_dialog_show_continue, GINT_TO_POINTER(type)); 1828 pidgin_account_dialog_show_continue, GINT_TO_POINTER(type));
1830 } 1829 }

mercurial