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