11 |
[wxID_FRAGGLEDIALOGPREFS, wxID_FRAGGLEDIALOGPREFSBTSAVE, |
[wxID_FRAGGLEDIALOGPREFS, wxID_FRAGGLEDIALOGPREFSBTSAVE, |
12 |
wxID_FRAGGLEDIALOGPREFSBUTTON1, wxID_FRAGGLEDIALOGPREFSBUTTONPROFILEDEL, |
wxID_FRAGGLEDIALOGPREFSBUTTON1, wxID_FRAGGLEDIALOGPREFSBUTTONPROFILEDEL, |
13 |
wxID_FRAGGLEDIALOGPREFSBUTTONPROFILELOAD, |
wxID_FRAGGLEDIALOGPREFSBUTTONPROFILELOAD, |
14 |
wxID_FRAGGLEDIALOGPREFSBUTTONPROFILESAVE, |
wxID_FRAGGLEDIALOGPREFSBUTTONPROFILESAVE, wxID_FRAGGLEDIALOGPREFSBUTTONTEST, |
15 |
wxID_FRAGGLEDIALOGPREFSCOMBOBOXPROFILE, wxID_FRAGGLEDIALOGPREFSSTATICTEXT1, |
wxID_FRAGGLEDIALOGPREFSCOMBOBOXPROFILE, wxID_FRAGGLEDIALOGPREFSSTATICTEXT1, |
16 |
wxID_FRAGGLEDIALOGPREFSSTATICTEXT2, wxID_FRAGGLEDIALOGPREFSSTATICTEXT3, |
wxID_FRAGGLEDIALOGPREFSSTATICTEXT2, wxID_FRAGGLEDIALOGPREFSSTATICTEXT3, |
17 |
wxID_FRAGGLEDIALOGPREFSSTATICTEXT4, wxID_FRAGGLEDIALOGPREFSSTATICTEXT5, |
wxID_FRAGGLEDIALOGPREFSSTATICTEXT4, wxID_FRAGGLEDIALOGPREFSSTATICTEXT5, |
19 |
wxID_FRAGGLEDIALOGPREFSTEXTCTRLRETRIEVAL, |
wxID_FRAGGLEDIALOGPREFSTEXTCTRLRETRIEVAL, |
20 |
wxID_FRAGGLEDIALOGPREFSTEXTCTRLSERVER, |
wxID_FRAGGLEDIALOGPREFSTEXTCTRLSERVER, |
21 |
wxID_FRAGGLEDIALOGPREFSTEXTCTRLUSERNAME, |
wxID_FRAGGLEDIALOGPREFSTEXTCTRLUSERNAME, |
22 |
] = map(lambda _init_ctrls: wxNewId(), range(17)) |
] = map(lambda _init_ctrls: wxNewId(), range(18)) |
23 |
|
|
24 |
class fraggleDialogPrefs(wxDialog): |
class fraggleDialogPrefs(wxDialog): |
|
def _init_utils(self): |
|
|
# generated method, don't edit |
|
|
pass |
|
|
|
|
25 |
def _init_ctrls(self, prnt): |
def _init_ctrls(self, prnt): |
26 |
# generated method, don't edit |
# generated method, don't edit |
27 |
wxDialog.__init__(self, id=wxID_FRAGGLEDIALOGPREFS, |
wxDialog.__init__(self, id=wxID_FRAGGLEDIALOGPREFS, |
28 |
name='fraggleDialogPrefs', parent=prnt, pos=wxPoint(283, 313), |
name='fraggleDialogPrefs', parent=prnt, pos=wxPoint(283, 313), |
29 |
size=wxSize(366, 233), style=wxDEFAULT_DIALOG_STYLE, |
size=wxSize(374, 260), style=wxDEFAULT_DIALOG_STYLE, |
30 |
title='Netfraggle Preferences') |
title='Netfraggle Preferences') |
|
self._init_utils() |
|
31 |
self.SetClientSize(wxSize(366, 233)) |
self.SetClientSize(wxSize(366, 233)) |
32 |
|
|
33 |
self.btsave = wxButton(id=wxID_FRAGGLEDIALOGPREFSBTSAVE, |
self.btsave = wxButton(id=wxID_FRAGGLEDIALOGPREFSBTSAVE, |
81 |
|
|
82 |
self.comboBoxProfile = wxComboBox(choices=[], |
self.comboBoxProfile = wxComboBox(choices=[], |
83 |
id=wxID_FRAGGLEDIALOGPREFSCOMBOBOXPROFILE, name='comboBoxProfile', |
id=wxID_FRAGGLEDIALOGPREFSCOMBOBOXPROFILE, name='comboBoxProfile', |
84 |
parent=self, pos=wxPoint(80, 8), size=wxSize(124, 16), style=0, |
parent=self, pos=wxPoint(80, 8), size=wxSize(124, 21), style=0, |
85 |
validator=wxDefaultValidator, value='') |
validator=wxDefaultValidator, value='') |
86 |
self.comboBoxProfile.SetLabel('') |
self.comboBoxProfile.SetLabel('') |
87 |
EVT_COMBOBOX(self.comboBoxProfile, |
EVT_COMBOBOX(self.comboBoxProfile, |
113 |
wxID_FRAGGLEDIALOGPREFSBUTTONPROFILELOAD, |
wxID_FRAGGLEDIALOGPREFSBUTTONPROFILELOAD, |
114 |
self.OnButtonprofileloadButton) |
self.OnButtonprofileloadButton) |
115 |
|
|
116 |
|
self.buttonTest = wxButton(id=wxID_FRAGGLEDIALOGPREFSBUTTONTEST, |
117 |
|
label=u'&Test Account', name=u'buttonTest', parent=self, |
118 |
|
pos=wxPoint(264, 208), size=wxSize(96, 16), style=0) |
119 |
|
EVT_BUTTON(self.buttonTest, wxID_FRAGGLEDIALOGPREFSBUTTONTEST, |
120 |
|
self.OnButtonTestButton) |
121 |
|
|
122 |
def __init_profiles(self): |
def __init_profiles(self): |
123 |
list = self.parent.preferencesCtl.getProfileList() |
list = self.parent.preferencesCtl.getProfileList() |
124 |
print list |
print list |
127 |
|
|
128 |
def __init__(self, parent): |
def __init__(self, parent): |
129 |
self.parent = parent |
self.parent = parent |
130 |
|
import __main__ |
131 |
|
self.engine = __main__.engine |
132 |
self._init_ctrls(parent) |
self._init_ctrls(parent) |
133 |
self.__init_profiles() |
self.__init_profiles() |
134 |
|
|
197 |
|
|
198 |
def OnComboboxprofileCombobox(self, event): |
def OnComboboxprofileCombobox(self, event): |
199 |
event.Skip() |
event.Skip() |
|
|
|
200 |
|
|
201 |
|
def OnButtonTestButton(self, event): |
202 |
|
#event.Skip() |
203 |
|
if self.engine.authenticate(self.textCtrlServer.GetValue(), self.textCtrlUsername.GetValue(), self.textCtrlPassword.GetValue()): |
204 |
|
wxMessageBox("Authentication successful!") |
205 |
|
else: |
206 |
|
wxMessageBox("Authentication failed!") |