From 8234444bd7a18aef441e3b01293e01b60241e8f4 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Thu, 8 Apr 2010 01:16:21 -0700 Subject: [PATCH] views.remote: Give focus to the topmost widget This adds some action-dependent behavior for giving the appropriate widget focus. Signed-off-by: David Aguilar --- cola/views/remote.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cola/views/remote.py b/cola/views/remote.py index c2c1aabb..b80d5685 100644 --- a/cola/views/remote.py +++ b/cola/views/remote.py @@ -74,15 +74,24 @@ class RemoteView(standard.StandardDialog): if action: self.action_button.setText(action.title()) self.setWindowTitle(action.title()) + if action == 'pull': self.tags_checkbox.hide() self.ffwd_only_checkbox.hide() self.local_label.hide() self.local_branch.hide() self.local_branches.hide() - if action != 'pull': + self.remote_branch.setFocus(True) + else: self.rebase_checkbox.hide() + # Action-dependent focus + if action == 'fetch': + self.remotename.setFocus(True) + + if action == 'push': + self.local_branch.setFocus(True) + if action == 'fetch': self.layout_remotes() self.layout_remote_branches() -- 2.11.4.GIT