add 'show current only' again

This commit is contained in:
Damien Elmes 2008-11-19 17:24:52 +09:00
parent 34177f0caa
commit f5234f52eb
4 changed files with 16 additions and 1 deletions

View file

@ -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):

View file

@ -264,8 +264,12 @@ class EditDeck(QDialog):
def selectLastCard(self):
"Show the row corresponding to the current card."
self.updateSearch()
if self.parent.config['editCurrentOnly']:
if self.parent.currentCard:
self.dialog.filterEdit.setText("<current>")
self.dialog.filterEdit.selectAll()
self.updateSearch()
if not self.parent.config['editCurrentOnly'] and self.parent.currentCard:
currentCardIndex = self.findCardInDeckModel(
self.model, self.parent.currentCard )
if currentCardIndex >= 0:

View file

@ -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())

View file

@ -511,6 +511,13 @@
</property>
</widget>
</item>
<item row="9" column="0" >
<widget class="QCheckBox" name="editCurrentOnly" >
<property name="text" >
<string>Show only current card in editor</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
@ -598,6 +605,7 @@
<tabstop>showToolbar</tabstop>
<tabstop>tallButtons</tabstop>
<tabstop>showTray</tabstop>
<tabstop>editCurrentOnly</tabstop>
<tabstop>toolbarIconSize</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>