remember multi languages choice
authorgc <gc>
Thu, 10 Apr 2008 07:23:31 +0000 (07:23 +0000)
committergc <gc>
Thu, 10 Apr 2008 07:23:31 +0000 (07:23 +0000)
bin/booh

index eebf210..b09da3b 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -3140,7 +3140,7 @@ def new_album
     nperpagecombo.active = 0
 
     multilanguages_value = nil
-    vb.add(ml = Gtk::HBox.new(false, 3).pack_start(ml_label = Gtk::Label.new(utf8(_("Multi-languages: disabled."))), false, false, 0).
+    vb.add(ml = Gtk::HBox.new(false, 3).pack_start(ml_label = Gtk::Label.new, false, false, 0).
                                         pack_start(multilanguages = Gtk::Button.new(utf8(_("Configure multi-languages"))), false, false, 0))
     tooltips.set_tip(ml, utf8(_("When disabled, the web-album will be generated with navigation in your desktop language. When enabled, the web-album will be generated with navigation in all languages you select, but you have to publish your web-album on an Apache web-server for that feature to work.")), nil)
     multilanguages.signal_connect('clicked') {
@@ -3154,6 +3154,12 @@ def new_album
             ml_label.text = utf8(_("Multi-languages: disabled."))
         end
     }
+    if $config['default-multi-languages']
+        multilanguages_value = $config['default-multi-languages']
+        ml_label.text = utf8(_("Multi-languages: enabled."))
+    else
+        ml_label.text = utf8(_("Multi-languages: disabled."))
+    end
 
     vb.add(Gtk::HBox.new(false, 3).pack_start(Gtk::Label.new(utf8(_("'Return to your website' link on pages bottom: "))), false, false, 0).
                                    pack_start(indexlinkentry = Gtk::Entry.new, true, true, 0))
@@ -3361,6 +3367,7 @@ Are you sure you want to continue?")), { :okcancel => true })
         theme = theme_button.label
         #- some sort of automatic theme preference
         $config['default-theme'] = theme
+        $config['default-multi-languages'] = multilanguages_value
         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)
@@ -3571,10 +3578,13 @@ def properties
     dialog.destroy
     
     if ok && (save_theme != theme || save_limit_sizes != limit_sizes || save_opt432 != opt432 || save_nperrow != nperrow || save_nperpage != nperpage || save_madewith != madewith || save_indexlink != indexlinkentry || save_multilanguages_value != multilanguages_value)
+        #- some sort of automatic preferences
         if save_theme != theme
-            #- some sort of automatic theme preference
             $config['default-theme'] = save_theme
         end
+        if save_multilanguages_value != multilanguages_value
+            $config['default-multi-languages'] = save_multilanguages_value
+        end
         mark_document_as_dirty
         save_current_file
         call_backend("booh-backend --use-config '#{$filename}' --for-gui --verbose-level #{$verbose_level} " +