[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/soc-parley/parley/practice
From: David Capel <wot.narg () gmail ! com>
Date: 2008-05-27 1:04:18
Message-ID: 1211850258.911029.26993.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 813162 by capel:
TODO Updated.
Added:
Basic use of layouts for the widgets -- these will be replaced by using SVGs for \
layouts soon. A vocab shuffling function.
M +24 -4 TODO
M +46 -10 parleypracticemainwindow.cpp
M +0 -7 prompt.h
--- branches/work/soc-parley/parley/practice/TODO #813161:813162
@@ -1,12 +1,32 @@
TODO Practice
-------------
+Planning:
+
* Define which elements a theme has to contain, optional ones
* How do we realize layout
- - use a svg with rects for the layout?
- - use widgets on canvas? does that give useable layouts??
+ - use a svg with rects for the layout? [probably]
+ - use widgets on canvas? does that give useable layouts? [yes, yes]
+ - should the entire interface be on the canvas, or only parts?
+ - What needs to be included in the main UI? How can we simplify the UI?
* Define base classes for the theme elements (interface/abstract)
- * Implement the theme elements
- * Define interaction with parley - does this stay independent?
+ - Seperate out logic from interface
+ * Theme elements
+ - What should be themeable? Do we need any invariant elements?
+ * Define interaction with parley
+ - How will parleypractice be spawned?
+ - How much abstraction should be between them?
+Doing (in no particular order):
+ * Make images and sounds work
+ * Set up SVG layouts
+ * Make sure resizing the window interacts sensibly with the widgets
+ * Clean up the UI / Make it pretty
+ * Create the settings dialogs
+ * Make parleypractice honor its settings
+ * Create the statistical summary dialog
+ * Create the basic widgets
+ * Recreate various practice modes
+ * Create new practice modes
+
\ No newline at end of file
--- branches/work/soc-parley/parley/practice/parleypracticemainwindow.cpp \
#813161:813162 @@ -21,13 +21,15 @@
#include <KLineEdit>
#include <KDebug>
#include <KStandardDirs>
-// #include <QGraphicsSvgItem>
+#include <QGraphicsSvgItem>
+#include <KSvgRenderer>
#include <QGraphicsProxyWidget>
#include <QResizeEvent>
#include <QSvgRenderer>
#include <QLCDNumber>
#include <KFileDialog>
#include <QPushButton>
+#include <QGraphicsLinearLayout>
//#include "questiondisplay.h"
//#include "defaulttheme/vocabularycard.h"
@@ -50,7 +52,7 @@
QGraphicsScene* scene = new QGraphicsScene(this);
m_view->setScene(scene);
- scene->setSceneRect(0.0, 0.0, 800.0, 600.0);
+ scene->setSceneRect(0.0, 0.0, 600.0, 300.0);
m_view->setSceneRect(scene->sceneRect());
@@ -59,6 +61,12 @@
m_view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ QGraphicsSvgItem * backgroundsvg = new QGraphicsSvgItem();
+ KSvgRenderer * krenderer = new KSvgRenderer(QString("~/background.svgz"));
+ backgroundsvg->setSharedRenderer(krenderer);
+// backgroundsvg->setSize(600,300);
+ scene->addItem(backgroundsvg);
+
//kDebug() << KStandardDirs::locate("data", "parley/images/card.svg");
KEduVocDocument * doc = new KEduVocDocument(this);
@@ -69,23 +77,48 @@
TextualPrompt * prompt = new TextualPrompt();
prompt->open(doc);
- prompt->resize(100, 30);
+ prompt->setMinimumSize(100, 30);
QGraphicsProxyWidget * gprompt = scene->addWidget(prompt);
TextualInput * input = new TextualInput();
+ prompt->setMinimumSize(100, 30);
QGraphicsProxyWidget * ginput = scene->addWidget(input);
-
+
LCDStatistics * stats = new LCDStatistics();
QGraphicsProxyWidget * gstats = scene->addWidget(stats);
stats->refresh();
+
+
+ QGraphicsLinearLayout * promptAndInput = new QGraphicsLinearLayout();
+ promptAndInput->setOrientation(Qt::Vertical);
+ promptAndInput->addItem(gprompt);
+ promptAndInput->addItem(ginput);
+
+ QGraphicsWidget * gpromptAndInput = new QGraphicsWidget();
+ gpromptAndInput->setLayout(promptAndInput);
+ scene->addItem(gpromptAndInput);
+
+
+
+
StdButtons * stdbuttons = new StdButtons();
QGraphicsProxyWidget * gstdbuttons = scene->addWidget(stdbuttons);
-
+
Hint * hint = new Hint(this);
-
QPushButton * showAnswerButton = new QPushButton("Show Answer");
QGraphicsProxyWidget * gshowAnswerButton = scene->addWidget(showAnswerButton);
+
+
+ QGraphicsLinearLayout * buttons = new QGraphicsLinearLayout();
+ buttons->addItem(gshowAnswerButton);
+ buttons->addItem(gstdbuttons);
+
+ QGraphicsWidget * gbuttons = new QGraphicsWidget();
+ gbuttons->setLayout(buttons);
+ scene->addItem(gbuttons);
+
+
connect(showAnswerButton, SIGNAL(clicked()), hint, SLOT(slotShowAnswer()));
connect(prompt, SIGNAL(signalAnswerChanged(KEduVocTranslation*)), input, \
SLOT(slotSetAnswer(KEduVocTranslation*))); @@ -106,11 +139,14 @@
connect(hint, SIGNAL(signalShowAnswer()), stats, SLOT(slotAnswerShown()));
connect(hint, SIGNAL(signalShowAnswer()), stdbuttons, SLOT(slotAnswerShown()));
- gprompt->setPos(30, 100);
- ginput->setPos(60, 60);
- gstdbuttons->setPos(200, 200);
+ //gprompt->setPos(30, 100);
+ //ginput->setPos(60, 60);
+ //gstdbuttons->setPos(200, 200);
gstats->setPos(200, 100);
- gshowAnswerButton->setPos(100, 200);
+ //gshowAnswerButton->setPos(100, 200);
+
+ gpromptAndInput->setPos(10, 10);
+ gbuttons->setPos(10, 200);
//kDebug() << KStandardDirs::locate("data", "defaulttheme/layout.svg");
--- branches/work/soc-parley/parley/practice/prompt.h #813161:813162
@@ -45,8 +45,6 @@
{
public: // slots:
- /// Sets the question entry.
- //virtual void slotSetEntry(KEduVocExpression* entry);
/// Called to show a new prompt and perform other tasks to create a new \
question. virtual void slotNewPrompt() = 0;
virtual void open(KEduVocDocument*);
@@ -108,11 +106,6 @@
/// Emitted when the set of questions is finished.
void signalSetFinished();
- private:
- // these are only for the initial layout testing ;)
- QString m_test_question;
- QString m_test_answer;
- QList<QPair<QString, QString> > list;
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic