tweak tab order

This commit is contained in:
Damien Elmes 2011-04-18 07:47:03 +09:00
parent 0c38354dae
commit c7fb1146da
2 changed files with 17 additions and 9 deletions

View file

@ -815,18 +815,20 @@ where id in %s""" % ids2str(sf))
frm.groupBox.layout().insertWidget(0, te)
te.setDeck(self.deck)
d.connect(d, SIGNAL("accepted()"), lambda: self.onSetGroup(frm, te))
self.setTabOrder(frm.setCur, te)
self.setTabOrder(te, frm.setInitial)
d.show()
te.setFocus()
def onSetGroup(self, frm, te):
self.model.beginReset()
self.mw.checkpoint(_("Set Group"))
if frm.selGroup.isChecked():
if frm.setCur.isChecked():
gid = self.deck.groupId(unicode(te.text()))
self.deck.db.execute(
"update cards set gid = ? where id in " + ids2str(
self.selectedCards()), gid)
if frm.moveFacts.isChecked():
if frm.setInitial.isChecked():
self.deck.db.execute(
"update facts set gid = ? where id in " + ids2str(
self.selectedFacts()), gid)

View file

@ -15,9 +15,9 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QRadioButton" name="selGroup">
<widget class="QRadioButton" name="setCur">
<property name="text">
<string>Move cards to chosen group:</string>
<string>Set current group to:</string>
</property>
<property name="checked">
<bool>true</bool>
@ -31,9 +31,9 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="moveFacts">
<widget class="QCheckBox" name="setInitial">
<property name="text">
<string>Move facts too</string>
<string>Set initial group too</string>
</property>
</widget>
</item>
@ -41,9 +41,9 @@
</widget>
</item>
<item>
<widget class="QRadioButton" name="factGroup">
<widget class="QRadioButton" name="reset">
<property name="text">
<string>Move cards to their fact's group</string>
<string>Reset to initial group</string>
</property>
</widget>
</item>
@ -59,6 +59,12 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>setCur</tabstop>
<tabstop>setInitial</tabstop>
<tabstop>reset</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
@ -94,7 +100,7 @@
</hints>
</connection>
<connection>
<sender>selGroup</sender>
<sender>setCur</sender>
<signal>toggled(bool)</signal>
<receiver>groupBox</receiver>
<slot>setEnabled(bool)</slot>