Class: MCLimit::AdminApp

Inherits:
Wx::App
  • Object
show all
Defined in:
lib/mc-limit/admin.rb

Instance Method Summary collapse

Instance Method Details

#on_initObject



39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/mc-limit/admin.rb', line 39

def on_init
  frame = Wx::Frame.new(nil, -1, 'Dialog')
  begin
    MCLimit.check_admin_password( frame )
    admin = AdminDialog.new( frame, MCLimit.remaining_minutes.to_i )
    MCLimit.update_remaining_minutes( admin.value ) if Wx::ID_OK == admin.show_modal
  rescue => e
    GUI.error( e.message )
    raise if $DEBUG
  ensure
    frame.close
  end
end