[Parley-devel] branches/KDE/4.2/kdeedu/parley/src

Frederik Gladhorn gladhorn at kde.org
Sun Jan 18 18:15:03 CET 2009


SVN commit 913019 by gladhorn:

Take out the new "Flash Card" practice mode as it was not ready.
I'm really unhappy about this, but never found the time to fix it properly this release cycle.
Looking forward to a much more polished 4.3.

CCMAIL:parley-devel at kde.org



 M  +29 -29    CMakeLists.txt  
 M  +2 -2      configure-practice/configurepracticewidget.cpp  
 M  +20 -25    configure-practice/configurepracticewidget.ui  
 M  +5 -5      main.cpp  
 M  +34 -33    parleymainwindow.cpp  
 M  +1 -1      parleymainwindow.h  
 M  +1 -1      practiceold/entryfilter.cpp  
 M  +0 -1      settings/parley.kcfg  


--- branches/KDE/4.2/kdeedu/parley/src/CMakeLists.txt #913018:913019
@@ -2,7 +2,7 @@
 add_subdirectory( settings )
 
 # leave themes installation in the sudir to make changes to themes easier
-add_subdirectory( practice/themes )
+#add_subdirectory( practice/themes )
 
 # libkdeedu/keduvocdocument contains the library for reading and writing vocabulary files
 include_directories( ${CMAKE_SOURCE_DIR}/libkdeedu/keduvocdocument/
@@ -75,39 +75,39 @@
     editor/editor.cpp
 )
 
-# the practice using qgraphicsview
+## the practice using qgraphicsview
 set(practice_SRCS
-    practice/kgametheme/kgametheme.cpp
-    practice/kgametheme/kgamethemeselector.cpp
-    practice/parleypracticemainwindow.cpp
-    practice/modespecifics.cpp
-    practice/modeindependent.cpp
-    practice/practiceview.cpp
-    practice/input/textualinput.cpp
-    practice/input/mcinput.cpp
-    practice/prompt/mixedlettersprompt.cpp
-    practice/prompt/textualprompt.cpp
-    practice/prompt/imageprompt.cpp
-    practice/prompt/soundprompt.cpp
-    practice/statistics/statistics.cpp
-    practice/statistics/svgbarstatistics.cpp
-    practice/stdbuttons.cpp
-    practice/answervalidator.cpp
-    practice/practiceentrymanager.cpp
-    practice/timer.cpp
-    practice/practiceentry.cpp
+	#    practice/kgametheme/kgametheme.cpp
+	#    practice/kgametheme/kgamethemeselector.cpp
+	#    practice/parleypracticemainwindow.cpp
+	#    practice/modespecifics.cpp
+	#    practice/modeindependent.cpp
+	#    practice/practiceview.cpp
+	#    practice/input/textualinput.cpp
+	#    practice/input/mcinput.cpp
+	#    practice/prompt/mixedlettersprompt.cpp
+	#    practice/prompt/textualprompt.cpp
+	#    practice/prompt/imageprompt.cpp
+	#    practice/prompt/soundprompt.cpp
+	#    practice/statistics/statistics.cpp
+	#    practice/statistics/svgbarstatistics.cpp
+	#    practice/stdbuttons.cpp
+	#    practice/answervalidator.cpp
+	#    practice/practiceentrymanager.cpp
+	#    practice/timer.cpp
+	#    practice/practiceentry.cpp
     practiceold/entryfilter.cpp
-    practice/activearea.cpp
-    practice/multiple/multipletextualprompt.cpp
-    practice/multiple/multipletextualinput.cpp
-    practice/messagebox.cpp
-    practice/summary/practicesummary.cpp
-    practice/summary/summarymodel.cpp
+	#    practice/activearea.cpp
+	#    practice/multiple/multipletextualprompt.cpp
+	#    practice/multiple/multipletextualinput.cpp
+	#    practice/messagebox.cpp
+	#    practice/summary/practicesummary.cpp
+	#    practice/summary/summarymodel.cpp
 )
 
 kde4_add_ui_files(practice_SRCS
-    practice/kgametheme/kgamethemeselector.ui
-    practice/summary/practicesummary.ui
+#    practice/kgametheme/kgamethemeselector.ui
+#    practice/summary/practicesummary.ui
     practiceold/entryfilter.ui
 )
 
