def __file_load(self, filename, password=None): if not filename: logger.debug("no revelation database provided") return False if dialog.present_unique(dialog.PasswordOpen): logger.debug('password dialog already opened') return False entrystore = self.datafile.load( filename, password, lambda: dialog.run_unique( dialog.PasswordOpen, None, os.path.basename(filename) ) ) self.entrystore.clear() self.entrystore.import_entry(entrystore, None) menu = self.__generate_entrymenu(self.entrystore) self.database_item.set_submenu(menu) self.database_item.set_sensitive(True) self.menu.show_all() self.locktimer.start(self.config.get("autolock_timeout") * 60) self.__close_popups() return True
def __file_load(self, file, password = None): "Loads a data file" if file in ( "", None ): return False if dialog.present_unique(dialog.PasswordOpen) == True: return False entrystore = self.datafile.load(file, password, lambda: dialog.run_unique(dialog.PasswordOpen, None, os.path.basename(file))) self.entrystore.clear() self.entrystore.import_entry(entrystore, None) self.entrymenu = self.__generate_entrymenu(self.entrystore) self.locktimer.start(self.config.get("autolock_timeout") * 60) self.__close_popups() return True
def prefs(self): "Displays the preference dialog" dialog.run_unique(Preferences, None, self.config)
def about(self): "Displays an about dialog" dialog.run_unique(About, self.applet)
def prefs(self): dialog.run_unique(Preferences, None, self.config)