[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/kwordquiz/src
From: Martin Pfeiffer <hubipete () gmx ! net>
Date: 2005-07-08 14:39:47
Message-ID: 1120833587.535647.6262.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 432783 by mpfeiffer:
some little changes
M +65 -0 keduvocdocument.cpp
M +10 -0 keduvocdocument.h
--- branches/work/kwordquiz/src/keduvocdocument.cpp #432782:432783
@@ -37,6 +37,7 @@
#include "keduvockvtmlwriter.h"
#include "keduvockvtmlreader.h"
+#include "leitnersystem.h"
//#include "prefs.h"
//********************************************************
@@ -86,6 +87,9 @@
doc_url.setFileName(i18n("Untitled"));
doctitle = "";
author = "";
+
+ activeLeitnerSystem = false;
+ leitnerSystem = 0;
}
@@ -661,7 +665,68 @@
return sort_lesson;
}
+bool KEduVocDocument::leitnerSystemActive()
+{
+ return activeLeitnerSystem;
+}
+void KEduVocDocument::setLeitnerSystemActive( bool yes )
+{
+ if( yes )
+ {
+ if( leitnerSystem == 0 )
+ createStandardLeitnerSystem(); //if nothing is loaded yet
+
+ activeLeitnerSystem = true;
+ }
+ else if( !yes )
+ activeLeitnerSystem = false;
+}
+
+void KEduVocDocument::createStandardLeitnerSystem()
+{
+ LeitnerSystem* tmpSystem = new LeitnerSystem();
+ QString name = "Standard";
+
+ tmpSystem->setSystemName( name );
+ tmpSystem->insertBox( "Box 1" );
+ tmpSystem->insertBox( "Box 2" );
+ tmpSystem->insertBox( "Box 3" );
+ tmpSystem->insertBox( "Box 4" );
+ tmpSystem->insertBox( "Box 5" );
+
+ tmpSystem->setCorrectBox( "Box 1", "Box 2" );
+ tmpSystem->setWrongBox( "Box 1", "Box 1" );
+
+ tmpSystem->setCorrectBox( "Box 2", "Box 3" );
+ tmpSystem->setWrongBox( "Box 2", "Box 1" );
+
+ tmpSystem->setCorrectBox( "Box 3", "Box 4" );
+ tmpSystem->setWrongBox( "Box 3", "Box 1" );
+
+ tmpSystem->setCorrectBox( "Box 4", "Box 5" );
+ tmpSystem->setWrongBox( "Box 4", "Box 1" );
+
+ tmpSystem->setCorrectBox( "Box 5", "Box 1" );
+ tmpSystem->setWrongBox( "Box 5", "Box 1" );
+
+ leitnerSystem = tmpSystem;
+}
+
+void KEduVocDocument::setLeitnerSystem( LeitnerSystem* system )
+{
+ leitnerSystem = system;
+
+ /*KWordQuizApp* app = (KWordQuizApp*) parent();
+ app->slotLeitnerSystem();*/
+}
+
+LeitnerSystem* KEduVocDocument::getLeitnerSystem()
+{
+ return leitnerSystem;
+}
+
+
class resetAll : public unary_function<KEduVocExpression, void>
{
--- branches/work/kwordquiz/src/keduvocdocument.h #432782:432783
@@ -243,6 +243,7 @@
class QTextStream;
class QStringList;
class MultipleChoice;
+class LeitnerSystem;
/*************************************************************
* This class contains the expressions of your vocabulary
@@ -590,6 +591,12 @@
*/
void setSizeHint (int index, const int width);
+ bool leitnerSystemActive();
+ void setLeitnerSystemActive(bool yes);
+ void createStandardLeitnerSystem();
+ void setLeitnerSystem( LeitnerSystem* system );
+ LeitnerSystem* getLeitnerSystem();
+
bool unknownAttribute (int line, const QString &name, const QString &attr);
void unknownElement (int line, const QString &elem );
void errorKvtMl (int line, const QString &text );
@@ -671,6 +678,9 @@
vector<Article> articles;
vector<Conjugation> conjugations;
+
+ LeitnerSystem* leitnerSystem;
+ bool activeLeitnerSystem;
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic