Exemplo n.º 1
0
    def decrypt_UI_components(self):
        """Create and add the decryption UI components to the layout"""
        line = QLabel('=' * 250)
        line.setFont(QFont('Arial', 14, weight=QFont.Bold))
        line.setAlignment(Qt.AlignCenter)
        self.layout.addWidget(line)

        decrypt_label = QLabel('Or Choose a file to decrypt: ')
        decrypt_label.setFont(QFont('Arial', 14, weight=QFont.Bold))
        decrypt_label.setAlignment(Qt.AlignCenter)
        self.layout.addWidget(decrypt_label)

        self.file_button = QPushButton('Choose a file')
        self.file_button.clicked.connect(self.get_file)
        self.layout.addWidget(self.file_button)

        self.decryption_password = PasswordEdit()
        self.layout.addWidget(self.decryption_password)

        self.decrypt_button = QPushButton('decrypt')
        self.decrypt_button.clicked.connect(self.decrypt)
        self.layout.addWidget(self.decrypt_button)

        # The hide button
        self.hide_button = QPushButton('hide')
        self.hide_button.clicked.connect(self.hide)
        self.layout.addWidget(self.hide_button)
Exemplo n.º 2
0
    def create_format_password(self, testo):
        label = QLabel(testo)
        label.setFont(self.font_label2)
        self.v_layout.addWidget(label)

        campo = PasswordEdit()
        campo.setFont(self.font_label1)
        campo.setEchoMode(QLineEdit.Password)
        self.v_layout.addWidget(campo)
        return campo
Exemplo n.º 3
0
    def __init__(self, parent=None):
        super(VistaLogin, self).__init__(parent)

        self.controllore = ControlloreListaClienti()

        self.font = QFont("Arial", 15, 15, True)

        self.v_layout = QVBoxLayout()

        # titolo
        self.label_alto = QLabel("Inserisci i dati per il login: "******"color: rgb(0, 0, 255)")
        self.v_layout.addWidget(self.label_alto)

        self.v_layout.addSpacing(20)

        # campo email
        self.label_email = QLabel("E-mail")
        self.label_email.setFont(self.font)
        self.v_layout.addWidget(self.label_email)

        self.campo_email = QLineEdit()
        self.campo_email.setFont(self.font)
        self.v_layout.addSpacing(5)
        self.v_layout.addWidget(self.campo_email)

        self.v_layout.addSpacing(10)

        # campo password
        self.label_password = QLabel("Password")
        self.label_password.setFont(self.font)
        self.v_layout.addWidget(self.label_password)

        self.campo_password = PasswordEdit()
        self.campo_password.setFont(self.font)
        self.campo_password.setEchoMode(QLineEdit.Password)
        self.v_layout.addSpacing(5)
        self.v_layout.addWidget(self.campo_password)

        self.v_layout.addSpacing(20)

        # bottone login
        self.bottone_login = QPushButton("Login")
        self.bottone_login.setFont(self.font)
        self.bottone_login.setStyleSheet("background-color:#ccd9ff;")
        self.bottone_login.clicked.connect(self.login)
        self.shortcut_open = QShortcut(QKeySequence('Return'), self)
        self.shortcut_open.activated.connect(self.login)
        self.v_layout.addWidget(self.bottone_login)

        self.setLayout(self.v_layout)
        self.resize(200, 200)
        self.setWindowTitle("Login")
Exemplo n.º 4
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.setWindowTitle(constants.LOGIN_DIALOG_TITLE)
        self.setFixedSize(constants.LOGIN_WINDOW_WIDTH,
                          constants.LOGIN_WINDOW_HEIGHT)

        self.login_label = QLabel(constants.LOGIN_LABEL_TEXT, self)
        self.status_label = QLabel(self)
        self.password_label = QLabel(constants.PASSWORD_LABEL_TEXT, self)
        self.login_edit = QLineEdit(self)
        self.password_edit = PasswordEdit(True, self)
        self.login_button = QPushButton(constants.LOGIN_BUTTON_TEXT, self)
        self.register_button = QPushButton(constants.REGISTER_BUTTON_TEXT,
                                           self)

        self.login_label.resize(self.login_label.sizeHint())
        self.password_label.resize(self.password_label.sizeHint())
        self.register_button.resize(self.register_button.sizeHint())
        self.login_button.resize(self.register_button.size())

        self.login_edit.setValidator(
            QRegExpValidator(QRegExp("[a-zA-Z0-9_]*", False)))
        self.password_edit.setValidator(
            QRegExpValidator(QRegExp("[^\s]*", False)))

        self.login_edit.move(constants.LOGIN_WIDGET_X_OFFSET,
                             constants.LOGIN_WIDGET_Y_OFFSET * 2)
        self.password_edit.move(constants.LOGIN_WIDGET_X_OFFSET,
                                offset_y(self.login_edit))
        self.login_button.move(constants.LOGIN_WIDGET_X_OFFSET,
                               offset_y(self.password_edit))
        self.register_button.move(offset_x(self.login_button),
                                  offset_y(self.password_edit))
        self.status_label.move(constants.LOGIN_WIDGET_X_OFFSET,
                               offset_y(self.login_button))

        self.login_edit.resize(self.register_button.pos().x() * 2,
                               constants.LOGIN_EDITS_HEIGHT)
        self.password_edit.resize(self.login_edit.width(),
                                  constants.LOGIN_EDITS_HEIGHT)
        self.login_label.move(constants.LOGIN_WIDGET_X_OFFSET,
                              offset_y(self.login_edit, offset=0, down=False))
        self.password_label.move(
            constants.LOGIN_WIDGET_X_OFFSET,
            offset_y(self.password_edit, offset=0, down=False))

        self.accepted.connect(self.accepted_event)
        self.rejected.connect(self.rejected_event)
        self.login_button.clicked.connect(self.login_clicked)
        self.register_button.clicked.connect(self.register_clicked)

        self.api_client = None
