[f-spot] Facebook Export: move album creation, so in case of error won't start uploading.
- From: Lorenzo Milesi <lmilesi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [f-spot] Facebook Export: move album creation, so in case of error won't start uploading.
- Date: Thu, 20 May 2010 08:17:56 +0000 (UTC)
commit 3960820418f31138d209878d607b158575904233
Author: Lorenzo Milesi <maxxer yetopen it>
Date: Thu May 20 10:16:37 2010 +0200
Facebook Export: move album creation, so in case of error won't start uploading.
Removed some SCWL.
.../Exporters/FacebookExport/FacebookExport.cs | 47 +++++++++----------
1 files changed, 22 insertions(+), 25 deletions(-)
---
diff --git a/extensions/Exporters/FacebookExport/FacebookExport.cs b/extensions/Exporters/FacebookExport/FacebookExport.cs
index a017aef..5113a68 100644
--- a/extensions/Exporters/FacebookExport/FacebookExport.cs
+++ b/extensions/Exporters/FacebookExport/FacebookExport.cs
@@ -264,6 +264,7 @@ namespace FSpot.Exporter.Facebook
FacebookExportDialog dialog;
ThreadProgressDialog progress_dialog;
System.Threading.Thread command_thread;
+ Album album = null;
public FacebookExport ()
{
@@ -284,34 +285,11 @@ namespace FSpot.Exporter.Facebook
return;
}
-
-
if (dialog.Run () != (int)ResponseType.Ok) {
dialog.Destroy ();
return;
}
- if (dialog.Account != null) {
- dialog.Hide ();
-
- command_thread = new System.Threading.Thread (new System.Threading.ThreadStart (Upload));
- command_thread.Name = Mono.Unix.Catalog.GetString ("Uploading Pictures");
-
- progress_dialog = new ThreadProgressDialog (command_thread, selection.Items.Length);
- progress_dialog.Start ();
- }
-
- dialog.Destroy ();
- }
-
- void Upload ()
- {
- Album album = null;
-
- IBrowsableItem [] items = dialog.Items;
- string [] captions = dialog.Captions;
- dialog.StoreCaption ();
-
if (dialog.CreateAlbum) {
string name = dialog.AlbumName;
if (String.IsNullOrEmpty (name)) {
@@ -341,6 +319,25 @@ namespace FSpot.Exporter.Facebook
album = dialog.ActiveAlbum;
}
+ if (dialog.Account != null) {
+ dialog.Hide ();
+
+ command_thread = new System.Threading.Thread (new System.Threading.ThreadStart (Upload));
+ command_thread.Name = Mono.Unix.Catalog.GetString ("Uploading Pictures");
+
+ progress_dialog = new ThreadProgressDialog (command_thread, selection.Items.Length);
+ progress_dialog.Start ();
+ }
+
+ dialog.Destroy ();
+ }
+
+ void Upload ()
+ {
+ IBrowsableItem [] items = dialog.Items;
+ string [] captions = dialog.Captions;
+ dialog.StoreCaption ();
+
long sent_bytes = 0;
FilterSet filters = new FilterSet ();
@@ -352,7 +349,7 @@ namespace FSpot.Exporter.Facebook
IBrowsableItem item = items [i];
FileInfo file_info;
- Console.WriteLine ("uploading {0}", i);
+ Log.Debug ("uploading {0}", i);
progress_dialog.Message = String.Format (Catalog.GetString ("Uploading picture \"{0}\" ({1} of {2})"), item.Name, i + 1, items.Length);
progress_dialog.ProgressText = string.Empty;
@@ -370,7 +367,7 @@ namespace FSpot.Exporter.Facebook
catch (Exception e) {
progress_dialog.Message = String.Format (Catalog.GetString ("Error Uploading To Facebook: {0}"), e.Message);
progress_dialog.ProgressText = Catalog.GetString ("Error");
- Console.WriteLine (e);
+ Log.DebugException (e);
if (progress_dialog.PerformRetrySkip ())
i--;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]