From d93ca3f2a43f273cb6399f0c5c212544627aac16 Mon Sep 17 00:00:00 2001 From: Konstantin <30900414+mercurykd@users.noreply.github.com> Date: Wed, 12 Jul 2023 23:16:20 +0400 Subject: [PATCH] improve status message --- SQLTools.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/SQLTools.py b/SQLTools.py index a5afef1..3e3f114 100644 --- a/SQLTools.py +++ b/SQLTools.py @@ -382,6 +382,12 @@ def promptNext(): promptNext() + @staticmethod + def changeStatus(text): + views = Window().views() + for view in views: + view.set_status('db', 'db:' + ST.conn.name + ' (' + text + ')') + @staticmethod def loadConnectionData(callback=None): # clear the list of identifiers (in case connection is changed) @@ -394,13 +400,10 @@ def loadConnectionData(callback=None): if not ST.conn: return - views = Window().views() - for view in views: - view.set_status('db', 'db: ' + ST.conn.name + ' ') - def afterAllDataHasLoaded(): ST.completion = Completion(ST.tables, ST.columns, ST.functions, settings=settingsStore) logger.info('completions loaded') + ST.changeStatus('ok {}/{}/{}'.format(len(ST.tables), len(ST.columns), len(ST.functions))) if (callback): callback() @@ -409,6 +412,7 @@ def tablesCallback(tables): nonlocal objectsLoaded objectsLoaded += 1 logger.info('loaded tables : "{0}"'.format(tables)) + ST.changeStatus('load tables') if objectsLoaded == 3: afterAllDataHasLoaded() @@ -417,6 +421,7 @@ def columnsCallback(columns): nonlocal objectsLoaded objectsLoaded += 1 logger.info('loaded columns : "{0}"'.format(columns)) + ST.changeStatus('load columns') if objectsLoaded == 3: afterAllDataHasLoaded() @@ -425,6 +430,7 @@ def functionsCallback(functions): nonlocal objectsLoaded objectsLoaded += 1 logger.info('loaded functions: "{0}"'.format(functions)) + ST.changeStatus('load functions') if objectsLoaded == 3: logger.info('all objects loaded') afterAllDataHasLoaded()