gtk2passwordapp 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/gtk2passwordapp +2 -2
- data/lib/gtk2passwordapp.rb +22 -21
- metadata +1 -1
data/bin/gtk2passwordapp
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# $Date: 2009/02/
|
2
|
+
# $Date: 2009/02/21 13:58:09 $
|
3
3
|
##########################################################
|
4
4
|
require 'lib/global_options_variables'
|
5
|
-
GlobalOptionsVariables.set('0.0.
|
5
|
+
GlobalOptionsVariables.set('0.0.4',
|
6
6
|
<<EOT
|
7
7
|
Usage: #{$0.sub(/^.*\//,'')} [options]
|
8
8
|
|
data/lib/gtk2passwordapp.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Date: 2009/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/
|
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
|
-
|
558
|
+
main_quit(icon) if !verify_user
|
552
559
|
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
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
|
-
|
565
|
-
|
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 &" ) }
|