From dfa0da57729f60dedd9d572b3529119cd07ecb17 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 26 May 2012 17:18:09 +0900 Subject: [PATCH] focus current profile --- aqt/main.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/aqt/main.py b/aqt/main.py index b7509bd75..44a73705d 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -114,8 +114,13 @@ class AnkiQt(QMainWindow): def refreshProfilesList(self): f = self.profileForm f.profiles.clear() - f.profiles.addItems(self.pm.profiles()) - f.profiles.setCurrentRow(0) + profs = self.pm.profiles() + f.profiles.addItems(profs) + try: + idx = profs.index(self.pm.name) + except: + idx = 0 + f.profiles.setCurrentRow(idx) def onProfileRowChange(self, n): if n < 0: