-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloading.py
108 lines (95 loc) · 3.71 KB
/
loading.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
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'loading.ui'
#
# Created by: PyQt5 UI code generator 5.15.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
import time
import os
#initflag=(0==os.system("ls basedir"))
def decrypt():
os.system("konsole -e cryfs basedir mountdir")
dir = os.listdir("mountdir")
dir2 = os.listdir("basedir")
return len(dir),len(dir2)
#decrypt()
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.setEnabled(True)
Dialog.resize(601, 593)
font = QtGui.QFont()
font.setFamily("URW Gothic")
font.setBold(False)
font.setWeight(50)
Dialog.setFont(font)
Dialog.setSizeGripEnabled(False)
Dialog.setModal(False)
self.label_2 = QtWidgets.QLabel(Dialog)
self.label_2.setGeometry(QtCore.QRect(175, 20, 240, 31))
font = QtGui.QFont()
font.setFamily("Orbitron")
font.setPointSize(18)
font.setBold(True)
font.setWeight(75)
self.label_2.setFont(font)
self.label_2.setObjectName("label_2")
self.progressBar = QtWidgets.QProgressBar(Dialog)
self.progressBar.setGeometry(QtCore.QRect(70, 490, 461, 24))
#self.progressBar.setProperty("value", 24)
self.progressBar.setObjectName("progressBar")
self.graphicsView = QtWidgets.QGraphicsView(Dialog)
self.graphicsView.setGeometry(QtCore.QRect(60, 90, 480, 300))
self.graphicsView.setObjectName("graphicsView")
scene = QtWidgets.QGraphicsScene()
self.pixmap = QtWidgets.QGraphicsPixmapItem()
scene.addItem(self.pixmap)
img = QtGui.QPixmap('media/bootup.jpg')
self.pixmap.setPixmap(img)
self.graphicsView.setScene(scene)
self.label = QtWidgets.QLabel(Dialog)
self.label.setGeometry(QtCore.QRect(100, 430, 411, 41))
font = QtGui.QFont()
font.setFamily("Orbitron")
font.setPointSize(18)
font.setBold(False)
font.setWeight(50)
self.label.setFont(font)
self.label.setObjectName("label")
self.pushButton = QtWidgets.QPushButton(Dialog)
self.pushButton.setGeometry(QtCore.QRect(250, 540, 104, 41))
self.pushButton.setObjectName("pushButton")
self.pushButton.clicked.connect(self.doAction)
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Project-X~Vault"))
self.label_2.setText(_translate("Dialog", "Project-X~Vault"))
self.pushButton.setText(_translate("Dialog", "Open Vault!"))
def doAction(self):
b,a=self.passDecry()
if a>2 and b==0:
print("Please check your password!")
self.label.setText(QtCore.QCoreApplication.translate("Dialog", "Incorrect password entered!"))
self.doAction()
else:
print("Files unvaulted succesfully!")
self.label.setText(QtCore.QCoreApplication.translate("Dialog", "Project-X is Decrypting Files..."))
for i in range(101):
time.sleep(0.05)
self.progressBar.setValue(i)
Dialog.close()
def passDecry(self):
b=decrypt()
return b
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Dialog = QtWidgets.QDialog()
ui = Ui_Dialog()
ui.setupUi(Dialog)
Dialog.show()
sys.exit(app.exec_())