f-spot r3765 - in trunk/extensions: . PicasaWebExport



Author: sdelcroix
Date: Thu Mar 20 12:56:36 2008
New Revision: 3765
URL: http://svn.gnome.org/viewvc/f-spot?rev=3765&view=rev

Log:
2008-03-20  Lorenzo Milesi <maxxer yetopen it>

	* PicasaWebExport/PicasaExport.glade:
	* PicasaWebExport/PicasaExport.cs: check if the current upload
	selection is fits the album photo# limit. Fix bgo#516553.


Modified:
   trunk/extensions/ChangeLog
   trunk/extensions/PicasaWebExport/PicasaWebExport.addin.xml
   trunk/extensions/PicasaWebExport/PicasaWebExport.cs
   trunk/extensions/PicasaWebExport/PicasaWebExport.glade

Modified: trunk/extensions/PicasaWebExport/PicasaWebExport.addin.xml
==============================================================================
--- trunk/extensions/PicasaWebExport/PicasaWebExport.addin.xml	(original)
+++ trunk/extensions/PicasaWebExport/PicasaWebExport.addin.xml	Thu Mar 20 12:56:36 2008
@@ -1,5 +1,5 @@
 <Addin namespace="FSpot"
-	version="1.2"
+	version="1.3"
 	name="PicasaWeb Export"
 	description="This extension allows you to export your photos to PicasaWeb."
 	author="F-Spot team"

Modified: trunk/extensions/PicasaWebExport/PicasaWebExport.cs
==============================================================================
--- trunk/extensions/PicasaWebExport/PicasaWebExport.cs	(original)
+++ trunk/extensions/PicasaWebExport/PicasaWebExport.cs	Thu Mar 20 12:56:36 2008
@@ -487,6 +487,7 @@
 			GoogleAccountManager manager = GoogleAccountManager.GetInstance ();
 			manager.AccountListChanged += PopulateGoogleOptionMenu;
 			PopulateGoogleOptionMenu (manager, null);
+			album_optionmenu.Changed += HandleAlbumOptionMenuChanged;
 
 			if (edit_button != null)
 				edit_button.Clicked += HandleEditGallery;
@@ -524,6 +525,7 @@
 		ArrayList accounts;
 		private GoogleAccount account;
 		private PicasaAlbum album;
+		private PicasaAlbumCollection albums = null;
 
 		private string xml_path;
 
@@ -546,6 +548,7 @@
 		[Glade.Widget] Gtk.Entry height_entry;
 
 		[Glade.Widget] Gtk.Label status_label;
+		[Glade.Widget] Gtk.Label album_status_label;
 
 		[Glade.Widget] Gtk.CheckButton browser_check;
 		[Glade.Widget] Gtk.CheckButton scale_check;
@@ -565,7 +568,6 @@
 		[Glade.Widget] Gtk.ScrolledWindow thumb_scrolledwindow;
 
 		System.Threading.Thread command_thread;
-		
 
 		private void HandleResponse (object sender, Gtk.ResponseArgs args)
 		{
@@ -822,7 +824,7 @@
 			PopulateAlbumOptionMenu (account.Picasa);
 				
 			// make the newly created album selected
-			PicasaAlbumCollection albums = account.Picasa.GetAlbums();
+//			PicasaAlbumCollection albums = account.Picasa.GetAlbums();
 			for (int i=0; i < albums.Count; i++) {
 				if (((PicasaAlbum)albums[i]).Title == title) {
 					album_optionmenu.SetHistory((uint)i);
@@ -832,12 +834,12 @@
 
 		private void PopulateAlbumOptionMenu (PicasaWeb picasa)
 		{
-			PicasaAlbumCollection albums = null;
 			if (picasa != null) {
 				try {
 					albums = picasa.GetAlbums();
 				} catch {
 					Console.WriteLine("Can't get the albums");
+					albums = null;
 					picasa = null;
 				}
 			}
@@ -864,6 +866,7 @@
 					System.Text.StringBuilder label_builder = new System.Text.StringBuilder ();
 					
 					label_builder.Append (album.Title);
+					label_builder.Append (" (" + album.PicturesCount + ")");
 
 					Gtk.MenuItem item = new Gtk.MenuItem (label_builder.ToString ());
 					((Gtk.Label)item.Child).UseUnderline = false;
@@ -879,6 +882,20 @@
 			album_optionmenu.Menu = menu;
 		}
 		
+		public void HandleAlbumOptionMenuChanged (object sender, System.EventArgs args)
+		{
+			PicasaAlbum a = albums [album_optionmenu.History];
+			export_button.Sensitive = a.PicturesRemaining >= items.Length;
+			if (album_status_label.Visible = !export_button.Sensitive) {
+				album_status_label.Text = String.Format (Catalog.GetString ("<small>The selected album has a limit of {0} pictures,\n" +
+									   "which would be passed with the current selection of {1} images</small>"), 
+									a.PicturesCount + a.PicturesRemaining, items.Length);
+				album_status_label.UseMarkup = true;
+			} else {
+				album_status_label.Text = String.Empty;
+			}
+		}
+		
 		public void HandleAddGallery (object sender, System.EventArgs args)
 		{
 			new GoogleAccountDialog (this.Dialog);

Modified: trunk/extensions/PicasaWebExport/PicasaWebExport.glade
==============================================================================
--- trunk/extensions/PicasaWebExport/PicasaWebExport.glade	(original)
+++ trunk/extensions/PicasaWebExport/PicasaWebExport.glade	Thu Mar 20 12:56:36 2008
@@ -215,6 +215,18 @@
                               </widget>
                             </child>
                             <child>
+                              <widget class="GtkLabel" id="album_status_label">
+                                <property name="visible">True</property>
+                                <property name="xalign">0</property>
+                                <property name="use_markup">True</property>
+                              </widget>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                            <child>
                               <widget class="GtkCheckButton" id="browser_check">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
@@ -227,7 +239,7 @@
                               <packing>
                                 <property name="expand">False</property>
                                 <property name="fill">False</property>
-                                <property name="position">1</property>
+                                <property name="position">2</property>
                               </packing>
                             </child>
                           </widget>



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