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, |
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, |
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 |
|
|