be sure that opening properties doesnt destroy some theme choices
authorgc <gc>
Sat, 4 Feb 2006 17:39:11 +0000 (17:39 +0000)
committergc <gc>
Sat, 4 Feb 2006 17:39:11 +0000 (17:39 +0000)
bin/booh

index 4d758f2c068192fa5f16636d987ab44c0dde6a0b..7595de08c0a141b1acd1e4a1e15fe1990c0eeae4 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -2703,6 +2703,13 @@ def populate_subalbums_treeview(select_first)
     end
 end
 
+def select_current_theme
+    select_theme($xmldoc.root.attributes['theme'],
+                 $xmldoc.root.attributes['limit-sizes'],
+                 !$xmldoc.root.attributes['optimize-for-32'].nil?,
+                 $xmldoc.root.attributes['thumbnails-per-row'])
+end
+
 def open_file(filename)
 
     $filename = nil
@@ -2780,12 +2787,9 @@ def open_file(filename)
         $xmldoc.root.add_attribute('version', $VERSION)
     end
 
-    limit_sizes = $xmldoc.root.attributes['limit-sizes']
-    optimizefor32 = !$xmldoc.root.attributes['optimize-for-32'].nil?
-    nperrow = $xmldoc.root.attributes['thumbnails-per-row']
+    select_current_theme
 
     $filename = filename
-    select_theme(theme, limit_sizes, optimizefor32, nperrow)
     $default_size['thumbnails'] =~ /(.*)x(.*)/
     $default_thumbnails = { :x => $1.to_i, :y => $2.to_i }
     $albums_thumbnail_size =~ /(.*)x(.*)/
@@ -3293,6 +3297,9 @@ def properties
                              open_file($filename)
                              $modified = true
                          } })
+    else
+        #- select_theme merges global variables, need to return to current choices
+        select_current_theme
     end
 end