def on_dlgMainPwd_response(self, widget, response): if response == 1: mpwd = self.__gui.get_widget('entryMPwd').get_text() if len(safe.get_safe().keys()) > 0: e = safe.get_entry(safe.get_safe().keys()[0]) if e: try: safe.decrypt(e[1], mpwd) except: self.__gui.get_widget('entryMPwd').set_text('') return self.__master_pwd = mpwd self.__dlg.hide() else: gtk.main_quit()
def __populate_txt_entries(self, id): '''Put values in all the text entries based on the id. @type id: string @param id: The ID of the entry to use. ''' entry = safe.get_entry(id) self.__gui.get_widget('entryID').set_text(id) self.__gui.get_widget('entryUserName').set_text(entry[0]) self.__gui.get_widget('textNote').get_buffer().set_text(entry[2]) try: self.__gui.get_widget('entryPasswd1').set_text(safe.decrypt(entry[1], self.__master_pwd)) self.__gui.get_widget('entryPasswd2').set_text(safe.decrypt(entry[1], self.__master_pwd)) except safe.BadPwdException, e: self.__gui.get_widget('entryPasswd1').set_text(self.__BADPWDTXT) self.__gui.get_widget('entryPasswd2').set_text(self.__BADPWDTXT)