[gthumb: 5/22] [picasaweb] return the email from the account chooser dialog



commit 77c57c7bf45c8e6ad050b877bf4a789a505586ba
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Jan 24 21:45:16 2010 +0100

    [picasaweb] return the email from the account chooser dialog

 extensions/picasaweb/dlg-export-to-picasaweb.c    |    2 +-
 extensions/picasaweb/gth-account-chooser-dialog.c |   15 ++++++++++++---
 extensions/picasaweb/gth-account-chooser-dialog.h |    2 +-
 3 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/extensions/picasaweb/dlg-export-to-picasaweb.c b/extensions/picasaweb/dlg-export-to-picasaweb.c
index 50bceaf..131d5dd 100644
--- a/extensions/picasaweb/dlg-export-to-picasaweb.c
+++ b/extensions/picasaweb/dlg-export-to-picasaweb.c
@@ -452,7 +452,7 @@ account_chooser_dialog_response_cb (GtkDialog *dialog,
 		g_free (data->challange);
 		data->challange = NULL;
 		g_free (data->email);
-		data->email = g_strdup (gth_account_chooser_dialog_get_active (GTH_ACCOUNT_CHOOSER_DIALOG (dialog)));
+		data->email = gth_account_chooser_dialog_get_active (GTH_ACCOUNT_CHOOSER_DIALOG (dialog));
 		if (data->email != NULL) {
 			gtk_widget_destroy (GTK_WIDGET (dialog));
 			connect_to_server (data);
diff --git a/extensions/picasaweb/gth-account-chooser-dialog.c b/extensions/picasaweb/gth-account-chooser-dialog.c
index e6e0436..49e5e17 100644
--- a/extensions/picasaweb/gth-account-chooser-dialog.c
+++ b/extensions/picasaweb/gth-account-chooser-dialog.c
@@ -172,9 +172,18 @@ gth_account_chooser_dialog_new (GList *accounts)
 }
 
 
-const char *
+char *
 gth_account_chooser_dialog_get_active (GthAccountChooserDialog *self)
 {
-	/* FIXME */
-	return NULL;
+	GtkTreeIter  iter;
+	char        *email;
+
+	if (! gtk_combo_box_get_active_iter (GTK_COMBO_BOX (GET_WIDGET ("account_combobox")), &iter))
+		return NULL;
+
+	gtk_tree_model_get (GTK_TREE_MODEL (GET_WIDGET ("account_liststore")), &iter,
+			    ACCOUNT_DATA_COLUMN, &email,
+			    -1);
+
+	return email;
 }
diff --git a/extensions/picasaweb/gth-account-chooser-dialog.h b/extensions/picasaweb/gth-account-chooser-dialog.h
index e467667..f2978a0 100644
--- a/extensions/picasaweb/gth-account-chooser-dialog.h
+++ b/extensions/picasaweb/gth-account-chooser-dialog.h
@@ -52,7 +52,7 @@ struct _GthAccountChooserDialogClass {
 
 GType          gth_account_chooser_dialog_get_type    (void);
 GtkWidget *    gth_account_chooser_dialog_new         (GList *accounts);
-const char *   gth_account_chooser_dialog_get_active  (GthAccountChooserDialog *self);
+char *         gth_account_chooser_dialog_get_active  (GthAccountChooserDialog *self);
 
 G_END_DECLS
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]