--- nfo/projects/netfraggle/bin/fraggleDialogPrefs.py 2004/08/25 19:52:04 1.3 +++ nfo/projects/netfraggle/bin/fraggleDialogPrefs.py 2004/08/25 21:43:00 1.4 @@ -1,10 +1,13 @@ #Boa:Dialog:fraggleDialogPrefs from wxPython.wx import * +from fraggleEngine import * def create(parent): return fraggleDialogPrefs(parent) + + [wxID_FRAGGLEDIALOGPREFS, wxID_FRAGGLEDIALOGPREFSBTSAVE, wxID_FRAGGLEDIALOGPREFSBUTTON1, wxID_FRAGGLEDIALOGPREFSSTATICLINE1, wxID_FRAGGLEDIALOGPREFSSTATICLINE2, wxID_FRAGGLEDIALOGPREFSSTATICTEXT1, @@ -39,6 +42,8 @@ self.button1 = wxButton(id=wxID_FRAGGLEDIALOGPREFSBUTTON1, label='Cancel', name='button1', parent=self, pos=wxPoint(80, 168), size=wxSize(56, 16), style=0) + EVT_BUTTON(self.button1, wxID_FRAGGLEDIALOGPREFSBUTTON1, + self.OnButton1Button) self.staticText1 = wxStaticText(id=wxID_FRAGGLEDIALOGPREFSSTATICTEXT1, label='Username', name='staticText1', parent=self, pos=wxPoint(16, @@ -104,3 +109,20 @@ self.parent.preferencesCtl.saveConfig() event.Skip() + + def loadConfig(self): + engine = FraggleEngine() + prefsfile = os.path.join(engine.getDefaultDir(), 'prefs.xml') + self.parent.preferencesCtl.loadConfig(prefsfile) + + def updateConfig(self): + config = self.parent.preferencesCtl.getConfig() + self.textCtrlUsername.SetValue(config["username"]) + self.textCtrlPassword.SetValue(config["password"]) + self.textCtrlServer.SetValue(config["url"]) + self.textCtrlRetrieval.SetValue(config["retrieval"]) + + def OnButton1Button(self, event): + self.Hide() + event.Skip() + \ No newline at end of file