bin/gtk2passwordapp in gtk2passwordapp-0.0.8 vs bin/gtk2passwordapp in gtk2passwordapp-1.0.0

- old
+ new

@@ -1,40 +1,29 @@ #!/usr/bin/env ruby -# $Date: 2009/02/27 23:51:40 $ -########################################################## -require 'lib/global_options_variables' -GlobalOptionsVariables.set('0.0.8', - <<EOT -Usage: #{$0.sub(/^.*\//,'')} [options] +require 'rubygems' +gem 'gtk2applib', '~> 3.1.0' +require 'gtk2applib/gtk2_app' -Options: - -h, --help print this help text and exit - -v, --version print program version and exit - -t, --test test - -T, --trace trace -EOT - ) -require 'lib/setup_user_space' -UserSpace.setup -UserSpace.copy('/README.txt') -require USER_CONF_DIR+CONF_FILE -########################################################## -require 'lib/gtk2passwordapp' +application = { + :name => 'Ruby-Gnome Password Manager', + :tooltip => 'Password Manager', + :FILE => __FILE__, + } +Gtk2App.init(application) +Gtk2App.icon.set_icon_name(Gtk::Stock::DIALOG_AUTHENTICATION) -lock = USER_CONF_DIR+'/lock' -if File.exist?(lock) then - $stderr.puts "process already running?" - # user should then notice it's already running, but - # let's remove the lock in case it's not and user - # tries again.... - File.unlink(lock) -else - begin - File.open(lock,'w'){|fh| fh.puts $$ } - gpa = Gtk2PasswordApp.new - gpa.status_icon - rescue Exception - puts_bang! - ensure - File.unlink(lock) if File.exist?(lock) - end +require 'gtk2passwordapp/edit_box.rb' +require 'gtk2passwordapp/passwords.rb' +passwords = Gtk2PasswordApp::Passwords.new +Gtk2PasswordApp.build_menu(passwords) + +about = { + :authors => ['carlosjhr64@gmail.com'], + :comments => 'Ruby-Gtk2 Passsword Manager', + :website => 'http://ruby-gnome-apps.blogspot.com/search/label/Passwords', + :website_label => 'Ruby-Gnome Password Manager', + :license => 'GPL', + :copyright => '2009-Dec-14', + } +Gtk2App.main_window(about) do |window| + Gtk2PasswordApp.edit(window,passwords) end