diff --git a/ankiqt/config.py b/ankiqt/config.py index 1a26f81cd..be1fccc2c 100644 --- a/ankiqt/config.py +++ b/ankiqt/config.py @@ -64,6 +64,7 @@ class Config(dict): 'showTimer': True, 'showSuspendedCards': True, 'simpleToolbar': True, + 'editCurrentOnly': True, } for (k,v) in fields.items(): if not self.has_key(k): diff --git a/ankiqt/ui/cardlist.py b/ankiqt/ui/cardlist.py index e7efaf80c..eb978712d 100644 --- a/ankiqt/ui/cardlist.py +++ b/ankiqt/ui/cardlist.py @@ -264,8 +264,12 @@ class EditDeck(QDialog): def selectLastCard(self): "Show the row corresponding to the current card." + if self.parent.config['editCurrentOnly']: + if self.parent.currentCard: + self.dialog.filterEdit.setText("") + self.dialog.filterEdit.selectAll() self.updateSearch() - if self.parent.currentCard: + if not self.parent.config['editCurrentOnly'] and self.parent.currentCard: currentCardIndex = self.findCardInDeckModel( self.model, self.parent.currentCard ) if currentCardIndex >= 0: diff --git a/ankiqt/ui/preferences.py b/ankiqt/ui/preferences.py index 1420f5e2b..880fe3ec2 100644 --- a/ankiqt/ui/preferences.py +++ b/ankiqt/ui/preferences.py @@ -171,6 +171,7 @@ class Preferences(QDialog): self.dialog.showTray.setChecked(self.config['showTrayIcon']) self.dialog.showTimer.setChecked(self.config['showTimer']) self.dialog.simpleToolbar.setChecked(self.config['simpleToolbar']) + self.dialog.editCurrentOnly.setChecked(self.config['editCurrentOnly']) self.dialog.toolbarIconSize.setText(str(self.config['iconSize'])) def updateAdvanced(self): @@ -185,6 +186,7 @@ class Preferences(QDialog): self.config['showTimer'] = self.dialog.showTimer.isChecked() self.config['suppressEstimates'] = self.dialog.suppressEstimates.isChecked() self.config['simpleToolbar'] = self.dialog.simpleToolbar.isChecked() + self.config['editCurrentOnly'] = self.dialog.editCurrentOnly.isChecked() i = 32 try: i = int(self.dialog.toolbarIconSize.text()) diff --git a/designer/preferences.ui b/designer/preferences.ui index 9e7801693..60b2c9c38 100644 --- a/designer/preferences.ui +++ b/designer/preferences.ui @@ -511,6 +511,13 @@ + + + + Show only current card in editor + + + @@ -598,6 +605,7 @@ showToolbar tallButtons showTray + editCurrentOnly toolbarIconSize buttonBox