--- branches/KDE/4.2/kdeedu/parley/src/configure-practice/configurepracticewidget.cpp #913018:913019
@@ -114,7 +114,7 @@
     connect(ParaphraseRadio, SIGNAL(toggled(bool)), SLOT(otherRadioToggled(bool)));
     connect(SynonymRadio, SIGNAL(toggled(bool)), SLOT(otherRadioToggled(bool)));
 
-    connect(FlashCardsRadio, SIGNAL(toggled(bool)), SLOT(flashCardsRadioToggled(bool)));
+//    connect(FlashCardsRadio, SIGNAL(toggled(bool)), SLOT(flashCardsRadioToggled(bool)));
     connect(WrittenRadio, SIGNAL(toggled(bool)), SLOT(writtenRadioToggled(bool)));
     connect(ComparisonRadio, SIGNAL(toggled(bool)), SLOT(comparisonRadioToggled(bool)));
     connect(ConjugationRadio, SIGNAL(toggled(bool)), SLOT(conjugationRadioToggled(bool)));
@@ -125,7 +125,7 @@
     connect(WrittenRadio, SIGNAL(toggled(bool)), SLOT(bilingualPracticeSelected(bool)));
     connect(MixedLettersRadio, SIGNAL(toggled(bool)), SLOT(bilingualPracticeSelected(bool)));
     connect(MultipleChoiceRadio, SIGNAL(toggled(bool)), SLOT(bilingualPracticeSelected(bool)));
-    connect(FlashCardsRadio, SIGNAL(toggled(bool)), SLOT(bilingualPracticeSelected(bool)));
+//    connect(FlashCardsRadio, SIGNAL(toggled(bool)), SLOT(bilingualPracticeSelected(bool)));
 
 
     connect(ArticleRadio, SIGNAL(toggled(bool)), SLOT(monolingualPracticeSelected(bool)));
--- branches/KDE/4.2/kdeedu/parley/src/configure-practice/configurepracticewidget.ui #913018:913019
@@ -18,28 +18,34 @@
         <string>Type of Test</string>
        </property>
        <layout class="QGridLayout" >
-        <item row="0" column="0" >
-         <widget class="QRadioButton" name="FlashCardsRadio" >
-          <property name="text" >
-           <string>Flash Cards</string>
+        <item row="6" column="0" >
+         <spacer>
+          <property name="orientation" >
+           <enum>Qt::Vertical</enum>
           </property>
-         </widget>
+          <property name="sizeHint" stdset="0" >
+           <size>
+            <width>20</width>
+            <height>0</height>
+           </size>
+          </property>
+         </spacer>
         </item>
-        <item row="1" column="0" >
+        <item row="0" column="0" >
          <widget class="QRadioButton" name="MixedLettersRadio" >
           <property name="text" >
            <string>Mixed Letters</string>
           </property>
          </widget>
         </item>
-        <item row="2" column="0" >
+        <item row="1" column="0" >
          <widget class="QRadioButton" name="MultipleChoiceRadio" >
           <property name="text" >
            <string>Multiple Choice</string>
           </property>
          </widget>
         </item>
-        <item row="3" column="0" >
+        <item row="2" column="0" >
          <widget class="QRadioButton" name="WrittenRadio" >
           <property name="toolTip" >
            <string/>
@@ -52,35 +58,22 @@
           </property>
          </widget>
         </item>
-        <item row="4" column="0" >
+        <item row="3" column="0" >
          <widget class="QRadioButton" name="ExampleRadio" >
           <property name="text" >
            <string>Example Sentences</string>
           </property>
          </widget>
         </item>
