forked from 3C-SCSU/Avatar
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFileShuffler.qml
More file actions
326 lines (279 loc) · 10.6 KB
/
Copy pathFileShuffler.qml
File metadata and controls
326 lines (279 loc) · 10.6 KB
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
import QtQuick.Dialogs
import Qt.labs.platform
import QtQuick 6.5
import QtQuick.Controls 6.4
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import QtQuick3D 6.7
// File shuffler Tab view
Rectangle {
id: fileShufflerView
color: "#718399"
Layout.fillWidth: true
Layout.fillHeight: true
// Separate logs for each action
property string unifyLog: ""
property string removeLog: ""
property string runLog: ""
// Status flags
property bool ranShuffle: false
property bool unifiedThoughts: false
// Which button is currently active ("unify", "remove", "run", or "")
property string activeButton: ""
ColumnLayout {
anchors.fill: parent
anchors.margins: 20
spacing: 16
// HEADER + BUTTON BAR
Rectangle {
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: fileShufflerView.width * 0.7
Layout.preferredHeight: fileShufflerView.height * 0.2
radius: 10
color: "#202846" // dark blue header
ColumnLayout {
anchors.fill: parent
anchors.margins: 14
spacing: 6
Text {
text: "FILE SHUFFLER"
color: "white"
font.family: "serif" //serif look
font.letterSpacing: 1.0 //
font.bold: true
font.pixelSize: 24
horizontalAlignment: Text.AlignHCenter
Layout.alignment: Qt.AlignHCenter
}
RowLayout {
id: buttonRow
Layout.alignment: Qt.AlignHCenter
spacing: 14
function isActive(name) {
return fileShufflerView.activeButton === name;
}
Button {
id: unifyButton
Layout.preferredWidth: 180
Layout.preferredHeight: 60
background: Rectangle {
radius: 6
color: "#7CC000"
border.color: "#E5E500"
}
contentItem: Text {
anchors.centerIn: parent
text: "Unify Thoughts"
font.pixelSize: 18
font.bold: true
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: buttonRow.isActive("unify") ? "yellow" : "white"
}
onClicked: {
fileShufflerView.activeButton = "unify"
unifyLog = "Running Thoughts Unifier...\n"
unifiedThoughts = false
ranShuffle = false
unifyThoughtsDialog.open()
}
}
Button {
id: removeButton
Layout.preferredWidth: 180
Layout.preferredHeight: 60
background: Rectangle {
radius: 6
color: "#7CC000"
border.color: "#E5E500"
}
contentItem: Text {
anchors.centerIn: parent
text: "Remove 8 Channel"
font.pixelSize: 18
font.bold: true
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: buttonRow.isActive("remove") ? "yellow" : "white"
}
onClicked: {
fileShufflerView.activeButton = "remove"
removeLog = "Running 8 Channel Data Remover...\n"
unifiedThoughts = false
ranShuffle = false
remove8channelDialog.open()
}
}
Button {
id: runButton
Layout.preferredWidth: 180
Layout.preferredHeight: 60
background: Rectangle {
radius: 6
color: "#7CC000"
border.color: "#E5E500"
}
contentItem: Text {
anchors.centerIn: parent
text: "Anonymize" //Renamed "Run File Shuffler" to "Anonymize"
font.pixelSize: 18
font.bold: true
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: buttonRow.isActive("run") ? "yellow" : "white"
}
onClicked: {
fileShufflerView.activeButton = "run"
runLog = "Running File Shuffler...\n"
unifiedThoughts = false
ranShuffle = false
fileShufflerDialog.open()
}
}
}
}
}
// CONSOLE LOG TITLE
Text {
text: "Console Log"
color: "white"
font.bold: true
font.pixelSize: 26
horizontalAlignment: Text.AlignHCenter
Layout.alignment: Qt.AlignHCenter
}
// WRAPPER THAT CONTROLS CONSOLE HEIGHT
Rectangle {
id: logsArea
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: fileShufflerView.width * 0.7
Layout.preferredHeight: fileShufflerView.height * 0.6
radius: 4
border.width: 1
border.color: "#D0D0D0"
color: "transparent"
RowLayout {
anchors.fill: parent
anchors.margins: 20
spacing: 10
// Panel 1: Unify Thoughts
Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
radius: 4
color: "white"
ScrollView {
anchors.fill: parent
TextArea {
text: fileShufflerView.unifyLog
readOnly: true
wrapMode: TextArea.Wrap
color: "black"
font.pixelSize: 13
background: null
}
}
}
// Panel 2: Remove 8 Channel
Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
radius: 4
color: "white"
ScrollView {
anchors.fill: parent
TextArea {
text: fileShufflerView.removeLog
readOnly: true
wrapMode: TextArea.Wrap
color: "black"
font.pixelSize: 13
background: null
}
}
}
// Panel 3: Run Shuffler
Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
radius: 4
color: "white"
ScrollView {
anchors.fill: parent
TextArea {
text: fileShufflerView.runLog
readOnly: true
wrapMode: TextArea.Wrap
color: "black"
font.pixelSize: 13
background: null
}
}
}
}
}
// STATUS TEXTS UNDER LOGS
Text {
id: ranText
text: "Shuffle Complete!"
color: "yellow"
font.bold: true
font.pixelSize: 16
Layout.alignment: Qt.AlignHCenter
visible: fileShufflerView.ranShuffle
}
Text {
id: unifiedText
text: "Thoughts Unified!"
color: "lightgreen"
font.bold: true
font.pixelSize: 16
Layout.alignment: Qt.AlignHCenter
visible: fileShufflerView.unifiedThoughts
}
}
// FOLDER DIALOGS
// Run File Shuffler - Renamed "Run File Shuffler" to "Anonymize"
FolderDialog {
id: fileShufflerDialog
folder: "file:///"
onAccepted: {
console.log("Selected folder:", fileShufflerDialog.folder)
var output = fileShufflerGui.run_file_shuffler_program(fileShufflerDialog.folder)
fileShufflerView.runLog += output + "\n"
fileShufflerView.ranShuffle = true
}
onRejected: {
console.log("Folder dialog canceled")
}
}
// Unify Thoughts
FolderDialog {
id: unifyThoughtsDialog
folder: "file:///"
onAccepted: {
console.log("Selected folder:", unifyThoughtsDialog.folder)
var output = fileShufflerGui.unify_thoughts(unifyThoughtsDialog.folder)
fileShufflerView.unifyLog += output + "\nThoughts Unified!\n"
fileShufflerView.unifiedThoughts = true
}
onRejected: {
console.log("Folder dialog canceled")
}
}
// Remove 8 Channel Data
FolderDialog {
id: remove8channelDialog
folder: "file:///"
onAccepted: {
console.log("Selected folder:", remove8channelDialog.folder)
var output = fileShufflerGui.remove_8_channel(remove8channelDialog.folder)
fileShufflerView.removeLog += output + "\n8 Channel Data Files Removed!\n"
fileShufflerView.unifiedThoughts = false
fileShufflerView.ranShuffle = false
}
onRejected: {
console.log("Folder dialog canceled")
}
}
}