Exemplo n.º 5
0
    def tab_dec_text(self):
        """
        This method handles the text decryption tab
        """
        # init layout and set suitable column widths
        layout = QGridLayout()
        pad = QLabel()
        layout.addWidget(pad, 0, 0, 1, 1)
        layout.addWidget(pad, 0, 9, 1, 1)

        # INSERT TEXT LABEL
        text_ins_label = QLabel(self.translations["labels"]["insert_text_dec"])
        text_ins_label.setObjectName(
            "large_label")  # set object name for qss tag effects
        text_ins_label.setAlignment(Qt.AlignCenter)
        layout.addWidget(text_ins_label, 0, 1, 1, 3)
        # INSERT TEXT BOX
        text_insert = QLineEdit()
        layout.addWidget(text_insert, 0, 4, 1, 5)

        # ALGORITHM LABEL
        algo_label = QLabel(self.translations["labels"]["set_dec_algorithm"])
        algo_label.setAlignment(Qt.AlignCenter)
        layout.addWidget(algo_label, 1, 1, 1, 3)
        # ALGORITHM DROPDOWN MENU
        self.algo_button_ttab = QPushButton(
            self.translations["buttons"]["algorithm"])
        self.algo_dropdown = QMenu()
        self.algo_dropdown.setObjectName("algo_menu_dec")
        for algo in ENC_ALGORITHMS:
            self.algo_dropdown.addAction(algo)
            self.algo_dropdown.addSeparator()
        self.algo_button_ttab.setMenu(self.algo_dropdown)
        self.algo_dropdown.triggered.connect(self.algorithms_text_tab)
        layout.addWidget(self.algo_button_ttab, 1, 4, 1, 3)

        # ENCRYPTION SALT LABEL
        self.enc_salt_label = QLabel(self.translations["labels"]["salt_label"])
        self.enc_salt_label.setAlignment(Qt.AlignCenter)
        layout.addWidget(self.enc_salt_label, 2, 1, 1, 3)
        # ENCRYPTION SALT INPUT
        self.text_box_salt_text = PasswordEdit()
        layout.addWidget(self.text_box_salt_text, 2, 4, 1, 5)

        # DECRYPT BUTTON
        decrypt_button = QPushButton(
            self.translations["buttons"]["final_decrypt"])
        layout.addWidget(decrypt_button, 3, 2, 1, 6)

        main = QWidget()
        main.setLayout(layout)
        return main
Exemplo n.º 6
0
    def encrypt_UI_components(self):
        """Create and add the encryption UI components to the layout"""
        label_1 = QLabel('Choose a directory to be encrypted then shredded: ')
        label_1.setFont(QFont('Arial', 14, weight=QFont.Bold))
        label_1.setAlignment(Qt.AlignCenter)
        self.directory_button = QPushButton('Choose a directory')
        self.directory_button.clicked.connect(self.get_dir)
        label_2 = QLabel('Enter a strong password: '******'Arial', 12))
        self.password = PasswordEdit()
        start_button = QPushButton('Start encrypting')
        start_button.clicked.connect(self.start_encrypting)

        self.layout.addWidget(label_1, alignment=Qt.AlignVCenter)
        self.layout.addWidget(self.directory_button, alignment=Qt.AlignVCenter)
        self.layout.addWidget(label_2, alignment=Qt.AlignVCenter)
        self.layout.addWidget(self.password)
        self.layout.addWidget(start_button, alignment=Qt.AlignVCenter)

        self.centralWidget.setLayout(self.layout)
Exemplo n.º 7
0
    def __init__(self):
        super().__init__()

        password = PasswordEdit()
        self.setCentralWidget(password)
