-
Notifications
You must be signed in to change notification settings - Fork 5
/
cmountpassword.py
66 lines (52 loc) · 2.13 KB
/
cmountpassword.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
# encfsgui Get mount password
#
#
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
import encfsgui_globals
from encfsgui_globals import *
import encfsgui_helper
from encfsgui_helper import *
class CMountPasswordWindow(QtWidgets.QDialog):
def __init__(self):
encfsgui_helper.print_debug("Start CMountPasswordWindow %s" % inspect.stack()[0][3])
super(CMountPasswordWindow, self).__init__()
uic.loadUi('encfsgui_password.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.lbl_enc_path = self.findChild(QtWidgets.QLabel, 'lbl_enc_path')
self.lbl_mount_path = self.findChild(QtWidgets.QLabel, 'lbl_mount_path')
self.txt_password = self.findChild(QtWidgets.QLineEdit, 'txt_password')
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)
def setEncPath(self, path):
encfsgui_helper.print_debug("Start %s" % inspect.stack()[0][3])
self.lbl_enc_path.setText(path)
return
def setMountPath(self, path):
encfsgui_helper.print_debug("Start %s" % inspect.stack()[0][3])
self.lbl_mount_path.setText(path)
return
def getPassword(self):
encfsgui_helper.print_debug("Start %s" % inspect.stack()[0][3])
return self.txt_password.text()
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