-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathencdec.kv
207 lines (178 loc) · 4.29 KB
/
encdec.kv
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
#:import Factory kivy.factory.Factory
#:import Clipboard kivy.core.clipboard.Clipboard
#:import data_dir __main__.data_dir
<ScrlTxtInst@ScrollableText>:
scroll_type: ['bars', 'content']
bar_width: 4
bar_color: [.2, .2, .2, .9]
bar_inactive_color: [.7, .7, .7, .9]
text: ti.text
TextInput:
id: ti
use_bubble: True
size_hint_y: None
height: max(self.minimum_height, self.parent.height)
<RootBox>:
orientation: 'vertical'
BoxLayout:
id: topLayout
size_hint_y: 10
ScrlTxtInst:
id: inputBox
ScrlTxtInst:
id: outputBox
BoxLayout:
id: midLayout
Button:
id: encBtn
size_hint_x: 2
text: 'ENCODE AND COPY--->'
on_press: root.enc_Button()
on_release: Clipboard.copy(root.ids.outputBox.text)
Button:
id: decBtn
size_hint_x: 2
text: '<---DECODE AND COPY'
on_press: root.dec_Button()
on_release: Clipboard.copy(root.ids.inputBox.text)
BoxLayout:
id: botLayout
Button:
id: keyBtn
text: 'VIEW/SET KEY'
on_release: Factory.ShowSetKeyAsk(lbl_text = app.rootMain.get_currentKeyFile()).open()
<ScrlLblInst@ScrollableLabel>:
id: sc
size_hint_y: 10
Label:
id: lb
text: sc.text
font_size: 14
text_size: self.width, None
size_hint_y: None
height: self.texture_size[1]
<NewKeyPop@CustPopup>:
title: 'Enter new key (only ASCII printable characters allowed)'
title_align: 'center'
auto_dismiss: False
newkeyinput: app.rootMain.newkey_input
on_newkeyinput: self.ids.popText.ids.ti.text = self.newkeyinput
GridLayout:
cols: 1
padding: 10
ScrlTxtInst:
id: popText
size_hint_y: 10
Button:
id: popOK
text: 'OK'
on_release: app.rootMain.init_program(reinitKey=root.ids.popText.text.strip())
on_release: root.dismiss()
BoxLayout:
orientation: 'horizontal'
Button:
text: 'LOAD FROM FILE'
on_release: app.rootMain.show_load()
Button:
text: 'BACKUP'
on_release: app.rootMain.show_save()
Button:
id: popCancel
text: 'CANCEL'
on_release: root.dismiss()
<ShowSetKeyAsk@CustPopup>:
title: 'This is the current encryption key. Do you want to change it?'
title_align: 'center'
auto_dismiss: False
GridLayout:
cols: 1
padding: 10
ScrlLblInst:
text: root.lbl_text
Button:
id: popYes
text: 'Yes'
on_release: Factory.NewKeyPop().open()
on_release: root.dismiss()
Button:
id: popNo
text: 'No'
on_release: root.dismiss()
<GenYesNo@CustPopup>:
title_align: 'center'
auto_dismiss: False
on_dismiss: app.rootMain.save(app.rootMain.temppath, app.rootMain.tempfile)
GridLayout:
cols: 1
padding: 10
Label:
size_hint_y: 10
text: root.lbl_text
Button:
id: popYes
text: 'Yes'
on_press: app.rootMain.yesno_answer = 'yes'
on_release: root.dismiss()
Button:
id: popNo
text: 'No'
on_press: app.rootMain.yesno_answer = 'no'
on_release: root.dismiss()
<GenericPop@CustPopup>:
title_align: 'center'
auto_dismiss: False
GridLayout:
cols: 1
padding: 10
Label:
size_hint_y: 10
text: root.lbl_text
Button:
text: 'OK'
on_release: root.dismiss()
<LoadDiag>:
title_align: 'center'
GridLayout:
cols: 1
padding: 10
FileChooserIconView:
size_hint_y: 10
id: filechooser
filters: ['*.txt']
filter_dirs: True
rootpath: data_dir
BoxLayout:
Button:
text: 'LOAD'
on_release: root.load(filechooser.path, filechooser.selection)
Button:
text: 'CANCEL'
on_release: root.dism()
<SaveDiag>:
title_align: 'center'
text_input: filnam
GridLayout:
cols: 1
padding: 10
FileChooserIconView:
size_hint_y: 10
id: filechooser
filters: ['*.txt']
filter_dirs: True
rootpath: data_dir
on_selection: filnam.text = filechooser.selection[0].replace(filechooser.path + '/','')
TextInput:
id: filnam
multiline: False
size_hint_y: None
height: self.minimum_height
text: 'oldKey.txt'
BoxLayout:
Button:
size_hint_x: 2
text: 'SAVE'
on_release: root.save(filechooser.path, root.text_input.text)
Button:
size_hint_x: 2
text: 'CANCEL'
on_release: root.dism()