mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
convert editor into main window wip, sort by ease
This commit is contained in:
parent
7563879093
commit
f3e5f5d9e1
2 changed files with 373 additions and 461 deletions
|
@ -15,6 +15,7 @@ from anki.utils import fmtTimeSpan, parseTags, findTag, addTags, deleteTags, \
|
||||||
from ankiqt.ui.utils import saveGeom, restoreGeom
|
from ankiqt.ui.utils import saveGeom, restoreGeom
|
||||||
from anki.errors import *
|
from anki.errors import *
|
||||||
from anki.db import *
|
from anki.db import *
|
||||||
|
from anki.stats import CardStats
|
||||||
|
|
||||||
# Deck editor
|
# Deck editor
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
@ -126,11 +127,6 @@ class DeckModel(QAbstractTableModel):
|
||||||
ads = " and ".join(ads)
|
ads = " and ".join(ads)
|
||||||
if isinstance(self.sortKey, types.StringType):
|
if isinstance(self.sortKey, types.StringType):
|
||||||
# card property
|
# card property
|
||||||
if self.sortKey == "ease":
|
|
||||||
sort = ("order by cards.reps = 0, "
|
|
||||||
"cards.noCount / (cards.reps + 0.001) desc, "
|
|
||||||
"cards.reps")
|
|
||||||
else:
|
|
||||||
sort = "order by cards." + self.sortKey
|
sort = "order by cards." + self.sortKey
|
||||||
if self.sortKey in ("question", "answer"):
|
if self.sortKey in ("question", "answer"):
|
||||||
sort += " collate nocase"
|
sort += " collate nocase"
|
||||||
|
@ -222,7 +218,7 @@ class StatusDelegate(QItemDelegate):
|
||||||
self.drawDisplay(painter, option, option.rect, data.toString())
|
self.drawDisplay(painter, option, option.rect, data.toString())
|
||||||
painter.restore()
|
painter.restore()
|
||||||
|
|
||||||
class EditDeck(QDialog):
|
class EditDeck(QMainWindow):
|
||||||
|
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
QDialog.__init__(self, parent, Qt.Window)
|
QDialog.__init__(self, parent, Qt.Window)
|
||||||
|
@ -230,7 +226,7 @@ class EditDeck(QDialog):
|
||||||
self.deck = self.parent.deck
|
self.deck = self.parent.deck
|
||||||
self.config = parent.config
|
self.config = parent.config
|
||||||
self.origModTime = parent.deck.modified
|
self.origModTime = parent.deck.modified
|
||||||
self.dialog = ankiqt.forms.cardlist.Ui_EditDeck()
|
self.dialog = ankiqt.forms.cardlist.Ui_MainWindow()
|
||||||
self.dialog.setupUi(self)
|
self.dialog.setupUi(self)
|
||||||
# flush all changes before we load
|
# flush all changes before we load
|
||||||
self.deck.s.flush()
|
self.deck.s.flush()
|
||||||
|
@ -242,7 +238,7 @@ class EditDeck(QDialog):
|
||||||
self.dialog.tableView.setFont(QFont(
|
self.dialog.tableView.setFont(QFont(
|
||||||
self.config['editFontFamily'],
|
self.config['editFontFamily'],
|
||||||
self.config['editFontSize']))
|
self.config['editFontSize']))
|
||||||
self.setupButtons()
|
self.setupMenus()
|
||||||
self.setupFilter()
|
self.setupFilter()
|
||||||
self.setupSort()
|
self.setupSort()
|
||||||
self.setupHeaders()
|
self.setupHeaders()
|
||||||
|
@ -317,7 +313,7 @@ class EditDeck(QDialog):
|
||||||
_("Due date"),
|
_("Due date"),
|
||||||
_("Interval"),
|
_("Interval"),
|
||||||
_("Answer count"),
|
_("Answer count"),
|
||||||
_("Difficulty"),
|
_("Ease"),
|
||||||
]
|
]
|
||||||
self.sortFields = sorted(self.deck.allFields())
|
self.sortFields = sorted(self.deck.allFields())
|
||||||
self.sortList.extend([_("Field '%s'") % f for f in self.sortFields])
|
self.sortList.extend([_("Field '%s'") % f for f in self.sortFields])
|
||||||
|
@ -341,7 +337,7 @@ class EditDeck(QDialog):
|
||||||
elif idx == 6:
|
elif idx == 6:
|
||||||
self.sortKey = "reps"
|
self.sortKey = "reps"
|
||||||
elif idx == 7:
|
elif idx == 7:
|
||||||
self.sortKey = "ease"
|
self.sortKey = "factor"
|
||||||
else:
|
else:
|
||||||
self.sortKey = ("field", self.sortFields[idx-8])
|
self.sortKey = ("field", self.sortFields[idx-8])
|
||||||
self.sortIndex = idx
|
self.sortIndex = idx
|
||||||
|
@ -409,71 +405,99 @@ class EditDeck(QDialog):
|
||||||
self.dialog.tableView.horizontalHeader().setResizeMode(i, QHeaderView.Stretch)
|
self.dialog.tableView.horizontalHeader().setResizeMode(i, QHeaderView.Stretch)
|
||||||
self.dialog.tableView.horizontalHeader().setResizeMode(2, QHeaderView.ResizeToContents)
|
self.dialog.tableView.horizontalHeader().setResizeMode(2, QHeaderView.ResizeToContents)
|
||||||
|
|
||||||
def setupButtons(self):
|
def setupMenus(self):
|
||||||
# buttons
|
self.connect(self.dialog.actionDelete, SIGNAL("triggered()"), self.deleteCards)
|
||||||
self.connect(self.dialog.factsButton,
|
self.connect(self.dialog.actionAddTag, SIGNAL("triggered()"), self.addTags)
|
||||||
SIGNAL("clicked()"),
|
self.connect(self.dialog.actionDeleteTag, SIGNAL("triggered()"), self.deleteTags)
|
||||||
self.factsMenu)
|
self.connect(self.dialog.actionAddCards, SIGNAL("triggered()"), self.addCards)
|
||||||
self.connect(self.dialog.cardsButton,
|
self.connect(self.dialog.actionResetProgress, SIGNAL("triggered()"), self.resetProgress)
|
||||||
SIGNAL("clicked()"),
|
self.connect(self.dialog.actionSelectAll, SIGNAL("triggered()"), self.selectAll)
|
||||||
self.cardsMenu)
|
self.connect(self.dialog.actionSelectFacts, SIGNAL("triggered()"), self.selectFacts)
|
||||||
# menus
|
self.parent.runHook('editor.setupMenus', self)
|
||||||
self.connect(self.dialog.action_Delete_card, SIGNAL("triggered()"), self.deleteCards)
|
|
||||||
self.connect(self.dialog.actionAdd_fact_tag, SIGNAL("triggered()"), self.addFactTags)
|
|
||||||
self.connect(self.dialog.actionAdd_card_tag, SIGNAL("triggered()"), self.addCardTags)
|
|
||||||
self.connect(self.dialog.actionDelete_fact_tag, SIGNAL("triggered()"), self.deleteFactTags)
|
|
||||||
self.connect(self.dialog.actionDelete_card_tag, SIGNAL("triggered()"), self.deleteCardTags)
|
|
||||||
self.connect(self.dialog.actionAdd_Missing_Cards, SIGNAL("triggered()"), self.addMissingCards)
|
|
||||||
self.connect(self.dialog.actionDelete_Fact, SIGNAL("triggered()"), self.deleteFacts)
|
|
||||||
self.connect(self.dialog.actionResetCardProgress, SIGNAL("triggered()"), self.resetCardProgress)
|
|
||||||
self.connect(self.dialog.actionResetFactProgress, SIGNAL("triggered()"), self.resetFactProgress)
|
|
||||||
self.parent.runHook('editor.setupButtons', self)
|
|
||||||
|
|
||||||
def factsMenu(self):
|
def onClose(self):
|
||||||
menu = QMenu(self)
|
saveGeom(self, "editor")
|
||||||
menu.addAction(self.dialog.actionAdd_fact_tag)
|
self.editor.saveFieldsNow()
|
||||||
menu.addAction(self.dialog.actionDelete_fact_tag)
|
if not self.factValid:
|
||||||
menu.addSeparator()
|
ui.utils.showInfo(_(
|
||||||
menu.addAction(self.dialog.actionAdd_Missing_Cards)
|
"Some fields are missing or not unique."),
|
||||||
menu.addSeparator()
|
parent=self, help="AddItems#AddError")
|
||||||
menu.addAction(self.dialog.actionResetFactProgress)
|
return
|
||||||
menu.addAction(self.dialog.actionDelete_Fact)
|
self.hide()
|
||||||
self.parent.runHook('editor.factsMenu', self, menu)
|
self.deck.deleteCards(self.model.deleted.keys())
|
||||||
menu.exec_(self.dialog.factsButton.mapToGlobal(QPoint(0,0)))
|
if len(self.model.deleted):
|
||||||
|
self.parent.setStatus(
|
||||||
|
_("%(del)d deleted.") %
|
||||||
|
{"del": len(self.model.deleted)})
|
||||||
|
if self.origModTime != self.deck.modified:
|
||||||
|
self.parent.reset()
|
||||||
|
ui.dialogs.close("CardList")
|
||||||
|
return True
|
||||||
|
|
||||||
def cardsMenu(self):
|
def closeEvent(self, evt):
|
||||||
menu = QMenu(self)
|
if self.onClose():
|
||||||
menu.addAction(self.dialog.actionAdd_card_tag)
|
evt.accept()
|
||||||
menu.addAction(self.dialog.actionDelete_card_tag)
|
|
||||||
menu.addSeparator()
|
|
||||||
menu.addAction(self.dialog.actionResetCardProgress)
|
|
||||||
menu.addAction(self.dialog.action_Delete_card)
|
|
||||||
self.parent.runHook('editor.cardsMenu', self, menu)
|
|
||||||
menu.exec_(self.dialog.cardsButton.mapToGlobal(QPoint(0,0)))
|
|
||||||
|
|
||||||
def deleteCards(self):
|
|
||||||
cards = self.selectedCards()
|
|
||||||
self.dialog.tableView.selectionModel().blockSignals(True)
|
|
||||||
self.dialog.tableView.selectionModel().clear()
|
|
||||||
self.dialog.tableView.selectionModel().blockSignals(False)
|
|
||||||
for id in cards:
|
|
||||||
if id in self.model.deleted:
|
|
||||||
del self.model.deleted[id]
|
|
||||||
else:
|
else:
|
||||||
self.model.deleted[id] = True
|
evt.ignore()
|
||||||
self.model.emit(SIGNAL("layoutChanged()"))
|
|
||||||
|
|
||||||
def deleteFacts(self):
|
def keyPressEvent(self, evt):
|
||||||
cardIds = self.selectedFactsAsCards()
|
"Show answer on RET or register answer."
|
||||||
self.dialog.tableView.selectionModel().blockSignals(True)
|
if evt.key() in (Qt.Key_Escape,):
|
||||||
self.dialog.tableView.selectionModel().clear()
|
self.close()
|
||||||
self.dialog.tableView.selectionModel().blockSignals(False)
|
|
||||||
for id in cardIds:
|
# Editor
|
||||||
if id in self.model.deleted:
|
######################################################################
|
||||||
del self.model.deleted[id]
|
|
||||||
else:
|
def setupEditor(self):
|
||||||
self.model.deleted[id] = True
|
self.editor = ui.facteditor.FactEditor(self,
|
||||||
self.model.emit(SIGNAL("layoutChanged()"))
|
self.dialog.fieldsArea,
|
||||||
|
self.deck)
|
||||||
|
self.factValid = True
|
||||||
|
self.editor.onFactValid = self.onFactValid
|
||||||
|
self.editor.onFactInvalid = self.onFactInvalid
|
||||||
|
self.connect(self.dialog.tableView.selectionModel(),
|
||||||
|
SIGNAL("currentRowChanged(QModelIndex, QModelIndex)"),
|
||||||
|
self.rowChanged)
|
||||||
|
|
||||||
|
def onFactValid(self, fact):
|
||||||
|
self.factValid = True
|
||||||
|
self.dialog.tableView.setEnabled(True)
|
||||||
|
self.dialog.filterEdit.setEnabled(True)
|
||||||
|
self.dialog.sortBox.setEnabled(True)
|
||||||
|
self.dialog.tagList.setEnabled(True)
|
||||||
|
self.dialog.menubar.setEnabled(True)
|
||||||
|
self.dialog.cardInfoGroup.setEnabled(True)
|
||||||
|
|
||||||
|
def onFactInvalid(self, fact):
|
||||||
|
self.factValid = False
|
||||||
|
self.dialog.tableView.setEnabled(False)
|
||||||
|
self.dialog.filterEdit.setEnabled(False)
|
||||||
|
self.dialog.sortBox.setEnabled(False)
|
||||||
|
self.dialog.tagList.setEnabled(False)
|
||||||
|
self.dialog.menubar.setEnabled(False)
|
||||||
|
self.dialog.cardInfoGroup.setEnabled(False)
|
||||||
|
|
||||||
|
def rowChanged(self, current, previous):
|
||||||
|
self.currentRow = current
|
||||||
|
self.currentCard = self.model.getCard(current)
|
||||||
|
self.deck.s.flush()
|
||||||
|
self.deck.s.refresh(self.currentCard)
|
||||||
|
self.deck.s.refresh(self.currentCard.fact)
|
||||||
|
fact = self.currentCard.fact
|
||||||
|
self.editor.setFact(fact, True)
|
||||||
|
self.showCardInfo(self.currentCard)
|
||||||
|
|
||||||
|
def setupCardInfo(self):
|
||||||
|
self.currentCard = None
|
||||||
|
self.cardStats = CardStats(self.deck, None)
|
||||||
|
|
||||||
|
def showCardInfo(self, card):
|
||||||
|
self.cardStats.card = self.currentCard
|
||||||
|
self.dialog.cardLabel.setText(
|
||||||
|
self.cardStats.report())
|
||||||
|
|
||||||
|
# Menu helpers
|
||||||
|
######################################################################
|
||||||
|
|
||||||
def selectedCards(self):
|
def selectedCards(self):
|
||||||
return [self.model.cards[idx.row()][0] for idx in
|
return [self.model.cards[idx.row()][0] for idx in
|
||||||
|
@ -491,158 +515,42 @@ where id in (%s)""" % ",".join([
|
||||||
"select id from cards where factId in (%s)" %
|
"select id from cards where factId in (%s)" %
|
||||||
",".join([str(s) for s in self.selectedFacts()]))
|
",".join([str(s) for s in self.selectedFacts()]))
|
||||||
|
|
||||||
def setupEditor(self):
|
|
||||||
self.editor = ui.facteditor.FactEditor(self,
|
|
||||||
self.dialog.fieldsArea,
|
|
||||||
self.deck)
|
|
||||||
self.editor.onFactValid = self.onFactValid
|
|
||||||
self.editor.onFactInvalid = self.onFactInvalid
|
|
||||||
self.connect(self.dialog.tableView.selectionModel(),
|
|
||||||
SIGNAL("currentRowChanged(QModelIndex, QModelIndex)"),
|
|
||||||
self.rowChanged)
|
|
||||||
|
|
||||||
def onFactValid(self, fact):
|
|
||||||
self.dialog.tableView.setEnabled(True)
|
|
||||||
self.dialog.searchGroup.setEnabled(True)
|
|
||||||
self.dialog.sortGroup.setEnabled(True)
|
|
||||||
self.dialog.actionGroup.setEnabled(True)
|
|
||||||
self.dialog.cardInfoGroup.setEnabled(True)
|
|
||||||
|
|
||||||
def onFactInvalid(self, fact):
|
|
||||||
self.dialog.tableView.setEnabled(False)
|
|
||||||
self.dialog.searchGroup.setEnabled(False)
|
|
||||||
self.dialog.sortGroup.setEnabled(False)
|
|
||||||
self.dialog.actionGroup.setEnabled(False)
|
|
||||||
self.dialog.cardInfoGroup.setEnabled(False)
|
|
||||||
|
|
||||||
def rowChanged(self, current, previous):
|
|
||||||
self.currentRow = current
|
|
||||||
self.currentCard = self.model.getCard(current)
|
|
||||||
self.deck.s.flush()
|
|
||||||
self.deck.s.refresh(self.currentCard)
|
|
||||||
self.deck.s.refresh(self.currentCard.fact)
|
|
||||||
fact = self.currentCard.fact
|
|
||||||
self.editor.setFact(fact, True)
|
|
||||||
self.showCardInfo(self.currentCard)
|
|
||||||
|
|
||||||
def setupCardInfo(self):
|
|
||||||
self.currentCard = None
|
|
||||||
self.cardInfoGrid = QGridLayout(self.dialog.cardInfoGroup)
|
|
||||||
self.cardInfoGrid.setMargin(6)
|
|
||||||
# card
|
|
||||||
l = QLabel(_("<b>Tags</b>"))
|
|
||||||
self.cardInfoGrid.addWidget(l, 0, 0)
|
|
||||||
self.cardStaticTags = QLabel()
|
|
||||||
self.cardStaticTags.setWordWrap(True)
|
|
||||||
self.cardInfoGrid.addWidget(self.cardStaticTags, 1, 0)
|
|
||||||
l = QLabel(_("<b>Card-specific tags</b>"))
|
|
||||||
self.cardInfoGrid.addWidget(l, 2, 0)
|
|
||||||
self.cardTags = QLineEdit()
|
|
||||||
self.connect(self.cardTags, SIGNAL("textChanged(QString)"), self.saveCardInfo)
|
|
||||||
self.cardInfoGrid.addWidget(self.cardTags, 3, 0)
|
|
||||||
l = QLabel(_("<b>Statistics</b>"))
|
|
||||||
self.cardInfoGrid.addWidget(l, 4, 0)
|
|
||||||
self.cardStats = QLabel()
|
|
||||||
self.cardInfoGrid.addWidget(self.cardStats, 5, 0)
|
|
||||||
item = QSpacerItem(20, 20, QSizePolicy.Expanding,
|
|
||||||
QSizePolicy.Expanding)
|
|
||||||
self.cardInfoGrid.addItem(item, 6, 0)
|
|
||||||
|
|
||||||
def updateStaticTags(self):
|
|
||||||
card = self.currentCard
|
|
||||||
self.cardStaticTags.setText(
|
|
||||||
", ".join(parseTags(
|
|
||||||
card.fact.model.tags + "," +
|
|
||||||
card.cardModel.name + "," +
|
|
||||||
card.fact.tags)))
|
|
||||||
|
|
||||||
def showCardInfo(self, card):
|
|
||||||
self.cardTags.setText(card.tags)
|
|
||||||
self.updateStaticTags()
|
|
||||||
# stats
|
|
||||||
next = time.time() - card.due
|
|
||||||
if next > 0:
|
|
||||||
next = "%s ago" % anki.utils.fmtTimeSpan(next)
|
|
||||||
else:
|
|
||||||
next = "in %s" % anki.utils.fmtTimeSpan(abs(next))
|
|
||||||
self.cardStats.setText(
|
|
||||||
_("Created: %(c)s ago<br>"
|
|
||||||
"Next due: %(n)s<br>"
|
|
||||||
"Interval: %(i)0.0f days<br>"
|
|
||||||
"Average: %(a)s<br>"
|
|
||||||
"Total: %(t)s<br>"
|
|
||||||
"Reviews: %(cor)d/%(tot)d<br>"
|
|
||||||
"Successive: %(suc)d")% {
|
|
||||||
"c": fmtTimeSpan(time.time() - card.created),
|
|
||||||
"n": next,
|
|
||||||
"i": card.interval,
|
|
||||||
"a": fmtTimeSpan(card.averageTime),
|
|
||||||
"t": fmtTimeSpan(card.reviewTime),
|
|
||||||
"cor": card.yesCount,
|
|
||||||
"tot": card.reps,
|
|
||||||
"suc": card.successive,
|
|
||||||
})
|
|
||||||
|
|
||||||
def saveCardInfo(self, text):
|
|
||||||
if self.currentCard:
|
|
||||||
tags = unicode(text)
|
|
||||||
if self.currentCard.tags != tags:
|
|
||||||
self.currentCard.tags = tags
|
|
||||||
self.currentCard.setModified()
|
|
||||||
self.deck.setModified()
|
|
||||||
|
|
||||||
def addFactTags(self):
|
|
||||||
tags = ui.utils.getOnlyText(_("Enter tag(s) to add to each fact:"), self)
|
|
||||||
if tags: self.deck.addFactTags(self.selectedFacts(), tags)
|
|
||||||
self.updateAfterCardChange()
|
|
||||||
|
|
||||||
def addCardTags(self):
|
|
||||||
tags = ui.utils.getOnlyText(_("Enter tag(s) to add to each card:"), self)
|
|
||||||
if tags: self.deck.addCardTags(self.selectedCards(), tags)
|
|
||||||
self.updateAfterCardChange()
|
|
||||||
|
|
||||||
def deleteFactTags(self):
|
|
||||||
tags = ui.utils.getOnlyText(_("Enter tag(s) to delete from each fact:"), self)
|
|
||||||
if tags: self.deck.deleteFactTags(self.selectedFacts(), tags)
|
|
||||||
self.updateAfterCardChange()
|
|
||||||
|
|
||||||
def deleteCardTags(self):
|
|
||||||
tags = ui.utils.getOnlyText(_("Enter tag(s) to delete from each card:"), self)
|
|
||||||
if tags: self.deck.deleteCardTags(self.selectedCards(), tags)
|
|
||||||
self.updateAfterCardChange()
|
|
||||||
|
|
||||||
def updateAfterCardChange(self, reset=False):
|
def updateAfterCardChange(self, reset=False):
|
||||||
"Refresh info like stats on current card"
|
"Refresh info like stats on current card"
|
||||||
self.rowChanged(self.currentRow, None)
|
self.rowChanged(self.currentRow, None)
|
||||||
if reset:
|
if reset:
|
||||||
self.updateSearch()
|
self.updateSearch()
|
||||||
|
|
||||||
def addMissingCards(self):
|
# Menu options
|
||||||
for id in self.selectedFacts():
|
######################################################################
|
||||||
self.deck.addMissingCards(self.deck.s.query(Fact).get(id))
|
|
||||||
|
def deleteCards(self):
|
||||||
|
cards = self.selectedCards()
|
||||||
|
self.deck.deleteCards(cards)
|
||||||
self.updateSearch()
|
self.updateSearch()
|
||||||
|
|
||||||
def resetCardProgress(self):
|
def addTags(self):
|
||||||
|
tags = ui.utils.getOnlyText(_("Enter tag(s) to add:"), self)
|
||||||
|
if tags: self.deck.addTags(self.selectedFacts(), tags)
|
||||||
|
self.updateAfterCardChange()
|
||||||
|
|
||||||
|
def deleteTags(self):
|
||||||
|
tags = ui.utils.getOnlyText(_("Enter tag(s) to delete:"), self)
|
||||||
|
if tags: self.deck.deleteTags(self.selectedFacts(), tags)
|
||||||
|
self.updateAfterCardChange()
|
||||||
|
|
||||||
|
def addCards(self):
|
||||||
|
raise
|
||||||
|
# for id in self.selectedFacts():
|
||||||
|
# self.deck.addMissingCards(self.deck.s.query(Fact).get(id))
|
||||||
|
# self.updateSearch()
|
||||||
|
|
||||||
|
def resetProgress(self):
|
||||||
self.deck.resetCards(self.selectedCards())
|
self.deck.resetCards(self.selectedCards())
|
||||||
self.updateAfterCardChange(reset=True)
|
self.updateAfterCardChange(reset=True)
|
||||||
|
|
||||||
def resetFactProgress(self):
|
def selectAll(self):
|
||||||
self.deck.resetCards(self.selectedFactsAsCards())
|
pass
|
||||||
self.updateAfterCardChange(reset=True)
|
|
||||||
|
|
||||||
def accept(self):
|
def selectFacts(self):
|
||||||
self.editor.saveFieldsNow()
|
pass
|
||||||
self.hide()
|
|
||||||
self.deck.deleteCards(self.model.deleted.keys())
|
|
||||||
if len(self.model.deleted):
|
|
||||||
self.parent.setStatus(
|
|
||||||
_("%(del)d deleted.") %
|
|
||||||
{"del": len(self.model.deleted)})
|
|
||||||
if self.origModTime != self.deck.modified:
|
|
||||||
self.parent.reset()
|
|
||||||
ui.dialogs.close("CardList")
|
|
||||||
QDialog.accept(self)
|
|
||||||
|
|
||||||
def reject(self):
|
|
||||||
saveGeom(self, "editor")
|
|
||||||
self.accept()
|
|
||||||
|
|
|
@ -1,56 +1,58 @@
|
||||||
<ui version="4.0" >
|
<ui version="4.0" >
|
||||||
<class>EditDeck</class>
|
<class>MainWindow</class>
|
||||||
<widget class="QDialog" name="EditDeck" >
|
<widget class="QMainWindow" name="MainWindow" >
|
||||||
<property name="windowModality" >
|
|
||||||
<enum>Qt::NonModal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="geometry" >
|
<property name="geometry" >
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>414</width>
|
<width>599</width>
|
||||||
<height>434</height>
|
<height>602</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle" >
|
||||||
<string>Anki - Edit Items</string>
|
<string>Edit Items</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon" >
|
<widget class="QWidget" name="centralwidget" >
|
||||||
<iconset resource="../icons.qrc" >
|
<property name="geometry" >
|
||||||
<normaloff>:/icons/view_text.png</normaloff>:/icons/view_text.png</iconset>
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>23</y>
|
||||||
|
<width>599</width>
|
||||||
|
<height>559</height>
|
||||||
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" >
|
<layout class="QVBoxLayout" name="verticalLayout" >
|
||||||
<property name="spacing" >
|
<property name="spacing" >
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<property name="margin" >
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" >
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<property name="margin" >
|
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="leftMargin" >
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="searchGroup" >
|
<layout class="QHBoxLayout" name="hlayout1" >
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy vsizetype="Minimum" hsizetype="Preferred" >
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="title" >
|
|
||||||
<string>&Search</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" >
|
|
||||||
<property name="spacing" >
|
<property name="spacing" >
|
||||||
<number>3</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin" >
|
<property name="leftMargin" >
|
||||||
<number>3</number>
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="filterEdit" >
|
<widget class="QLineEdit" name="filterEdit" >
|
||||||
|
@ -62,63 +64,10 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="tagList" />
|
<widget class="QComboBox" name="tagList" />
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="sortGroup" >
|
|
||||||
<property name="title" >
|
|
||||||
<string>S&ort</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" >
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<property name="margin" >
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="sortBox" />
|
<widget class="QComboBox" name="sortBox" />
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="actionGroup" >
|
|
||||||
<property name="title" >
|
|
||||||
<string>Change</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" >
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<property name="margin" >
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="factsButton" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Facts...</string>
|
|
||||||
</property>
|
|
||||||
<property name="autoDefault" >
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="cardsButton" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Cards...</string>
|
|
||||||
</property>
|
|
||||||
<property name="autoDefault" >
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSplitter" name="splitter" >
|
<widget class="QSplitter" name="splitter" >
|
||||||
|
@ -170,7 +119,7 @@
|
||||||
<property name="frameShadow" >
|
<property name="frameShadow" >
|
||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" >
|
<layout class="QVBoxLayout" name="_5" >
|
||||||
<property name="spacing" >
|
<property name="spacing" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
@ -178,35 +127,13 @@
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" name="_6" >
|
||||||
<property name="margin" >
|
<property name="margin" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing" >
|
<property name="spacing" >
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="1" >
|
|
||||||
<widget class="QGroupBox" name="cardInfoGroup" >
|
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
|
|
||||||
<horstretch>2</horstretch>
|
|
||||||
<verstretch>2</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize" >
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>300</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="title" >
|
|
||||||
<string>Current Card</string>
|
|
||||||
</property>
|
|
||||||
<property name="flat" >
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QGroupBox" name="fieldsArea" >
|
<widget class="QGroupBox" name="fieldsArea" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
|
@ -223,6 +150,28 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="1" >
|
||||||
|
<widget class="QGroupBox" name="cardInfoGroup" >
|
||||||
|
<property name="title" >
|
||||||
|
<string>Current Card</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_4" >
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="cardLabel" >
|
||||||
|
<property name="text" >
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="alignment" >
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -230,16 +179,63 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
<action name="action_Delete_card" >
|
</widget>
|
||||||
|
<widget class="QMenuBar" name="menubar" >
|
||||||
|
<property name="geometry" >
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>599</width>
|
||||||
|
<height>23</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<widget class="QMenu" name="menu_Edit" >
|
||||||
|
<property name="title" >
|
||||||
|
<string>&Edit</string>
|
||||||
|
</property>
|
||||||
|
<addaction name="actionSelectAll" />
|
||||||
|
<addaction name="actionSelectFacts" />
|
||||||
|
</widget>
|
||||||
|
<widget class="QMenu" name="menu_Actions" >
|
||||||
|
<property name="title" >
|
||||||
|
<string>&Actions</string>
|
||||||
|
</property>
|
||||||
|
<addaction name="actionAddTag" />
|
||||||
|
<addaction name="actionDeleteTag" />
|
||||||
|
<addaction name="separator" />
|
||||||
|
<addaction name="actionAddCards" />
|
||||||
|
<addaction name="separator" />
|
||||||
|
<addaction name="actionResetProgress" />
|
||||||
|
<addaction name="actionDelete" />
|
||||||
|
<addaction name="separator" />
|
||||||
|
<addaction name="actionClose" />
|
||||||
|
</widget>
|
||||||
|
<addaction name="menu_Actions" />
|
||||||
|
<addaction name="menu_Edit" />
|
||||||
|
</widget>
|
||||||
|
<widget class="QStatusBar" name="statusbar" >
|
||||||
|
<property name="geometry" >
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>582</y>
|
||||||
|
<width>599</width>
|
||||||
|
<height>20</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<action name="actionDelete" >
|
||||||
<property name="icon" >
|
<property name="icon" >
|
||||||
<iconset resource="../icons.qrc" >
|
<iconset resource="../icons.qrc" >
|
||||||
<normaloff>:/icons/editdelete.png</normaloff>:/icons/editdelete.png</iconset>
|
<normaloff>:/icons/editdelete.png</normaloff>:/icons/editdelete.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Toggle Delete</string>
|
<string>Delete</string>
|
||||||
|
</property>
|
||||||
|
<property name="shortcut" >
|
||||||
|
<string>Ctrl+Del</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionAdd_fact_tag" >
|
<action name="actionAddTag" >
|
||||||
<property name="icon" >
|
<property name="icon" >
|
||||||
<iconset resource="../icons.qrc" >
|
<iconset resource="../icons.qrc" >
|
||||||
<normaloff>:/icons/Anki_Add_Tag.png</normaloff>:/icons/Anki_Add_Tag.png</iconset>
|
<normaloff>:/icons/Anki_Add_Tag.png</normaloff>:/icons/Anki_Add_Tag.png</iconset>
|
||||||
|
@ -248,16 +244,7 @@
|
||||||
<string>Add Tag...</string>
|
<string>Add Tag...</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionAdd_card_tag" >
|
<action name="actionDeleteTag" >
|
||||||
<property name="icon" >
|
|
||||||
<iconset resource="../icons.qrc" >
|
|
||||||
<normaloff>:/icons/Anki_Add_Tag.png</normaloff>:/icons/Anki_Add_Tag.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string>Add Tag...</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionDelete_fact_tag" >
|
|
||||||
<property name="icon" >
|
<property name="icon" >
|
||||||
<iconset resource="../icons.qrc" >
|
<iconset resource="../icons.qrc" >
|
||||||
<normaloff>:/icons/Anki_Del_Tag.png</normaloff>:/icons/Anki_Del_Tag.png</iconset>
|
<normaloff>:/icons/Anki_Del_Tag.png</normaloff>:/icons/Anki_Del_Tag.png</iconset>
|
||||||
|
@ -266,49 +253,66 @@
|
||||||
<string>Delete Tag...</string>
|
<string>Delete Tag...</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionDelete_card_tag" >
|
<action name="actionAddCards" >
|
||||||
<property name="icon" >
|
|
||||||
<iconset resource="../icons.qrc" >
|
|
||||||
<normaloff>:/icons/Anki_Del_Tag.png</normaloff>:/icons/Anki_Del_Tag.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string>Delete Tag...</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionAdd_Missing_Cards" >
|
|
||||||
<property name="icon" >
|
<property name="icon" >
|
||||||
<iconset resource="../icons.qrc" >
|
<iconset resource="../icons.qrc" >
|
||||||
<normaloff>:/icons/Anki_Card.png</normaloff>:/icons/Anki_Card.png</iconset>
|
<normaloff>:/icons/Anki_Card.png</normaloff>:/icons/Anki_Card.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Add Missing Active Cards</string>
|
<string>Add Cards...</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionDelete_Fact" >
|
<action name="actionResetProgress" >
|
||||||
<property name="icon" >
|
<property name="icon" >
|
||||||
<iconset resource="../icons.qrc" >
|
<iconset resource="../icons.qrc" >
|
||||||
<normaloff>:/icons/editdelete.png</normaloff>:/icons/editdelete.png</iconset>
|
<normaloff>:/icons/edit-undo.png</normaloff>:/icons/edit-undo.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
|
||||||
<string>Toggle Delete</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionResetCardProgress" >
|
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Reset Progress</string>
|
<string>Reset Progress</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionResetFactProgress" >
|
<action name="actionClose" >
|
||||||
|
<property name="icon" >
|
||||||
|
<iconset resource="../icons.qrc" >
|
||||||
|
<normaloff>:/icons/fileclose.png</normaloff>:/icons/fileclose.png</iconset>
|
||||||
|
</property>
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Reset Progress</string>
|
<string>&Close</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionSelectAll" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Select &All</string>
|
||||||
|
</property>
|
||||||
|
<property name="shortcut" >
|
||||||
|
<string>Ctrl+A</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionSelectFacts" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Select &Facts</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<tabstops>
|
|
||||||
<tabstop>fieldsArea</tabstop>
|
|
||||||
</tabstops>
|
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../icons.qrc" />
|
<include location="../icons.qrc" />
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>actionSelectAll</sender>
|
||||||
|
<signal>triggered()</signal>
|
||||||
|
<receiver>tableView</receiver>
|
||||||
|
<slot>selectAll()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel" >
|
||||||
|
<x>-1</x>
|
||||||
|
<y>-1</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel" >
|
||||||
|
<x>299</x>
|
||||||
|
<y>279</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
Loading…
Reference in a new issue