Translate status bar messages.
[kaya.git] / lib / plugins / ics / lib / preferences.rb
blob68a1792a49f8ef78611e50d561d11f527faff5df
1 # Copyright (c) 2009 Paolo Capriotti <p.capriotti@gmail.com>
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 require 'toolkit'
9 require_bundle 'ics', 'config'
11 module ICS
13 class Preferences < KDE::Dialog
14   def initialize(parent)
15     super(parent)
16     @gui = KDE::autogui(:preferences, 
17                         :caption => KDE::i18n("Configure ICS")) do |b|
18       b.layout(:type => :vertical) do |vl|
19         vl.layout(:type => :horizontal) do |l|
20           l.label(:text => KDE::i18n("&Username:"),
21                   :buddy => :username)
22           l.line_edit(:username)
23         end
24         
25         vl.layout(:type => :horizontal) do |l|
26           l.label(:text => KDE::i18n("&Password:"),
27                   :buddy => :password)
28           l.line_edit(:password)
29         end
30       end
31     end
32     
33     setGUI(@gui)
34     
35     data = Config.load
36     username.text = data[:username]
37     password.text = data[:password]
38     
39     on(:ok_clicked) do
40       Config.save :username => username.text,
41                   :password => password.text
42     end
43   end
44 end
46 end