remember optimize for 3/2 choice
authorgc <gc>
Thu, 10 Apr 2008 07:36:51 +0000 (07:36 +0000)
committergc <gc>
Thu, 10 Apr 2008 07:36:51 +0000 (07:36 +0000)
bin/booh
lib/booh/booh-lib.rb

index b09da3b..b609058 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -3121,7 +3121,7 @@ def new_album
                          pack_start(theme_button = Gtk::Button.new($config['default-theme'] || 'simple'), false, false, 0))
     vb.add(Gtk::HBox.new(false, 3).pack_start(Gtk::Label.new(utf8(_("Sizes of images to generate: "))), false, false, 0).
                                    pack_start(sizes = Gtk::HBox.new, false, false, 0))
-    vb.add(optimize432 = Gtk::CheckButton.new(utf8(_("Optimize for 3/2 aspect ratio"))))
+    vb.add(optimize432 = Gtk::CheckButton.new(utf8(_("Optimize for 3/2 aspect ratio"))).set_active($config['default-optimize32'].to_b))
     tooltips.set_tip(optimize432, utf8(_("Resize images with optimized sizes for 3/2 aspect ratio rather than 4/3 (typical aspect ratio of photos from non digital cameras are 3/2 when pictures from digital cameras are 4/3)")), nil)
     vb.add(Gtk::HBox.new(false, 3).pack_start(Gtk::Label.new(utf8(_("Number of thumbnails per row: "))), false, false, 0).
                                    pack_start(nperrowradios = Gtk::HBox.new, false, false, 0))
@@ -3368,6 +3368,7 @@ Are you sure you want to continue?")), { :okcancel => true })
         #- some sort of automatic theme preference
         $config['default-theme'] = theme
         $config['default-multi-languages'] = multilanguages_value
+        $config['default-optimize32'] = optimize432.active?.to_s
         sizes = theme_sizes.find_all { |e| e[:widget].active? }.collect { |e| e[:value] }.join(',')
         nperrow = nperrows.find { |e| e[:widget].active? }[:value]
         nperpage = nperpage_model.get_value(nperpagecombo.active_iter, 1)
@@ -3585,6 +3586,9 @@ def properties
         if save_multilanguages_value != multilanguages_value
             $config['default-multi-languages'] = save_multilanguages_value
         end
+        if save_opt432 != opt432
+            $config['default-optimize32'] = save_opt432.to_s
+        end
         mark_document_as_dirty
         save_current_file
         call_backend("booh-backend --use-config '#{$filename}' --for-gui --verbose-level #{$verbose_level} " +
index 3d34ce9..3c4c41c 100644 (file)
@@ -853,6 +853,17 @@ French: Guillaume Cottenceau')),
                         Gdk::Pixbuf.new("#{$FPATH}/images/booh-48x48.png") ]
         return w
     end
+
+end
+
+class Object
+    def to_b
+        if !self || self.to_s == 'false'
+            return false
+        else
+            return true
+        end
+    end
 end
 
 class File