[kde-edu]: Review Request: KWordQuiz: new feature Language Tutor
Peter Hedlund
peter at peterandlinda.com
Sat Feb 13 21:34:09 CET 2010
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/2822/#review4143
-----------------------------------------------------------
Great progress. There are three things you need to do and then I will commit the first version so we can work on smaller changes.
1. Consider the comments below.
2. Add appropriate licence and copyright header to the .h and .cpp files.
3. Work on the preferences dialog. A fixed size dialog is not acceptable since many strings will be considearbly longer when translated to other languages. Experiment with applying different types of layouts in Qt Designer until you get something that resizes smoothly. A tip is to finish by applying a grid layout to the top widget itself. This will need some experimenting.
Thanks,
Peter
/trunk/KDE/kdeedu/kwordquiz/src/kwqtutor.h
<http://reviewboard.kde.org/r/2822/#comment3690>
KSystemTrayIcon* m_tray;
/trunk/KDE/kdeedu/kwordquiz/src/kwqtutor.cpp
<http://reviewboard.kde.org/r/2822/#comment3691>
Build the menu something like this:
m_tray = new KSystemTrayIcon(KIconLoader::global()->iconPath("kwordquiz", KIconLoader::Panel));
connect (m_tray, SIGNAL(quitSelected()),this, SLOT(quit()));
QAction* a;
a = m_tray->actionCollection()->addAction("tutor_start");
a->setText(i18n("Start Exercise"));
a->setIcon(KIcon("media-playback-start"));
connect (a, SIGNAL(triggered()), this, SLOT (startStopPressed()));
m_tray->contextMenu()->addAction(a);
a = KStandardAction::open(this, SLOT(loadFile()), m_tray->actionCollection());
m_tray->contextMenu()->addAction(a);
a = KStandardAction::preferences(this, SLOT(showPrefMenu()), m_tray->actionCollection());
a->setText(i18n("Configure KWordQuiz Tutor..."));
m_tray->contextMenu()->addAction(a);
m_tray->show();
/trunk/KDE/kdeedu/kwordquiz/src/kwqtutor.cpp
<http://reviewboard.kde.org/r/2822/#comment3692>
if (isStarted == false && m_tutorDoc->lesson()->entryCount(KEduVocLesson::Recursive)) //make sure the file's not empty
{
isStarted = true;
//myMenu->actions().at(1)->setText(i18n("Stop Exercise")); //change menu text to "Stop"
m_tray->actionCollection()->action("tutor_start")->setText(i18n("Stop Exercise"));
m_tray->actionCollection()->action("tutor_start")->setIcon(KIcon("media-playback-stop"));
updateTimer();
return;
}
if (isStarted == true)
{
myTimer->stop();
//myMenu->actions().at(1)->setText(i18n("Start Exercise"));
m_tray->actionCollection()->action("tutor_start")->setText(i18n("Start Exercise"));
m_tray->actionCollection()->action("tutor_start")->setIcon(KIcon("media-playback-start"));
isStarted = false;
- Peter
On 2010-02-12 21:01:14, Aleks wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/2822/
> -----------------------------------------------------------
>
> (Updated 2010-02-12 21:01:14)
>
>
> Review request for KDE-Edu.
>
>
> Summary
> -------
>
> A feature which pops up words randomly at certain time intervals.
> It is implemented through a -g tutor [file] command line switch.
> It creates a trayicon. When user presses start menu item, a window pops up at an interval defined in Preferences. There are two GlobalShortcut bindings, one for closing the flashcard, another for showing the reverse side.
> It might not be prudent to load the whole binary into memory if one wants to run just the Tutor, so there is an option of implemeting this Tutor as a stand-alone program.
> Also the Preferences Dialog is not yet finished and the Settings dont get saved upon exit.
> I just wanted to here people's comments and suggestions before I tidy up the code.
>
> KWQTutor class creates a SysTray, Menu and connects menu items to SLOTs.
> startstoppressed SLOT displays the QLabel (the flashcard itself) with the text.
>
>
> Diffs
> -----
>
> /trunk/KDE/kdeedu/kwordquiz/src/CMakeLists.txt 1084846
> /trunk/KDE/kdeedu/kwordquiz/src/kwordquiz.kcfg 1084846
> /trunk/KDE/kdeedu/kwordquiz/src/kwqtutor.h PRE-CREATION
> /trunk/KDE/kdeedu/kwordquiz/src/kwqtutor.cpp PRE-CREATION
> /trunk/KDE/kdeedu/kwordquiz/src/kwqtutordialog.h PRE-CREATION
> /trunk/KDE/kdeedu/kwordquiz/src/kwqtutordialog.cpp PRE-CREATION
> /trunk/KDE/kdeedu/kwordquiz/src/kwqtutorflashcard.h PRE-CREATION
> /trunk/KDE/kdeedu/kwordquiz/src/kwqtutorlabel.h PRE-CREATION
> /trunk/KDE/kdeedu/kwordquiz/src/kwqtutorwelcome.h PRE-CREATION
> /trunk/KDE/kdeedu/kwordquiz/src/kwqtutorwelcome.cpp PRE-CREATION
> /trunk/KDE/kdeedu/kwordquiz/src/kwqtutorwelcome.ui PRE-CREATION
> /trunk/KDE/kdeedu/kwordquiz/src/main.cpp 1084846
> /trunk/KDE/kdeedu/kwordquiz/src/tutorform.ui PRE-CREATION
>
> Diff: http://reviewboard.kde.org/r/2822/diff
>
>
> Testing
> -------
>
>
> Thanks,
>
> Aleks
>
>
More information about the kde-edu
mailing list