#endif
ui->setupUi(this);
setupcodedUI();
- initverbiste();
}
void MainWindow::setupcodedUI()
connect(wordinput, SIGNAL(returnPressed()), this, SLOT(startLookup()));
connect(btnLookup, SIGNAL(clicked()), this, SLOT(startLookup()));
+
+ /* Icon */
+ QIcon *icon = new QIcon();
+ icon->addFile(ICONFILE);
+ setWindowIcon(*icon);
+
+ /* About Dialog */
+ aboutDialog = new AboutDialog(ICONFILE, "MVerbiste");
+ aboutDialog->setIntro(trUtf8("A French conjugation utility for Maemo and MeeGo"));
+ aboutDialog->addAuthor(QString::fromUtf8("Nguyễn Hồng Quân <ng.hong.quan@gmail.com>\nPierre Sarrazin <sarrazip@sarrazip.com>"));
+
+ /* Menu */
+ QMenu *menu = ui->menuBar->addMenu(tr("Top menu"));
+ QAction *act_about = menu->addAction(tr("About"));
+ connect(act_about, SIGNAL(triggered()), aboutDialog, SLOT(show()));
}
MainWindow::~MainWindow()
{
delete ui;
delete freVerbDic;
+ delete aboutDialog;
}
void MainWindow::setOrientation(ScreenOrientation orientation)
#else
show();
#endif
+ initverbiste();
wordinput->setFocus();
}
bool includePronouns = FALSE; // TODO: Will get this value from external
bool isItalian = FALSE; // TODO: Will get this value from external
+#ifndef QT_NO_DEBUG
+ timer.start();
+ qDebug() << "Start " << timer.elapsed();
+#endif
freVerbDic->deconjugate(word, infles);
resultPages->setUpdatesEnabled(false);
*/
VVVS conjug;
- getConjugation(freVerbDic, d.infinitive, d.templateName, conjug, includePronouns);
+#ifndef QT_NO_DEBUG
+ qDebug() << " START getConjugation " << timer.elapsed();
+#endif
+ getConjugation(freVerbDic, d.infinitive, d.templateName, conjug,
+ #ifndef QT_NO_DEBUG
+ timer,
+ #endif
+ includePronouns);
+
+#ifndef QT_NO_DEBUG
+ qDebug() << " getConjugation() returns: " << timer.elapsed();
+#endif
if (conjug.size() == 0 // if no tenses
|| conjug[0].size() == 0 // if no infinitive tense
std::string utf8Infinitive = conjug[0][0][0];
#ifndef QT_NO_DEBUG
- qDebug() << " getConjugation() returns:";
- qDebug() << " Infinitive " << utf8Infinitive.c_str() << " at " << timer.elapsed();
+ qDebug() << " Infinitive " << utf8Infinitive.c_str();
qDebug() << " Template " << d.templateName.c_str();
#endif
QVBoxLayout *cell = makeResultCell(*t, utf8TenseName, word, freVerbDic);
rsp->grid->addLayout(cell, row, col);
}
+
/* Show the result on GUI */
rsp->packContent();
prevUTF8Infinitive = utf8Infinitive;
prevTemplateName = d.templateName;
}
+
/* Enable the button again */
btnLookup->setEnabled(true);
btnLookup->setText("");