mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -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 anki.errors import *
|
||||
from anki.db import *
|
||||
from anki.stats import CardStats
|
||||
|
||||
# Deck editor
|
||||
##########################################################################
|
||||
|
@ -126,14 +127,9 @@ class DeckModel(QAbstractTableModel):
|
|||
ads = " and ".join(ads)
|
||||
if isinstance(self.sortKey, types.StringType):
|
||||
# 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
|
||||
if self.sortKey in ("question", "answer"):
|
||||
sort += " collate nocase"
|
||||
sort = "order by cards." + self.sortKey
|
||||
if self.sortKey in ("question", "answer"):
|
||||
sort += " collate nocase"
|
||||
query = ("select id, priority, question, answer, due, "
|
||||
"reps, factId from cards ")
|
||||
if ads:
|
||||
|
@ -222,7 +218,7 @@ class StatusDelegate(QItemDelegate):
|
|||
self.drawDisplay(painter, option, option.rect, data.toString())
|
||||
painter.restore()
|
||||
|
||||
class EditDeck(QDialog):
|
||||
class EditDeck(QMainWindow):
|
||||
|
||||
def __init__(self, parent):
|
||||
QDialog.__init__(self, parent, Qt.Window)
|
||||
|
@ -230,7 +226,7 @@ class EditDeck(QDialog):
|
|||
self.deck = self.parent.deck
|
||||
self.config = parent.config
|
||||
self.origModTime = parent.deck.modified
|
||||
self.dialog = ankiqt.forms.cardlist.Ui_EditDeck()
|
||||
self.dialog = ankiqt.forms.cardlist.Ui_MainWindow()
|
||||
self.dialog.setupUi(self)
|
||||
# flush all changes before we load
|
||||
self.deck.s.flush()
|
||||
|
@ -242,7 +238,7 @@ class EditDeck(QDialog):
|
|||
self.dialog.tableView.setFont(QFont(
|
||||
self.config['editFontFamily'],
|
||||
self.config['editFontSize']))
|
||||
self.setupButtons()
|
||||
self.setupMenus()
|
||||
self.setupFilter()
|
||||
self.setupSort()
|
||||
self.setupHeaders()
|
||||
|
@ -317,7 +313,7 @@ class EditDeck(QDialog):
|
|||
_("Due date"),
|
||||
_("Interval"),
|
||||
_("Answer count"),
|
||||
_("Difficulty"),
|
||||
_("Ease"),
|
||||
]
|
||||
self.sortFields = sorted(self.deck.allFields())
|
||||
self.sortList.extend([_("Field '%s'") % f for f in self.sortFields])
|
||||
|
@ -341,7 +337,7 @@ class EditDeck(QDialog):
|
|||
elif idx == 6:
|
||||
self.sortKey = "reps"
|
||||
elif idx == 7:
|
||||
self.sortKey = "ease"
|
||||
self.sortKey = "factor"
|
||||
else:
|
||||
self.sortKey = ("field", self.sortFields[idx-8])
|
||||
self.sortIndex = idx
|
||||
|
@ -409,71 +405,99 @@ class EditDeck(QDialog):
|
|||
self.dialog.tableView.horizontalHeader().setResizeMode(i, QHeaderView.Stretch)
|
||||
self.dialog.tableView.horizontalHeader().setResizeMode(2, QHeaderView.ResizeToContents)
|
||||
|
||||
def setupButtons(self):
|
||||
# buttons
|
||||
self.connect(self.dialog.factsButton,
|
||||
SIGNAL("clicked()"),
|
||||
self.factsMenu)
|
||||
self.connect(self.dialog.cardsButton,
|
||||
SIGNAL("clicked()"),
|
||||
self.cardsMenu)
|
||||
# menus
|
||||
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 setupMenus(self):
|
||||
self.connect(self.dialog.actionDelete, SIGNAL("triggered()"), self.deleteCards)
|
||||
self.connect(self.dialog.actionAddTag, SIGNAL("triggered()"), self.addTags)
|
||||
self.connect(self.dialog.actionDeleteTag, SIGNAL("triggered()"), self.deleteTags)
|
||||
self.connect(self.dialog.actionAddCards, SIGNAL("triggered()"), self.addCards)
|
||||
self.connect(self.dialog.actionResetProgress, SIGNAL("triggered()"), self.resetProgress)
|
||||
self.connect(self.dialog.actionSelectAll, SIGNAL("triggered()"), self.selectAll)
|
||||
self.connect(self.dialog.actionSelectFacts, SIGNAL("triggered()"), self.selectFacts)
|
||||
self.parent.runHook('editor.setupMenus', self)
|
||||
|
||||
def factsMenu(self):
|
||||
menu = QMenu(self)
|
||||
menu.addAction(self.dialog.actionAdd_fact_tag)
|
||||
menu.addAction(self.dialog.actionDelete_fact_tag)
|
||||
menu.addSeparator()
|
||||
menu.addAction(self.dialog.actionAdd_Missing_Cards)
|
||||
menu.addSeparator()
|
||||
menu.addAction(self.dialog.actionResetFactProgress)
|
||||
menu.addAction(self.dialog.actionDelete_Fact)
|
||||
self.parent.runHook('editor.factsMenu', self, menu)
|
||||
menu.exec_(self.dialog.factsButton.mapToGlobal(QPoint(0,0)))
|
||||
def onClose(self):
|
||||
saveGeom(self, "editor")
|
||||
self.editor.saveFieldsNow()
|
||||
if not self.factValid:
|
||||
ui.utils.showInfo(_(
|
||||
"Some fields are missing or not unique."),
|
||||
parent=self, help="AddItems#AddError")
|
||||
return
|
||||
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")
|
||||
return True
|
||||
|
||||
def cardsMenu(self):
|
||||
menu = QMenu(self)
|
||||
menu.addAction(self.dialog.actionAdd_card_tag)
|
||||
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 closeEvent(self, evt):
|
||||
if self.onClose():
|
||||
evt.accept()
|
||||
else:
|
||||
evt.ignore()
|
||||
|
||||
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:
|
||||
self.model.deleted[id] = True
|
||||
self.model.emit(SIGNAL("layoutChanged()"))
|
||||
def keyPressEvent(self, evt):
|
||||
"Show answer on RET or register answer."
|
||||
if evt.key() in (Qt.Key_Escape,):
|
||||
self.close()
|
||||
|
||||
def deleteFacts(self):
|
||||
cardIds = self.selectedFactsAsCards()
|
||||
self.dialog.tableView.selectionModel().blockSignals(True)
|
||||
self.dialog.tableView.selectionModel().clear()
|
||||
self.dialog.tableView.selectionModel().blockSignals(False)
|
||||
for id in cardIds:
|
||||
if id in self.model.deleted:
|
||||
del self.model.deleted[id]
|
||||
else:
|
||||
self.model.deleted[id] = True
|
||||
self.model.emit(SIGNAL("layoutChanged()"))
|
||||
# Editor
|
||||
######################################################################
|
||||
|
||||
def setupEditor(self):
|
||||
self.editor = ui.facteditor.FactEditor(self,
|
||||
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):
|
||||
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)" %
|
||||
",".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):
|
||||
"Refresh info like stats on current card"
|
||||
self.rowChanged(self.currentRow, None)
|
||||
if reset:
|
||||
self.updateSearch()
|
||||
|
||||
def addMissingCards(self):
|
||||
for id in self.selectedFacts():
|
||||
self.deck.addMissingCards(self.deck.s.query(Fact).get(id))
|
||||
# Menu options
|
||||
######################################################################
|
||||
|
||||
def deleteCards(self):
|
||||
cards = self.selectedCards()
|
||||
self.deck.deleteCards(cards)
|
||||
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.updateAfterCardChange(reset=True)
|
||||
|
||||
def resetFactProgress(self):
|
||||
self.deck.resetCards(self.selectedFactsAsCards())
|
||||
self.updateAfterCardChange(reset=True)
|
||||
def selectAll(self):
|
||||
pass
|
||||
|
||||
def accept(self):
|
||||
self.editor.saveFieldsNow()
|
||||
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()
|
||||
def selectFacts(self):
|
||||
pass
|
||||
|
|
|
@ -1,245 +1,241 @@
|
|||
<ui version="4.0" >
|
||||
<class>EditDeck</class>
|
||||
<widget class="QDialog" name="EditDeck" >
|
||||
<property name="windowModality" >
|
||||
<enum>Qt::NonModal</enum>
|
||||
</property>
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>414</width>
|
||||
<height>434</height>
|
||||
<width>599</width>
|
||||
<height>602</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>Anki - Edit Items</string>
|
||||
<string>Edit Items</string>
|
||||
</property>
|
||||
<property name="windowIcon" >
|
||||
<iconset resource="../icons.qrc" >
|
||||
<normaloff>:/icons/view_text.png</normaloff>:/icons/view_text.png</iconset>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="spacing" >
|
||||
<number>3</number>
|
||||
<widget class="QWidget" name="centralwidget" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>23</y>
|
||||
<width>599</width>
|
||||
<height>559</height>
|
||||
</rect>
|
||||
</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>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="searchGroup" >
|
||||
<layout class="QVBoxLayout" name="verticalLayout" >
|
||||
<property name="spacing" >
|
||||
<number>0</number>
|
||||
</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>
|
||||
<layout class="QHBoxLayout" name="hlayout1" >
|
||||
<property name="spacing" >
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="leftMargin" >
|
||||
<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>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="filterEdit" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="tagList" />
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="sortBox" />
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSplitter" name="splitter" >
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<widget class="QTableView" name="tableView" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Minimum" hsizetype="Preferred" >
|
||||
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
<verstretch>4</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title" >
|
||||
<string>&Search</string>
|
||||
<property name="contextMenuPolicy" >
|
||||
<enum>Qt::ActionsContextMenu</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="frameShape" >
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy" >
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="editTriggers" >
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="tabKeyNavigation" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="alternatingRowColors" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionBehavior" >
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QFrame" name="frame" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>2</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape" >
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="_5" >
|
||||
<property name="spacing" >
|
||||
<number>3</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin" >
|
||||
<number>3</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="filterEdit" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
<layout class="QGridLayout" name="_6" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="tagList" />
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QGroupBox" name="fieldsArea" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
|
||||
<horstretch>7</horstretch>
|
||||
<verstretch>2</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="flat" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
</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>
|
||||
<widget class="QComboBox" name="sortBox" />
|
||||
</item>
|
||||
</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>
|
||||
<widget class="QSplitter" name="splitter" >
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<widget class="QTableView" name="tableView" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>4</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="contextMenuPolicy" >
|
||||
<enum>Qt::ActionsContextMenu</enum>
|
||||
</property>
|
||||
<property name="frameShape" >
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy" >
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="editTriggers" >
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="tabKeyNavigation" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="alternatingRowColors" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionBehavior" >
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QFrame" name="frame" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>2</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape" >
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="spacing" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</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" >
|
||||
<widget class="QGroupBox" name="fieldsArea" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
|
||||
<horstretch>7</horstretch>
|
||||
<verstretch>2</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="flat" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<action name="action_Delete_card" >
|
||||
</item>
|
||||
</layout>
|
||||
</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" >
|
||||
<iconset resource="../icons.qrc" >
|
||||
<normaloff>:/icons/editdelete.png</normaloff>:/icons/editdelete.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Toggle Delete</string>
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
<property name="shortcut" >
|
||||
<string>Ctrl+Del</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionAdd_fact_tag" >
|
||||
<action name="actionAddTag" >
|
||||
<property name="icon" >
|
||||
<iconset resource="../icons.qrc" >
|
||||
<normaloff>:/icons/Anki_Add_Tag.png</normaloff>:/icons/Anki_Add_Tag.png</iconset>
|
||||
|
@ -248,16 +244,7 @@
|
|||
<string>Add Tag...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionAdd_card_tag" >
|
||||
<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" >
|
||||
<action name="actionDeleteTag" >
|
||||
<property name="icon" >
|
||||
<iconset resource="../icons.qrc" >
|
||||
<normaloff>:/icons/Anki_Del_Tag.png</normaloff>:/icons/Anki_Del_Tag.png</iconset>
|
||||
|
@ -266,49 +253,66 @@
|
|||
<string>Delete Tag...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDelete_card_tag" >
|
||||
<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" >
|
||||
<action name="actionAddCards" >
|
||||
<property name="icon" >
|
||||
<iconset resource="../icons.qrc" >
|
||||
<normaloff>:/icons/Anki_Card.png</normaloff>:/icons/Anki_Card.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Add Missing Active Cards</string>
|
||||
<string>Add Cards...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDelete_Fact" >
|
||||
<action name="actionResetProgress" >
|
||||
<property name="icon" >
|
||||
<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 name="text" >
|
||||
<string>Toggle Delete</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionResetCardProgress" >
|
||||
<property name="text" >
|
||||
<string>Reset Progress</string>
|
||||
</property>
|
||||
</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" >
|
||||
<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>
|
||||
</action>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>fieldsArea</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../icons.qrc" />
|
||||
</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>
|
||||
|
|
Loading…
Reference in a new issue