]> Git trees. - libqmvoc.git/commitdiff
the leitnersystem's base classes, not fully intergrated yet, no saving/loading
authorMartin Pfeiffer <hubipete@gmx.net>
Thu, 7 Jul 2005 16:27:14 +0000 (16:27 +0000)
committerMartin Pfeiffer <hubipete@gmx.net>
Thu, 7 Jul 2005 16:27:14 +0000 (16:27 +0000)
svn path=/branches/work/kwordquiz/src/leitnersystemview.cpp; revision=432508

kwordquiz/leitnerbox.cpp [new file with mode: 0644]
kwordquiz/leitnerbox.h [new file with mode: 0644]
kwordquiz/leitnersystem.cpp [new file with mode: 0644]
kwordquiz/leitnersystem.h [new file with mode: 0644]
kwordquiz/leitnersystemview.cpp [new file with mode: 0644]
kwordquiz/leitnersystemview.h [new file with mode: 0644]
kwordquiz/prefleitner.h [new file with mode: 0644]
kwordquiz/prefleitnerbase.ui [new file with mode: 0644]

diff --git a/kwordquiz/leitnerbox.cpp b/kwordquiz/leitnerbox.cpp
new file mode 100644 (file)
index 0000000..aab7fff
--- /dev/null
@@ -0,0 +1,69 @@
+//
+// C++ Implementation: leitnerbox
+//
+// Description: 
+//
+//
+// Author: Martin Pfeiffer <martin-pfeiffer-bensheim@web.de>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "leitnerbox.h"
+
+LeitnerBox::LeitnerBox()
+{
+}
+
+
+LeitnerBox::~LeitnerBox()
+{
+}
+
+int LeitnerBox::getVocabCount()
+{
+       return m_vocabCount;
+}
+
+void LeitnerBox::setVocabCount( int count )
+{
+       m_vocabCount = count;
+}
+
+const QString& LeitnerBox::getBoxName() const
+{
+       return m_name;
+}
+
+LeitnerBox* LeitnerBox::getCorrectWordBox()
+{
+       return m_correctWordBox;
+}
+
+LeitnerBox* LeitnerBox::getWrongWordBox()
+{
+       return m_wrongWordBox;
+}
+
+void LeitnerBox::setBoxName( const QString& name )
+{
+       m_name = name;
+}
+
+void LeitnerBox::setCorrectWordBox( LeitnerBox* correctWordBox )
+{
+       m_correctWordBox = correctWordBox;
+}
+
+void LeitnerBox::setWrongWordBox( LeitnerBox* wrongWordBox )
+{
+       m_wrongWordBox = wrongWordBox;
+}
+
+bool LeitnerBox::operator ==( const LeitnerBox& a ) const
+{
+       if( a.getBoxName() == getBoxName() )
+               return true;
+       else
+               return false;
+}
diff --git a/kwordquiz/leitnerbox.h b/kwordquiz/leitnerbox.h
new file mode 100644 (file)
index 0000000..bf20d6a
--- /dev/null
@@ -0,0 +1,49 @@
+//
+// C++ Interface: leitnerbox
+//
+// Description: 
+//
+//
+// Author: Martin Pfeiffer <martin-pfeiffer-bensheim@web.de>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef LEITNERBOX_H
+#define LEITNERBOX_H
+
+#include <qstring.h>
+
+/**
+@author Martin Pfeiffer
+*/
+class LeitnerBox
+{
+public:
+       LeitnerBox();
+
+       ~LeitnerBox();
+
+       void setCorrectWordBox( LeitnerBox* );  //sets the correct word box
+       void setWrongWordBox( LeitnerBox* );    //sets the wrong word box
+       void setBoxName( const QString& );      //sets the boxes name
+
+       void setVocabCount( int count );
+       int getVocabCount();
+       
+       LeitnerBox* getCorrectWordBox();        
+       LeitnerBox* getWrongWordBox();
+       const QString& getBoxName() const;
+       
+       bool operator == ( const LeitnerBox& a ) const;
+
+private:
+       QString m_name;
+
+       int m_vocabCount;
+       
+       LeitnerBox* m_wrongWordBox;
+       LeitnerBox* m_correctWordBox;
+};
+
+#endif
diff --git a/kwordquiz/leitnersystem.cpp b/kwordquiz/leitnersystem.cpp
new file mode 100644 (file)
index 0000000..178b8b9
--- /dev/null
@@ -0,0 +1,191 @@
+//
+// C++ Implementation: leitnersystem
+//
+// Description: 
+//
+//
+// Author: Martin Pfeiffer <martin-pfeiffer-bensheim@web.de>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "leitnersystem.h"
+#include <kdebug.h>
+
+LeitnerSystem::LeitnerSystem(QValueList<LeitnerBox>& boxes, QString name)
+{
+       if( !boxes.empty() )
+               m_boxes = boxes;
+
+       if( name.isNull() )
+               m_systemName = name;
+}
+
+LeitnerSystem::LeitnerSystem()
+{
+}
+
+LeitnerSystem::~LeitnerSystem()
+{
+}
+
+QStringList LeitnerSystem::getBoxNameList()
+{
+       QStringList boxNameList;
+       QValueList<LeitnerBox>::iterator it;    
+
+
+       for(it = m_boxes.begin(); it != m_boxes.end(); ++it)
+       {
+               boxNameList.append((*it).getBoxName());
+       }
+
+       return boxNameList;
+}
+
+int LeitnerSystem::getNumberOfBoxes()
+{
+       return m_boxes.count();
+}
+
+LeitnerBox* LeitnerSystem::getBoxWithNumber( int number )
+{
+       return &m_boxes[ number ];
+}
+
+LeitnerBox* LeitnerSystem::getBoxWithName( const QString& name )
+{
+       QValueList<LeitnerBox>::iterator it;
+
+       for(it = m_boxes.begin(); it != m_boxes.end(); ++it)
+       {
+               if((*it).getBoxName() == name)
+                       return &(*it);
+       }
+
+       return 0;
+}
+
+QString& LeitnerSystem::getSystemName()
+{
+       return m_systemName;
+}
+
+const QString& LeitnerSystem::getNextBox( QString& previousBox )
+{
+       for( int i = 0; i < m_boxes.count(); i++ )
+       {
+               if( m_boxes[i].getVocabCount() > 0 )
+                       return getBox( i );
+       }
+       
+       return QString::null;
+}
+
+const QString& LeitnerSystem::getCorrectBox( int box )
+{
+       return m_boxes[ box ].getCorrectWordBox()->getBoxName();
+}
+
+const QString& LeitnerSystem::getWrongBox( int box )
+{
+       return m_boxes[ box ].getWrongWordBox()->getBoxName();
+}
+
+int LeitnerSystem::getWrongBoxNumber( int box )
+{
+       return getNumber( m_boxes[ box ].getWrongWordBox() );
+}
+
+int LeitnerSystem::getCorrectBoxNumber( int box )
+{
+       return getNumber( m_boxes[ box ].getCorrectWordBox() );
+}
+
+void LeitnerSystem::deleteBox( int box )
+{
+       m_boxes.remove( m_boxes.at( box ) );
+}
+
+void LeitnerSystem::deleteBox( LeitnerBox* box )
+{
+       m_boxes.remove( *box ); 
+}
+
+bool LeitnerSystem::insertBox( const QString& name, int correctWordBox, int wrongWordBox )
+{
+       if( getBoxNameList().contains( name ) != 0 )
+               return false;
+       
+       LeitnerBox tmpBox;
+       tmpBox.setBoxName( name );
+       tmpBox.setCorrectWordBox( getBoxWithNumber( correctWordBox ) );
+       tmpBox.setWrongWordBox( getBoxWithNumber( wrongWordBox ) );
+       
+       m_boxes.append( tmpBox );
+       return true;
+}
+
+void LeitnerSystem::setSystemName( const QString& name )
+{
+       m_systemName = name;
+}
+
+int LeitnerSystem::getNumber( LeitnerBox* box )
+{
+       if( m_boxes.findIndex( *box ) == -1 )
+               kdDebug() << "muhaha" << endl;
+       return m_boxes.findIndex( *box );
+}
+
+bool LeitnerSystem::setBoxName( int box, const QString& name )
+{
+       if( getBoxWithName( name ) == 0 || getBoxWithName( name ) == getBoxWithNumber( box ) )
+       {
+               getBoxWithNumber( box )->setBoxName( name );
+               
+               return true;
+       }
+       else
+               return false;
+}
+
+bool LeitnerSystem::setBoxName( LeitnerBox* box, const QString& name )
+{
+       if( getBoxWithName( name ) == 0 || getBoxWithName( name ) == box )
+       {
+               box->setBoxName( name );
+               
+               return true;
+       }
+       else
+               return false;
+}
+
+bool LeitnerSystem::insertBox( const QString& name )
+{
+       if( getBoxNameList().contains( name ) != 0 )
+               return false;
+       
+       LeitnerBox tmpBox;
+       tmpBox.setBoxName( name );
+       //tmpBox.setVocabCount( count );
+               
+       m_boxes.append( tmpBox );
+       return true;
+}
+
+void LeitnerSystem::setCorrectBox( const QString& box, const QString& correctWordBox )
+{
+       getBoxWithName( box )->setCorrectWordBox( getBoxWithName( correctWordBox ) );
+}
+
+void LeitnerSystem::setWrongBox( const QString& box, const QString& wrongWordBox )
+{
+       getBoxWithName( box )->setWrongWordBox( getBoxWithName( wrongWordBox ) );
+}
+
+const QString& LeitnerSystem::getBox( int i )
+{
+       return getBoxWithNumber( i )->getBoxName();
+}
diff --git a/kwordquiz/leitnersystem.h b/kwordquiz/leitnersystem.h
new file mode 100644 (file)
index 0000000..87e583d
--- /dev/null
@@ -0,0 +1,67 @@
+//
+// C++ Interface: leitnersystem
+//
+// Description: 
+//
+//
+// Author: Martin Pfeiffer <martin-pfeiffer-bensheim@web.de>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qvaluelist.h>
+#include "leitnerbox.h"
+
+#ifndef LEITNERSYSTEM_H
+#define LEITNERSYSTEM_H
+
+
+/**
+@author Martin Pfeiffer
+*/
+class LeitnerSystem
+{
+public:
+       LeitnerSystem();
+       LeitnerSystem( QValueList<LeitnerBox>& boxes, QString name );
+
+       ~LeitnerSystem();
+
+       int getNumberOfBoxes();                         //returns the number of boxes in the system
+       QStringList getBoxNameList();                   //returns a list with the boxes names
+
+       QString& getSystemName();                       //returns the systems name
+       void setSystemName( const QString& name );              //sets the systems name
+
+       LeitnerBox* getBoxWithNumber( int number );     //returns box by number
+       LeitnerBox* getBoxWithName( const QString& name );//returns box by name
+       int getNumber( LeitnerBox* box );
+       const QString& getBox( int i );
+       
+       const QString& getNextBox( QString& previousBox );      //returns the next box for the next question
+       
+       const QString& getCorrectBox( int box );        //returns the correct word box of "int box"
+       const QString& getWrongBox( int box );          //returns the wrong word box of "int box"
+       int getWrongBoxNumber( int box );
+       int getCorrectBoxNumber( int box );
+       void setCorrectBox( const QString& box, const QString& correctWordBox );
+       void setWrongBox( const QString& box, const QString& wrongWordBox );
+       bool setBoxName( int box, const QString& name );
+       bool setBoxName( LeitnerBox* box, const QString& name );
+       
+       //inserts a box with number, name, correct and wrong word box
+       bool insertBox( const QString& name, int correctWordBox, int wrongWordBox );
+       bool insertBox( const QString& name );
+       void deleteBox( int box );
+       void deleteBox( LeitnerBox* box );
+
+private:
+       QString m_systemName;                           //the systems name
+
+       QValueList<LeitnerBox> m_boxes;
+};
+
+#endif
diff --git a/kwordquiz/leitnersystemview.cpp b/kwordquiz/leitnersystemview.cpp
new file mode 100644 (file)
index 0000000..3dcd5b0
--- /dev/null
@@ -0,0 +1,217 @@
+//
+// C++ Implementation: leitnersystemview
+//
+// Description: 
+//
+//
+// Author: Martin Pfeiffer <martin-pfeiffer-bensheim@web.de>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "leitnersystemview.h"
+
+#include "leitnersystem.h"
+#include "kwordquiz.h"
+
+#include <stdlib.h>
+#include <kiconloader.h>
+#include <qpainter.h>
+
+#include <kdebug.h>
+
+LeitnerSystemView::LeitnerSystemView(QWidget * parent, const char* name, WFlags f)
+ : QScrollView(parent, name, f)
+{
+       m_highlightedBox = -1;
+}
+
+
+LeitnerSystemView::~LeitnerSystemView()
+{
+}
+
+void LeitnerSystemView::drawSystem(QPainter* p)
+{
+       kdDebug() << "drawSystem( )" << endl;
+       
+
+       //einarbeiten von m_selectedBox... aus prefLeitner
+       
+       m_imageY = height() / 2 - 32;
+
+       //draw the boxes' icons
+       for(int i = 0; i < m_leitnerSystem->getNumberOfBoxes(); i++)
+       {
+               if(i == m_highlightedBox)
+               {
+                       //p->drawPixmap(12 + i * 64 + i*10, m_imageY, KGlobal::iconLoader()->loadIcon("leitnerbox", KIcon::Panel));
+                       p->drawRect(12 + i * 64 + i*10, m_imageY,64,64);
+                       p->fillRect(12 + i * 64 + i*10, m_imageY,64,64, QBrush(red));
+               }
+               else
+               {       //for each box 74 = 64(pixmap) + 10(distance between two boxes)
+                       //p->drawPixmap(12 + i * 74, m_imageY, KGlobal::iconLoader()->loadIcon("leitnerbox", KIcon::Panel)); 
+                       p->drawRect(12 + i * 64 + i*10, m_imageY,64,64);
+               }
+       }
+}
+
+void LeitnerSystemView::drawConnections(QPainter* p)
+{
+       //dist = number of boxes that are in between the two boxes
+       //width = width of the rect for the arc
+       int dist, width = 0;
+       int numberOfBoxes = m_leitnerSystem->getNumberOfBoxes();
+       
+       p->setPen( QPen(green, 2) );
+
+       //paint the connections for the correct word boxes, above the boxes 
+       for(int i = 0; i < numberOfBoxes; i++)
+       {
+               dist = m_leitnerSystem->getCorrectBoxNumber( i ) - i;
+                               
+               if(dist <= 0)
+               {
+                       // (dist*(-1) -1)*64 == for each box in between take 64
+                       // dist*(-1)*10 == the gaps in between
+                       // 2*22; 2*21 == the distances of the endings on the picture 
+                       width = (dist*(-1) -1)*64 + dist*(-1)*10 + 2*22 + 2*21; 
+                        
+                       p->drawArc( 12 + (dist+i)*74 + 21, m_imageY-(width/3), width, /*(height()/2 - 12-32) *2*/ width/3*2, 0, 180*16);
+               }
+               else
+               {
+                       width = (dist-1)*64 + dist*10 + 2*21;
+                       p->drawArc(12 + i*74 + 21+22 ,m_imageY-(width/3) , width, /*(height()/2 - 12-32) *2*/width/3*2, 0, 180*16);
+               }
+               
+       }
+       
+       //paint the connections for the wrong word boxes, below the boxes
+       p->setPen(QPen(red, 2));
+
+       for(int i = 0; i < numberOfBoxes; i++)
+       {
+               dist = m_leitnerSystem->getWrongBoxNumber( i ) - i;
+                               
+               if(dist <= 0)
+               {
+                       width = (dist*(-1) -1)*64 + dist*(-1)*10 + 2*22 + 2*21; 
+                       p->drawArc(12+ (dist+i)*74 + 21 ,m_imageY+64-width/3 , width, width/3*2 , 180*16, 180*16);
+               }
+               else
+               {
+                       width = (dist-1)*64 + dist*10 + 2*21;
+                       p->drawArc(12 + i*74 + 21+22 ,m_imageY+64-width/3 , width, width/3*2, 180*16, 180*16);
+               }
+       }
+
+}
+
+void LeitnerSystemView::setSystem(LeitnerSystem* leitnersystem)
+{
+       m_leitnerSystem = leitnersystem;
+       
+       //calculate the new sizes
+       calculateSize();
+       updateContents();
+       //repaint
+       //update();
+       //QPainter* p = new QPainter(this);
+       //drawContents( p, 0, 0, 0, 0 );
+}
+
+void LeitnerSystemView::highlightBox(int box)
+{
+       m_highlightedBox = box;
+       updateContents();
+}
+
+void LeitnerSystemView::drawContents(QPainter* p, int clipx, int clipy, int clipw, int cliph)
+{
+       kdDebug() << "drawContents" << endl;
+       p->eraseRect(0,0,width(),height()); 
+       
+       drawSystem( p );
+       
+       drawConnections( p );
+}
+
+void LeitnerSystemView::calculateSize()
+{
+       //margin = 12
+       //distance between boxes = 10
+       //boxes = 64*64
+       
+       int numberOfBoxes = m_leitnerSystem->getNumberOfBoxes();
+       QString x;
+       int height, dist, tmpMaxC, tmpMaxW;
+       tmpMaxC = 0;
+       tmpMaxW = 0;    
+       height = 0;
+
+       for(int i = 0; i < numberOfBoxes; i++)
+       {
+               dist = m_leitnerSystem->getCorrectBoxNumber( i ) - i;
+                               
+               if( abs(dist) >= abs(tmpMaxC) )
+                       tmpMaxC = dist;
+       
+               dist = m_leitnerSystem->getWrongBoxNumber( i ) - i;
+               
+               if( abs(dist) >= abs(tmpMaxW) )
+                       tmpMaxW = dist;
+       }
+       
+       if( tmpMaxC <= 0 )
+               height += (( abs(tmpMaxC) -1)*64 + abs(tmpMaxC)*10 + 2*22 + 2*21)/3;
+       else
+               height += (( tmpMaxC-1)*64 + tmpMaxC*10 + 2*21)/3;
+       
+       if( tmpMaxW <= 0 )
+               height += (( abs(tmpMaxW) -1)*64 + abs(tmpMaxW)*10 + 2*22 + 2*21)/3;
+       else
+               height += (( tmpMaxW-1)*64 + tmpMaxW*10 + 2*21)/3;
+
+       height += 24+64;
+       
+       resizeContents( numberOfBoxes * 64 + (numberOfBoxes - 1)*10 + 2 * 12, height );
+       setMinimumSize( numberOfBoxes * 64 + (numberOfBoxes - 1)*10 + 2 * 12, height );
+}
+
+void LeitnerSystemView::mousePressEvent(QMouseEvent* e)
+{
+       kdDebug() << "mouseClick" << endl;
+       //if the user has clicked into a box
+       if(e->y() > m_imageY && e->y() < m_imageY + 64 && e->x() < width()-13)
+       {
+               int d = (e->x()-12)/74;
+               
+               if((e->x()-12-74*d) <= 64)
+               {
+                       //signal for prefLeitner to set the comboboxes to the clicked box
+                       emit boxClicked( d );
+                       m_highlightedBox = d;
+                       
+                       updateContents();
+               }
+               else
+               {
+                       emit boxClicked( -1 );
+                       m_highlightedBox = -1;
+                       
+                       updateContents();
+               }
+       }
+       else
+       {
+               emit boxClicked( -1 );
+               m_highlightedBox = -1;
+                       
+               updateContents();
+       }
+}
+
+#include "leitnersystemview.moc"
+
diff --git a/kwordquiz/leitnersystemview.h b/kwordquiz/leitnersystemview.h
new file mode 100644 (file)
index 0000000..be52bc0
--- /dev/null
@@ -0,0 +1,57 @@
+//
+// C++ Interface: leitnersystemview
+//
+// Description: 
+//
+//
+// Author: Martin Pfeiffer <martin-pfeiffer-bensheim@web.de>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef LEITNERSYSTEMVIEW_H
+#define LEITNERSYSTEMVIEW_H
+
+#include <qscrollview.h>
+#include <qpixmap.h>
+
+class LeitnerSystem;
+
+
+/**
+@author Martin Pfeiffer
+*/
+
+class LeitnerSystemView : public QScrollView
+{
+       Q_OBJECT
+               
+public:
+    LeitnerSystemView(QWidget* parent = 0, const char* name = 0, WFlags f = 0);
+
+    ~LeitnerSystemView();
+
+    void setSystem(LeitnerSystem* system);     //set a new system to view on
+    void highlightBox(int box);                        //highlight a box
+
+signals:
+       void boxClicked(int box);               //is emited if the user clicks on a box 
+
+protected:
+    virtual void drawContents(QPainter* p, int clipx, int clipy, int clipw, int cliph);
+    virtual void mousePressEvent(QMouseEvent* e);
+
+private:
+       LeitnerSystem* m_leitnerSystem;         //the system which is shown
+
+       void drawSystem(QPainter*);             //paints the boxes
+       void drawConnections(QPainter*);                //paints the arrows between the boxes
+       void calculateSize();
+
+       //QRect m_viewArea;
+       int m_imageY;                           //high border of the images
+       int m_distPixmap;
+       int m_highlightedBox;                   //the box which is currently highlighted
+};
+
+#endif
diff --git a/kwordquiz/prefleitner.h b/kwordquiz/prefleitner.h
new file mode 100644 (file)
index 0000000..09ecae1
--- /dev/null
@@ -0,0 +1,56 @@
+//
+// C++ Interface: prefleitner
+//
+// Description: the part of the preferences to change the settings for the LeitnerSystem
+//
+//
+// Author: Martin Pfeiffer <martin-pfeiffer-bensheim@web.de>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef PREFLEITNER_H
+#define PREFLEITNER_H
+
+#include <prefleitnerbase.h>
+
+class LeitnerSystemView;
+class LeitnerSystem;
+class LeitnerBox;
+
+/**
+@author Martin Pfeiffer
+*/
+class PrefLeitner : public PrefLeitnerBase
+{
+       Q_OBJECT
+       
+public:
+       PrefLeitner(QWidget * parent, const char* name, WFlags f, LeitnerSystem* system);
+
+       ~PrefLeitner();
+       
+       LeitnerSystem* getSystem();
+
+public slots:
+       void slotCorrectWord( const QString& newBox );
+       void slotWrongWord( const QString& newBox );
+       void slotBoxName( const QString& newName );
+       void slotAddBox();
+       void slotDeleteBox();
+       void slotDiscard();
+       void slotApply();
+
+private slots:
+       void slotBoxClicked(int);               //catches the signal from the view if user clicks on box
+
+private:
+       LeitnerSystemView* m_leitnerSystemView; //the LeitnerSystemView which shows the selected system
+       LeitnerSystem* m_selectedSystem;        //the currently selected system to be changed
+       LeitnerBox* m_selectedBox;              //the currently selected box
+
+       void refreshSystemView();               //refresh the LeitnerSystemView
+       void newSystem();
+};
+
+#endif
diff --git a/kwordquiz/prefleitnerbase.ui b/kwordquiz/prefleitnerbase.ui
new file mode 100644 (file)
index 0000000..1a154c1
--- /dev/null
@@ -0,0 +1,247 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>PrefLeitnerBase</class>
+<widget class="QDialog">
+    <property name="name">
+        <cstring>PrefLeitnerBase</cstring>
+    </property>
+    <property name="geometry">
+        <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>770</width>
+            <height>458</height>
+        </rect>
+    </property>
+    <property name="caption">
+        <string>Leitner System</string>
+    </property>
+    <grid>
+        <property name="name">
+            <cstring>unnamed</cstring>
+        </property>
+        <widget class="QLayoutWidget" row="0" column="0">
+            <property name="name">
+                <cstring>layout5</cstring>
+            </property>
+            <grid>
+                <property name="name">
+                    <cstring>unnamed</cstring>
+                </property>
+                <widget class="QPushButton" row="3" column="3">
+                    <property name="name">
+                        <cstring>btnApply</cstring>
+                    </property>
+                    <property name="text">
+                        <string>Appl&amp;y Changes</string>
+                    </property>
+                    <property name="accel">
+                        <string>Alt+Y</string>
+                    </property>
+                </widget>
+                <spacer row="3" column="0" rowspan="1" colspan="2">
+                    <property name="name">
+                        <cstring>spacer2</cstring>
+                    </property>
+                    <property name="orientation">
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property name="sizeType">
+                        <enum>Expanding</enum>
+                    </property>
+                    <property name="sizeHint">
+                        <size>
+                            <width>421</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget class="QLayoutWidget" row="0" column="1" rowspan="3" colspan="1">
+                    <property name="name">
+                        <cstring>lytBoxName</cstring>
+                    </property>
+                    <grid>
+                        <property name="name">
+                            <cstring>unnamed</cstring>
+                        </property>
+                        <widget class="QLineEdit" row="1" column="0">
+                            <property name="name">
+                                <cstring>lndBoxName</cstring>
+                            </property>
+                        </widget>
+                        <widget class="QLabel" row="0" column="0">
+                            <property name="name">
+                                <cstring>lblBoxName</cstring>
+                            </property>
+                            <property name="text">
+                                <string>Edit box name:</string>
+                            </property>
+                        </widget>
+                    </grid>
+                </widget>
+                <widget class="QPushButton" row="3" column="2">
+                    <property name="name">
+                        <cstring>btnDiscard</cstring>
+                    </property>
+                    <property name="text">
+                        <string>Disc&amp;ard Changes</string>
+                    </property>
+                    <property name="accel">
+                        <string>Alt+A</string>
+                    </property>
+                </widget>
+                <widget class="QPushButton" row="1" column="0">
+                    <property name="name">
+                        <cstring>btnAddBox</cstring>
+                    </property>
+                    <property name="text">
+                        <string>Add a bo&amp;x</string>
+                    </property>
+                    <property name="accel">
+                        <string>Alt+X</string>
+                    </property>
+                </widget>
+                <widget class="QPushButton" row="2" column="0">
+                    <property name="name">
+                        <cstring>btnDeleteBox</cstring>
+                    </property>
+                    <property name="text">
+                        <string>Delete selected &amp;box</string>
+                    </property>
+                    <property name="accel">
+                        <string>Alt+B</string>
+                    </property>
+                </widget>
+                <widget class="QLayoutWidget" row="0" column="2" rowspan="3" colspan="2">
+                    <property name="name">
+                        <cstring>lytWrongCorrect</cstring>
+                    </property>
+                    <grid>
+                        <property name="name">
+                            <cstring>unnamed</cstring>
+                        </property>
+                        <widget class="QLabel" row="0" column="0">
+                            <property name="name">
+                                <cstring>lblCorrect</cstring>
+                            </property>
+                            <property name="paletteBackgroundColor">
+                                <color>
+                                    <red>0</red>
+                                    <green>255</green>
+                                    <blue>0</blue>
+                                </color>
+                            </property>
+                            <property name="text">
+                                <string>Correct words to:</string>
+                            </property>
+                        </widget>
+                        <widget class="QComboBox" row="0" column="1">
+                            <property name="name">
+                                <cstring>cmbCorrect</cstring>
+                            </property>
+                        </widget>
+                        <widget class="QLabel" row="1" column="0">
+                            <property name="name">
+                                <cstring>lblWrong</cstring>
+                            </property>
+                            <property name="paletteBackgroundColor">
+                                <color>
+                                    <red>255</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                            </property>
+                            <property name="text">
+                                <string>Wrong words to:</string>
+                            </property>
+                        </widget>
+                        <widget class="QComboBox" row="1" column="1">
+                            <property name="name">
+                                <cstring>cmbWrong</cstring>
+                            </property>
+                            <property name="paletteBackgroundColor">
+                                <color>
+                                    <red>253</red>
+                                    <green>253</green>
+                                    <blue>253</blue>
+                                </color>
+                            </property>
+                        </widget>
+                    </grid>
+                </widget>
+                <spacer row="0" column="0">
+                    <property name="name">
+                        <cstring>spacer1</cstring>
+                    </property>
+                    <property name="orientation">
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property name="sizeType">
+                        <enum>Expanding</enum>
+                    </property>
+                    <property name="sizeHint">
+                        <size>
+                            <width>252</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+            </grid>
+        </widget>
+    </grid>
+</widget>
+<connections>
+    <connection>
+        <sender>cmbCorrect</sender>
+        <signal>activated(const QString&amp;)</signal>
+        <receiver>PrefLeitnerBase</receiver>
+        <slot>slotCorrectWord(const QString&amp;)</slot>
+    </connection>
+    <connection>
+        <sender>cmbWrong</sender>
+        <signal>activated(const QString&amp;)</signal>
+        <receiver>PrefLeitnerBase</receiver>
+        <slot>slotWrongWord(const QString&amp;)</slot>
+    </connection>
+    <connection>
+        <sender>lndBoxName</sender>
+        <signal>textChanged(const QString&amp;)</signal>
+        <receiver>PrefLeitnerBase</receiver>
+        <slot>slotBoxName(const QString&amp;)</slot>
+    </connection>
+    <connection>
+        <sender>btnAddBox</sender>
+        <signal>clicked()</signal>
+        <receiver>PrefLeitnerBase</receiver>
+        <slot>slotAddBox()</slot>
+    </connection>
+    <connection>
+        <sender>btnDeleteBox</sender>
+        <signal>clicked()</signal>
+        <receiver>PrefLeitnerBase</receiver>
+        <slot>slotDeleteBox()</slot>
+    </connection>
+    <connection>
+        <sender>btnApply</sender>
+        <signal>clicked()</signal>
+        <receiver>PrefLeitnerBase</receiver>
+        <slot>slotDiscard()</slot>
+    </connection>
+    <connection>
+        <sender>btnDiscard</sender>
+        <signal>clicked()</signal>
+        <receiver>PrefLeitnerBase</receiver>
+        <slot>slotApply()</slot>
+    </connection>
+</connections>
+<slots>
+    <slot>slotBoxName(const QString&amp;)</slot>
+    <slot>slotSystem(const QString&amp;)</slot>
+    <slot>slotWrongWord(const QString&amp;)</slot>
+    <slot>slotCorrectWord(const QString&amp;)</slot>
+    <slot>slotAddBox()</slot>
+    <slot>slotDeleteBox()</slot>
+    <slot>slotDiscard()</slot>
+    <slot>slotApply()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>