Exemplo n.º 8
0
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(542, 553)
        MainWindow.setMinimumSize(QtCore.QSize(537, 537))
        MainWindow.setMaximumSize(QtCore.QSize(542, 553))
        MainWindow.setWindowTitle("ByeDeadMan")
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.label_decrypt = QtWidgets.QLabel(self.centralwidget)
        self.label_decrypt.setGeometry(QtCore.QRect(10, 350, 111, 31))
        font = QtGui.QFont()
        font.setBold(False)
        font.setItalic(False)
        font.setUnderline(False)
        font.setWeight(50)
        font.setKerning(True)
        self.label_decrypt.setFont(font)
        self.label_decrypt.setObjectName("label_decrypt")
        self.frame_decrypt = QtWidgets.QFrame(self.centralwidget)
        self.frame_decrypt.setGeometry(QtCore.QRect(10, 390, 521, 141))
        self.frame_decrypt.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_decrypt.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_decrypt.setObjectName("frame_decrypt")
        self.pushButton_decrypt = QtWidgets.QPushButton(self.frame_decrypt)
        self.pushButton_decrypt.setGeometry(QtCore.QRect(180, 100, 161, 31))
        palette = QtGui.QPalette()
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(155, 255, 179))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(205, 255, 217))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(77, 127, 89))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(103, 170, 119))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(155, 255, 179))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(205, 255, 217))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.PlaceholderText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(155, 255, 179))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(205, 255, 217))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(77, 127, 89))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(103, 170, 119))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(155, 255, 179))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(205, 255, 217))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive,
                         QtGui.QPalette.PlaceholderText, brush)
        brush = QtGui.QBrush(QtGui.QColor(77, 127, 89))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(155, 255, 179))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(205, 255, 217))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(77, 127, 89))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(103, 170, 119))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(77, 127, 89))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(77, 127, 89))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(155, 255, 179))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(155, 255, 179))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(155, 255, 179))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled,
                         QtGui.QPalette.PlaceholderText, brush)
        self.pushButton_decrypt.setPalette(palette)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.pushButton_decrypt.setFont(font)
        self.pushButton_decrypt.setObjectName("pushButton_decrypt")
        self.layoutWidget_3 = QtWidgets.QWidget(self.frame_decrypt)
        self.layoutWidget_3.setGeometry(QtCore.QRect(11, 50, 481, 28))
        self.layoutWidget_3.setObjectName("layoutWidget_3")
        self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.layoutWidget_3)
        self.horizontalLayout_5.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
        self.label_5 = QtWidgets.QLabel(self.layoutWidget_3)
        self.label_5.setObjectName("label_5")
        self.horizontalLayout_5.addWidget(self.label_5)
        self.lineEdit_pass_decrypt = PasswordEdit()
        self.lineEdit_pass_decrypt.setObjectName("lineEdit_pass_decrypt")
        self.horizontalLayout_5.addWidget(self.lineEdit_pass_decrypt)
        self.widget = QtWidgets.QWidget(self.frame_decrypt)
        self.widget.setGeometry(QtCore.QRect(12, 10, 481, 28))
        self.widget.setObjectName("widget")
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.widget)
        self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.label_choose_file = QtWidgets.QLabel(self.widget)
        self.label_choose_file.setObjectName("label_choose_file")
        self.horizontalLayout_4.addWidget(self.label_choose_file)
        self.lineEdit_file = QtWidgets.QLineEdit(self.widget)
        self.lineEdit_file.setObjectName("lineEdit_file")
        self.horizontalLayout_4.addWidget(self.lineEdit_file)
        self.pushButton_browse_file = QtWidgets.QPushButton(self.widget)
        self.pushButton_browse_file.setObjectName("pushButton_browse_file")
        self.horizontalLayout_4.addWidget(self.pushButton_browse_file)
        self.frame_encrypt = QtWidgets.QFrame(self.centralwidget)
        self.frame_encrypt.setGeometry(QtCore.QRect(10, 50, 521, 221))
        self.frame_encrypt.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_encrypt.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_encrypt.setObjectName("frame_encrypt")
        self.pushButton_encrypt = QtWidgets.QPushButton(self.frame_encrypt)
        self.pushButton_encrypt.setGeometry(QtCore.QRect(180, 130, 161, 31))
        palette = QtGui.QPalette()
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(239, 98, 124))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 208, 217))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(247, 153, 170))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(119, 49, 62))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(159, 65, 82))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(239, 98, 124))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(247, 176, 189))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.PlaceholderText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(239, 98, 124))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 208, 217))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(247, 153, 170))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(119, 49, 62))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(159, 65, 82))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(239, 98, 124))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(247, 176, 189))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive,
                         QtGui.QPalette.PlaceholderText, brush)
        brush = QtGui.QBrush(QtGui.QColor(119, 49, 62))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(239, 98, 124))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 208, 217))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(247, 153, 170))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(119, 49, 62))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(159, 65, 82))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(119, 49, 62))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(119, 49, 62))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(239, 98, 124))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(239, 98, 124))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(239, 98, 124))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled,
                         QtGui.QPalette.PlaceholderText, brush)
        self.pushButton_encrypt.setPalette(palette)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.pushButton_encrypt.setFont(font)
        self.pushButton_encrypt.setObjectName("pushButton_encrypt")
        self.layoutWidget = QtWidgets.QWidget(self.frame_encrypt)
        self.layoutWidget.setGeometry(QtCore.QRect(11, 50, 481, 28))
        self.layoutWidget.setObjectName("layoutWidget")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.layoutWidget)
        self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.label_pass_decrypt = QtWidgets.QLabel(self.layoutWidget)
        self.label_pass_decrypt.setObjectName("label_pass_decrypt")
        self.horizontalLayout_2.addWidget(self.label_pass_decrypt)
        self.lineEdit_pass_encrypt = PasswordEdit()
        self.lineEdit_pass_encrypt.setObjectName("lineEdit_pass_encrypt")
        self.horizontalLayout_2.addWidget(self.lineEdit_pass_encrypt)
        self.layoutWidget_2 = QtWidgets.QWidget(self.frame_encrypt)
        self.layoutWidget_2.setGeometry(QtCore.QRect(11, 10, 481, 28))
        self.layoutWidget_2.setObjectName("layoutWidget_2")
        self.horizontalLayout = QtWidgets.QHBoxLayout(self.layoutWidget_2)
        self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.label_choose_folder = QtWidgets.QLabel(self.layoutWidget_2)
        self.label_choose_folder.setObjectName("label_choose_folder")
        self.horizontalLayout.addWidget(self.label_choose_folder)
        self.lineEdit_folder = QtWidgets.QLineEdit(self.layoutWidget_2)
        self.lineEdit_folder.setObjectName("lineEdit_folder")
        self.horizontalLayout.addWidget(self.lineEdit_folder)
        self.pushButton_browse_folder = QtWidgets.QPushButton(
            self.layoutWidget_2)
        self.pushButton_browse_folder.setObjectName("pushButton_browse_folder")
        self.horizontalLayout.addWidget(self.pushButton_browse_folder)
        self.pushButton_hide = QtWidgets.QPushButton(self.frame_encrypt)
        self.pushButton_hide.setGeometry(QtCore.QRect(10, 180, 501, 31))
        palette = QtGui.QPalette()
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 155, 155))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 205, 205))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(127, 77, 77))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 103, 103))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 155, 155))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 205, 205))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.PlaceholderText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 155, 155))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 205, 205))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(127, 77, 77))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 103, 103))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 155, 155))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 205, 205))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive,
                         QtGui.QPalette.PlaceholderText, brush)
        brush = QtGui.QBrush(QtGui.QColor(127, 77, 77))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 155, 155))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 205, 205))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(127, 77, 77))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 103, 103))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(127, 77, 77))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(127, 77, 77))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 155, 155))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 155, 155))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 155, 155))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText,
                         brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled,
                         QtGui.QPalette.PlaceholderText, brush)
        self.pushButton_hide.setPalette(palette)
        font = QtGui.QFont()
        font.setFamily("Hack")
        font.setPointSize(11)
        self.pushButton_hide.setFont(font)
        self.pushButton_hide.setObjectName("pushButton_hide")
        self.widget1 = QtWidgets.QWidget(self.frame_encrypt)
        self.widget1.setGeometry(QtCore.QRect(10, 90, 163, 29))
        self.widget1.setObjectName("widget1")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.widget1)
        self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.label_delay = QtWidgets.QLabel(self.widget1)
        self.label_delay.setObjectName("label_delay")
        self.horizontalLayout_3.addWidget(self.label_delay)
        self.delay = QtWidgets.QDoubleSpinBox(self.widget1)
        self.delay.setObjectName("delay")
        self.horizontalLayout_3.addWidget(self.delay)
        self.label_encrypt = QtWidgets.QLabel(self.centralwidget)
        self.label_encrypt.setGeometry(QtCore.QRect(10, 10, 111, 31))
        self.label_encrypt.setObjectName("label_encrypt")
        self.line = QtWidgets.QFrame(self.centralwidget)
        self.line.setGeometry(QtCore.QRect(-10, 290, 601, 16))
        self.line.setFrameShape(QtWidgets.QFrame.HLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line.setObjectName("line")
        self.label_or = QtWidgets.QLabel(self.centralwidget)
        self.label_or.setGeometry(QtCore.QRect(220, 300, 111, 24))
        self.label_or.setObjectName("label_or")
        self.line_2 = QtWidgets.QFrame(self.centralwidget)
        self.line_2.setGeometry(QtCore.QRect(-30, 320, 621, 20))
        self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
        self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_2.setObjectName("line_2")
        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
Exemplo n.º 9
0
    def __init__(self, translation):
        super().__init__()
        layout = QVBoxLayout()
        self.chosen_algo = ""
        self.chosen_hash = ""
        self.chosen_salt = ""
        self.chosen_key = ""
        self.window = None
        self.settings_translate = translation
        enc_key = self.settings_translate["buttons"]["encryption_key_prompt"]
        enc_key_confirm = self.settings_translate["buttons"][
            "encryption_key_confirm"]
        algorithm = self.settings_translate["buttons"]["algorithm"]
        salt_select = self.settings_translate["buttons"]["salt_select"]
        self.automatic_salt = self.settings_translate["buttons"][
            "automatic_salt"]
        self.click_salt = self.settings_translate["buttons"]["click_salt"]
        self.write_salt = self.settings_translate["buttons"]["write_salt"]
        hash = self.settings_translate["buttons"]["hash"]
        salt = self.settings_translate["buttons"]["salt"]
        close_btn = self.settings_translate["prompts"]["close_button"]

        self.setWindowIcon(QIcon(IMG_LOCATION + "win_icon.png"))
        self.setWindowTitle("Set default encryption settings")

        self.hash = QPushButton(hash)
        self.algorithm = QPushButton(algorithm)
        self.salt_selection = QPushButton(salt_select)
        self.text_box_salt = PasswordEdit(self)
        self.text_box_salt.setPlaceholderText(salt)
        self.text_box_enc_text = PasswordEdit(self)
        self.text_box_enc_text.setPlaceholderText(enc_key)
        self.text_box_enc_text_confirm = PasswordEdit(self)
        self.text_box_enc_text_confirm.setPlaceholderText(enc_key_confirm)
        self.close_button = QPushButton(close_btn)
        self.close_button.clicked.connect(self.close_settings)
        # Define Hash functions menu
        self.menu = QMenu(self)
        self.menu.setObjectName("default_hash_menu")
        self.menu.addAction("MD5")
        self.menu.addSeparator()
        self.menu.addAction("SHA-256")
        self.menu.addSeparator()
        self.menu.addAction("SHA-512")
        self.menu.addSeparator()
        self.menu.addAction("SHA3-512")
        self.hash.setMenu(self.menu)
        self.menu.triggered.connect(self.hashes)
        # Define Algorithms functions menu
        self.menu_algo = QMenu(self)
        self.menu_algo.setObjectName("default_algo_menu")
        self.menu_algo.addAction("ChaCha20")
        self.menu_algo.addSeparator()
        self.menu_algo.addAction("RSA")
        self.menu_algo.addSeparator()
        self.menu_algo.addAction("AES")
        self.algorithm.setMenu(self.menu_algo)
        self.menu_algo.triggered.connect(self.algorithms)
        # Define Salt type functions menu
        self.salt_selection_menu = QMenu(self)
        self.salt_selection_menu.setObjectName("default_salt_menu")
        self.salt_selection_menu.addAction(self.automatic_salt)
        self.salt_selection_menu.addSeparator()
        self.salt_selection_menu.addAction(self.click_salt)
        self.salt_selection_menu.addSeparator()
        self.salt_selection_menu.addAction(self.write_salt)
        self.salt_selection.setMenu(self.salt_selection_menu)
        self.salt_selection_menu.triggered.connect(self.choose_salt)
        layout.addWidget(self.hash)
        layout.addWidget(self.algorithm)
        layout.addWidget(self.salt_selection)
        #        layout.addWidget(self.salt)
        layout.addWidget(self.text_box_salt)
        layout.addWidget(self.text_box_enc_text)
        layout.addWidget(self.text_box_enc_text_confirm)
        layout.addSpacing(50)
        layout.addWidget(self.close_button)
        self.setLayout(layout)

        self.Width = 700
        self.height = int(0.8 * self.Width)
        self.setFixedSize(self.Width, self.height)
        # center the window relative to screensize
        centering = self.frameGeometry()
        centerOfScreen = QDesktopWidget().availableGeometry().center()
        centering.moveCenter(centerOfScreen)
        self.move(centering.topLeft())
Exemplo n.º 10
0
    def __init__(self, parent=None):
        super(Login, self).__init__(parent)

        self.setWindowTitle('Login - Centro Polisportivo')
        self.setFixedSize(380, 300)
        self.controller = ControlloreListaDipendenti()
        self.setStyleSheet("background-color: Azure;")

        self.lista_suggerimenti = []
        for dipendente in self.controller.get_lista_dipendenti():
            nome = dipendente.id
            self.lista_suggerimenti.append(nome)

        # definisco un layout verticale per il login
        login_layout = QVBoxLayout()
        login_layout.setAlignment(Qt.AlignCenter)
        login_layout.setSpacing(25)
        # definisco un layout orizzontale per i pulsanti
        btn_layout = QHBoxLayout()

        # creazione campi inserimento username
        labelUsername = QLabel('<font size = "5"> <b> Username </b> </font>')
        self.username = QLineEdit()
        self.username.setCompleter(QCompleter(self.lista_suggerimenti))
        #self.username.setStyleSheet("background-color: #ffffff; font-size: 20px;")
        self.impostaGrandezzaMassima(self.username)
        self.username.setPlaceholderText('Inserisci username - id')
        # creazione campi inserimento password
        labelPassword = QLabel('<font size = "5"> <b> Password </b> </font>')
        self.password = PasswordEdit()
        #self.password.setStyleSheet("background-color: #ffffff; font-size: 20px;")
        self.impostaGrandezzaMassima(self.password)
        self.password.setPlaceholderText('Inserisci password')
        # creazione pulsante del login
        btn_login = QPushButton('Login')
        btn_login.setStyleSheet(
            "background-color: #b0c4de; font-size: 15px; font-weight: bold;")
        self.impostaGrandezzaMassima(btn_login)
        btn_login.setShortcut("Return")
        btn_login.clicked.connect(self.check_credenziali)
        # creazione pulsante esci
        btn_esci = QPushButton('Esci')
        btn_esci.setStyleSheet(
            "background-color: #b0c4de; font-size: 15px; font-weight: bold;")
        btn_esci.setShortcut("Esc")
        self.impostaGrandezzaMassima(btn_esci)
        btn_esci.clicked.connect(self.close)

        # aggiunta pulsanti al layout dei pulsanti
        btn_layout.addWidget(btn_login)
        btn_layout.addWidget(btn_esci)

        # aggiunta username al layout
        login_layout.addWidget(labelUsername)
        login_layout.addWidget(self.username)
        # aggiunta password al layout
        login_layout.addWidget(labelPassword)
        login_layout.addWidget(self.password)
        # aggiunta layout pulsanti al layout principale
        login_layout.addLayout(btn_layout)

        # setting del layout della finestra
        self.setLayout(login_layout)
Exemplo n.º 11
0
    def __init__(self, dipendente_selezionato, controller, callback):
        super(VistaModificaDipendente, self).__init__()

        self.dp = dipendente_selezionato
        # passo alla classe il dipendente che seleziono per avere le sue informazioni
        self.dipendente = ControlloreDipendente(dipendente_selezionato)
        self.controller = controller
        self.callback = callback
        self.info = {}
        self.combo_abilitazione = QComboBox()

        # layout di modifica dei dati del dipendente
        self.v_layout = QVBoxLayout()
        self.setFixedSize(650, 470)

        # pulsante di conferma della modifica
        btn_modifica = QPushButton("Modifica")
        btn_modifica.setStyleSheet(
            "background-color: #90ee90; font-size: 13px; font-weight: bold;")
        btn_modifica.setShortcut("Return")
        btn_modifica.clicked.connect(self.mod_dipendente)
        # pulsante di annullamento delle modifica
        btn_annulla = QPushButton("Annulla")
        btn_annulla.setStyleSheet(
            "background-color: #f08080; font-size: 13px; font-weight: bold;")
        btn_annulla.setShortcut("Esc")
        btn_annulla.clicked.connect(self.close)

        self.label_img = QLabel()
        self.label_img.setPixmap(QPixmap('listadipendenti/data/utente.png'))

        # layout superiore
        h_lay_sup = QHBoxLayout()
        v_lay_sup_sx = QVBoxLayout()
        v_lay_sup_dx = QVBoxLayout()
        v_lay_sup_sx.addStretch()
        v_lay_sup_sx.addLayout(
            self.get_form_entry(self.dipendente.get_nome_dipendente(), "Nome"))
        v_lay_sup_sx.addLayout(
            self.get_form_entry(self.dipendente.get_cognome_dipendente(),
                                "Cognome"))
        v_lay_sup_sx.addLayout(
            self.get_form_entry(self.dipendente.get_cf_dipendente(),
                                "Codice Fiscale"))
        v_lay_sup_sx.addStretch()
        v_lay_sup_dx.addWidget(self.label_img)
        h_lay_sup.addLayout(v_lay_sup_sx)
        h_lay_sup.addLayout(v_lay_sup_dx)
        # layout centrale
        h_lay_cent = QHBoxLayout()
        v_lay_cent_sx = QVBoxLayout()
        v_lay_cent_dx = QVBoxLayout()
        v_lay_cent_sx.addLayout(
            self.get_form_entry(self.dipendente.get_luogo_dipendente(),
                                "Luogo di nascita"))
        v_lay_cent_dx.addLayout(
            self.get_form_entry(self.dipendente.get_data_dipendente(),
                                "Data di nascita"))
        v_lay_cent_sx.addLayout(
            self.get_form_entry(self.dipendente.get_residenza_dipendente(),
                                "Residenza"))
        v_lay_cent_dx.addLayout(
            self.get_form_entry(self.dipendente.get_indirizzo_dipendente(),
                                "Indirizzo"))
        v_lay_cent_sx.addLayout(
            self.get_form_entry(self.dipendente.get_telefono_dipendente(),
                                "Telefono"))
        v_lay_cent_dx.addLayout(
            self.get_form_entry(self.dipendente.get_email_dipendente(),
                                "Email"))
        h_lay_cent.addLayout(v_lay_cent_sx)
        h_lay_cent.addLayout(v_lay_cent_dx)
        # layout inferiore
        v_lay_inf = QVBoxLayout()
        h_lay_inf = QHBoxLayout()
        h_lay_inf_btn = QHBoxLayout()

        password = QLabel("<b>Password</b>")
        self.password = PasswordEdit()
        self.password.setText(self.dipendente.get_password_dipendente())
        h_lay_inf.addWidget(password)
        h_lay_inf.addWidget(self.password)
        self.info["Password"] = self.password

        h_lay_inf_btn.addWidget(btn_annulla)
        h_lay_inf_btn.addWidget(btn_modifica)
        v_lay_inf.addLayout(h_lay_inf)
        v_lay_inf.addStretch()
        v_lay_inf.addLayout(h_lay_inf_btn)

        self.v_layout.addLayout(h_lay_sup)
        self.v_layout.addLayout(
            self.get_combo(["Collaboratore", "Personal Trainer"]))

        self.v_layout.addLayout(h_lay_cent)
        self.v_layout.addLayout(v_lay_inf)

        self.setLayout(self.v_layout)
        self.setWindowTitle("Modifica Dipendente")
Exemplo n.º 12
0
    def __init__(self, parent=None):
        """Initialize messenger object."""

        super().__init__(parent)
        self.setupUi(self)
        self.translate = QtCore.QCoreApplication.translate

        self.password_line1 = PasswordEdit(True, self.login_page)
        self.password_line2 = PasswordEdit(True, self.registration_page)
        self.modify_password_lines()

        # Connect buttons to the methods.
        self.send_button.pressed.connect(self.send)
        self.sign_up_button.pressed.connect(self.sign_up_user)
        self.login_button.pressed.connect(self.login_user)

        # Connect actions to the methods.
        self.action_shortcuts.triggered.connect(self.show_shortcuts_box)
        self.action_commands.triggered.connect(self.show_commands_box)
        self.action_about.triggered.connect(self.show_about_box)
        self.action_contacts.triggered.connect(self.show_contacts_box)
        self.action_preferences.triggered.connect(self.open_preferences_window)
        self.action_logout.triggered.connect(self.logout)
        self.action_close.triggered.connect(self.close)

        # Filter shortcuts and text overflow.
        self.plain_text_edit.installEventFilter(self)

        self.username = None
        self.password = None
        self.last_message_time = 0
        self.max_text_len = 250
        self.server_IP = '0.0.0.0:9000'

        # Load client content.
        self.message_style = get_message_style()
        self.warning_messages = get_warning_messages()
        self.message_box_text = get_message_box_text()

        # Load commands.
        self.client_commands = get_client_commands()
        self.run_client_command = {
            'close': self.close,
            'logout': self.logout,
            'reload': self.reload
        }
        self.server_commands = []
        self.run_server_command = {}

        self.timer_get_messages = QtCore.QTimer()
        self.timer_get_messages.timeout.connect(self.get_messages)
        self.timer_get_messages.start(1000)

        self.timer_get_status = QtCore.QTimer()
        self.timer_get_status.timeout.connect(self.get_status)
        self.timer_get_status.start(5000)

        clickable(self.go_to_sign_up).connect(self.go_to_registration_form)
        clickable(self.go_to_login).connect(self.go_to_login_form)

        self.get_status()
Exemplo n.º 13
0
    def decryption(self):
        """
        This method handles the frame for the entire decrypt tab
        
        #final_layout = QVBoxLayout()

        # DEFINE TOP WIDGET (TABS AND SWITCHING BETWEEN THEM)
        #dec_button_text = self.translations["buttons"]["decrypt_text"]
        #dec_button_files = self.translations["buttons"]["decrypt_files"]

        #self.btn_dec_t = QPushButton(f"{dec_button_text}")
        #self.btn_dec_t.setObjectName("btn_dec_t")
        #self.btn_dec_t.clicked.connect(self.button_dec_t)
        #self.btn_dec_f = QPushButton(f"{dec_button_files}")
        #self.btn_dec_f.setObjectName("btn_dec_f")
        #self.btn_dec_f.clicked.connect(self.button_dec_f)

        #if check_dark_mode(db_location) == "False":
            #self.btn_dec_t.setStyleSheet(DEC_TEXT_PRESSED_QSS)
        #else:
            #self.btn_dec_t.setStyleSheet(DARK_DEC_TEXT_PRESSED_QSS)

        top_actions = QHBoxLayout()
        top_actions.setSpacing(0)
        top_actions.setContentsMargins(0, 16, 0, 0)
        #top_actions.addWidget(self.btn_dec_t)
        #top_actions.addWidget(self.btn_dec_f)
        self.top_widget_dec = QWidget()
        self.top_widget_dec.setLayout(top_actions)

        # DEFINE BOTTOM WIDGET (TAB CONTENTS)
        #self.tab_dec_t = self.tab_dec_text()
        #self.tab_dec_f = self.tab_dec_files()
        self.bottom_widget_dec = QTabWidget()
        self.bottom_widget_dec.tabBar().setObjectName("DecryptionTab")

        #self.bottom_widget_dec.addTab(self.tab_dec_t, "")
        #self.bottom_widget_dec.addTab(self.tab_dec_f, "")

        self.bottom_widget_dec.setCurrentIndex(1)  # default to text decryption tab

        # add top and bottom widgets to layout
        final_layout.addWidget(self.top_widget_dec)
        final_layout.addWidget(self.bottom_widget_dec)

        # Finish layout
        main = QWidget()
        main.setLayout(final_layout)

        return main
        """
        # init layout
        self.layout = QGridLayout()
        title_label = QLabel(self.translations["labels"]["decryption_file"])
        title_label.setAlignment(Qt.AlignCenter)
        title_label.setObjectName("title_label")
        title_label.setSizePolicy(
            QSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Fixed))
        title_label.setAlignment(Qt.AlignmentFlag.AlignHCenter)
        self.layout.addWidget(title_label, 0, 1, 1, 8)
        pad = QLabel(" ")
        self.layout.addWidget(pad, 1, 0, 1, 2)
        self.layout.addWidget(pad, 1, 8, 1, 2)

        # FILE BROWSE LABEL
        open_file_label = QLabel(
            self.translations["labels"]["insert_file_dec"])
        open_file_label.setObjectName("large_label")
        open_file_label.setAlignment(Qt.AlignCenter)
        self.layout.addWidget(open_file_label, 1, 2, 1, 3)
        # FILE BROWSE
        open_file_btn = QPushButton(
            self.translations["buttons"]["browse_files"])
        open_file_btn.clicked.connect(self.filedialogopen)
        self.layout.addWidget(open_file_btn, 1, 5, 1, 3)

        # ALGORITHM LABEL
        algo_label = QLabel(self.translations["labels"]["set_dec_algorithm"])
        self.layout.addWidget(algo_label, 2, 2, 1, 3)
        # ALGORITHM DROPDOWN MENU
        self.algo_button = QPushButton(
            self.translations["buttons"]["algorithm"])
        self.algo_dropdown = QMenu()
        self.algo_dropdown.setObjectName("algo_menu_dec")
        for algo in ENC_ALGORITHMS_FILES:
            self.algo_dropdown.addAction(algo)
            self.algo_dropdown.addSeparator()
        self.algo_button.setMenu(self.algo_dropdown)
        self.algo_dropdown.triggered.connect(self.algorithms)
        self.layout.addWidget(self.algo_button, 2, 5, 1, 3)

        # CUSTOM RSA KEY SELECTION LABEL
        self.rsa_key_selection_label = QLabel(
            self.translations["labels"]["encryption_rsa_key_label"])
        self.layout.addWidget(self.rsa_key_selection_label, 3, 3, 1, 1)
        self.rsa_key_selection_label.setHidden(True)

        # CUSTOM RSA KEY FILEOPEN PROMPT
        self.rsa_selection_btn = QPushButton(
            self.translations["buttons"]["browse_files"])
        self.rsa_selection_btn.setText("private.pem")
        self.rsa_selection_btn.clicked.connect(self.filedialogopen_rsa)
        self.layout.addWidget(self.rsa_selection_btn, 3, 5, 1, 3)
        self.rsa_selection_btn.setHidden(True)

        # ENCRYPTION KEY LABEL
        self.enc_key_label = QLabel(
            self.translations["labels"]["encryption_key_label"])
        self.enc_key_label.setAlignment(Qt.AlignCenter)
        self.layout.addWidget(self.enc_key_label, 3, 2, 1, 2)
        # ENCRYPTION KEY INPUT
        self.text_box_dec_text = PasswordEdit()
        self.layout.addWidget(self.text_box_dec_text, 3, 4, 1, 5)

        # ENCRYPTION SALT LABEL
        self.enc_salt_label = QLabel(self.translations["labels"]["salt_label"])
        self.layout.addWidget(self.enc_salt_label, 4, 2, 1, 3)
        # ENCRYPTION SALT INPUT
        self.text_box_salt_text = PasswordEdit()
        self.layout.addWidget(self.text_box_salt_text, 4, 4, 1, 5)

        # DECRYPT BUTTON
        decrypt_button = QPushButton(
            self.translations["buttons"]["final_decrypt"])
        decrypt_button.clicked.connect(self.decrypt_file)
        self.layout.addWidget(decrypt_button, 5, 2, 1, 6)

        # finish layout
        main = QWidget()
        main.setLayout(self.layout)
        return main
