make save and save_as not sensitive before we have an album
authorgc <gc>
Sun, 17 Apr 2005 01:15:44 +0000 (01:15 +0000)
committergc <gc>
Sun, 17 Apr 2005 01:15:44 +0000 (01:15 +0000)
bin/booh-gui

index 5d081700652f99991fc52a77bdf8462bf1418bdf..52e88eaa1355ee1507985ef48bd41449992061ed 100755 (executable)
@@ -1166,6 +1166,7 @@ def open_file(filename)
 
     $config['last-opens'] ||= []
     $config['last-opens'] << filename
+    $save.sensitive = $save_as.sensitive = true
     return nil
 end
 
@@ -1347,20 +1348,20 @@ def create_menu_and_toolbar
 
     filemenu = Gtk::MenuItem.new(utf8(_("_File")))
     filesubmenu = Gtk::Menu.new
-    filesubmenu.append(new     = Gtk::ImageMenuItem.new(Gtk::Stock::NEW))
-    filesubmenu.append(open    = Gtk::ImageMenuItem.new(Gtk::Stock::OPEN))
-    filesubmenu.append(          Gtk::SeparatorMenuItem.new)
-    filesubmenu.append(save    = Gtk::ImageMenuItem.new(Gtk::Stock::SAVE))
-    filesubmenu.append(save_as = Gtk::ImageMenuItem.new(Gtk::Stock::SAVE_AS))
-    filesubmenu.append(          Gtk::SeparatorMenuItem.new)
-    filesubmenu.append(quit    = Gtk::ImageMenuItem.new(Gtk::Stock::QUIT))
+    filesubmenu.append(new      = Gtk::ImageMenuItem.new(Gtk::Stock::NEW))
+    filesubmenu.append(open     = Gtk::ImageMenuItem.new(Gtk::Stock::OPEN))
+    filesubmenu.append(           Gtk::SeparatorMenuItem.new)
+    filesubmenu.append($save    = Gtk::ImageMenuItem.new(Gtk::Stock::SAVE).set_sensitive(false))
+    filesubmenu.append($save_as = Gtk::ImageMenuItem.new(Gtk::Stock::SAVE_AS).set_sensitive(false))
+    filesubmenu.append(           Gtk::SeparatorMenuItem.new)
+    filesubmenu.append(quit     = Gtk::ImageMenuItem.new(Gtk::Stock::QUIT))
     filemenu.set_submenu(filesubmenu)
     mb.append(filemenu)
 
     new.signal_connect('activate') { new_album }
     open.signal_connect('activate') { open_file_popup }
-    save.signal_connect('activate') { save_current_file }
-    save_as.signal_connect('activate') { save_as_do }
+    $save.signal_connect('activate') { save_current_file }
+    $save_as.signal_connect('activate') { save_as_do }
     quit.signal_connect('activate') { try_quit }
 
     editmenu = Gtk::MenuItem.new(utf8(_("_Edit")))