#include "keduvockvtmlwriter.h"
#include "keduvockvtmlreader.h"
+#include "leitnersystem.h"
//#include "prefs.h"
//********************************************************
doc_url.setFileName(i18n("Untitled"));
doctitle = "";
author = "";
+
+ activeLeitnerSystem = false;
+ leitnerSystem = 0;
}
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>
{
class QTextStream;
class QStringList;
class MultipleChoice;
+class LeitnerSystem;
/*************************************************************
* This class contains the expressions of your vocabulary
*/
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 );
vector<Article> articles;
vector<Conjugation> conjugations;
+
+ LeitnerSystem* leitnerSystem;
+ bool activeLeitnerSystem;
};