mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
move to stacked widgets, fix scrollbar display
This commit is contained in:
parent
e617fe7df7
commit
e0e6979101
6 changed files with 348 additions and 201 deletions
|
@ -334,7 +334,7 @@ class EditDeck(QMainWindow):
|
||||||
self.updateSearch()
|
self.updateSearch()
|
||||||
|
|
||||||
def updateFilterLabel(self):
|
def updateFilterLabel(self):
|
||||||
self.setWindowTitle(_("Anki - Edit Items (%(cur)d "
|
self.setWindowTitle(_("Editor (%(cur)d "
|
||||||
"of %(tot)d cards shown)") %
|
"of %(tot)d cards shown)") %
|
||||||
{"cur": len(self.model.cards),
|
{"cur": len(self.model.cards),
|
||||||
"tot": self.deck.cardCount})
|
"tot": self.deck.cardCount})
|
||||||
|
|
|
@ -19,11 +19,10 @@ class FactEditor(object):
|
||||||
Extra widgets can be added to 'fieldsGrid' to represent card-specific
|
Extra widgets can be added to 'fieldsGrid' to represent card-specific
|
||||||
information, etc."""
|
information, etc."""
|
||||||
|
|
||||||
def __init__(self, parent, widget, deck=None, colour=""):
|
def __init__(self, parent, widget, deck=None):
|
||||||
self.widget = widget
|
self.widget = widget
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.deck = deck
|
self.deck = deck
|
||||||
self.colour = colour
|
|
||||||
self.fact = None
|
self.fact = None
|
||||||
self.fontChanged = False
|
self.fontChanged = False
|
||||||
self.setupFields()
|
self.setupFields()
|
||||||
|
@ -74,9 +73,6 @@ class FactEditor(object):
|
||||||
# button styles for mac
|
# button styles for mac
|
||||||
self.plastiqueStyle = QStyleFactory.create("plastique")
|
self.plastiqueStyle = QStyleFactory.create("plastique")
|
||||||
self.widget.setStyle(self.plastiqueStyle)
|
self.widget.setStyle(self.plastiqueStyle)
|
||||||
self.widget.setStyleSheet("""
|
|
||||||
%s
|
|
||||||
#fieldsArea { border: 0px; margin-top: 4px; }""" % self.colour)
|
|
||||||
# bold
|
# bold
|
||||||
self.bold = QPushButton()
|
self.bold = QPushButton()
|
||||||
self.bold.setCheckable(True)
|
self.bold.setCheckable(True)
|
||||||
|
@ -209,9 +205,7 @@ class FactEditor(object):
|
||||||
|
|
||||||
def _makeGrid(self):
|
def _makeGrid(self):
|
||||||
"Rebuild the grid to avoid trigging QT bugs."
|
"Rebuild the grid to avoid trigging QT bugs."
|
||||||
self.fieldsFrame = QFrame()
|
self.fieldsFrame = QWidget()
|
||||||
self.fieldsFrame.setFrameStyle(0)
|
|
||||||
self.fieldsFrame.setLineWidth(0)
|
|
||||||
self.fieldsGrid = QGridLayout(self.fieldsFrame)
|
self.fieldsGrid = QGridLayout(self.fieldsFrame)
|
||||||
self.fieldsFrame.setLayout(self.fieldsGrid)
|
self.fieldsFrame.setLayout(self.fieldsGrid)
|
||||||
self.fieldsGrid.setMargin(0)
|
self.fieldsGrid.setMargin(0)
|
||||||
|
|
|
@ -77,14 +77,12 @@ class AnkiQt(QMainWindow):
|
||||||
self.mainWin.mainText = ui.view.AnkiWebView(self.mainWin.mainTextFrame)
|
self.mainWin.mainText = ui.view.AnkiWebView(self.mainWin.mainTextFrame)
|
||||||
self.mainWin.mainText.setObjectName("mainText")
|
self.mainWin.mainText.setObjectName("mainText")
|
||||||
self.mainWin.mainText.setFocusPolicy(Qt.ClickFocus)
|
self.mainWin.mainText.setFocusPolicy(Qt.ClickFocus)
|
||||||
self.mainWin.vboxlayout.addWidget(self.mainWin.mainText)
|
self.mainWin.mainStack.addWidget(self.mainWin.mainText)
|
||||||
self.mainWin.buttonWidget = QWidget(self.mainWin.mainTextFrame)
|
|
||||||
self.mainWin.buttonWidget.setObjectName("buttonWidget")
|
|
||||||
self.mainWin.vboxlayout.addWidget(self.mainWin.buttonWidget)
|
|
||||||
self.help = ui.help.HelpArea(self.mainWin.helpFrame, self.config, self)
|
self.help = ui.help.HelpArea(self.mainWin.helpFrame, self.config, self)
|
||||||
self.mainWin.mainText.pageAction(QWebPage.Reload).setVisible(False)
|
self.mainWin.mainText.pageAction(QWebPage.Reload).setVisible(False)
|
||||||
self.mainWin.welcomeText.hide()
|
self.mainWin.mainStack.setCurrentIndex(2)
|
||||||
self.mainWin.mainText.hide()
|
self.mainWin.buttonStack.show()
|
||||||
|
self.mainWin.buttonStack.setCurrentIndex(1)
|
||||||
|
|
||||||
def setupViews(self):
|
def setupViews(self):
|
||||||
self.bodyView = ui.view.View(self, self.mainWin.mainText,
|
self.bodyView = ui.view.View(self, self.mainWin.mainText,
|
||||||
|
@ -184,19 +182,14 @@ An error occurred. Please copy the following message into a bug report.\n\n""" +
|
||||||
self.state = state
|
self.state = state
|
||||||
self.updateTitleBar()
|
self.updateTitleBar()
|
||||||
if 'state' != 'noDeck' and state != 'editCurrentFact':
|
if 'state' != 'noDeck' and state != 'editCurrentFact':
|
||||||
self.mainWin.welcomeText.hide()
|
self.showReviewScreen()
|
||||||
self.mainWin.mainText.show()
|
|
||||||
self.mainWin.buttonWidget.show()
|
|
||||||
self.mainWin.fieldsArea.hide()
|
|
||||||
if state == "noDeck":
|
if state == "noDeck":
|
||||||
self.mainWin.welcomeText.show()
|
self.showWelcomeScreen()
|
||||||
self.mainWin.mainText.hide()
|
|
||||||
self.help.hide()
|
self.help.hide()
|
||||||
self.currentCard = None
|
self.currentCard = None
|
||||||
self.lastCard = None
|
self.lastCard = None
|
||||||
self.disableDeckMenuItems()
|
self.disableDeckMenuItems()
|
||||||
self.updateRecentFilesMenu()
|
self.updateRecentFilesMenu()
|
||||||
self.resetButtons()
|
|
||||||
# hide all deck-associated dialogs
|
# hide all deck-associated dialogs
|
||||||
ui.dialogs.closeAll()
|
ui.dialogs.closeAll()
|
||||||
elif state == "getQuestion":
|
elif state == "getQuestion":
|
||||||
|
@ -217,14 +210,12 @@ An error occurred. Please copy the following message into a bug report.\n\n""" +
|
||||||
else:
|
else:
|
||||||
return self.moveToState("deckFinished")
|
return self.moveToState("deckFinished")
|
||||||
elif state == "deckEmpty":
|
elif state == "deckEmpty":
|
||||||
self.mainWin.welcomeText.show()
|
self.showWelcomeScreen()
|
||||||
self.mainWin.mainText.hide()
|
|
||||||
self.resetButtons()
|
|
||||||
self.disableCardMenuItems()
|
self.disableCardMenuItems()
|
||||||
self.mainWin.menu_Lookup.setEnabled(False)
|
self.mainWin.menu_Lookup.setEnabled(False)
|
||||||
elif state == "deckFinished":
|
elif state == "deckFinished":
|
||||||
self.deck.s.flush()
|
self.deck.s.flush()
|
||||||
self.resetButtons()
|
self.hideButtons()
|
||||||
self.mainWin.menu_Lookup.setEnabled(False)
|
self.mainWin.menu_Lookup.setEnabled(False)
|
||||||
self.disableCardMenuItems()
|
self.disableCardMenuItems()
|
||||||
self.startRefreshTimer()
|
self.startRefreshTimer()
|
||||||
|
@ -232,22 +223,16 @@ An error occurred. Please copy the following message into a bug report.\n\n""" +
|
||||||
elif state == "showQuestion":
|
elif state == "showQuestion":
|
||||||
if self.deck.mediaDir():
|
if self.deck.mediaDir():
|
||||||
os.chdir(self.deck.mediaDir())
|
os.chdir(self.deck.mediaDir())
|
||||||
self.resetButtons()
|
|
||||||
self.showAnswerButton()
|
self.showAnswerButton()
|
||||||
self.updateMarkAction()
|
self.updateMarkAction()
|
||||||
self.runHook('showQuestion')
|
self.runHook('showQuestion')
|
||||||
elif state == "showAnswer":
|
elif state == "showAnswer":
|
||||||
self.resetButtons()
|
|
||||||
self.showEaseButtons()
|
self.showEaseButtons()
|
||||||
self.enableCardMenuItems()
|
self.enableCardMenuItems()
|
||||||
elif state == "editCurrentFact":
|
elif state == "editCurrentFact":
|
||||||
if self.lastState == "editCurrentFact":
|
if self.lastState == "editCurrentFact":
|
||||||
return self.moveToState("saveEdit")
|
return self.moveToState("saveEdit")
|
||||||
self.resetButtons()
|
self.showEditor()
|
||||||
self.showSaveEditorButton()
|
|
||||||
self.mainWin.mainText.hide()
|
|
||||||
self.mainWin.fieldsArea.show()
|
|
||||||
self.editor.setFact(self.currentCard.fact)
|
|
||||||
elif state == "saveEdit":
|
elif state == "saveEdit":
|
||||||
self.editor.saveFieldsNow()
|
self.editor.saveFieldsNow()
|
||||||
self.deck.s.flush()
|
self.deck.s.flush()
|
||||||
|
@ -321,27 +306,23 @@ An error occurred. Please copy the following message into a bug report.\n\n""" +
|
||||||
self.refreshTimer.stop()
|
self.refreshTimer.stop()
|
||||||
self.refreshTimer = None
|
self.refreshTimer = None
|
||||||
|
|
||||||
|
# Main stack
|
||||||
|
##########################################################################
|
||||||
|
|
||||||
|
def showWelcomeScreen(self):
|
||||||
|
self.mainWin.mainStack.setCurrentIndex(0)
|
||||||
|
self.hideButtons()
|
||||||
|
|
||||||
|
def showEditScreen(self):
|
||||||
|
self.mainWin.mainStack.setCurrentIndex(1)
|
||||||
|
|
||||||
|
def showReviewScreen(self):
|
||||||
|
self.mainWin.mainStack.setCurrentIndex(2)
|
||||||
|
|
||||||
# Buttons
|
# Buttons
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
def setupButtons(self):
|
def setupButtons(self):
|
||||||
self.outerButtonBox = QHBoxLayout(self.mainWin.buttonWidget)
|
|
||||||
self.outerButtonBox.setMargin(3)
|
|
||||||
self.outerButtonBox.setSpacing(0)
|
|
||||||
self.innerButtonWidget = None
|
|
||||||
|
|
||||||
def resetButtons(self):
|
|
||||||
# this round-about process is trying to work around a bug in qt
|
|
||||||
if self.lastState == self.state:
|
|
||||||
return
|
|
||||||
if self.innerButtonWidget:
|
|
||||||
self.outerButtonBox.removeWidget(self.innerButtonWidget)
|
|
||||||
self.innerButtonWidget.deleteLater()
|
|
||||||
self.innerButtonWidget = QWidget()
|
|
||||||
self.outerButtonBox.addWidget(self.innerButtonWidget)
|
|
||||||
self.buttonBox = QVBoxLayout(self.innerButtonWidget)
|
|
||||||
self.buttonBox.setSpacing(3)
|
|
||||||
self.buttonBox.setMargin(3)
|
|
||||||
if self.config['easeButtonHeight'] == "tall":
|
if self.config['easeButtonHeight'] == "tall":
|
||||||
self.easeButtonHeight = 50
|
self.easeButtonHeight = 50
|
||||||
else:
|
else:
|
||||||
|
@ -349,77 +330,50 @@ An error occurred. Please copy the following message into a bug report.\n\n""" +
|
||||||
self.easeButtonHeight = 35
|
self.easeButtonHeight = 35
|
||||||
else:
|
else:
|
||||||
self.easeButtonHeight = 25
|
self.easeButtonHeight = 25
|
||||||
|
# ask
|
||||||
|
self.connect(self.mainWin.showAnswerButton, SIGNAL("clicked()"),
|
||||||
|
lambda: self.moveToState("showAnswer"))
|
||||||
|
# answer
|
||||||
|
for i in range(1, 5):
|
||||||
|
b = getattr(self.mainWin, "easeButton%d" % i)
|
||||||
|
b.setFixedHeight(self.easeButtonHeight)
|
||||||
|
b.setFixedWidth(100)
|
||||||
|
self.connect(b, SIGNAL("clicked()"),
|
||||||
|
lambda i=i: self.cardAnswered(i))
|
||||||
|
# editor
|
||||||
|
self.connect(self.mainWin.saveEditorButton, SIGNAL("clicked()"),
|
||||||
|
lambda: self.moveToState("saveEdit"))
|
||||||
|
|
||||||
|
def hideButtons(self):
|
||||||
|
self.mainWin.buttonStack.hide()
|
||||||
|
|
||||||
def showAnswerButton(self):
|
def showAnswerButton(self):
|
||||||
if self.lastState == self.state:
|
self.mainWin.buttonStack.setCurrentIndex(0)
|
||||||
return
|
self.mainWin.buttonStack.show()
|
||||||
button = QPushButton(_("Show answer"))
|
self.mainWin.showAnswerButton.setFocus()
|
||||||
button.setFixedHeight(self.easeButtonHeight)
|
|
||||||
self.buttonBox.addWidget(button)
|
|
||||||
button.setFocus()
|
|
||||||
button.setDefault(True)
|
|
||||||
self.connect(button, SIGNAL("clicked()"),
|
|
||||||
lambda: self.moveToState("showAnswer"))
|
|
||||||
|
|
||||||
def getSpacer(self, hpolicy=QSizePolicy.Preferred):
|
|
||||||
return QSpacerItem(20, 20,
|
|
||||||
hpolicy,
|
|
||||||
QSizePolicy.Preferred)
|
|
||||||
|
|
||||||
def showEaseButtons(self):
|
def showEaseButtons(self):
|
||||||
# if the state hasn't changed, do nothing
|
self.updateEaseButtons()
|
||||||
if self.lastState == self.state:
|
self.mainWin.buttonStack.setCurrentIndex(1)
|
||||||
return
|
self.mainWin.buttonStack.show()
|
||||||
# gather next intervals
|
self.mainWin.easeButton3.setFocus()
|
||||||
nextInts = {}
|
|
||||||
for i in range(5):
|
|
||||||
s=self.deck.nextIntervalStr(self.currentCard, i)
|
|
||||||
nextInts["ease%d" % i] = s
|
|
||||||
# button grid
|
|
||||||
grid = QGridLayout()
|
|
||||||
grid.setSpacing(3)
|
|
||||||
button3 = self.showCompactEaseButtons(grid, nextInts)
|
|
||||||
hbox = QHBoxLayout()
|
|
||||||
hbox.addStretch()
|
|
||||||
hbox.addLayout(grid)
|
|
||||||
hbox.addStretch()
|
|
||||||
self.buttonBox.addLayout(hbox)
|
|
||||||
button3.setFocus()
|
|
||||||
|
|
||||||
def showCompactEaseButtons(self, grid, nextInts):
|
def showSaveEditorButton(self):
|
||||||
text = (
|
self.mainWin.buttonStack.setCurrentIndex(2)
|
||||||
(_("Again"),
|
self.mainWin.buttonStack.show()
|
||||||
_("<b>%(ease1)s</b>"),
|
|
||||||
_("<b>Relearn (1)</b><br>Mark harder and learn again.")),
|
def updateEaseButtons(self):
|
||||||
(_("Hard"),
|
nextInts = {}
|
||||||
_("<b>%(ease2)s</b>"),
|
|
||||||
_("<b>Hard (2)</b><br>Wait a little longer next time.")),
|
|
||||||
(_("Good"),
|
|
||||||
_("<b>%(ease3)s</b>"),
|
|
||||||
_("<b>Comfortable (3)</b><br>Wait longer next time.")),
|
|
||||||
(_("Easy"),
|
|
||||||
_("<b>%(ease4)s</b>"),
|
|
||||||
_("<b>Easy (4)</b><br>Wait a lot longer next time.")))
|
|
||||||
button3 = None
|
|
||||||
for i in range(1, 5):
|
for i in range(1, 5):
|
||||||
if not self.config['suppressEstimates']:
|
l = getattr(self.mainWin, "easeLabel%d" % i)
|
||||||
|
if self.config['suppressEstimates']:
|
||||||
|
l.hide()
|
||||||
|
else:
|
||||||
if i == 1:
|
if i == 1:
|
||||||
label = QLabel(self.withInterfaceFont(_("Soon")))
|
l.setText(self.withInterfaceFont(_("Soon")))
|
||||||
else:
|
else:
|
||||||
label = QLabel(self.withInterfaceFont(text[i-1][1] % nextInts))
|
l.setText(self.withInterfaceFont("<b>" +
|
||||||
label.setAlignment(Qt.AlignHCenter)
|
self.deck.nextIntervalStr(self.currentCard, i) + "</b>"))
|
||||||
grid.addWidget(label, 0, (i*2)+1)
|
|
||||||
button = QPushButton(text[i-1][0])
|
|
||||||
button.setFixedHeight(self.easeButtonHeight)
|
|
||||||
button.setFixedWidth(100)
|
|
||||||
button.setToolTip(text[i-1][2])
|
|
||||||
self.connect(button, SIGNAL("clicked()"),
|
|
||||||
lambda i=i: self.cardAnswered(i))
|
|
||||||
#button.setFixedWidth(70)
|
|
||||||
if i == 3:
|
|
||||||
button3 = button
|
|
||||||
grid.addWidget(button, 1, (i*2)+1)
|
|
||||||
return button3
|
|
||||||
|
|
||||||
def withInterfaceFont(self, text):
|
def withInterfaceFont(self, text):
|
||||||
family = self.config["interfaceFontFamily"]
|
family = self.config["interfaceFontFamily"]
|
||||||
|
@ -852,31 +806,21 @@ To upgrade an old deck, download Anki 0.9.8.7."""))
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
def setupEditor(self):
|
def setupEditor(self):
|
||||||
self.mainWin.fieldsArea.hide()
|
|
||||||
self.mainWin.fieldsArea.setFlat(True)
|
|
||||||
self.editor = ui.facteditor.FactEditor(
|
self.editor = ui.facteditor.FactEditor(
|
||||||
self, self.mainWin.fieldsArea, self.deck,
|
self, self.mainWin.fieldsArea, self.deck)
|
||||||
colour="* { background-color: #fff; }\n")
|
|
||||||
self.editor.onFactValid = self.onFactValid
|
self.editor.onFactValid = self.onFactValid
|
||||||
self.editor.onFactInvalid = self.onFactInvalid
|
self.editor.onFactInvalid = self.onFactInvalid
|
||||||
|
|
||||||
def showSaveEditorButton(self):
|
def showEditor(self):
|
||||||
if self.lastState == self.state:
|
self.showSaveEditorButton()
|
||||||
return
|
self.mainWin.mainStack.setCurrentIndex(1)
|
||||||
self.editFactButton = QPushButton(_("Close"))
|
self.editor.setFact(self.currentCard.fact)
|
||||||
self.editFactButton.setToolTip("Hit Esc to return to review.")
|
|
||||||
self.editFactButton.setFixedHeight(self.easeButtonHeight)
|
|
||||||
self.editFactButton.setShortcut(_("Esc"))
|
|
||||||
self.editFactButton.setDefault(False)
|
|
||||||
self.buttonBox.addWidget(self.editFactButton)
|
|
||||||
self.connect(self.editFactButton, SIGNAL("clicked()"),
|
|
||||||
lambda: self.moveToState("saveEdit"))
|
|
||||||
|
|
||||||
def onFactValid(self, fact):
|
def onFactValid(self, fact):
|
||||||
self.editFactButton.setEnabled(True)
|
self.mainWin.saveEditorButton.setEnabled(True)
|
||||||
|
|
||||||
def onFactInvalid(self, fact):
|
def onFactInvalid(self, fact):
|
||||||
self.editFactButton.setEnabled(False)
|
self.mainWin.saveEditorButton.setEnabled(False)
|
||||||
|
|
||||||
# Toolbar
|
# Toolbar
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
@ -1209,9 +1153,7 @@ To upgrade an old deck, download Anki 0.9.8.7."""))
|
||||||
self.connect(self.syncThread, SIGNAL("closeSyncProgress"), self.closeSyncProgress)
|
self.connect(self.syncThread, SIGNAL("closeSyncProgress"), self.closeSyncProgress)
|
||||||
self.connect(self.syncThread, SIGNAL("updateSyncProgress"), self.updateSyncProgress)
|
self.connect(self.syncThread, SIGNAL("updateSyncProgress"), self.updateSyncProgress)
|
||||||
self.syncThread.start()
|
self.syncThread.start()
|
||||||
self.mainWin.buttonWidget.hide()
|
self.showWelcomeScreen()
|
||||||
self.mainWin.mainText.hide()
|
|
||||||
self.mainWin.welcomeText.show()
|
|
||||||
self.setEnabled(False)
|
self.setEnabled(False)
|
||||||
while not self.syncThread.isFinished():
|
while not self.syncThread.isFinished():
|
||||||
self.app.processEvents()
|
self.app.processEvents()
|
||||||
|
@ -1221,7 +1163,7 @@ To upgrade an old deck, download Anki 0.9.8.7."""))
|
||||||
|
|
||||||
def syncFinished(self):
|
def syncFinished(self):
|
||||||
"Reopen after sync finished."
|
"Reopen after sync finished."
|
||||||
self.mainWin.buttonWidget.show()
|
self.mainWin.buttonStack.show()
|
||||||
if self.loadAfterSync:
|
if self.loadAfterSync:
|
||||||
self.loadDeck(self.deckPath, sync=False)
|
self.loadDeck(self.deckPath, sync=False)
|
||||||
self.deck.syncName = self.syncName
|
self.deck.syncName = self.syncName
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle" >
|
||||||
<string>Anki - Add Items</string>
|
<string>Add Items</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout" >
|
<layout class="QVBoxLayout" name="verticalLayout" >
|
||||||
<property name="spacing" >
|
<property name="spacing" >
|
||||||
|
@ -21,15 +21,24 @@
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" >
|
||||||
|
<property name="leftMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin" >
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
<property name="horizontalSpacing" >
|
<property name="horizontalSpacing" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="verticalSpacing" >
|
<property name="verticalSpacing" >
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QWidget" native="1" name="modelArea" />
|
<widget class="QWidget" native="1" name="modelArea" />
|
||||||
</item>
|
</item>
|
||||||
|
@ -47,7 +56,7 @@
|
||||||
<property name="orientation" >
|
<property name="orientation" >
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QGroupBox" name="fieldsArea" >
|
<widget class="QWidget" native="1" name="fieldsArea" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
|
<sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
@ -57,12 +66,6 @@
|
||||||
<property name="autoFillBackground" >
|
<property name="autoFillBackground" >
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="title" >
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="flat" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QTextEdit" name="status" >
|
<widget class="QTextEdit" name="status" >
|
||||||
<property name="enabled" >
|
<property name="enabled" >
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>23</y>
|
<y>23</y>
|
||||||
<width>599</width>
|
<width>599</width>
|
||||||
<height>559</height>
|
<height>579</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout" >
|
<layout class="QVBoxLayout" name="verticalLayout" >
|
||||||
|
@ -135,19 +135,13 @@
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QGroupBox" name="fieldsArea" >
|
<widget class="QWidget" native="1" name="fieldsArea" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
|
<sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
|
||||||
<horstretch>7</horstretch>
|
<horstretch>7</horstretch>
|
||||||
<verstretch>2</verstretch>
|
<verstretch>2</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="title" >
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="flat" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1" >
|
<item row="0" column="1" >
|
||||||
|
@ -211,16 +205,6 @@
|
||||||
<addaction name="menuActions" />
|
<addaction name="menuActions" />
|
||||||
<addaction name="menuEdit" />
|
<addaction name="menuEdit" />
|
||||||
</widget>
|
</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" >
|
<action name="actionDelete" >
|
||||||
<property name="icon" >
|
<property name="icon" >
|
||||||
<iconset resource="../icons.qrc" >
|
<iconset resource="../icons.qrc" >
|
||||||
|
|
300
designer/main.ui
300
designer/main.ui
|
@ -5,8 +5,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>454</width>
|
<width>655</width>
|
||||||
<height>504</height>
|
<height>487</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
|
@ -27,8 +27,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>69</y>
|
<y>69</y>
|
||||||
<width>454</width>
|
<width>655</width>
|
||||||
<height>415</height>
|
<height>398</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
|
@ -122,43 +122,267 @@
|
||||||
<property name="frameShadow" >
|
<property name="frameShadow" >
|
||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" >
|
<layout class="QGridLayout" name="gridLayout" >
|
||||||
<property name="spacing" >
|
<item row="0" column="0" >
|
||||||
<number>0</number>
|
<widget class="QStackedWidget" name="mainStack" >
|
||||||
</property>
|
|
||||||
<property name="margin" >
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="fieldsArea" >
|
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
|
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||||
<horstretch>7</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>2</verstretch>
|
<verstretch>99</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="autoFillBackground" >
|
<property name="currentIndex" >
|
||||||
<bool>true</bool>
|
<number>1</number>
|
||||||
</property>
|
|
||||||
<property name="title" >
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="flat" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="checkable" >
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
</property>
|
||||||
|
<widget class="QWidget" name="page" >
|
||||||
|
<property name="geometry" >
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>370</width>
|
||||||
|
<height>330</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_5" >
|
||||||
|
<item>
|
||||||
|
<widget class="QTextBrowser" name="welcomeText" >
|
||||||
|
<property name="focusPolicy" >
|
||||||
|
<enum>Qt::ClickFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape" >
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="page_2" >
|
||||||
|
<property name="geometry" >
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>370</width>
|
||||||
|
<height>336</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2" >
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" native="1" name="fieldsArea" />
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="1" column="0" >
|
||||||
<widget class="QTextBrowser" name="welcomeText" >
|
<widget class="QStackedWidget" name="buttonStack" >
|
||||||
<property name="focusPolicy" >
|
<property name="currentIndex" >
|
||||||
<enum>Qt::ClickFocus</enum>
|
<number>1</number>
|
||||||
</property>
|
|
||||||
<property name="frameShape" >
|
|
||||||
<enum>QFrame::NoFrame</enum>
|
|
||||||
</property>
|
</property>
|
||||||
|
<widget class="QWidget" name="page1" >
|
||||||
|
<property name="geometry" >
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>370</width>
|
||||||
|
<height>52</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout" >
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer" >
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0" >
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>1</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="showAnswerButton" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Show Answer</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="page2" >
|
||||||
|
<property name="geometry" >
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>370</width>
|
||||||
|
<height>50</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3" >
|
||||||
|
<property name="spacing" >
|
||||||
|
<number>0</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>6</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout" >
|
||||||
|
<property name="spacing" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer" >
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0" >
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2" >
|
||||||
|
<property name="horizontalSpacing" >
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="verticalSpacing" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0" >
|
||||||
|
<widget class="QLabel" name="easeLabel1" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>TextLabel</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment" >
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1" >
|
||||||
|
<widget class="QLabel" name="easeLabel2" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>TextLabel</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment" >
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2" >
|
||||||
|
<widget class="QLabel" name="easeLabel3" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>TextLabel</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment" >
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="3" >
|
||||||
|
<widget class="QLabel" name="easeLabel4" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>TextLabel</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment" >
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" >
|
||||||
|
<widget class="QPushButton" name="easeButton1" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Again</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1" >
|
||||||
|
<widget class="QPushButton" name="easeButton2" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Hard</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2" >
|
||||||
|
<widget class="QPushButton" name="easeButton3" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Good</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="3" >
|
||||||
|
<widget class="QPushButton" name="easeButton4" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Easy</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2" >
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0" >
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="page3" >
|
||||||
|
<property name="geometry" >
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>370</width>
|
||||||
|
<height>44</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_4" >
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer_2" >
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0" >
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>1</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="saveEditorButton" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Close</string>
|
||||||
|
</property>
|
||||||
|
<property name="shortcut" >
|
||||||
|
<string>Esc</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -352,7 +576,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>454</width>
|
<width>655</width>
|
||||||
<height>23</height>
|
<height>23</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -489,8 +713,8 @@
|
||||||
<property name="geometry" >
|
<property name="geometry" >
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>484</y>
|
<y>467</y>
|
||||||
<width>454</width>
|
<width>655</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -503,7 +727,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>23</y>
|
<y>23</y>
|
||||||
<width>454</width>
|
<width>655</width>
|
||||||
<height>46</height>
|
<height>46</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
|
Loading…
Reference in a new issue