diff options
Diffstat (limited to 'kiten/learn.cpp')
-rw-r--r-- | kiten/learn.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/kiten/learn.cpp b/kiten/learn.cpp index a1b685d4..cb647aa1 100644 --- a/kiten/learn.cpp +++ b/kiten/learn.cpp @@ -70,18 +70,18 @@ Learn::Learn(Dict::Index *parentDict, TQWidget *parent, const char *name) TQVBoxLayout *veryTop = new TQVBoxLayout(dummy, 0, KDialog::spacingHint()); Tabs = new TQTabWidget(dummy); - connect(Tabs, TQT_SIGNAL(currentChanged(TQWidget *)), TQT_SLOT(tabChanged(TQWidget *))); + connect(Tabs, TQ_SIGNAL(currentChanged(TQWidget *)), TQ_SLOT(tabChanged(TQWidget *))); veryTop->addWidget(Tabs); listTop = new TQSplitter(Tabs); - listTop->setOrientation(Qt::Vertical); + listTop->setOrientation(TQt::Vertical); quizTop = new TQWidget(Tabs); Tabs->addTab(listTop, i18n("&List")); Tabs->addTab(quizTop, i18n("&Quiz")); View = new ResultView(true, listTop, "View"); View->setBasicMode(true); - connect(View, TQT_SIGNAL(linkClicked(const TQString &)), this, TQT_SIGNAL(linkClicked(const TQString &))); + connect(View, TQ_SIGNAL(linkClicked(const TQString &)), this, TQ_SIGNAL(linkClicked(const TQString &))); List = new TDEListView(listTop); @@ -101,8 +101,8 @@ Learn::Learn(Dict::Index *parentDict, TQWidget *parent, const char *name) List->setSorting(4); List->setSelectionModeExt(TDEListView::Extended); - connect(List, TQT_SIGNAL(executed(TQListViewItem *)), TQT_SLOT(showKanji(TQListViewItem *))); - connect(List, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(itemSelectionChanged())); + connect(List, TQ_SIGNAL(executed(TQListViewItem *)), TQ_SLOT(showKanji(TQListViewItem *))); + connect(List, TQ_SIGNAL(selectionChanged()), this, TQ_SLOT(itemSelectionChanged())); TQStringList grades(i18n("Grade 1")); grades.append(i18n("Grade 2")); @@ -113,25 +113,25 @@ Learn::Learn(Dict::Index *parentDict, TQWidget *parent, const char *name) grades.append(i18n("Others in Jouyou")); grades.append(i18n("Jinmeiyou")); - /*TDEAction *closeAction = */(void) KStdAction::close(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); - printAct = KStdAction::print(TQT_TQOBJECT(this), TQT_SLOT(print()), actionCollection()); - forwardAct = KStdAction::forward(TQT_TQOBJECT(this), TQT_SLOT(next()), actionCollection()); + /*TDEAction *closeAction = */(void) KStdAction::close(this, TQ_SLOT(close()), actionCollection()); + printAct = KStdAction::print(this, TQ_SLOT(print()), actionCollection()); + forwardAct = KStdAction::forward(this, TQ_SLOT(next()), actionCollection()); forwardAct->plug(toolBar()); - backAct = KStdAction::back(TQT_TQOBJECT(this), TQT_SLOT(prev()), actionCollection()); + backAct = KStdAction::back(this, TQ_SLOT(prev()), actionCollection()); backAct->plug(toolBar()); - cheatAct = new TDEAction(i18n("&Cheat"), CTRL + Key_C, TQT_TQOBJECT(this), TQT_SLOT(cheat()), actionCollection(), "cheat"); - randomAct = new TDEAction(i18n("&Random"), "goto", CTRL + Key_R, TQT_TQOBJECT(this), TQT_SLOT(random()), actionCollection(), "random"); + cheatAct = new TDEAction(i18n("&Cheat"), CTRL + Key_C, this, TQ_SLOT(cheat()), actionCollection(), "cheat"); + randomAct = new TDEAction(i18n("&Random"), "goto", CTRL + Key_R, this, TQ_SLOT(random()), actionCollection(), "random"); gradeAct = new TDEListAction(i18n("Grade"), 0, 0, 0, actionCollection(), "grade"); gradeAct->setItems(grades); - connect(gradeAct, TQT_SIGNAL(activated(const TQString&)), TQT_SLOT(updateGrade())); - removeAct = new TDEAction(i18n("&Delete"), "edit_remove", CTRL + Key_X, TQT_TQOBJECT(this), TQT_SLOT(del()), actionCollection(), "del"); - addAct = new TDEAction(i18n("&Add"), "edit_add", CTRL + Key_A, TQT_TQOBJECT(this), TQT_SLOT(add()), actionCollection(), "add"); - addAllAct = new TDEAction(i18n("Add A&ll"), 0, TQT_TQOBJECT(this), TQT_SLOT(addAll()), actionCollection(), "addall"); - newAct = KStdAction::openNew(TQT_TQOBJECT(this), TQT_SLOT(openNew()), actionCollection()); - openAct = KStdAction::open(TQT_TQOBJECT(this), TQT_SLOT(open()), actionCollection()); - saveAct = KStdAction::save(TQT_TQOBJECT(this), TQT_SLOT(save()), actionCollection()); - saveAsAct = KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(saveAs()), actionCollection()); - (void) KStdAction::preferences(TQT_TQOBJECT(this), TQT_SIGNAL(configureLearn()), actionCollection()); + connect(gradeAct, TQ_SIGNAL(activated(const TQString&)), TQ_SLOT(updateGrade())); + removeAct = new TDEAction(i18n("&Delete"), "edit_remove", CTRL + Key_X, this, TQ_SLOT(del()), actionCollection(), "del"); + addAct = new TDEAction(i18n("&Add"), "edit_add", CTRL + Key_A, this, TQ_SLOT(add()), actionCollection(), "add"); + addAllAct = new TDEAction(i18n("Add A&ll"), 0, this, TQ_SLOT(addAll()), actionCollection(), "addall"); + newAct = KStdAction::openNew(this, TQ_SLOT(openNew()), actionCollection()); + openAct = KStdAction::open(this, TQ_SLOT(open()), actionCollection()); + saveAct = KStdAction::save(this, TQ_SLOT(save()), actionCollection()); + saveAsAct = KStdAction::saveAs(this, TQ_SLOT(saveAs()), actionCollection()); + (void) KStdAction::preferences(this, TQ_SIGNAL(configureLearn()), actionCollection()); removeAct->setEnabled(false); @@ -140,18 +140,18 @@ Learn::Learn(Dict::Index *parentDict, TQWidget *parent, const char *name) quizLayout->addStretch(); TQHBoxLayout *hlayout = new TQHBoxLayout(quizLayout); qKanji = new TQPushButton(quizTop); - connect(qKanji, TQT_SIGNAL(clicked()), this, TQT_SLOT(qKanjiClicked())); + connect(qKanji, TQ_SIGNAL(clicked()), this, TQ_SLOT(qKanjiClicked())); hlayout->addStretch(); hlayout->addWidget(qKanji); hlayout->addStretch(); quizLayout->addStretch(); - answers = new TQButtonGroup(1,Qt::Horizontal, quizTop); + answers = new TQButtonGroup(1,TQt::Horizontal, quizTop); for (int i = 0; i < numberOfAnswers; ++i) answers->insert(new KPushButton(answers), i); quizLayout->addWidget(answers); quizLayout->addStretch(); - connect(answers, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(answerClicked(int))); + connect(answers, TQ_SIGNAL(clicked(int)), this, TQ_SLOT(answerClicked(int))); createGUI("learnui.rc"); //closeAction->plug(toolBar()); @@ -164,7 +164,7 @@ Learn::Learn(Dict::Index *parentDict, TQWidget *parent, const char *name) nogood = false; // this is so learn doesn't take so long to show itself - TQTimer::singleShot(200, this, TQT_SLOT(finishCtor())); + TQTimer::singleShot(200, this, TQ_SLOT(finishCtor())); } void Learn::finishCtor() @@ -247,7 +247,7 @@ bool Learn::queryClose() void Learn::random() { - int rand = static_cast<int>(static_cast<float>(list.count()) / (static_cast<float>(RAND_MAX) / kapp->random())); + int rand = static_cast<int>(static_cast<float>(list.count()) / (static_cast<float>(RAND_MAX) / tdeApp->random())); current = list.at(rand - 1); update(); @@ -303,7 +303,7 @@ void Learn::update() for (TQValueListIterator<Dict::Entry> it = compounds.list.begin(); it != compounds.list.end(); ++it) { - kapp->processEvents(); + tdeApp->processEvents(); View->addResult(*it, true); } @@ -683,12 +683,12 @@ TQString Learn::randomMeaning(TQStringList &oldMeanings) do { - float rand = kapp->random(); + float rand = tdeApp->random(); if ((rand > (RAND_MAX / 2)) || (List->childCount() < numberOfAnswers)) { // get a meaning from dict //kdDebug() << "from our dict\n"; - rand = kapp->random(); + rand = tdeApp->random(); float rand2 = RAND_MAX / rand; rand = ((float)list.count() - 1) / rand2; //rand -= 1; @@ -711,7 +711,7 @@ TQString Learn::randomMeaning(TQStringList &oldMeanings) { // get a meaning from our list //kdDebug() << "from our list\n"; - rand = kapp->random(); + rand = tdeApp->random(); float rand2 = RAND_MAX / rand; rand = List->childCount() / rand2; @@ -749,7 +749,7 @@ void Learn::qupdate() newFont.setPixelSize(24); qKanji->setFont(newFont); - float rand = kapp->random(); + float rand = tdeApp->random(); float rand2 = RAND_MAX / rand; seikai = static_cast<int>(numberOfAnswers / rand2); @@ -787,10 +787,10 @@ void Learn::qnew() // new quiz kanji // use f(2) every third time, f(1) otherwise // where f(1) = numberOfItems * rand[0..1] // and f(2) = numberOfItems * rand[0..1] * rand[0..1] - // rand[0..1] = kapp->random() / RAND_MAX - float max = static_cast<float>(count) / (static_cast<float>(RAND_MAX) / kapp->random()); - if (kapp->random() < (static_cast<float>(RAND_MAX) / 3.25)) - max /= (static_cast<float>(RAND_MAX) / (kapp->random() + 1)); + // rand[0..1] = tdeApp->random() / RAND_MAX + float max = static_cast<float>(count) / (static_cast<float>(RAND_MAX) / tdeApp->random()); + if (tdeApp->random() < (static_cast<float>(RAND_MAX) / 3.25)) + max /= (static_cast<float>(RAND_MAX) / (tdeApp->random() + 1)); max = static_cast<int>(max); |