1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import webbrowser
20
21 import wx
22
23 from timelinelib.wxgui.dialogs.feedback.controller import FeedbackDialogController
24 from timelinelib.wxgui.framework import Dialog
25
26
28
29 """
30 <BoxSizerVertical>
31 <StaticText name="info" border="LEFT|TOP|RIGHT" />
32 <FlexGridSizer columns="2" growableColumns="1" growableRows="2" proportion="1" border="ALL">
33 <StaticText align="ALIGN_CENTER_VERTICAL" label="$(to_text)" />
34 <TextCtrl name="to_text" style="TE_READONLY" />
35 <StaticText align="ALIGN_CENTER_VERTICAL" label="$(subject_text)" />
36 <TextCtrl name="subject_text" />
37 <StaticText align="ALIGN_TOP" label="$(body_text)" />
38 <TextCtrlSelect name="body_text" height="200" style="TE_MULTILINE" />
39 <StaticText align="ALIGN_CENTER_VERTICAL" label="$(send_with_text)" />
40 <BoxSizerHorizontal>
41 <Button label="$(default_button_text)" borderType="SMALL" border="RIGHT" event_EVT_BUTTON="on_default_click" />
42 <Button label="$(gmail_button_text)" borderType="SMALL" border="RIGHT" event_EVT_BUTTON="on_gmail_click" />
43 <Button label="$(other_button_text)" border="RIGHT" event_EVT_BUTTON="on_other_click" />
44 <StretchSpacer />
45 <DialogButtonsCloseSizer />
46 </BoxSizerHorizontal>
47 </FlexGridSizer>
48 </BoxSizerVertical>
49 """
50
51 - def __init__(self, parent, info, subject, body):
52 Dialog.__init__(self, FeedbackDialogController, parent, {
53 "title_text": _("Email Feedback"),
54 "to_text": _("To:"),
55 "subject_text": _("Subject:"),
56 "body_text": _("Body:"),
57 "send_with_text": _("Send With:"),
58 "default_button_text": _("Default client"),
59 "gmail_button_text": _("Gmail"),
60 "other_button_text": _("Other"),
61 }, title=_("Email Feedback"), style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
62 self.controller.on_init(webbrowser, info, subject, body)
63 self.body_text.SetFocus()
64
65 - def SetInfoText(self, text):
66 self.info.SetLabel(text)
67 self.SetSizerAndFit(self.GetSizer())
68
69 - def GetToText(self):
70 return self.to_text.GetValue()
71
72 - def SetToText(self, text):
73 self.to_text.SetValue(text)
74
75 - def GetSubjectText(self):
76 return self.subject_text.GetValue()
77
78 - def SetSubjectText(self, text):
79 self.subject_text.SetValue(text)
80
81 - def GetBodyText(self):
82 return self.body_text.GetValue()
83
84 - def SetBodyText(self, text):
85 self.body_text.SetValue(text)
86
88 self.body_text.SelectAll()
89
90
95