Exemplo n.º 14
0
    def tab_dec_files(self):
        """
        This method handles the file decryption tab
        """
        # init layout
        self.layout = QGridLayout()
        pad = QLabel(" ")
        self.layout.addWidget(pad, 0, 0, 1, 2)
        self.layout.addWidget(pad, 0, 8, 1, 2)

        # FILE BROWSE LABEL
        open_file_label = QLabel(
            self.translations["labels"]["insert_file_dec"])
        open_file_label.setObjectName("large_label")
        open_file_label.setAlignment(Qt.AlignCenter)
        self.layout.addWidget(open_file_label, 0, 2, 1, 3)
        # FILE BROWSE
        open_file_btn = QPushButton(
            self.translations["buttons"]["browse_files"])
        open_file_btn.clicked.connect(self.filedialogopen)
        self.layout.addWidget(open_file_btn, 0, 5, 1, 3)

        # ALGORITHM LABEL
        algo_label = QLabel(self.translations["labels"]["set_dec_algorithm"])
        self.layout.addWidget(algo_label, 1, 2, 1, 3)
        # ALGORITHM DROPDOWN MENU
        self.algo_button = QPushButton(
            self.translations["buttons"]["algorithm"])
        self.algo_dropdown = QMenu()
        self.algo_dropdown.setObjectName("algo_menu_dec")
        for algo in ENC_ALGORITHMS_FILES:
            self.algo_dropdown.addAction(algo)
            self.algo_dropdown.addSeparator()
        self.algo_button.setMenu(self.algo_dropdown)
        self.algo_dropdown.triggered.connect(self.algorithms)
        self.layout.addWidget(self.algo_button, 1, 5, 1, 3)

        # CUSTOM RSA KEY SELECTION LABEL
        self.rsa_key_selection_label = QLabel(
            self.translations["labels"]["encryption_rsa_key_label"])
        self.layout.addWidget(self.rsa_key_selection_label, 2, 3, 1, 1)
        self.rsa_key_selection_label.setHidden(True)

        # CUSTOM RSA KEY FILEOPEN PROMPT
        self.rsa_selection_btn = QPushButton(
            self.translations["buttons"]["browse_files"])
        self.rsa_selection_btn.setText("private.pem")
        self.rsa_selection_btn.clicked.connect(self.filedialogopen_rsa)
        self.layout.addWidget(self.rsa_selection_btn, 2, 5, 1, 3)
        self.rsa_selection_btn.setHidden(True)

        # ENCRYPTION KEY LABEL
        self.enc_key_label = QLabel(
            self.translations["labels"]["encryption_key_label"])
        self.enc_key_label.setAlignment(Qt.AlignCenter)
        self.layout.addWidget(self.enc_key_label, 2, 2, 1, 2)
        # ENCRYPTION KEY INPUT
        self.text_box_dec_text = PasswordEdit()
        self.layout.addWidget(self.text_box_dec_text, 2, 4, 1, 5)

        # ENCRYPTION SALT LABEL
        self.enc_salt_label = QLabel(self.translations["labels"]["salt_label"])
        self.layout.addWidget(self.enc_salt_label, 3, 2, 1, 3)
        # ENCRYPTION SALT INPUT
        self.text_box_salt_text = PasswordEdit()
        self.layout.addWidget(self.text_box_salt_text, 3, 4, 1, 5)

        # DECRYPT BUTTON
        decrypt_button = QPushButton(
            self.translations["buttons"]["final_decrypt"])
        decrypt_button.clicked.connect(self.decrypt_file)
        self.layout.addWidget(decrypt_button, 4, 2, 1, 6)

        # finish layout
        main = QWidget()
        main.setLayout(self.layout)
        return main
