framed/centered congrats/studyopts, bigger type answer, timer spacing

This commit is contained in:
Damien Elmes 2009-02-06 16:01:46 +09:00
parent 4dea5d284a
commit f5f68a8603
4 changed files with 620 additions and 544 deletions

View file

@ -83,6 +83,7 @@ class Config(dict):
'editFontFamily': 'Arial',
'editFontSize': 12,
'factEditorAdvanced': False,
'typeAnswerFontSize': 20,
}
for (k,v) in fields.items():
if not self.has_key(k):

View file

@ -279,6 +279,7 @@ Please do not file a bug report with Anki.<br><br>""")
self.showEditor()
elif state == "saveEdit":
self.editor.saveFieldsNow()
self.mainWin.buttonStack.show()
self.deck.s.flush()
return self.moveToState("auto")
elif state == "studyScreen":
@ -440,16 +441,18 @@ new:
# ask
self.connect(self.mainWin.showAnswerButton, SIGNAL("clicked()"),
lambda: self.moveToState("showAnswer"))
self.mainWin.showAnswerButton.setFixedWidth(351)
self.mainWin.showAnswerButton.setFixedHeight(41)
# answer
for i in range(1, 5):
b = getattr(self.mainWin, "easeButton%d" % i)
b.setFixedWidth(85)
self.connect(b, SIGNAL("clicked()"),
lambda i=i: self.cardAnswered(i))
# editor
self.connect(self.mainWin.saveEditorButton, SIGNAL("clicked()"),
lambda: self.moveToState("saveEdit"))
# type answer
outer = QHBoxLayout()
self.typeAnswerSpacer1 = QSpacerItem(5, 5)
outer.addSpacerItem(self.typeAnswerSpacer1)
class QLineEditNoUndo(QLineEdit):
def __init__(self, parent):
self.parent = parent
@ -462,14 +465,21 @@ new:
else:
return QLineEdit.keyPressEvent(self, evt)
self.typeAnswerField = QLineEditNoUndo(self)
self.mainWin.typeAnswerLayout.addWidget(self.typeAnswerField)
self.typeAnswerField.setFixedWidth(351)
f = QFont()
f.setPixelSize(self.config['typeAnswerFontSize'])
self.typeAnswerField.setFont(f)
outer.addWidget(self.typeAnswerField)
self.typeAnswerSpacer2 = QSpacerItem(5, 5)
outer.addSpacerItem(self.typeAnswerSpacer2)
self.mainWin.typeAnswerPage.setLayout(outer)
def hideButtons(self):
self.mainWin.buttonStack.hide()
def showAnswerButton(self):
if self.currentCard.cardModel.typeAnswer:
self.mainWin.buttonStack.setCurrentIndex(4)
self.mainWin.buttonStack.setCurrentIndex(2)
self.typeAnswerField.setFocus()
if not unicode(self.typeAnswerField.text()):
self.typeAnswerField.setText(_(
@ -491,10 +501,6 @@ new:
else:
self.mainWin.easeButton3.setFocus()
def showSaveEditorButton(self):
self.mainWin.buttonStack.setCurrentIndex(2)
self.mainWin.buttonStack.show()
def updateEaseButtons(self):
nextInts = {}
for i in range(1, 5):
@ -946,9 +952,13 @@ To upgrade an old deck, download Anki 0.9.8.7."""))
self, self.mainWin.fieldsArea, self.deck)
self.editor.onFactValid = self.onFactValid
self.editor.onFactInvalid = self.onFactInvalid
# editor
self.connect(self.mainWin.saveEditorButton, SIGNAL("clicked()"),
lambda: self.moveToState("saveEdit"))
def showEditor(self):
self.showSaveEditorButton()
self.mainWin.buttonStack.hide()
self.switchToEditScreen()
self.editor.setFact(self.currentCard.fact)
@ -1070,8 +1080,7 @@ day = :d""", d=yesterday)
self.switchToStudyScreen()
self.updateStudyStats()
# start reviewing button
self.mainWin.buttonStack.setCurrentIndex(3)
self.mainWin.buttonStack.show()
self.mainWin.buttonStack.hide()
t = " " * 5
if initial:
self.mainWin.startReviewingButton.setText(t+_("Start &Reviewing"))

View file

@ -106,6 +106,8 @@ class StatusView(object):
self.timer.setText("00:00")
if sys.platform.startswith("darwin"):
self.timer.setFixedWidth(40)
else:
self.timer.setFixedWidth(33)
self.addWidget(self.timer)
self.plastiqueStyle = QStyleFactory.create("plastique")
self.progressBar.setStyle(self.plastiqueStyle)

View file

@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>699</width>
<height>446</height>
<width>988</width>
<height>710</height>
</rect>
</property>
<property name="sizePolicy" >
@ -27,8 +27,8 @@
<rect>
<x>0</x>
<y>69</y>
<width>699</width>
<height>357</height>
<width>988</width>
<height>621</height>
</rect>
</property>
<property name="sizePolicy" >
@ -138,7 +138,7 @@
</sizepolicy>
</property>
<property name="currentIndex" >
<number>5</number>
<number>3</number>
</property>
<widget class="QWidget" name="page1" >
<property name="geometry" >
@ -146,17 +146,44 @@
<x>0</x>
<y>0</y>
<width>422</width>
<height>59</height>
<height>57</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<property name="margin" >
<property name="spacing" >
<number>0</number>
</property>
<property name="leftMargin" >
<number>8</number>
</property>
<property name="topMargin" >
<number>4</number>
</property>
<property name="rightMargin" >
<number>8</number>
</property>
<property name="bottomMargin" >
<number>4</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4" >
<item>
<spacer name="horizontalSpacer_2" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="showAnswerButton" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Minimum" >
<sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -175,6 +202,21 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="page2" >
@ -183,7 +225,7 @@
<x>0</x>
<y>0</y>
<width>422</width>
<height>53</height>
<height>57</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3" >
@ -215,24 +257,17 @@
</spacer>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_2" >
<layout class="QGridLayout" name="answerButtonLayout" >
<property name="topMargin" >
<number>4</number>
</property>
<property name="bottomMargin" >
<number>4</number>
</property>
<property name="verticalSpacing" >
<number>0</number>
</property>
<item row="0" column="2" >
<spacer name="verticalSpacer_7" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>55</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" >
<item row="0" column="0" >
<widget class="QLabel" name="easeLabel1" >
<property name="text" >
<string/>
@ -242,7 +277,7 @@
</property>
</widget>
</item>
<item row="1" column="1" >
<item row="0" column="1" >
<widget class="QLabel" name="easeLabel2" >
<property name="text" >
<string/>
@ -252,7 +287,7 @@
</property>
</widget>
</item>
<item row="1" column="2" >
<item row="0" column="2" >
<widget class="QLabel" name="easeLabel3" >
<property name="text" >
<string/>
@ -262,7 +297,7 @@
</property>
</widget>
</item>
<item row="1" column="3" >
<item row="0" column="3" >
<widget class="QLabel" name="easeLabel4" >
<property name="text" >
<string/>
@ -272,7 +307,7 @@
</property>
</widget>
</item>
<item row="2" column="0" >
<item row="1" column="0" >
<widget class="QPushButton" name="easeButton1" >
<property name="toolTip" >
<string>Show this card again soon (shortcut key: 1)</string>
@ -282,7 +317,7 @@
</property>
</widget>
</item>
<item row="2" column="1" >
<item row="1" column="1" >
<widget class="QPushButton" name="easeButton2" >
<property name="toolTip" >
<string>Wait a little longer next time (shortcut key: 2)</string>
@ -292,7 +327,7 @@
</property>
</widget>
</item>
<item row="2" column="2" >
<item row="1" column="2" >
<widget class="QPushButton" name="easeButton3" >
<property name="toolTip" >
<string>Wait longer next time (shortcut key: 3)</string>
@ -302,7 +337,7 @@
</property>
</widget>
</item>
<item row="2" column="3" >
<item row="1" column="3" >
<widget class="QPushButton" name="easeButton4" >
<property name="toolTip" >
<string>Wait a lot longer next time (shortcut key: 4)</string>
@ -331,118 +366,23 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="page3" >
<widget class="QWidget" name="typeAnswerPage" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>422</width>
<height>53</height>
<height>57</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 class="QWidget" name="page4" >
<widget class="QWidget" name="blankButtonPage" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>422</width>
<height>53</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6" >
<item>
<spacer name="verticalSpacer_5" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="startReviewingButton" >
<property name="text" >
<string>Review</string>
</property>
<property name="icon" >
<iconset resource="../icons.qrc" >
<normaloff>:/icons/player-time.png</normaloff>:/icons/player-time.png</iconset>
</property>
<property name="iconSize" >
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="page5" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>422</width>
<height>53</height>
</rect>
</property>
<layout class="QVBoxLayout" name="typeAnswerLayout" >
<item>
<spacer name="verticalSpacer_6" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>2</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="page" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>422</width>
<height>53</height>
<width>711</width>
<height>57</height>
</rect>
</property>
</widget>
@ -457,7 +397,7 @@
</sizepolicy>
</property>
<property name="currentIndex" >
<number>0</number>
<number>4</number>
</property>
<widget class="QWidget" name="blankPage" >
<property name="geometry" >
@ -465,7 +405,7 @@
<x>0</x>
<y>0</y>
<width>422</width>
<height>304</height>
<height>300</height>
</rect>
</property>
</widget>
@ -474,8 +414,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>422</width>
<height>304</height>
<width>711</width>
<height>564</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5" >
@ -500,7 +440,7 @@
<x>0</x>
<y>0</y>
<width>422</width>
<height>304</height>
<height>300</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2" >
@ -513,6 +453,23 @@
<item>
<widget class="QWidget" native="1" name="fieldsArea" />
</item>
<item>
<widget class="QPushButton" name="saveEditorButton" >
<property name="text" >
<string>Continue Reviewing</string>
</property>
<property name="icon" >
<iconset resource="../icons.qrc" >
<normaloff>:/icons/go-previous.png</normaloff>:/icons/go-previous.png</iconset>
</property>
<property name="iconSize" >
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="optionsPage" >
@ -520,15 +477,55 @@
<rect>
<x>0</x>
<y>0</y>
<width>422</width>
<height>304</height>
<width>711</width>
<height>564</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_3" >
<property name="verticalSpacing" >
<number>0</number>
<layout class="QVBoxLayout" name="verticalLayout_4" >
<item>
<spacer name="verticalSpacer_2" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<item row="0" column="0" >
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>38</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" >
<item>
<spacer name="horizontalSpacer" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QFrame" name="frame" >
<property name="maximumSize" >
<size>
<width>450</width>
<height>16777215</height>
</size>
</property>
<property name="frameShape" >
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6" >
<item>
<layout class="QVBoxLayout" name="verticalLayout_11" >
<property name="spacing" >
<number>0</number>
@ -589,9 +586,12 @@
<property name="topMargin" >
<number>6</number>
</property>
<property name="spacing" >
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<number>4</number>
</property>
<item row="1" column="0" >
<widget class="QLabel" name="label_20" >
<property name="minimumSize" >
@ -696,7 +696,7 @@
</widget>
</item>
<item row="3" column="0" >
<layout class="QHBoxLayout" name="horizontalLayout_2" >
<layout class="QHBoxLayout" name="horizontalLayout_5" >
<property name="spacing" >
<number>6</number>
</property>
@ -791,34 +791,69 @@
</widget>
</item>
<item>
<spacer name="verticalSpacer_3" >
<spacer name="verticalSpacer" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="startReviewingButton" >
<property name="text" >
<string>Review</string>
</property>
<property name="icon" >
<iconset resource="../icons.qrc" >
<normaloff>:/icons/player-time.png</normaloff>:/icons/player-time.png</iconset>
</property>
<property name="iconSize" >
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item row="0" column="1" >
<spacer name="horizontalSpacer_4" >
<item>
<spacer name="verticalSpacer_5" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>1000</width>
<height>20</height>
<width>20</width>
<height>39</height>
</size>
</property>
</spacer>
@ -830,17 +865,52 @@
<rect>
<x>0</x>
<y>0</y>
<width>422</width>
<height>304</height>
<width>711</width>
<height>564</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9" >
<layout class="QVBoxLayout" name="verticalLayout_8" >
<item>
<spacer name="verticalSpacer_3" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>219</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3" >
<item>
<spacer name="horizontalSpacer" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QFrame" name="frame_2" >
<property name="frameShape" >
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9" >
<item>
<layout class="QVBoxLayout" name="verticalLayout_10" >
<property name="leftMargin" >
<number>6</number>
<property name="margin" >
<number>10</number>
</property>
<item>
<spacer name="verticalSpacer_10" >
@ -912,8 +982,11 @@
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="horizontalSpacer" >
<spacer name="horizontalSpacer_2" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
@ -928,14 +1001,14 @@
</layout>
</item>
<item>
<spacer name="verticalSpacer_8" >
<spacer name="verticalSpacer_6" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
<height>219</height>
</size>
</property>
</spacer>
@ -1135,7 +1208,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>699</width>
<width>988</width>
<height>23</height>
</rect>
</property>
@ -1281,11 +1354,14 @@
<property name="geometry" >
<rect>
<x>0</x>
<y>426</y>
<width>699</width>
<y>690</y>
<width>988</width>
<height>20</height>
</rect>
</property>
<property name="sizeGripEnabled" >
<bool>true</bool>
</property>
</widget>
<widget class="QToolBar" name="toolBar" >
<property name="enabled" >
@ -1295,7 +1371,7 @@
<rect>
<x>0</x>
<y>23</y>
<width>699</width>
<width>988</width>
<height>46</height>
</rect>
</property>
@ -1871,23 +1947,11 @@
</action>
</widget>
<tabstops>
<tabstop>newPerDay</tabstop>
<tabstop>minuteLimit</tabstop>
<tabstop>questionLimit</tabstop>
<tabstop>optionsButton</tabstop>
<tabstop>optionsHelpButton</tabstop>
<tabstop>newCardOrder</tabstop>
<tabstop>newCardScheduling</tabstop>
<tabstop>revCardOrder</tabstop>
<tabstop>delayLapsedCards</tabstop>
<tabstop>easeButton1</tabstop>
<tabstop>easeButton2</tabstop>
<tabstop>easeButton3</tabstop>
<tabstop>easeButton4</tabstop>
<tabstop>startReviewingButton</tabstop>
<tabstop>showAnswerButton</tabstop>
<tabstop>help</tabstop>
<tabstop>saveEditorButton</tabstop>
<tabstop>welcomeText</tabstop>
</tabstops>
<resources>
@ -1901,12 +1965,12 @@
<slot>setShown(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>54</x>
<y>202</y>
<x>203</x>
<y>322</y>
</hint>
<hint type="destinationlabel" >
<x>53</x>
<y>250</y>
<x>194</x>
<y>364</y>
</hint>
</hints>
</connection>