-
Notifications
You must be signed in to change notification settings - Fork 5
/
cgetmasterkey.py
55 lines (43 loc) · 1.77 KB
/
cgetmasterkey.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
# encfsgui Ask for master key
#
import os
import sys
import time
import datetime
import string
from PyQt5 import uic
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import *
from PyQt5 import QtCore
from PyQt5.QtWidgets import QMessageBox, QSystemTrayIcon, QMenu, QAction, QStyle
import encfsgui_globals
from encfsgui_globals import *
import encfsgui_helper
from encfsgui_helper import *
class CMasterKeyWindow(QtWidgets.QDialog):
def __init__(self):
encfsgui_helper.print_debug("Start CMasterKeyWindow %s" % inspect.stack()[0][3])
super(CMasterKeyWindow, self).__init__()
uic.loadUi('encfsgui_masterkey.ui', self)
# disable/remove buttons
self.setWindowFlags(self.windowFlags() | QtCore.Qt.CustomizeWindowHint | QtCore.Qt.WindowStaysOnTopHint)
self.setWindowFlag(QtCore.Qt.WindowMaximizeButtonHint, False)
self.setWindowFlag(QtCore.Qt.WindowCloseButtonHint, False)
self.okbutton = self.findChild(QtWidgets.QPushButton, 'btn_OK')
self.okbutton.clicked.connect(self.OKButtonClicked)
self.cancelbutton = self.findChild(QtWidgets.QPushButton, 'btn_cancel')
self.cancelbutton.clicked.connect(self.CancelButtonClicked)
self.txt_password = self.findChild(QtWidgets.QLineEdit, 'txt_password')
def getPassword(self):
encfsgui_helper.print_debug("Start %s" % inspect.stack()[0][3])
pw = encfsgui_helper.makePW32(self.txt_password.text()[0:31])
return pw
def OKButtonClicked(self):
encfsgui_helper.print_debug("Start %s" % inspect.stack()[0][3])
self.close()
return
def CancelButtonClicked(self):
encfsgui_helper.print_debug("Start %s" % inspect.stack()[0][3])
self.txt_password.setText("")
self.close()
return