gtk2passwordapp 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/bin/gtk2passwordapp CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
- # $Date: 2009/02/20 18:46:54 $
2
+ # $Date: 2009/02/21 13:58:09 $
3
3
  ##########################################################
4
4
  require 'lib/global_options_variables'
5
- GlobalOptionsVariables.set('0.0.3',
5
+ GlobalOptionsVariables.set('0.0.4',
6
6
  <<EOT
7
7
  Usage: #{$0.sub(/^.*\//,'')} [options]
8
8
 
@@ -1,4 +1,4 @@
1
- # $Date: 2009/02/20 18:46:02 $
1
+ # $Date: 2009/02/21 13:56:55 $
2
2
  require 'lib/passwords_data'
3
3
  require 'gtk2'
4
4
  require 'find'
@@ -13,7 +13,7 @@ class Gtk2PasswordApp
13
13
  'website' => 'http://ruby-gnome-apps.blogspot.com/search/label/Passwords',
14
14
  'website-label' => 'Ruby Gnome Password Manager',
15
15
  'license' => 'GPL',
16
- 'copyright' => '$Date: 2009/02/20 18:46:02 $'.gsub(/\s*\$\s*/,''),
16
+ 'copyright' => '$Date: 2009/02/21 13:56:55 $'.gsub(/\s*\$\s*/,''),
17
17
  'logo' => Gdk::Pixbuf.new(LOGO_IMAGE),
18
18
  }
19
19
 
@@ -540,6 +540,13 @@ class Gtk2PasswordApp
540
540
  end
541
541
  end
542
542
 
543
+ def main_quit(icon)
544
+ quit_windows
545
+ icon.set_visible(false)
546
+ icon = nil
547
+ Gtk.main_quit
548
+ end
549
+
543
550
  def status_icon
544
551
  icon = Gtk::StatusIcon.new
545
552
  icon.set_icon_name(Gtk::Stock::DIALOG_AUTHENTICATION)
@@ -548,29 +555,23 @@ class Gtk2PasswordApp
548
555
  if @window then
549
556
  quit_windows
550
557
  else
551
- menu = Gtk::Menu.new
558
+ main_quit(icon) if !verify_user
552
559
 
553
- if verify_user then
554
- @passwords.accounts.each {|account|
555
- menuitem = Gtk::MenuItem.new(account)
556
- menuitem.child.modify_fg(Gtk::STATE_NORMAL, RED) if @passwords.expired?(account)
557
- menu.append(menuitem)
558
- menuitem.signal_connect('activate'){|b|
559
- primary = Gtk::Clipboard.get(Gdk::Selection::PRIMARY)
560
- clipboard = Gtk::Clipboard.get(Gdk::Selection::CLIPBOARD)
561
- primary.text = clipboard.text = @passwords.password_of(b.child.text.strip)
562
- }
560
+ menu = Gtk::Menu.new
561
+ @passwords.accounts.each {|account|
562
+ menuitem = Gtk::MenuItem.new(account)
563
+ menuitem.child.modify_fg(Gtk::STATE_NORMAL, RED) if @passwords.expired?(account)
564
+ menu.append(menuitem)
565
+ menuitem.signal_connect('activate'){|b|
566
+ primary = Gtk::Clipboard.get(Gdk::Selection::PRIMARY)
567
+ clipboard = Gtk::Clipboard.get(Gdk::Selection::CLIPBOARD)
568
+ primary.text = clipboard.text = @passwords.password_of(b.child.text.strip)
563
569
  }
564
- menu.append( Gtk::SeparatorMenuItem.new )
565
- end
570
+ }
571
+ menu.append( Gtk::SeparatorMenuItem.new )
566
572
 
567
573
  menuitem = Gtk::MenuItem.new('Quit')
568
- menuitem.signal_connect('activate'){
569
- quit_windows
570
- icon.set_visible(false)
571
- icon = nil
572
- Gtk.main_quit
573
- }
574
+ menuitem.signal_connect('activate'){ main_quit(icon) }
574
575
  menu.append(menuitem)
575
576
 
576
577
  Gtk::AboutDialog.set_url_hook{|about,link| system( "#{BROWSER} '#{link}' > /dev/null 2>&1 &" ) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gtk2passwordapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - carlosjhr64@gmail.com