Esempio n. 1
0
    def onRemove(self, event):
        '''
        if the currentTag was not Trash, move the selected account to trash. otherwise remove the account.
        @param event:        
        '''
        account = self.pwdService.getPwdById(self.selectedPwdId)

        if self.selectedTagId == myGui.ID_TAG_TRASH:
            if myGui.showConfirmationDialog(myGui.CONFIRM_COMPLETE_REMOVE,
                                            account.title) == wx.ID_YES:
                self.pwdService.deleteAccount(account.id)
                self.reLoadWindow()

        else:  # move to Trash
            if myGui.showConfirmationDialog(myGui.CONFIRM_MOVETO_TRASH,
                                            account.title) == wx.ID_YES:
                self.pwdService.moveToTrash(account.id)

                # if in search, searchList needs to be maintained.
                if self.selectedTagId == myGui.ID_TAG_SEARCH:
                    for pwd in self.searchResult:
                        if pwd.id == account.id:
                            self.searchResult.remove(pwd)
                            break

                self.reLoadWindow()
Esempio n. 2
0
 def onRemoveTag(self,event):
     tag = self.tagService.getTagById(self.selectedTagId)
     count = self.tagService.getPwdCountByTagId(tag.id)
     if count>0:
         if myGui.showConfirmationDialog(myGui.CONFIRM_REMOVE_USEDTAG,tag.name)==wx.ID_YES:
             self.tagService.removeTagInUse(tag.id)
             self.reLoadWindow(tag.id)
     elif myGui.showConfirmationDialog(myGui.CONFIRM_REMOVE_TAG, tag.name)==wx.ID_YES:            
         self.tagService.removeTag(tag.id)
         self.reLoadWindow()   
Esempio n. 3
0
 def onRemoveTag(self):
     tag = self.tagFunc.getTagByID(self.selectedTagID)
     cnt = self.tagFunc.getPwdCntByTagID(tag.id)
     if cnt > 0:
         if myGui.showConfirmationDialog(myGui.CONFIRM_REMOVE_USEDTAG, tag.name) == QtGui.QMessageBox.Ok:
             self.tagFunc.removeTagInUse(tag.id)
             self.reloadWindow()
     elif myGui.showConfirmationDialog(myGui.CONFIRM_REMOVE_TAG, tag.name) == QtGui.QMessageBox.Ok:
         self.tagFunc.removeTag(tag.id)
         self.reloadWindow()
Esempio n. 4
0
 def onRemoveTag(self, event):
     tag = self.tagService.getTagById(self.selectedTagId)
     count = self.tagService.getPwdCountByTagId(tag.id)
     if count > 0:
         if myGui.showConfirmationDialog(myGui.CONFIRM_REMOVE_USEDTAG,
                                         tag.name) == wx.ID_YES:
             self.tagService.removeTagInUse(tag.id)
             self.reLoadWindow(tag.id)
     elif myGui.showConfirmationDialog(myGui.CONFIRM_REMOVE_TAG,
                                       tag.name) == wx.ID_YES:
         self.tagService.removeTag(tag.id)
         self.reLoadWindow()
Esempio n. 5
0
 def onRemove(self):
     '''
     if the currentTag is not Trash, move the selected accouont to Trash. Otherwise remove the account.
     '''
     account = self.pwdFunc.getPwdByID(self.selectedPwdID)
     
     if self.selectedTagID == myGui.ID_TAG_TRASH:
         if myGui.showConfirmationDialog(myGui.CONFIRM_COMPLETE_REMOVE, account.title) == QtGui.QMessageBox.Ok:
             self.pwdFunc.deleteAccount(account.id)
             self.reloadWindow(self.selectedTagID)
     else:
         if myGui.showConfirmationDialog(myGui.CONFIRM_MOVETO_TRASH, account.title) == QtGui.QMessageBox.Ok:
             self.pwdFunc.moveToTrash(account.id)
             
             # if the currentTag is SearchResult, SearchList need to be maintained.
             if self.selectedTagID == myGui.ID_TAG_SEARCH:
                 global SEARCHRESULT
                 for pwd in SEARCHRESULT:
                     if pwd.id == account.id:
                         SEARCHRESULT.remove(pwd)
                         break
             self.reloadWindow(self.selectedTagID)
Esempio n. 6
0
    def onRemove(self,event):
        '''
        if the currentTag was not Trash, move the selected account to trash. otherwise remove the account.
        @param event:        
        '''
        account = self.pwdService.getPwdById(self.selectedPwdId)
        
        if self.selectedTagId == myGui.ID_TAG_TRASH:
            if myGui.showConfirmationDialog(myGui.CONFIRM_COMPLETE_REMOVE , account.title)==wx.ID_YES:
                self.pwdService.deleteAccount(account.id)
                self.reLoadWindow()

        else:    # move to Trash
            if myGui.showConfirmationDialog(myGui.CONFIRM_MOVETO_TRASH , account.title) ==wx.ID_YES:
                self.pwdService.moveToTrash(account.id)

                # if in search, searchList needs to be maintained.
                if self.selectedTagId == myGui.ID_TAG_SEARCH: 
                    for pwd in self.searchResult:
                        if pwd.id == account.id:
                            self.searchResult.remove(pwd)
                            break;
                        
                self.reLoadWindow()
Esempio n. 7
0
 def onEmptyTrash(self, event):
     if myGui.showConfirmationDialog(
             myGui.CONFIRM_EMPTY_TRASH) == wx.ID_YES:
         self.pwdService.emptyTrash()
         self.reLoadWindow()
Esempio n. 8
0
 def onEmptyTrash(self,event):
     if myGui.showConfirmationDialog(myGui.CONFIRM_EMPTY_TRASH)==wx.ID_YES:
         self.pwdService.emptyTrash()
         self.reLoadWindow()
Esempio n. 9
0
 def onEmptyTrash(self):
     if myGui.showConfirmationDialog(myGui.CONFIRM_EMPTY_TRASH) == QtGui.QMessageBox.Ok:
         self.pwdFunc.emptyTrash()
         self.reloadWindow()