patch for flickr export



Hello,

Here's a patch that makes the flickr export dialogs save your user/pass.

James
? f-spot.desktop
? f-spot.desktop.in
? foo
? fspot_snorp_flickr_fixes_v1.diff
? src/f-spot.gladep
? src/f-spot.schemas
Index: src/FlickrExport.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/FlickrExport.cs,v
retrieving revision 1.13
diff -u -r1.13 FlickrExport.cs
--- src/FlickrExport.cs	3 Jun 2005 09:54:13 -0000	1.13
+++ src/FlickrExport.cs	7 Jun 2005 23:22:50 -0000
@@ -1,3 +1,5 @@
+using GConf.PropertyEditors;
+
 namespace FSpot {
 	public class FlickrExport : GladeDialog {
 		IPhotoCollection selection;
@@ -13,6 +15,8 @@
 		System.Threading.Thread command_thread;
 		ThreadProgressDialog progress_dialog;
 		ProgressItem progress_item;
+
+		PropertyEditorEntry entry_editor;
 		
 		bool open;
 		bool scale;
@@ -37,6 +41,9 @@
 
 			Dialog.ShowAll ();
 			Dialog.Response += HandleResponse;
+
+			entry_editor = new PropertyEditorEntry (SettingKeys.FlickrEmail, email_entry);
+			entry_editor.Setup ();
 		}
 
 		public void HandleSizeActive (object sender, System.EventArgs args)
@@ -48,21 +55,43 @@
 		{
 			Gtk.Dialog password_dialog = new Gtk.Dialog (Mono.Posix.Catalog.GetString ("Enter Password"),
 								     Dialog, Gtk.DialogFlags.Modal);
-			
+
+			Gtk.VBox box = new Gtk.VBox (false, 6);
+			box.BorderWidth = 12;
+                        
 			Gtk.Entry password_entry = new Gtk.Entry ();
 			password_entry.ActivatesDefault = true;
 			password_entry.Visibility = false;
 
-			password_dialog.VBox.BorderWidth = 12;
-			password_dialog.VBox.Spacing = 6;
-			password_dialog.VBox.PackStart (new Gtk.Label (Mono.Posix.Catalog.GetString ("Enter Password for ") + email));
-			password_dialog.VBox.PackStart (password_entry);
+			Gtk.CheckButton remember_button = new Gtk.CheckButton (Mono.Posix.Catalog.GetString ("Remember password"));
+
+			if (Settings.FlickrPassword != System.String.Empty)
+			{
+				password_entry.Text = Settings.FlickrPassword;
+				remember_button.Active = true;
+			}
+
+			box.PackStart (new Gtk.Label (Mono.Posix.Catalog.GetString ("Enter Password for ") + email));
+			box.PackStart (password_entry);
+			box.PackStart (remember_button);
+			password_dialog.VBox.PackStart (box);
+
 			password_dialog.AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok);
 			password_dialog.HasSeparator = false;
 			password_dialog.DefaultResponse = Gtk.ResponseType.Ok;
 			password_dialog.ShowAll ();
 			password_dialog.Run ();
-			string password =  password_entry.Text;
+
+			string password = password_entry.Text;
+			if (remember_button.Active)
+			{
+				Settings.FlickrPassword = password;
+			}
+			else
+			{
+				Settings.FlickrPassword = System.String.Empty;
+			}
+                        
 			password_dialog.Destroy ();
 			return password;
 		}
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gnome/f-spot/src/Makefile.am,v
retrieving revision 1.30
diff -u -r1.30 Makefile.am
--- src/Makefile.am	2 Jun 2005 22:12:20 -0000	1.30
+++ src/Makefile.am	7 Jun 2005 23:22:50 -0000
@@ -65,6 +65,7 @@
 	$(srcdir)/ProgressDialog.cs		\
 	$(srcdir)/RotateCommand.cs		\
 	$(srcdir)/ScalingIconView.cs		\
+	$(srcdir)/Settings.cs			\
 	$(srcdir)/SlideView.cs			\
 	$(srcdir)/StockIcons.cs			\
 	$(srcdir)/SimpleCalendar.cs		\
@@ -192,6 +193,12 @@
 	-resource:$(top_srcdir)/icons/f-spot-simple-white.css,f-spot-simple-white.css	\
 	-resource:$(srcdir)/f-spot.glade,f-spot.glade
 
+schema_in_files = f-spot.schemas.in
+schemadir = $(GCONF_SCHEMA_FILE_DIR)
+schema_DATA = $(schema_in_files:.schemas.in=.schemas)
+
+ INTLTOOL_SCHEMAS_RULE@
+
 fspotlibdir = $(libdir)/f-spot
 fspotlib_DATA = f-spot.exe.config	\
 		f-spot.exe
@@ -205,7 +212,13 @@
 
 all: f-spot.exe
 
+if GCONF_SCHEMAS_INSTALL
+install-data-local:
+	GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(schema_DATA)
+endif
+
 EXTRA_DIST =					\
+	$(schema_in_files)			\
 	$(F_SPOT_CSDISTFILES)			\
 	f-spot.exe.config.in			\
 	f-spot.glade				\

Attachment: smime.p7s
Description: S/MIME cryptographic signature



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