def load_database(self, database_name): # Load the database in the sync server thread. mutex.lock() # Libmnemosyne itself could also generate dialog messages, so # we temporarily override the main_widget with the threaded # routines in this class. self.component_manager.components[None]["main_widget"].append(self) self.sync_started_signal.emit() # Unload database in main thread. if not self.server_has_connection: database_released.wait(mutex) SyncServer.load_database(self, database_name) self.server_has_connection = True mutex.unlock() return self.database()
def __init__(self, component_manager): QtCore.QThread.__init__(self) SyncServer.__init__(self, component_manager, self) self.server_has_connection = False # A fast moving progress bar seems to cause crashes on Windows. self.show_numeric_progress_bar = (sys.platform != "win32")