-        <item row="5" column="0" >
+        <item row="4" column="0" >
          <widget class="QRadioButton" name="ParaphraseRadio" >
           <property name="text" >
            <string>Paraphrase</string>
           </property>
          </widget>
         </item>
-        <item row="6" column="0" >
-         <spacer>
-          <property name="orientation" >
-           <enum>Qt::Vertical</enum>
-          </property>
-          <property name="sizeHint" stdset="0" >
-           <size>
-            <width>20</width>
-            <height>0</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       <item row="0" column="1" >
-         <widget class="QRadioButton" name="ArticleRadio" >
+    <item row="0" column="1" >
+        <widget class="QRadioButton" name="ArticleRadio" >
           <property name="text" >
            <string>Article Training</string>
           </property>
@@ -117,6 +110,7 @@
        </layout>
       </widget>
      </item>
+ 
      <item>
       <widget class="QGroupBox" name="OptionsGroupBox" >
        <property name="title" >
@@ -157,6 +151,7 @@
        </layout>
       </item>
      </layout>
+     <zorder>kcfg_TestType</zorder>
     </widget>
    </item>
    <item>
--- branches/KDE/4.2/kdeedu/parley/src/main.cpp #913018:913019
@@ -27,7 +27,7 @@
 #include <kapplication.h>
 
 #include "parleymainwindow.h"
-#include "practice/parleypracticemainwindow.h"
+//#include "practice/parleypracticemainwindow.h"
 #include "version.h"
 
 
@@ -126,11 +126,11 @@
             parleyApp = new ParleyMainWindow(KCmdLineArgs::appName(), args->url(0));
             args->clear();
         } else {
-            if (practiceMode) {
-                parleyApp = new ParleyPracticeMainWindow();
-            } else {
+//            if (practiceMode) {
+//                parleyApp = new ParleyPracticeMainWindow();
+//            } else {
                 parleyApp = new ParleyMainWindow(KCmdLineArgs::appName());
-            }
+//            }
         }
         if (args) {
             args->clear();
--- branches/KDE/4.2/kdeedu/parley/src/parleymainwindow.cpp #913018:913019
@@ -32,7 +32,7 @@
 #include "settings/documentproperties.h"
 #include "configure-practice/configurepracticedialog.h"
 #include "practiceold/testentrymanager.h"
-#include "practice/parleypracticemainwindow.h"
+//#include "practice/parleypracticemainwindow.h"
 #include "prefs.h"
 #include "welcomescreen/welcomescreen.h"
 
@@ -46,7 +46,7 @@
 
 #include <QtCore/QTimer>
 
-ParleyMainWindow::ParleyMainWindow(const QString& appName, const KUrl & filename) : KXmlGuiWindow(0), m_currentComponent(NoComponent), m_practice(0)
+ParleyMainWindow::ParleyMainWindow(const QString& appName, const KUrl & filename) : KXmlGuiWindow(0), m_currentComponent(NoComponent) //, m_practice(0)
 {
     m_appName = appName;
     m_document = new ParleyDocument(this);
@@ -177,32 +177,33 @@
         return;
     }
 
-    if (Prefs::testType() == Prefs::EnumTestType::FlashCardsTest) {
-        // New practice modes - for now enabled only for flash cards
-        ///@todo: instead of creating a new instance only a new document should be set
-        Component lastComponent = m_currentComponent;
-        switchComponent(NoComponent); // unload the last component (could be a practice window)
-        m_practice = new ParleyPracticeMainWindow(m_document->document(), 0);
-        switchComponent(PracticeComponent);
-        m_practice->show();
-        if (lastComponent == EditorComponent) {
-            connect(m_practice, SIGNAL(signalPracticeFinished()), this, SLOT(showEditor()));
-        } else {
-            connect(m_practice, SIGNAL(signalPracticeFinished()), this, SLOT(showWelcomeScreen()));
-        }
-        // If starting the practice fails (e.g. there are no entries selected), the signalPracticeFinished() signal
-        // is emitted in the constructor and thus before the connect
-        if (m_practice->finished() && lastComponent == EditorComponent) {
-            showEditor();
-        } else if(m_practice->finished()) {
-            showWelcomeScreen();
-        }
-    } else {
+// disable flash card mode for 4.2
+//    if (Prefs::testType() == Prefs::EnumTestType::FlashCardsTest) {
+//        // New practice modes - for now enabled only for flash cards
+//        ///@todo: instead of creating a new instance only a new document should be set
+//        Component lastComponent = m_currentComponent;
+//        switchComponent(NoComponent); // unload the last component (could be a practice window)
+//        m_practice = new ParleyPracticeMainWindow(m_document->document(), 0);
+//        switchComponent(PracticeComponent);
+//        m_practice->show();
+//        if (lastComponent == EditorComponent) {
+//            connect(m_practice, SIGNAL(signalPracticeFinished()), this, SLOT(showEditor()));
+//        } else {
+//            connect(m_practice, SIGNAL(signalPracticeFinished()), this, SLOT(showWelcomeScreen()));
+//        }
+//        // If starting the practice fails (e.g. there are no entries selected), the signalPracticeFinished() signal
+//        // is emitted in the constructor and thus before the connect
+//        if (m_practice->finished() && lastComponent == EditorComponent) {
+//            showEditor();
+//        } else if(m_practice->finished()) {
+//            showWelcomeScreen();
+//        }
+//    } else {
         hide();
         TestEntryManager testManager(m_document->document(), this);
         testManager.startPractice();
         show();
-    }
+//    }
 }
 
 bool ParleyMainWindow::queryClose()
