From 86ce952db52bdf8a6d738f62ebcca094f82ae128 Mon Sep 17 00:00:00 2001 From: Tim G L Lyons Date: Sat, 7 Jan 2012 00:10:03 +0000 Subject: [PATCH] 0005351: Focus on event window should be set to "Event type" by default. Discussion also suggests focus for EditSourceRef. This patch applies that focus algorithm to EditCitation, since this, in effect, takes the place of EditSourceRef. svn: r18715 --- src/gui/editors/editcitation.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/editors/editcitation.py b/src/gui/editors/editcitation.py index 2ab8f5058..79019a71a 100644 --- a/src/gui/editors/editcitation.py +++ b/src/gui/editors/editcitation.py @@ -207,6 +207,13 @@ class EditCitation(EditPrimary): self.primtab = RefTab(self.dbstate, self.uistate, self.track, _('General'), tblref) + def _post_init(self): + title = self.glade.get_object('title') + volume = self.glade.get_object('volume') + if not title.get_text_length(): + title.grab_focus(); + elif not volume.get_text_length(): + volume.grab_focus(); def _connect_signals(self): """Connects any signals that need to be connected.