All pastes #209623 Raw Edit

Untitled

public text v1 · immutable
#209623 ·published 2006-10-19 08:23 UTC
rendered paste body
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/f-spot/ChangeLog,v
retrieving revision 1.1649
diff -u -p -r1.1649 ChangeLog
--- ChangeLog   19 Oct 2006 04:01:56 -0000      1.1649
+++ ChangeLog   19 Oct 2006 08:22:11 -0000
@@ -1,3 +1,9 @@
+2006-10-19  Thomas Van Machelen  <thomas.vanmachelen@gmail.com>
+
+       * src/Preferences.cs:
+       * src/FolderExport.cs: Store the export setting in GConf. Fixes bgo
+       #353539.
+
 2006-10-18  Gabriel Burt  <gabriel.burt@gmail.com>

        * src/OpenWithMenu.cs:
Index: src/FolderExport.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/FolderExport.cs,v
retrieving revision 1.37
diff -u -p -r1.37 FolderExport.cs
--- src/FolderExport.cs 8 Oct 2006 02:41:16 -0000       1.37
+++ src/FolderExport.cs 19 Oct 2006 08:22:12 -0000
@@ -116,6 +116,12 @@ namespace FSpot {

                        //LoadHistory ();
                        Dialog.Response += HandleResponse;
+
+                       LoadPreference (Preferences.EXPORT_FOLDER_SCALE);
+                       LoadPreference (Preferences.EXPORT_FOLDER_SIZE);
+                       LoadPreference (Preferences.EXPORT_FOLDER_OPEN);
+                       LoadPreference (Preferences.EXPORT_FOLDER_ROTATE);
+                       LoadPreference (Preferences.EXPORT_FOLDER_METHOD);
                }

                public void HandleSizeActive (object sender, System.EventArgs args)
@@ -195,6 +201,14 @@ namespace FSpot {
                                if (open) {
                                        GnomeUtil.UrlShow (null, target.ToString ());
                                }
+
+                               // Save these settings for next time
+                               Preferences.Set (Preferences.EXPORT_FOLDER_SCALE, scale);
+                               Preferences.Set (Preferences.EXPORT_FOLDER_SIZE, size);
+                               Preferences.Set (Preferences.EXPORT_FOLDER_OPEN, open);
+                               Preferences.Set (Preferences.EXPORT_FOLDER_ROTATE, rotate);
+                               Preferences.Set (Preferences.EXPORT_FOLDER_METHOD, static_radio.Active ? "static" : original_radio.Active ? "original" : "folder" );
+
                        } catch (System.Exception e) {
                                progress_dialog.Message = e.ToString ();
                                progress_dialog.ProgressText = Mono.Posix.Catalog.GetString ("Error Transferring");
@@ -205,6 +219,7 @@ namespace FSpot {
                                        System.IO.Directory.Delete (gallery_path, true);

                                Gtk.Application.Invoke (delegate { Dialog.Destroy(); });
+
                        }
                }

@@ -284,6 +299,42 @@ namespace FSpot {
                        // this should actually be 1 anyway, because we transfer just one dir
                        progress_dialog = new FSpot.ThreadProgressDialog (command_thread, 1);
                        progress_dialog.Start ();
+               }
+
+               void LoadPreference (string key)
+               {
+                       object val = Preferences.Get (key);
+
+                       if (val == null)
+                               return;
+
+                       //System.Console.WriteLine ("Setting {0} to {1}", key, val);
+
+                       switch (key) {
+                       case Preferences.EXPORT_FOLDER_SCALE:
+                               if (scale_check.Active != (bool) val)
+                                       scale_check.Active = (bool) val;
+                               break;
+
+                       case Preferences.EXPORT_FOLDER_SIZE:
+                               size_spin.Value = (double) (int) val;
+                               break;
+
+                       case Preferences.EXPORT_FOLDER_OPEN:
+                               if (open_check.Active != (bool) val)
+                                       open_check.Active = (bool) val;
+                               break;
+
+                       case Preferences.EXPORT_FOLDER_ROTATE:
+                               if (rotate_check.Active != (bool) val)
+                                       rotate_check.Active = (bool) val;
+                               break;
+                       case Preferences.EXPORT_FOLDER_METHOD:
+                               static_radio.Active = (string) val == "static";
+                               original_radio.Active = (string) val == "original";
+                               plain_radio.Active = (string) val == "folder";
+                               break;
+                       }
                }
        }

Index: src/Preferences.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/Preferences.cs,v
retrieving revision 1.17
diff -u -p -r1.17 Preferences.cs
--- src/Preferences.cs  13 Sep 2006 19:36:27 -0000      1.17
+++ src/Preferences.cs  19 Oct 2006 08:22:12 -0000
@@ -77,6 +77,12 @@ namespace FSpot
                public const string EXPORT_PICASAWEB_ROTATE = "/apps/f-spot/export/picasaweb/rotate";
                public const string EXPORT_PICASAWEB_BROWSER = "/apps/f-spot/export/picasaweb/browser";

+               public const string EXPORT_FOLDER_SCALE = "/apps/f-spot/export/folder/scale";
+               public const string EXPORT_FOLDER_SIZE = "/apps/f-spot/export/folder/size";
+               public const string EXPORT_FOLDER_OPEN = "/apps/f-spot/export/folder/browser";
+               public const string EXPORT_FOLDER_ROTATE = "/apps/f-spot/export/folder/rotate";
+               public const string EXPORT_FOLDER_METHOD = "/apps/f-spot/export/folder/method";
+
                public const string EXPORT_EMAIL_SIZE = "/apps/f-spot/export/email/size";
                public const string EXPORT_EMAIL_ROTATE = "/apps/f-spot/export/email/auto_rotate";
                public const string EXPORT_EMAIL_DELETE_TIMEOUT_SEC = "/apps/f-spot/export/email/delete_timeout_seconds";
@@ -135,9 +141,11 @@ namespace FSpot
                        case EXPORT_PICASAWEB_SCALE:
                        case EXPORT_PICASAWEB_ROTATE:
                        case EXPORT_PICASAWEB_BROWSER:
+                       case EXPORT_FOLDER_SCALE:
                                return true;

                        case EXPORT_PICASAWEB_SIZE:
+                       case EXPORT_FOLDER_SIZE:
                                return 800;

                        case SIDEBAR_POSITION:
@@ -151,9 +159,13 @@ namespace FSpot
                        case EXPORT_EMAIL_SIZE:
                                return 3;       // medium size 640px
                        case EXPORT_EMAIL_ROTATE:
-                               return true;    // auto rotate original photos
+                       case EXPORT_FOLDER_OPEN:
+                       case EXPORT_FOLDER_ROTATE:
+                               return true;
                        case EXPORT_EMAIL_DELETE_TIMEOUT_SEC:
                                return 30;      // delete temporary email pictures after 30 seconds
+                       case EXPORT_FOLDER_METHOD:
+                               return "static";
                        }

                        return null;