|
|
|
@ -68,7 +68,7 @@ KWordQuizApp::KWordQuizApp(TQWidget* , const char* name):KMainWindow(0, name)
|
|
|
|
|
initView();
|
|
|
|
|
|
|
|
|
|
m_dirWatch = KDirWatch::self();
|
|
|
|
|
m_quizType = WTQQuiz::qtEditor;
|
|
|
|
|
m_quizType = WQQuiz::qtEditor;
|
|
|
|
|
m_quiz = 0;
|
|
|
|
|
m_flashView = 0;
|
|
|
|
|
m_multipleView = 0;
|
|
|
|
@ -568,7 +568,7 @@ void KWordQuizApp::slotFileSave()
|
|
|
|
|
void KWordQuizApp::slotFileGHNS()
|
|
|
|
|
{
|
|
|
|
|
if (!m_newStuff)
|
|
|
|
|
m_newStuff = new KWTQNewStuff(this);
|
|
|
|
|
m_newStuff = new KWQNewStuff(this);
|
|
|
|
|
m_newStuff->download();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -660,7 +660,7 @@ void KWordQuizApp::slotFileClose()
|
|
|
|
|
void KWordQuizApp::slotFilePrint()
|
|
|
|
|
{
|
|
|
|
|
slotStatusMsg(i18n("Printing..."));
|
|
|
|
|
WTQPrintDialogPage * p = new WTQPrintDialogPage(this);
|
|
|
|
|
WQPrintDialogPage * p = new WQPrintDialogPage(this);
|
|
|
|
|
KPrinter printer;
|
|
|
|
|
printer.addDialogPage(p);
|
|
|
|
|
printer.setFullPage(true);
|
|
|
|
@ -885,32 +885,32 @@ void KWordQuizApp::slotMode5()
|
|
|
|
|
void KWordQuizApp::slotQuizEditor()
|
|
|
|
|
{
|
|
|
|
|
slotStatusMsg(i18n("Starting editor session..."));
|
|
|
|
|
updateSession(WTQQuiz::qtEditor);
|
|
|
|
|
updateSession(WQQuiz::qtEditor);
|
|
|
|
|
slotStatusMsg(i18n("Ready"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KWordQuizApp::slotQuizFlash()
|
|
|
|
|
{
|
|
|
|
|
slotStatusMsg(i18n("Starting flashcard session..."));
|
|
|
|
|
updateSession(WTQQuiz::qtFlash);
|
|
|
|
|
updateSession(WQQuiz::qtFlash);
|
|
|
|
|
slotStatusMsg(i18n("Ready"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KWordQuizApp::slotQuizMultiple()
|
|
|
|
|
{
|
|
|
|
|
slotStatusMsg(i18n("Starting multiple choice session..."));
|
|
|
|
|
updateSession(WTQQuiz::qtMultiple);
|
|
|
|
|
updateSession(WQQuiz::qtMultiple);
|
|
|
|
|
slotStatusMsg(i18n("Ready"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KWordQuizApp::slotQuizQA()
|
|
|
|
|
{
|
|
|
|
|
slotStatusMsg(i18n("Starting question & answer session..."));
|
|
|
|
|
updateSession(WTQQuiz::qtQA);
|
|
|
|
|
updateSession(WQQuiz::qtQA);
|
|
|
|
|
slotStatusMsg(i18n("Ready"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KWordQuizApp::updateSession(WTQQuiz::QuizType qt)
|
|
|
|
|
void KWordQuizApp::updateSession(WQQuiz::QuizType qt)
|
|
|
|
|
{
|
|
|
|
|
if (m_quiz != 0)
|
|
|
|
|
{
|
|
|
|
@ -919,24 +919,24 @@ void KWordQuizApp::updateSession(WTQQuiz::QuizType qt)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch( m_quizType ){
|
|
|
|
|
case WTQQuiz::qtEditor:
|
|
|
|
|
case WQQuiz::qtEditor:
|
|
|
|
|
//
|
|
|
|
|
break;
|
|
|
|
|
case WTQQuiz::qtFlash:
|
|
|
|
|
case WQQuiz::qtFlash:
|
|
|
|
|
if (m_flashView != 0)
|
|
|
|
|
{
|
|
|
|
|
delete(m_flashView);
|
|
|
|
|
m_flashView = 0;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case WTQQuiz::qtMultiple:
|
|
|
|
|
case WQQuiz::qtMultiple:
|
|
|
|
|
if (m_multipleView != 0)
|
|
|
|
|
{
|
|
|
|
|
delete(m_multipleView);
|
|
|
|
|
m_multipleView = 0;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case WTQQuiz::qtQA:
|
|
|
|
|
case WQQuiz::qtQA:
|
|
|
|
|
if (m_qaView != 0)
|
|
|
|
|
{
|
|
|
|
|
delete(m_qaView);
|
|
|
|
@ -949,15 +949,15 @@ void KWordQuizApp::updateSession(WTQQuiz::QuizType qt)
|
|
|
|
|
updateActions(qt);
|
|
|
|
|
|
|
|
|
|
switch( m_quizType ){
|
|
|
|
|
case WTQQuiz::qtEditor:
|
|
|
|
|
case WQQuiz::qtEditor:
|
|
|
|
|
m_editView->show();
|
|
|
|
|
setCentralWidget(m_editView);
|
|
|
|
|
m_editView -> setFocus();
|
|
|
|
|
break;
|
|
|
|
|
case WTQQuiz::qtFlash:
|
|
|
|
|
m_quiz = new WTQQuiz(m_editView);
|
|
|
|
|
case WQQuiz::qtFlash:
|
|
|
|
|
m_quiz = new WQQuiz(m_editView);
|
|
|
|
|
connect(m_quiz, TQT_SIGNAL(checkingAnswer(int )), m_editView, TQT_SLOT(slotCheckedAnswer(int )));
|
|
|
|
|
m_quiz ->setQuizType(WTQQuiz::qtFlash);
|
|
|
|
|
m_quiz ->setQuizType(WQQuiz::qtFlash);
|
|
|
|
|
m_quiz->setQuizMode(Prefs::mode());
|
|
|
|
|
if (m_quiz -> init())
|
|
|
|
|
{
|
|
|
|
@ -982,10 +982,10 @@ void KWordQuizApp::updateSession(WTQQuiz::QuizType qt)
|
|
|
|
|
m_quiz = 0;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case WTQQuiz::qtMultiple:
|
|
|
|
|
m_quiz = new WTQQuiz(m_editView);
|
|
|
|
|
case WQQuiz::qtMultiple:
|
|
|
|
|
m_quiz = new WQQuiz(m_editView);
|
|
|
|
|
connect(m_quiz, TQT_SIGNAL(checkingAnswer(int )), m_editView, TQT_SLOT(slotCheckedAnswer(int )));
|
|
|
|
|
m_quiz ->setQuizType(WTQQuiz::qtMultiple);
|
|
|
|
|
m_quiz ->setQuizType(WQQuiz::qtMultiple);
|
|
|
|
|
m_quiz->setQuizMode(Prefs::mode());
|
|
|
|
|
if (m_quiz -> init())
|
|
|
|
|
{
|
|
|
|
@ -1009,10 +1009,10 @@ void KWordQuizApp::updateSession(WTQQuiz::QuizType qt)
|
|
|
|
|
m_quiz = 0;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case WTQQuiz::qtQA:
|
|
|
|
|
m_quiz = new WTQQuiz(m_editView);
|
|
|
|
|
case WQQuiz::qtQA:
|
|
|
|
|
m_quiz = new WQQuiz(m_editView);
|
|
|
|
|
connect(m_quiz, TQT_SIGNAL(checkingAnswer(int )), m_editView, TQT_SLOT(slotCheckedAnswer(int )));
|
|
|
|
|
m_quiz ->setQuizType(WTQQuiz::qtQA);
|
|
|
|
|
m_quiz ->setQuizType(WQQuiz::qtQA);
|
|
|
|
|
m_quiz->setQuizMode(Prefs::mode());
|
|
|
|
|
if (m_quiz -> init())
|
|
|
|
|
{
|
|
|
|
@ -1217,9 +1217,9 @@ void KWordQuizApp::slotContextMenuRequested(int row, int col, const TQPoint & po
|
|
|
|
|
popup->exec(pos);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KWordQuizApp::updateActions( WTQQuiz::QuizType qt )
|
|
|
|
|
void KWordQuizApp::updateActions( WQQuiz::QuizType qt )
|
|
|
|
|
{
|
|
|
|
|
bool fEdit = (qt == WTQQuiz::qtEditor);
|
|
|
|
|
bool fEdit = (qt == WQQuiz::qtEditor);
|
|
|
|
|
|
|
|
|
|
fileSave->setEnabled(fEdit);
|
|
|
|
|
fileSaveAs->setEnabled(fEdit);
|
|
|
|
@ -1237,21 +1237,21 @@ void KWordQuizApp::updateActions( WTQQuiz::QuizType qt )
|
|
|
|
|
vocabSort->setEnabled(fEdit);
|
|
|
|
|
vocabShuffle->setEnabled(fEdit);
|
|
|
|
|
|
|
|
|
|
quizEditor->setEnabled(qt != WTQQuiz::qtEditor);
|
|
|
|
|
quizFlash->setEnabled(qt != WTQQuiz::qtFlash);
|
|
|
|
|
quizMultiple->setEnabled(qt != WTQQuiz::qtMultiple);
|
|
|
|
|
quizQA->setEnabled(qt != WTQQuiz::qtQA);
|
|
|
|
|
quizEditor->setEnabled(qt != WQQuiz::qtEditor);
|
|
|
|
|
quizFlash->setEnabled(qt != WQQuiz::qtFlash);
|
|
|
|
|
quizMultiple->setEnabled(qt != WQQuiz::qtMultiple);
|
|
|
|
|
quizQA->setEnabled(qt != WQQuiz::qtQA);
|
|
|
|
|
|
|
|
|
|
quizCheck->setEnabled(qt != WTQQuiz::qtEditor);
|
|
|
|
|
quizRestart->setEnabled(qt != WTQQuiz::qtEditor);
|
|
|
|
|
quizCheck->setEnabled(qt != WQQuiz::qtEditor);
|
|
|
|
|
quizRestart->setEnabled(qt != WQQuiz::qtEditor);
|
|
|
|
|
quizRepeatErrors->setEnabled(false);
|
|
|
|
|
|
|
|
|
|
flashKnow->setEnabled(qt == WTQQuiz::qtFlash);
|
|
|
|
|
flashDontKnow->setEnabled(qt == WTQQuiz::qtFlash);
|
|
|
|
|
flashKnow->setEnabled(qt == WQQuiz::qtFlash);
|
|
|
|
|
flashDontKnow->setEnabled(qt == WQQuiz::qtFlash);
|
|
|
|
|
|
|
|
|
|
qaHint->setEnabled(qt == WTQQuiz::qtQA);
|
|
|
|
|
qaHint->setEnabled(qt == WQQuiz::qtQA);
|
|
|
|
|
|
|
|
|
|
toolBar("quizToolBar")->setHidden(qt == WTQQuiz::qtEditor);
|
|
|
|
|
toolBar("quizToolBar")->setHidden(qt == WQQuiz::qtEditor);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|