Make GData plugin use the password store.
[claws.git] / src / plugins / gdata / cm_gdata_prefs.c
index a2082fd2fe36bb147bfe79495a4f347689cc38b4..83a23a6c17be0784aff4ea84df71d2d6f5ec0daa 100644 (file)
@@ -24,6 +24,7 @@
 #include <glib.h>
 #include <glib/gi18n.h>
 
+#include "password.h"
 #include "cm_gdata_prefs.h"
 #include "gdata_plugin.h"
 #include "cm_gdata_contacts.h"
@@ -38,7 +39,6 @@ typedef struct
 {
   PrefsPage page;
   GtkWidget *entry_username;
-  GtkWidget *entry_password;
   GtkWidget *spin_max_num_results;
   GtkWidget *spin_max_cache_age;
 } CmGDataPage;
@@ -51,15 +51,15 @@ PrefParam cm_gdata_param[] =
     {"username", NULL, &cm_gdata_config.username, P_STRING,
         &gdata_page.entry_username, prefs_set_data_from_entry, prefs_set_entry},
 
-    {"password", NULL, &cm_gdata_config.password, P_PASSWORD,
-        &gdata_page.entry_password, prefs_set_data_from_entry, prefs_set_entry},
-
     { "max_num_results", "1000", &cm_gdata_config.max_num_results, P_INT,
         &gdata_page.spin_max_num_results, prefs_set_data_from_spinbtn, prefs_set_spinbtn},
 
     { "max_cache_age", "300", &cm_gdata_config.max_cache_age, P_INT,
         &gdata_page.spin_max_cache_age, prefs_set_data_from_spinbtn, prefs_set_spinbtn},
 
+    {"oauth2_refresh_token", NULL, &cm_gdata_config.oauth2_refresh_token, P_PASSWORD,
+        NULL, NULL, NULL},
+
     {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL }
 };
 
@@ -88,14 +88,6 @@ static void gdata_create_prefs_page(PrefsPage *page, GtkWindow *window, gpointer
   gtk_widget_set_size_request(entry, 250, -1);
   gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, GTK_FILL, 4, 4);
   gdata_page.entry_username = entry;
-  label = gtk_label_new(_("Password:"));
-  gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-  gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 4, 4);
-  entry = gtk_entry_new();
-  gtk_widget_set_size_request(entry, 250, -1);
-  gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
-  gdata_page.entry_password = entry;
-  gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, GTK_FILL, 4, 4);
   gtk_container_add(GTK_CONTAINER(frame), table);
 
   table = gtk_table_new(2, 2, FALSE);