def pushButtonClicked(self): Glob.doAnimation(self.buttonAnim, self.pushButton, 4) masterPasswordText = self.masterPasswordEdit.text() confirmMasterPasswordText = self.confirmMasterPasswordEdit.text() messageText = None if masterPasswordText != confirmMasterPasswordText: messageText = "Passwords don't match each other" else: if masterPasswordText == '': messageText = 'Password is empty' else: if self.hintEdit.text().strip() == '': messageText = 'Must provide a hint' else: if len(masterPasswordText) <= 4: messageText = 'Password is too short\n(should be more than 4 symbols)' else: messageText = 'Master password has been\nsuccessfully set' self.requirements_passed = True # writing hint and encoded password to your_keygen.json self.dumpToJson() self.close() self.messageBox.messageText.setText(messageText) self.messageBox.show()
def brushToolButtonClicked(self): Glob.doAnimation(self.brushToolButtonAnim, self.brushToolButton, 4) colors = self.colors().copy() colors.remove(self.currentColor()) chosen_color = random.choice(colors) self.setBackground(chosen_color) self.color = chosen_color
def caseToolButtonClicked(self): Glob.doAnimation(self.caseToolButtonAnim, self.caseToolButton, 4) text = self.passwordEdit.text() if self.upper: text = text.upper() self.upper = False else: text = text.lower() self.upper = True self.passwordEdit.setText(text)
def deleteToolButtonClicked(self): Glob.doAnimation(self.deleteToolButtonAnim, self.deleteToolButton, 4) self.doOpacityAnimation() mainWindow = self.parent().mainWindow() scene = mainWindow.scene() item_data = self.parent().data() json_data = mainWindow.json() json_data['id'].pop(item_data['id']) self.opacityAnimation.finished.connect(lambda: scene.fill_with_cards()) mainWindow.saveData()
def editToolButtonClicked(self): Glob.doAnimation(self.editToolButtonAnim, self.editToolButton, 4) # showing addWindow but with the contents of service card stickerData = self.parent().data() mainWindow = self.parent().mainWindow() self.changeWindow = AddWindow(parent=mainWindow, edit=True, card=self.parent()) self.changeWindow.serviceEdit.setText(stickerData['name']) self.changeWindow.loginEdit.setText(stickerData['login']) self.changeWindow.passwordEdit.setText(stickerData['password']) self.changeWindow.show()
def pushButtonClicked(self): Glob.doAnimation(self.pushButtonAnim, self.pushButton, 4) json_data = self.parent().json() encoded_real_password = base64.b64decode( json_data['enterData']['masterPassword'].encode()) real_password = encoded_real_password.decode() if self.lineEdit.text() == real_password: self.correct_password_entered = True self.close() else: if self.incorrect_times > 2: self.hintLabel.setText('Hint: ' + json_data['enterData']['hint']) self.messageBox.show() self.incorrect_times += 1
def keyToolButtonClicked(self): Glob.doAnimation(self.keyToolButtonAnim, self.keyToolButton, 4) convenient_symbols = '' if self.numbersBox.isChecked(): for i in range(10): convenient_symbols += str(i) if self.lettersBox.isChecked(): convenient_symbols += string.ascii_lowercase password = '' try: for i in range(self.lengthSlider.value()): password += random.choice(convenient_symbols) # if none of the boxes are checked except IndexError: pass self.passwordEdit.setText(password)
def pushButtonClicked(self): Glob.doAnimation(self.anim, self.pushButton, 4) self.close()
def copyToolButtonClicked(self): Glob.doAnimation(self.copyToolButtonAnim, self.copyToolButton, 4) # putting password to exchange buffer QApplication.clipboard().setText(self.parent().data()['password'])
def plusToolButtonClicked(self): Glob.doAnimation(self.plusToolButtonAnim, self.plusToolButton, 3) addWindow = AddWindow(parent=self) addWindow.show()
def crownToolButtonClicked(self): Glob.doAnimation(self.crownToolButtonAnim, self.crownToolButton, 3) chosen_action = self.contextMenu.exec_(self.calculateCoordinates()) self.contextMenu.executeAction(chosen_action)