Exemplo n.º 15
0
    def tab_enc_files(self):
        """
        This method handles the file encryption tab
        """
        # init layout
        self.layout = QGridLayout()
        self.layout.setContentsMargins(0, 0, 0, 0)

        pad = QLabel(" ")
        self.layout.addWidget(pad, 0, 8, 1, 2)
        self.layout.addWidget(pad, 0, 0, 1, 1)

        # FILE BROWSER LABEL
        file_browse_label = QLabel(self.translations["labels"]["browse_file_enc"])
        file_browse_label.setObjectName("large_label")
        file_browse_label.setAlignment(Qt.AlignCenter)
        self.layout.addWidget(file_browse_label, 0, 2, 1, 3)
        # INSERT FILE BROWSER
        file_browse_btn = QPushButton(self.translations["buttons"]["browse_files"])
        file_browse_btn.clicked.connect(self.filedialogopen)
        self.layout.addWidget(file_browse_btn, 0, 5, 1, 3)

        # ALGORITHM SET LABEL
        self.algo_text_label = QLabel(self.translations["labels"]["set_enc_algorithm"])
        self.algo_text_label.setAlignment(Qt.AlignCenter)
        self.layout.addWidget(self.algo_text_label, 1, 2, 1, 3)
        # ALGORITHM DROPDOWN MENU
        self.algo_button = QPushButton(self.translations["buttons"]["algorithm"])
        self.algo_dropdown = QMenu()
        self.algo_dropdown.setObjectName("algo_menu_enc_files")
        for algo in ENC_ALGORITHMS_FILES:
            self.algo_dropdown.addAction(algo)
            self.algo_dropdown.addSeparator()
        self.algo_button.setMenu(self.algo_dropdown)
        self.algo_dropdown.triggered.connect(self.algorithms)
        if self.defaults["default_algo"] != "":
            self.algo_button.setText(self.defaults["default_algo"])
        #        if self.algo_dropdown.triggered:
        #            self.algo_button.setText(self.chosen_algo)
        #            self.layout.update()
        self.layout.addWidget(self.algo_button, 1, 5, 1, 3)

        # CUSTOM RSA KEY SELECTION LABEL
        self.rsa_key_selection_label = QLabel(
            self.translations["labels"]["encryption_rsa_key_label"]
        )
        self.layout.addWidget(self.rsa_key_selection_label, 2, 3, 1, 1)
        self.rsa_key_selection_label.setHidden(True)

        # CUSTOM RSA KEY FILEOPEN PROMPT
        self.rsa_selection_btn = QPushButton(
            self.translations["buttons"]["browse_files"]
        )
        self.rsa_selection_btn.setText("public.pem")
        self.rsa_selection_btn.clicked.connect(self.filedialogopen_rsa)
        self.layout.addWidget(self.rsa_selection_btn, 2, 5, 1, 3)
        self.rsa_selection_btn.setHidden(True)

        # ENCRYPTION KEY INPUT AND CONFIRM LABELS
        self.enc_text_label = QLabel(
            self.translations["labels"]["encryption_key_label"]
        )
        self.enc_conf_label = QLabel(
            self.translations["labels"]["encryption_key_confirm_label"]
        )
        self.enc_text_label.setAlignment(Qt.AlignCenter)
        self.enc_conf_label.setAlignment(Qt.AlignCenter)
        self.layout.addWidget(self.enc_text_label, 2, 2, 1, 2)
        self.layout.addWidget(self.enc_conf_label, 3, 2, 1, 2)
        # ENCRYPTION KEY INPUT AND CONFIRM
        self.text_box_enc_text = PasswordEdit()
        if self.defaults["default_key"] != "":
            self.text_box_enc_text.setText(self.defaults["default_key"])
        self.text_box_enc_text_confirm = PasswordEdit()
        if self.defaults["default_key"] != "":
            self.text_box_enc_text_confirm.setText(self.defaults["default_key"])
        self.layout.addWidget(self.text_box_enc_text, 2, 4, 1, 5)
        self.layout.addWidget(self.text_box_enc_text_confirm, 3, 4, 1, 5)

        # SALT INPUT LABEL
        self.salt_label = QLabel(self.translations["labels"]["salt_label"])
        self.salt_label.setObjectName("large_label")
        self.salt_label.setAlignment(Qt.AlignCenter)
        self.layout.addWidget(self.salt_label, 4, 2, 1, 2)
        # SALT INPUT
        self.salt_insert_box = PasswordEdit()
        if self.defaults["default_salt"] != "":
            self.salt_insert_box.setText(self.defaults["default_salt"])
        self.layout.addWidget(self.salt_insert_box, 4, 4, 1, 5)

        # ENCRYPT BUTTON
        self.encrypt_button = QPushButton(self.translations["buttons"]["final_encrypt"])
        self.layout.addWidget(self.encrypt_button, 5, 3, 1, 5)
        self.encrypt_button.clicked.connect(self.encrypt_file)

        # finish and set layout
        self.main = QWidget()
        self.main.setLayout(self.layout)
        return self.main
