summaryrefslogtreecommitdiffstats
path: root/pgcli/pgtoolbar.py
diff options
context:
space:
mode:
authorIrina Truong <i.chernyavska@gmail.com>2016-12-12 15:06:51 -0800
committerGitHub <noreply@github.com>2016-12-12 15:06:51 -0800
commit4edd124c0dcbf24ff898eaac855f0a76c7c1e8bb (patch)
tree5d90934ca6b9ab9ab6dc8a2b53b7f1426e389f19 /pgcli/pgtoolbar.py
parenta9352bdb221b7df0c3bec67167e1a8f73d8a2514 (diff)
parent466b8e74be8904f8443882f0c69f82239e01c919 (diff)
Merge pull request #621 from dbcli/koljonen/show_transaction_status
Add transaction status to toolbar
Diffstat (limited to 'pgcli/pgtoolbar.py')
-rw-r--r--pgcli/pgtoolbar.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/pgcli/pgtoolbar.py b/pgcli/pgtoolbar.py
index 84db715d..be720074 100644
--- a/pgcli/pgtoolbar.py
+++ b/pgcli/pgtoolbar.py
@@ -10,7 +10,8 @@ def _get_vi_mode(cli):
InputMode.INSERT_MULTIPLE: 'M',
}[cli.vi_state.input_mode]
-def create_toolbar_tokens_func(get_vi_mode_enabled, get_is_refreshing):
+def create_toolbar_tokens_func(get_vi_mode_enabled, get_is_refreshing,
+ failed_transaction, valid_transaction):
"""
Return a function that generates the toolbar tokens.
"""
@@ -43,6 +44,12 @@ def create_toolbar_tokens_func(get_vi_mode_enabled, get_is_refreshing):
else:
result.append((token.On, '[F4] Emacs-mode'))
+ if failed_transaction():
+ result.append((token.Transaction.Failed, ' Failed transaction'))
+
+ if valid_transaction():
+ result.append((token.Transaction.Valid, ' Transaction'))
+
if get_is_refreshing():
result.append((token, ' Refreshing completions...'))