1 |
xabbu |
1.2 |
#Boa:Dialog:fraggleDialogPrefs |
2 |
xabbu |
1.1 |
|
3 |
|
|
from wxPython.wx import * |
4 |
|
|
|
5 |
|
|
def create(parent): |
6 |
xabbu |
1.2 |
return fraggleDialogPrefs(parent) |
7 |
xabbu |
1.1 |
|
8 |
xabbu |
1.2 |
[wxID_FRAGGLEDIALOGPREFS, wxID_FRAGGLEDIALOGPREFSBTSAVE, |
9 |
|
|
wxID_FRAGGLEDIALOGPREFSBUTTON1, wxID_FRAGGLEDIALOGPREFSSTATICLINE1, |
10 |
|
|
wxID_FRAGGLEDIALOGPREFSSTATICLINE2, wxID_FRAGGLEDIALOGPREFSSTATICTEXT1, |
11 |
|
|
wxID_FRAGGLEDIALOGPREFSSTATICTEXT2, wxID_FRAGGLEDIALOGPREFSSTATICTEXT3, |
12 |
|
|
wxID_FRAGGLEDIALOGPREFSSTATICTEXT4, wxID_FRAGGLEDIALOGPREFSSTATICTEXT5, |
13 |
|
|
wxID_FRAGGLEDIALOGPREFSTEXTCTRLPASSWORD, |
14 |
|
|
wxID_FRAGGLEDIALOGPREFSTEXTCTRLRETRIEVAL, |
15 |
|
|
wxID_FRAGGLEDIALOGPREFSTEXTCTRLSERVER, |
16 |
|
|
wxID_FRAGGLEDIALOGPREFSTEXTCTRLUSERNAME, |
17 |
xabbu |
1.1 |
] = map(lambda _init_ctrls: wxNewId(), range(14)) |
18 |
|
|
|
19 |
xabbu |
1.2 |
class fraggleDialogPrefs(wxDialog): |
20 |
xabbu |
1.1 |
def _init_utils(self): |
21 |
|
|
# generated method, don't edit |
22 |
|
|
pass |
23 |
|
|
|
24 |
|
|
def _init_ctrls(self, prnt): |
25 |
|
|
# generated method, don't edit |
26 |
xabbu |
1.2 |
wxDialog.__init__(self, id=wxID_FRAGGLEDIALOGPREFS, |
27 |
|
|
name='fraggleDialogPrefs', parent=prnt, pos=wxPoint(283, 313), |
28 |
|
|
size=wxSize(366, 188), style=wxDEFAULT_DIALOG_STYLE, |
29 |
|
|
title='Netfraggle Preferences') |
30 |
xabbu |
1.1 |
self._init_utils() |
31 |
|
|
self.SetClientSize(wxSize(366, 188)) |
32 |
|
|
|
33 |
xabbu |
1.2 |
self.btsave = wxButton(id=wxID_FRAGGLEDIALOGPREFSBTSAVE, label='Save', |
34 |
xabbu |
1.1 |
name='btsave', parent=self, pos=wxPoint(8, 168), size=wxSize(64, |
35 |
|
|
16), style=0) |
36 |
xabbu |
1.2 |
EVT_BUTTON(self.btsave, wxID_FRAGGLEDIALOGPREFSBTSAVE, |
37 |
|
|
self.OnBtsaveButton) |
38 |
xabbu |
1.1 |
|
39 |
xabbu |
1.2 |
self.button1 = wxButton(id=wxID_FRAGGLEDIALOGPREFSBUTTON1, |
40 |
|
|
label='Cancel', name='button1', parent=self, pos=wxPoint(80, 168), |
41 |
|
|
size=wxSize(56, 16), style=0) |
42 |
xabbu |
1.1 |
|
43 |
xabbu |
1.2 |
self.staticText1 = wxStaticText(id=wxID_FRAGGLEDIALOGPREFSSTATICTEXT1, |
44 |
xabbu |
1.1 |
label='Username', name='staticText1', parent=self, pos=wxPoint(16, |
45 |
|
|
16), size=wxSize(47, 13), style=0) |
46 |
|
|
|
47 |
xabbu |
1.2 |
self.staticText2 = wxStaticText(id=wxID_FRAGGLEDIALOGPREFSSTATICTEXT2, |
48 |
xabbu |
1.1 |
label='Password', name='staticText2', parent=self, pos=wxPoint(16, |
49 |
|
|
40), size=wxSize(53, 16), style=0) |
50 |
|
|
|
51 |
xabbu |
1.2 |
self.textCtrlUsername = wxTextCtrl(id=wxID_FRAGGLEDIALOGPREFSTEXTCTRLUSERNAME, |
52 |
xabbu |
1.1 |
name='textCtrlUsername', parent=self, pos=wxPoint(80, 16), |
53 |
|
|
size=wxSize(80, 16), style=0, value='') |
54 |
|
|
|
55 |
xabbu |
1.2 |
self.textCtrlPassword = wxTextCtrl(id=wxID_FRAGGLEDIALOGPREFSTEXTCTRLPASSWORD, |
56 |
xabbu |
1.1 |
name='textCtrlPassword', parent=self, pos=wxPoint(80, 40), |
57 |
|
|
size=wxSize(80, 16), style=0, value='') |
58 |
|
|
|
59 |
xabbu |
1.2 |
self.staticText3 = wxStaticText(id=wxID_FRAGGLEDIALOGPREFSSTATICTEXT3, |
60 |
xabbu |
1.1 |
label='Server URL', name='staticText3', parent=self, |
61 |
|
|
pos=wxPoint(16, 64), size=wxSize(58, 16), style=0) |
62 |
|
|
|
63 |
xabbu |
1.2 |
self.textCtrlServer = wxTextCtrl(id=wxID_FRAGGLEDIALOGPREFSTEXTCTRLSERVER, |
64 |
xabbu |
1.1 |
name='textCtrlServer', parent=self, pos=wxPoint(80, 64), |
65 |
|
|
size=wxSize(272, 16), style=0, |
66 |
|
|
value='http://your.server.com/netfraggle.php') |
67 |
|
|
|
68 |
xabbu |
1.2 |
self.staticText4 = wxStaticText(id=wxID_FRAGGLEDIALOGPREFSSTATICTEXT4, |
69 |
xabbu |
1.1 |
label='Topic Retrieval Interval', name='staticText4', parent=self, |
70 |
|
|
pos=wxPoint(16, 144), size=wxSize(120, 16), style=0) |
71 |
|
|
|
72 |
xabbu |
1.2 |
self.textCtrlRetrieval = wxTextCtrl(id=wxID_FRAGGLEDIALOGPREFSTEXTCTRLRETRIEVAL, |
73 |
xabbu |
1.1 |
name='textCtrlRetrieval', parent=self, pos=wxPoint(128, 144), |
74 |
|
|
size=wxSize(40, 16), style=0, value='') |
75 |
|
|
|
76 |
xabbu |
1.2 |
self.staticText5 = wxStaticText(id=wxID_FRAGGLEDIALOGPREFSSTATICTEXT5, |
77 |
xabbu |
1.1 |
label='Seconds', name='staticText5', parent=self, pos=wxPoint(176, |
78 |
|
|
144), size=wxSize(56, 16), style=0) |
79 |
|
|
|
80 |
xabbu |
1.2 |
self.staticLine1 = wxStaticLine(id=wxID_FRAGGLEDIALOGPREFSSTATICLINE1, |
81 |
xabbu |
1.1 |
name='staticLine1', parent=self, pos=wxPoint(0, 144), |
82 |
|
|
size=wxSize(368, 0), style=0) |
83 |
|
|
|
84 |
xabbu |
1.2 |
self.staticLine2 = wxStaticLine(id=wxID_FRAGGLEDIALOGPREFSSTATICLINE2, |
85 |
xabbu |
1.1 |
name='staticLine2', parent=self, pos=wxPoint(0, 56), |
86 |
|
|
size=wxSize(368, 8), style=0) |
87 |
|
|
|
88 |
|
|
def __init__(self, parent): |
89 |
xabbu |
1.2 |
self.parent = parent |
90 |
xabbu |
1.1 |
self._init_ctrls(parent) |
91 |
xabbu |
1.2 |
|
92 |
|
|
def OnBtsaveButton(self, event): |
93 |
|
|
self.parent.preferencesCtl.setConfig(self.textCtrlUsername.GetValue(),self.textCtrlPassword.GetValue(), |
94 |
|
|
self.textCtrlServer.GetValue(),self.textCtrlRetrieval.GetValue()) |
95 |
|
|
self.parent.preferencesCtl.saveConfig() |
96 |
|
|
event.Skip() |