-
Notifications
You must be signed in to change notification settings - Fork 6
/
ExtractionDialog.py
168 lines (149 loc) · 6.94 KB
/
ExtractionDialog.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# -*- coding: CP1252 -*-
#
# generated by wxGlade 0.7.2 on Thu Jul 14 22:50:59 2016
#
import wx
# begin wxGlade: dependencies
# end wxGlade
# begin wxGlade: extracode
# end wxGlade
class ExtractionDialog(wx.Dialog):
def __init__(self, *args, **kwds):
# begin wxGlade: ExtractionDialog.__init__
wx.Dialog.__init__(self, *args, **kwds)
self.panel_21 = wx.Panel(self, wx.ID_ANY)
self.panel_22 = wx.Panel(self, wx.ID_ANY)
self.label_2 = wx.StaticText(self, wx.ID_ANY, _("Extraction Location: "))
self.panel_23 = wx.Panel(self, wx.ID_ANY)
self.text_ctrl_outpath = wx.TextCtrl(self, wx.ID_ANY, "")
self.panel_24 = wx.Panel(self, wx.ID_ANY)
self.button_browse_path = wx.Button(self, wx.ID_ANY, _("Browse"))
self.panel_25 = wx.Panel(self, wx.ID_ANY)
self.panel_10 = wx.Panel(self, wx.ID_ANY)
self.panel_13 = wx.Panel(self, wx.ID_ANY)
self.radio_box_selection = wx.RadioBox(self, wx.ID_ANY, _("Selection"), choices=[_("Extract All Highlighted")], majorDimension=1, style=wx.RA_SPECIFY_COLS)
self.panel_14 = wx.Panel(self, wx.ID_ANY)
self.panel_18 = wx.Panel(self, wx.ID_ANY)
self.panel_19 = wx.Panel(self, wx.ID_ANY)
self.checklistbox_options = wx.CheckListBox(self, wx.ID_ANY)
self.panel_20 = wx.Panel(self, wx.ID_ANY)
self.panel_12 = wx.Panel(self, wx.ID_ANY)
self.panel_15 = wx.Panel(self, wx.ID_ANY)
self.button_extract = wx.Button(self, wx.ID_ANY, _("Extract"))
self.panel_16 = wx.Panel(self, wx.ID_ANY)
self.button_cancel = wx.Button(self, wx.ID_ANY, _("Cancel"))
self.panel_17 = wx.Panel(self, wx.ID_ANY)
self.panel_11 = wx.Panel(self, wx.ID_ANY)
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_BUTTON, self.button_browse_path_click, self.button_browse_path)
self.Bind(wx.EVT_RADIOBOX, self.radio_box_selection_clicked, self.radio_box_selection)
self.Bind(wx.EVT_BUTTON, self.button_extract_click, self.button_extract)
self.Bind(wx.EVT_BUTTON, self.button_cancel_click, self.button_cancel)
# end wxGlade
self._InitCheckboxes()
def __set_properties(self):
# begin wxGlade: ExtractionDialog.__set_properties
self.SetTitle(_("Extraction Options"))
self.SetSize((479, 243))
self.panel_21.SetMinSize((201, 5))
self.panel_22.SetMinSize((5, 20))
self.panel_23.SetMinSize((5, 20))
self.panel_24.SetMinSize((10, 20))
self.panel_25.SetMinSize((5, 26))
self.panel_10.SetMinSize((379,5))
self.panel_13.SetMinSize((5, 47))
self.radio_box_selection.SetSelection(0)
self.panel_14.SetMinSize((5, 47))
self.panel_18.SetMinSize((379, 15))
self.panel_19.SetMinSize((5, 69))
self.panel_20.SetMinSize((5, 69))
self.panel_12.SetMinSize((379, 10))
self.panel_15.SetMinSize((5, 26))
self.button_extract.SetMinSize((88, 26))
self.panel_16.SetMinSize((10, 26))
self.button_cancel.SetMinSize((88, 26))
self.panel_17.SetMinSize((10, 26))
self.panel_11.SetMinSize((379, 5))
# end wxGlade
def __do_layout(self):
# begin wxGlade: ExtractionDialog.__do_layout
sizer_15 = wx.BoxSizer(wx.HORIZONTAL)
sizer_16 = wx.BoxSizer(wx.VERTICAL)
sizer_19 = wx.BoxSizer(wx.HORIZONTAL)
sizer_20 = wx.BoxSizer(wx.HORIZONTAL)
sizer_17 = wx.BoxSizer(wx.HORIZONTAL)
sizer_18 = wx.BoxSizer(wx.HORIZONTAL)
sizer_21 = wx.BoxSizer(wx.HORIZONTAL)
sizer_16.Add(self.panel_21, 1, 0, 0)
sizer_21.Add(self.panel_22, 0, wx.EXPAND, 0)
sizer_21.Add(self.label_2, 0, wx.ALIGN_CENTER, 0)
sizer_21.Add(self.panel_23, 0, wx.EXPAND, 0)
sizer_21.Add(self.text_ctrl_outpath, 1, wx.EXPAND, 0)
sizer_21.Add(self.panel_24, 0, wx.EXPAND, 0)
sizer_21.Add(self.button_browse_path, 0, wx.EXPAND, 0)
sizer_21.Add(self.panel_25, 0, wx.EXPAND, 0)
sizer_16.Add(sizer_21, 1, wx.EXPAND, 0)
sizer_16.Add(self.panel_10, 0, wx.EXPAND, 0)
sizer_18.Add(self.panel_13, 0, wx.EXPAND, 0)
sizer_18.Add(self.radio_box_selection, 1, wx.EXPAND, 0)
sizer_18.Add(self.panel_14, 0, wx.EXPAND, 0)
sizer_17.Add(sizer_18, 1, wx.EXPAND, 0)
sizer_16.Add(sizer_17, 1, wx.EXPAND, 0)
sizer_16.Add(self.panel_18, 0, wx.EXPAND, 0)
sizer_20.Add(self.panel_19, 0, wx.EXPAND, 0)
sizer_20.Add(self.checklistbox_options, 1, wx.EXPAND, 0)
sizer_20.Add(self.panel_20, 0, wx.EXPAND, 0)
sizer_16.Add(sizer_20, 1, 0, 0)
sizer_16.Add(self.panel_12, 0, wx.EXPAND, 0)
sizer_19.Add(self.panel_15, 1, wx.EXPAND, 0)
sizer_19.Add(self.button_extract, 0, 0, 0)
sizer_19.Add(self.panel_16, 0, wx.EXPAND, 0)
sizer_19.Add(self.button_cancel, 0, 0, 0)
sizer_19.Add(self.panel_17, 0, wx.EXPAND, 0)
sizer_16.Add(sizer_19, 0, wx.EXPAND, 0)
sizer_16.Add(self.panel_11, 0, wx.EXPAND, 0)
sizer_15.Add(sizer_16, 1, 0, 0)
self.SetSizer(sizer_15)
self.Layout()
# end wxGlade
def radio_box_selection_clicked(self, event): # wxGlade: ExtractionDialog.<event_handler>
print "Event handler 'radio_box_selection_clicked' not implemented!"
event.Skip()
def button_extract_click(self, event): # wxGlade: ExtractionDialog.<event_handler>
print "Event handler 'button_extract_click' not implemented!"
self.EndModal(wx.ID_OK)
def button_cancel_click(self, event): # wxGlade: ExtractionDialog.<event_handler>
print "Event handler 'button_cancel_click' not implemented!"
self.EndModal(wx.ID_CANCEL )
def _InitCheckboxes(self):
option_strings = [
'Append inode'
]
self.checklistbox_options.InsertItems(option_strings,0)
self.Bind(wx.EVT_LISTBOX, self.EvtListBox, self.checklistbox_options)
self.Bind(wx.EVT_CHECKLISTBOX, self.EvtCheckListBox, self.checklistbox_options)
def EvtListBox(self, event):
print('EvtListBox: %s\n' % event.GetString())
def EvtCheckListBox(self, event):
index = event.GetSelection()
label = self.checklistbox_options.GetString(index)
status = 'un'
if self.checklistbox_options.IsChecked(index):
status = ''
print('Box %s is %schecked \n' % (label, status))
self.checklistbox_options.SetSelection(index)
def button_browse_path_click(self, event):
print "Event handler 'button_browse_path_click' not implemented!"
dlg = wx.DirDialog(
self,
"Choose a directory:",
style=wx.DD_DEFAULT_STYLE
)
if dlg.ShowModal() == wx.ID_OK:
self.text_ctrl_outpath.Clear()
self.text_ctrl_outpath.SetValue(dlg.GetPath())
print('You selected: %s\n' % dlg.GetPath())
dlg.Destroy()
event.Skip()
# end of class ExtractionDialog