lib/gtk2passwordapp.rb in gtk2passwordapp-0.0.1 vs lib/gtk2passwordapp.rb in gtk2passwordapp-0.0.2

- old
+ new

@@ -1,6 +1,6 @@ -# $Date: 2009/02/19 20:50:22 $ +# $Date: 2009/02/20 16:08:59 $ require 'lib/passwords_data' require 'gtk2' require 'find' class Gtk2PasswordApp @@ -11,11 +11,11 @@ 'comments' => "Ruby-Gtk2 Password Manager.", 'version' => $version, 'website' => 'http://ruby-gnome-apps.blogspot.com/search/label/Passwords', 'website-label' => 'Ruby Gnome Password Manager', 'license' => 'GPL', - 'copyright' => '$Date: 2009/02/19 20:50:22 $'.gsub(/\s*\$\s*/,''), + 'copyright' => '$Date: 2009/02/20 16:08:59 $'.gsub(/\s*\$\s*/,''), 'logo' => Gdk::Pixbuf.new(LOGO_IMAGE), } BUTTONS = [[ :username, :current, :url, ],[ :note, :edit, :quit, ],] @@ -547,21 +547,23 @@ icon.signal_connect('activate') { if @window then quit_windows else menu = Gtk::Menu.new - @passwords.accounts.each {|account| - menuitem = Gtk::MenuItem.new(account) - menuitem.child.modify_fg(Gtk::STATE_NORMAL, RED) if @passwords.expired?(account) - menu.append(menuitem) - menuitem.signal_connect('activate'){|b| - primary = Gtk::Clipboard.get(Gdk::Selection::PRIMARY) - clipboard = Gtk::Clipboard.get(Gdk::Selection::CLIPBOARD) - primary.text = clipboard.text = @passwords.password_of(b.child.text.strip) - } - } - menu.append( Gtk::SeparatorMenuItem.new ) + if verify_user then + @passwords.accounts.each {|account| + menuitem = Gtk::MenuItem.new(account) + menuitem.child.modify_fg(Gtk::STATE_NORMAL, RED) if @passwords.expired?(account) + menu.append(menuitem) + menuitem.signal_connect('activate'){|b| + primary = Gtk::Clipboard.get(Gdk::Selection::PRIMARY) + clipboard = Gtk::Clipboard.get(Gdk::Selection::CLIPBOARD) + primary.text = clipboard.text = @passwords.password_of(b.child.text.strip) + } + } + menu.append( Gtk::SeparatorMenuItem.new ) + end menuitem = Gtk::MenuItem.new('Quit') menuitem.signal_connect('activate'){ quit_windows icon.set_visible(false)