diff --git a/aqt/browser.py b/aqt/browser.py
index 574cf69ff..7c4ad625a 100644
--- a/aqt/browser.py
+++ b/aqt/browser.py
@@ -228,8 +228,6 @@ class DataModel(QAbstractTableModel):
return "%d%%" % (c.factor/10)
elif type == "deck":
return self.browser.mw.col.decks.name(c.did)
- elif type == "ndeck":
- return self.browser.mw.col.decks.name(c.note().did)
def question(self, c):
return self.formatQA(c.a())
@@ -395,7 +393,6 @@ class Browser(QMainWindow):
('answer', _("Answer")),
('template', _("Card")),
('deck', _("Card Deck")),
- ('ndeck', _("Note Deck")),
('noteFld', _("Sort Field")),
('noteCrt', _("Created")),
('noteMod', _("Edited")),
@@ -885,20 +882,16 @@ where id in %s""" % ids2str(sf))
# Deck change
######################################################################
- def setDeck(self, initial=False):
+ def setDeck(self):
d = QDialog(self)
d.setWindowModality(Qt.WindowModal)
frm = aqt.forms.setgroup.Ui_Dialog()
frm.setupUi(d)
from aqt.tagedit import TagEdit
te = TagEdit(d, type=1)
- frm.groupBox.layout().insertWidget(0, te)
+ frm.verticalLayout_2.insertWidget(1, te)
te.setCol(self.col)
d.connect(d, SIGNAL("accepted()"), lambda: self._onSetDeck(frm, te))
- self.setTabOrder(frm.setCur, te)
- self.setTabOrder(te, frm.setInitial)
- if initial:
- frm.setInitial.setChecked(True)
d.show()
te.setFocus()
@@ -907,19 +900,10 @@ where id in %s""" % ids2str(sf))
self.mw.checkpoint(_("Set Deck"))
mod = intTime()
usn = self.col.usn()
- if frm.setCur.isChecked():
- did = self.col.decks.id(unicode(te.text()))
- self.col.db.execute(
- "update cards set usn=?, mod=?, did=? where id in " + ids2str(
- self.selectedCards()), usn, mod, did)
- if frm.setInitial.isChecked():
- self.col.db.execute(
- "update notes set usn=?, mod=?, did=? where id in " + ids2str(
- self.selectedNotes()), usn, mod, did)
- else:
- self.col.db.execute("""
-update cards set usn=?, mod=?, did=(select did from notes where id = cards.nid)
-where id in %s""" % ids2str(self.selectedCards()), usn, mod)
+ did = self.col.decks.id(unicode(te.text()))
+ self.col.db.execute(
+ "update cards set usn=?, mod=?, did=? where id in " + ids2str(
+ self.selectedCards()), usn, mod, did)
self.onSearch(reset=False)
self.mw.requireReset()
self.model.endReset()
diff --git a/aqt/editor.py b/aqt/editor.py
index 3ffa64bec..56fa27b4d 100644
--- a/aqt/editor.py
+++ b/aqt/editor.py
@@ -537,7 +537,7 @@ class Editor(object):
self.deck.setCol(self.mw.col)
self.tags.setCol(self.mw.col)
if self.addMode:
- self.deck.setText(self.mw.col.decks.name(self.note.did))
+ self.deck.setText(self.mw.col.decks.name(self.note.model()['did']))
self.tags.setText(self.note.stringTags().strip())
def saveTagsAndDeck(self):
@@ -547,12 +547,11 @@ class Editor(object):
if self.addMode:
name = self.deck.text()
if not name.strip():
- self.note.did = 1
+ self.note.model()['did'] = 1
else:
- self.note.did = self.mw.col.decks.id(name)
- # save group and tags to model
+ self.note.model()['did'] = self.mw.col.decks.id(name)
+ # save tags to model
m = self.note.model()
- m['did'] = self.note.did
m['tags'] = self.note.tags
self.mw.col.models.save(m)
if not self.addMode:
diff --git a/designer/setgroup.ui b/designer/setgroup.ui
index 462589e22..799757c01 100644
--- a/designer/setgroup.ui
+++ b/designer/setgroup.ui
@@ -6,8 +6,8 @@
0
0
- 291
- 188
+ 276
+ 151
@@ -15,37 +15,24 @@
-
-
+
- Move card(s) to deck:
-
-
- true
+ Move cards to deck:
-
-
-
-
+
+
+ Qt::Vertical
-
-
-
-
-
- Move notes too
-
-
-
-
-
-
- -
-
-
- Move card(s) to their note's deck
+
+
+ 20
+ 40
+
-
+
-
@@ -60,9 +47,6 @@
- setCur
- setInitial
- reset
buttonBox
@@ -99,21 +83,5 @@
-
- setCur
- toggled(bool)
- groupBox
- setEnabled(bool)
-
-
- 188
- 19
-
-
- 343
- 53
-
-
-