gtk2passwordapp 2.0.1 → 2.1.0

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.
@@ -83,6 +83,7 @@ module Configuration
83
83
  PASSWORDS_FILE = File.join( Gtk2AppLib::USERDIR, 'passwords.dat' )
84
84
  # Switches the roles of PRIMARY and CLIPBOARD when true
85
85
  SWITCH_CLIPBOARDS = (Gtk2AppLib::HILDON || !Gtk2AppLib::Configuration::X)? true: false
86
+ CLIPBOARD_TIMEOUT = 15 # clear clipboard after set number of seconds
86
87
  PASSWORD_EXPIRED = 60*60*24*30*3 # 3 months
87
88
  URL_PATTERN = Regexp.new('^https?:\/\/[^\s\']+$')
88
89
  DEFAULT_PASSWORD_LENGTH = 16
@@ -9,12 +9,22 @@ module Gtk2Password
9
9
  'website' => 'https://sites.google.com/site/gtk2applib/home/gtk2applib-applications/gtk2passwordapp',
10
10
  'website-label' => 'Ruby-Gnome Password Manager',
11
11
  'license' => 'GPL',
12
- 'copyright' => '2011-07-03 09:52:12',
12
+ 'copyright' => '2011-09-19 12:00:24',
13
13
  }
14
14
 
15
15
  PRIMARY = Gtk::Clipboard.get((Configuration::SWITCH_CLIPBOARDS)? Gdk::Selection::CLIPBOARD: Gdk::Selection::PRIMARY)
16
16
  CLIPBOARD = Gtk::Clipboard.get((Configuration::SWITCH_CLIPBOARDS)? Gdk::Selection::PRIMARY: Gdk::Selection::CLIPBOARD)
17
17
 
18
+ @@thread = nil
19
+ def self.clear_clipboard
20
+ @@thread.kill if !@@thread.nil?
21
+ @@thread = Thread.new do
22
+ sleep Configuration::CLIPBOARD_TIMEOUT
23
+ PRIMARY.text = ''
24
+ CLIPBOARD.text = ''
25
+ end
26
+ end
27
+
18
28
  Passwords::PROMPT[:password] = Configuration::PASSWORD
19
29
  Passwords::PROMPT[:again] = Configuration::AGAIN
20
30
  Passwords::PROMPT[:retry] = Configuration::RETRY
@@ -54,6 +64,7 @@ module Gtk2Password
54
64
  @@index = @passwords.accounts.index(account)
55
65
  PRIMARY.text = @passwords.password_of(account)
56
66
  CLIPBOARD.text = @passwords.username_of(account)
67
+ Gtk2Password.clear_clipboard
57
68
  end
58
69
  item.child.modify_fg(Gtk::STATE_NORMAL, Configuration::EXPIRED_COLOR) if @passwords.expired?(account)
59
70
  end
@@ -244,12 +255,14 @@ module Gtk2Password
244
255
  if account then
245
256
  PRIMARY.text = @passwords.password_of(account)
246
257
  CLIPBOARD.text = @passwords.username_of(account)
258
+ Gtk2Password.clear_clipboard
247
259
  end
248
260
 
249
261
  when @gui[:previous_button]
250
262
  if account then
251
263
  PRIMARY.text = @passwords.previous_password_of(account)
252
264
  CLIPBOARD.text = @passwords.username_of(account)
265
+ Gtk2Password.clear_clipboard
253
266
  end
254
267
 
255
268
  when @gui[:save_button] then yield(:save)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gtk2passwordapp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
- - 0
9
8
  - 1
10
- version: 2.0.1
9
+ - 0
10
+ version: 2.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - carlosjhr64@gmail.com
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-03 00:00:00 Z
18
+ date: 2011-09-19 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: crypt-tea
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - gtk2
102
102
  rubyforge_project:
103
- rubygems_version: 1.8.4
103
+ rubygems_version: 1.8.10
104
104
  signing_key:
105
105
  specification_version: 3
106
106
  summary: Ruby-Gnome Password Manager