@@ -394,10 +395,10 @@
         oldClient = m_editor;
         oldWidget = m_editor;
         break;
-    case PracticeComponent:
-        oldClient = m_practice;
-        oldWidget = m_practice;
-        break;
+//    case PracticeComponent:
+//        oldClient = m_practice;
+//        oldWidget = m_practice;
+//        break;
     default:
         break;
     }
@@ -418,11 +419,11 @@
         newWidget = m_editor;
         showDocumentActions(true, true);
         break;
-    case PracticeComponent:
-        newClient = m_practice;
-        newWidget = m_practice;
-        showDocumentActions(false, false);
-        break;
+//    case PracticeComponent:
+//        newClient = m_practice;
+//        newWidget = m_practice;
+//        showDocumentActions(false, false);
+//        break;
     default:
         break;
     }
--- branches/KDE/4.2/kdeedu/parley/src/parleymainwindow.h #913018:913019
@@ -139,7 +139,7 @@
 
     WelcomeScreen *m_welcomeScreen;
     Editor *m_editor;
-    ParleyPracticeMainWindow *m_practice;
+    //ParleyPracticeMainWindow *m_practice;
 
     KRecentFilesAction* m_recentFilesAction;
 
--- branches/KDE/4.2/kdeedu/parley/src/practiceold/entryfilter.cpp #913018:913019
@@ -34,7 +34,7 @@
         case Prefs::EnumTestType::WrittenTest:
         case Prefs::EnumTestType::MixedLettersTest:
         case Prefs::EnumTestType::MultipleChoiceTest:
-        case Prefs::EnumTestType::FlashCardsTest:
+//        case Prefs::EnumTestType::FlashCardsTest:
             m_fromTranslation = Prefs::questionLanguage();
             m_toTranslation = Prefs::solutionLanguage();
             break;
--- branches/KDE/4.2/kdeedu/parley/src/settings/parley.kcfg #913018:913019
@@ -304,7 +304,6 @@
 
     <entry name="TestType" type="Enum">
         <choices>
-            <choice name="FlashCardsTest"/>
             <choice name="MixedLettersTest"/>
             <choice name="MultipleChoiceTest"/>
             <choice name="WrittenTest"/>


More information about the Parley-devel mailing list