97 |
self.buttonProfileSave = wxButton(id=wxID_FRAGGLEDIALOGPREFSBUTTONPROFILESAVE, |
self.buttonProfileSave = wxButton(id=wxID_FRAGGLEDIALOGPREFSBUTTONPROFILESAVE, |
98 |
label='Save', name='buttonProfileSave', parent=self, |
label='Save', name='buttonProfileSave', parent=self, |
99 |
pos=wxPoint(272, 8), size=wxSize(40, 16), style=0) |
pos=wxPoint(272, 8), size=wxSize(40, 16), style=0) |
100 |
|
EVT_BUTTON(self.buttonProfileSave, |
101 |
|
wxID_FRAGGLEDIALOGPREFSBUTTONPROFILESAVE, |
102 |
|
self.OnButtonprofilesaveButton) |
103 |
|
|
104 |
self.buttonProfileDel = wxButton(id=wxID_FRAGGLEDIALOGPREFSBUTTONPROFILEDEL, |
self.buttonProfileDel = wxButton(id=wxID_FRAGGLEDIALOGPREFSBUTTONPROFILEDEL, |
105 |
label='Delete', name='buttonProfileDel', parent=self, |
label='Delete', name='buttonProfileDel', parent=self, |
106 |
pos=wxPoint(320, 8), size=wxSize(40, 16), style=0) |
pos=wxPoint(320, 8), size=wxSize(40, 16), style=0) |
107 |
|
EVT_BUTTON(self.buttonProfileDel, |
108 |
|
wxID_FRAGGLEDIALOGPREFSBUTTONPROFILEDEL, |
109 |
|
self.OnButtonprofiledelButton) |
110 |
|
|
111 |
self.buttonProfileLoad = wxButton(id=wxID_FRAGGLEDIALOGPREFSBUTTONPROFILELOAD, |
self.buttonProfileLoad = wxButton(id=wxID_FRAGGLEDIALOGPREFSBUTTONPROFILELOAD, |
112 |
label='Load', name='buttonProfileLoad', parent=self, |
label='Load', name='buttonProfileLoad', parent=self, |
113 |
pos=wxPoint(216, 8), size=wxSize(48, 16), style=0) |
pos=wxPoint(216, 8), size=wxSize(48, 16), style=0) |
114 |
|
EVT_BUTTON(self.buttonProfileLoad, |
115 |
|
wxID_FRAGGLEDIALOGPREFSBUTTONPROFILELOAD, |
116 |
|
self.OnButtonprofileloadButton) |
117 |
|
|
118 |
|
def __init_profiles(self): |
119 |
|
list = self.parent.preferencesCtl.getProfileList() |
120 |
|
print list |
121 |
|
for i in list: |
122 |
|
self.comboBoxProfile.Append(i) |
123 |
|
|
124 |
def __init__(self, parent): |
def __init__(self, parent): |
125 |
self.parent = parent |
self.parent = parent |
126 |
self._init_ctrls(parent) |
self._init_ctrls(parent) |
127 |
|
self.__init_profiles() |
128 |
|
|
129 |
def OnBtsaveButton(self, event): |
def OnBtsaveButton(self, event): |
130 |
|
|
131 |
# convert from utf-8: required for win32 |
# convert from utf-8: required for win32 |
150 |
|
|
151 |
def updateConfig(self): |
def updateConfig(self): |
152 |
config = self.parent.preferencesCtl.getConfig() |
config = self.parent.preferencesCtl.getConfig() |
153 |
self.textCtrlUsername.SetValue(config["username"]) |
try: |
154 |
self.textCtrlPassword.SetValue(config["password"]) |
self.textCtrlUsername.SetValue(config["username"]) |
155 |
self.textCtrlServer.SetValue(config["url"]) |
self.textCtrlPassword.SetValue(config["password"]) |
156 |
self.textCtrlRetrieval.SetValue(config["retrieval"]) |
self.textCtrlServer.SetValue(config["url"]) |
157 |
|
self.textCtrlRetrieval.SetValue(config["retrieval"]) |
158 |
|
except TypeError: |
159 |
|
self.textCtrlUsername.SetValue("username") |
160 |
|
self.textCtrlPassword.SetValue("password") |
161 |
|
self.textCtrlServer.SetValue("url") |
162 |
|
self.textCtrlRetrieval.SetValue("retrieval") |
163 |
|
|
164 |
def OnButton1Button(self, event): |
def OnButton1Button(self, event): |
165 |
self.Hide() |
self.Hide() |
166 |
event.Skip() |
event.Skip() |
167 |
|
|
168 |
|
def OnButtonprofilesaveButton(self, event): |
169 |
|
username = self.textCtrlUsername.GetValue() |
170 |
|
password = self.textCtrlPassword.GetValue() |
171 |
|
url = self.textCtrlServer.GetValue() |
172 |
|
retrieval = self.textCtrlRetrieval.GetValue() |
173 |
|
self.parent.preferencesCtl.setConfig(username,password,url,retrieval) |
174 |
|
i = self.parent.preferencesCtl.appendProfile(self.comboBoxProfile.GetValue(),self.parent.preferencesCtl.configList) |
175 |
|
if i == 0: |
176 |
|
self.comboBoxProfile.Append(self.comboBoxProfile.GetValue()) |
177 |
|
|
178 |
|
self.parent.preferencesCtl.saveProfiles() |
179 |
|
event.Skip() |
180 |
|
|
181 |
|
def OnButtonprofileloadButton(self, event): |
182 |
|
self.parent.preferencesCtl.loadProfile(self.comboBoxProfile.GetValue()) |
183 |
|
self.updateConfig() |
184 |
|
event.Skip() |
185 |
|
|
186 |
|
def OnButtonprofiledelButton(self, event): |
187 |
|
#self.parent.preferencesCtl.deleteProfile(self.comboBoxProfile.GetValue()) |
188 |
|
#self.comboBoxProfile.Remove(self.comboBoxProfile.GetValue()) |
189 |
|
event.Skip() |
190 |
|
|