Exemplo n.º 16
0
    def tab_enc_text(self):
        """
        This method handles the text encryption tab
        """
        # init layout
        layout = QGridLayout()

        # INSERT TEXT LABEL
        text_to_enc_label = QLabel(self.translations["labels"]["insert_text_enc"])
        text_to_enc_label.setAlignment(Qt.AlignCenter)
        text_to_enc_label.setObjectName("large_label")
        layout.addWidget(text_to_enc_label, 0, 1, 1, 3)
        # INSERT TEXT BOX
        self.text_insert = QLineEdit()
        layout.addWidget(self.text_insert, 0, 4, 1, 5)

        # ALGORITHM SET LABEL
        algo_text_label = QLabel(self.translations["labels"]["set_enc_algorithm"])
        algo_text_label.setAlignment(Qt.AlignCenter)
        layout.addWidget(algo_text_label, 1, 1, 1, 3)
        # ALGORITHM DROPDOWN MENU
        algo_trans = self.translations["buttons"]["algorithm"]
        self.algo_button_ttab = QPushButton(algo_trans)
        self.algo_dropdown = QMenu()
        self.algo_dropdown.setObjectName("algo_menu_enc_text")
        for algo in ENC_ALGORITHMS:
            self.algo_dropdown.addAction(algo)
            self.algo_dropdown.addSeparator()
        self.algo_button_ttab.setMenu(self.algo_dropdown)
        self.algo_dropdown.triggered.connect(self.algorithms_text)
        if self.defaults["default_hash"] != "":
            self.algo_button_ttab.setText(self.defaults["default_hash"])
        layout.addWidget(self.algo_button_ttab, 1, 4, 1, 3)

        # ENCRYPTION KEY INPUT AND CONFIRM LABELS
        enc_text_label = QLabel(self.translations["labels"]["encryption_key_label"])
        enc_text_label.setAlignment(Qt.AlignCenter)
        enc_conf_label = QLabel(
            self.translations["labels"]["encryption_key_confirm_label"]
        )
        enc_conf_label.setAlignment(Qt.AlignCenter)
        enc_text_label.setHidden(True)
        enc_conf_label.setHidden(True)
        layout.addWidget(enc_text_label, 2, 3, 1, 1)
        layout.addWidget(enc_conf_label, 3, 2, 1, 2)

        # ENCRYPTION KEY INPUT AND CONFIRM
        self.text_box_enc_text_ttab = PasswordEdit()
        self.text_box_enc_text_ttab.setHidden(True)
        if self.defaults["default_key"] != "":
            self.text_box_enc_text_ttab.setText(self.defaults["default_key"])
        self.text_box_enc_text_confirm_ttab = PasswordEdit()
        self.text_box_enc_text_confirm_ttab.setHidden(True)
        if self.defaults["default_key"] != "":
            self.text_box_enc_text_confirm_ttab.setText(self.defaults["default_key"])
        layout.addWidget(self.text_box_enc_text_ttab, 2, 4, 1, 3)
        layout.addWidget(self.text_box_enc_text_confirm_ttab, 3, 4, 1, 3)

        # SALT INPUT LABEL
        salt_label = QLabel(self.translations["labels"]["salt_label"])
        salt_label.setAlignment(Qt.AlignCenter)
        salt_label.setObjectName("large_label")
        layout.addWidget(salt_label, 4, 1, 1, 3)
        # SALT INPUT
        self.salt_insert_box_ttab = PasswordEdit()
        if self.defaults["default_salt"] != "":
            self.salt_insert_box_ttab.setText(self.defaults["default_salt"])
        layout.addWidget(self.salt_insert_box_ttab, 4, 4, 1, 5)

        # ENCRYPT BUTTON
        enc_trans = self.translations["buttons"]["final_encrypt"]
        encrypt_button = QPushButton(enc_trans)
        encrypt_button.clicked.connect(self.encrypt_text)
        self.encrypt_result = QLineEdit()
        self.encrypt_result.setHidden(True)
        layout.addWidget(encrypt_button, 5, 2, 1, 6)
        layout.addWidget(self.encrypt_result, 6, 0, 1, 10)

        # finish and set layout
        main = QWidget()
        main.setLayout(layout)
        return main