Ejemplo n.º 1
0
 def fileUnlockedEvent(self, success, decryptedFileName):
     if success == 'True':
         QMessageBox.information(self, __appname__, "File Unlocked Successfully.")
     else:
         os.remove(decryptedFileName)
         EncryptedFile.replaceWithUnlockDialog(EncryptedFile.CALLER_LOCATION, decryptedFileName)
         QMessageBox.information(self, __appname__, "Wrong password. Couldn't unlock file.")
Ejemplo n.º 2
0
 def fileUnlockedEvent(self, success, decryptedFileName):
     if success == 'True':
         QMessageBox.information(self, __appname__,
                                 "File Unlocked Successfully.")
     else:
         os.remove(decryptedFileName)
         EncryptedFile.replaceWithUnlockDialog(
             EncryptedFile.CALLER_LOCATION, decryptedFileName)
         QMessageBox.information(self, __appname__,
                                 "Wrong password. Couldn't unlock file.")
Ejemplo n.º 3
0
 def run(self):
     file = EncryptedFile.createEncryptedFile(
         self.fileName,
         self.password,
         baseFileLocation=EncryptedFile.CALLER_LOCATION,
         makeBackup=self.makeBackup)
     self.signal.emit(self.fileName)
Ejemplo n.º 4
0
 def unlockFile(self):
     if EncryptedFile.isValidFile(self.fileName):
         eFile = EncryptedFile(self.fileName)
         unhashedPassword = self.passwordLineEdit.text()
         password = EncryptionHelper.generateKeyHash(unhashedPassword)
         self.thread = QThread()
         self.worker = Worker(eFile, password, self.signal,
                              self.sameLocation)
         self.worker.moveToThread(self.thread)
         self.thread.started.connect(self.worker.run)
         self.worker.signal.connect(self.thread.quit)
         self.worker.signal.connect(self.worker.deleteLater)
         self.thread.finished.connect(self.thread.deleteLater)
         self.thread.start()
     else:
         QMessageBox.information(self, __appname__,
                                 "Invalid .exelocker file.")
     self.passwordLineEdit.setText("")
Ejemplo n.º 5
0
 def unlockFile(self):
     if EncryptedFile.isValidFile(self.fileName):
         eFile = EncryptedFile(self.fileName)
         unhashedPassword = self.passwordLineEdit.text()
         password = EncryptionHelper.generateKeyHash(unhashedPassword)
         self.thread = QThread()
         self.worker = Worker(eFile, password, self.signal, self.sameLocation)
         self.worker.moveToThread(self.thread)
         self.thread.started.connect(self.worker.run)
         self.worker.signal.connect(self.thread.quit)
         self.worker.signal.connect(self.worker.deleteLater)
         self.thread.finished.connect(self.thread.deleteLater)
         self.thread.start()
     else:
         QMessageBox.information(self, __appname__, "Invalid .exelocker file.")
     self.passwordLineEdit.setText("")
Ejemplo n.º 6
0
    def _getRelevantCmdArgument(self, args):
        for arg in args:
            if EncryptedFile.isValidFile(arg):
                return args.index(arg)

        return None
Ejemplo n.º 7
0
    def _getRelevantCmdArgument(self, args):
        for arg in args:
            if EncryptedFile.isValidFile(arg):
                return args.index(arg)

        return None
Ejemplo n.º 8
0
 def run(self):
     file = EncryptedFile.createEncryptedFile(self.fileName, self.password, baseFileLocation=EncryptedFile.CALLER_LOCATION, makeBackup=self.makeBackup)
     self.signal.emit(self.fileName)