/[cvs]/nfo/projects/netfraggle/bin/fraggleDialogPrefs.py
ViewVC logotype

Diff of /nfo/projects/netfraggle/bin/fraggleDialogPrefs.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by joko, Wed Aug 25 19:52:04 2004 UTC revision 1.4 by xabbu, Wed Aug 25 21:43:00 2004 UTC
# Line 1  Line 1 
1  #Boa:Dialog:fraggleDialogPrefs  #Boa:Dialog:fraggleDialogPrefs
2    
3  from wxPython.wx import *  from wxPython.wx import *
4    from fraggleEngine import *
5    
6  def create(parent):  def create(parent):
7      return fraggleDialogPrefs(parent)      return fraggleDialogPrefs(parent)
8    
9    
10    
11  [wxID_FRAGGLEDIALOGPREFS, wxID_FRAGGLEDIALOGPREFSBTSAVE,  [wxID_FRAGGLEDIALOGPREFS, wxID_FRAGGLEDIALOGPREFSBTSAVE,
12   wxID_FRAGGLEDIALOGPREFSBUTTON1, wxID_FRAGGLEDIALOGPREFSSTATICLINE1,   wxID_FRAGGLEDIALOGPREFSBUTTON1, wxID_FRAGGLEDIALOGPREFSSTATICLINE1,
13   wxID_FRAGGLEDIALOGPREFSSTATICLINE2, wxID_FRAGGLEDIALOGPREFSSTATICTEXT1,   wxID_FRAGGLEDIALOGPREFSSTATICLINE2, wxID_FRAGGLEDIALOGPREFSSTATICTEXT1,
# Line 39  class fraggleDialogPrefs(wxDialog): Line 42  class fraggleDialogPrefs(wxDialog):
42          self.button1 = wxButton(id=wxID_FRAGGLEDIALOGPREFSBUTTON1,          self.button1 = wxButton(id=wxID_FRAGGLEDIALOGPREFSBUTTON1,
43                label='Cancel', name='button1', parent=self, pos=wxPoint(80, 168),                label='Cancel', name='button1', parent=self, pos=wxPoint(80, 168),
44                size=wxSize(56, 16), style=0)                size=wxSize(56, 16), style=0)
45            EVT_BUTTON(self.button1, wxID_FRAGGLEDIALOGPREFSBUTTON1,
46                  self.OnButton1Button)
47    
48          self.staticText1 = wxStaticText(id=wxID_FRAGGLEDIALOGPREFSSTATICTEXT1,          self.staticText1 = wxStaticText(id=wxID_FRAGGLEDIALOGPREFSSTATICTEXT1,
49                label='Username', name='staticText1', parent=self, pos=wxPoint(16,                label='Username', name='staticText1', parent=self, pos=wxPoint(16,
# Line 104  class fraggleDialogPrefs(wxDialog): Line 109  class fraggleDialogPrefs(wxDialog):
109                    
110          self.parent.preferencesCtl.saveConfig()          self.parent.preferencesCtl.saveConfig()
111          event.Skip()          event.Skip()
112    
113        def loadConfig(self):
114            engine = FraggleEngine()
115            prefsfile = os.path.join(engine.getDefaultDir(), 'prefs.xml')
116            self.parent.preferencesCtl.loadConfig(prefsfile)
117            
118        def updateConfig(self):
119            config = self.parent.preferencesCtl.getConfig()
120            self.textCtrlUsername.SetValue(config["username"])
121            self.textCtrlPassword.SetValue(config["password"])    
122            self.textCtrlServer.SetValue(config["url"])
123            self.textCtrlRetrieval.SetValue(config["retrieval"])
124    
125        def OnButton1Button(self, event):
126            self.Hide()
127            event.Skip()
128            

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed