[kde-edu]: How does Paley use its configuration?

Frederik Gladhorn gladhorn at kde.org
Tue Jan 20 22:38:04 CET 2009


On Dienstag 20 Januar 2009 18:32:36 Daniel Laidig wrote:
> On Tuesday 20 January 2009 11:06:42 Nadav Vinik wrote:
> > Hello
> >
> > I try to fix problem in Parley which the setting of "Number of
> > choices" not affect on the quiz.
> > Unfortunately, from yesterday I stuck in understanding how I can use
> > in the configuration dialog.
> > I didn't success to find in the code how the other parts use in the
> > configuration.
> >
> > For example I search for 'kcfg_AltLearn' :
> > $ find|xargs grep -n kcfg_AltLearn
> > ./src/ui_advancedpracticeoptions.h~:41:    QCheckBox *kcfg_AltLearn;
> > ./src/ui_advancedpracticeoptions.h~:85:    kcfg_AltLearn = new
> > QCheckBox(groupBox);
> > ./src/ui_advancedpracticeoptions.h~:86:
> > kcfg_AltLearn->setObjectName(QString::fromUtf8("kcfg_AltLearn"));
> > ./src/ui_advancedpracticeoptions.h~:88:
> > vboxLayout1->addWidget(kcfg_AltLearn);
> > ./src/ui_advancedpracticeoptions.h~:247:
> > QWidget::setTabOrder(kcfg_SwapDirection, kcfg_AltLearn);
> > ./src/ui_advancedpracticeoptions.h~:248:
> > QWidget::setTabOrder(kcfg_AltLearn, kcfg_ShowMore);
> > ./src/ui_advancedpracticeoptions.h~:261:
> > kcfg_AltLearn->setToolTip(tr2i18n("By checking this, you will use the
> > Leitner method of learning which requires you to answer correctlyto
> > each question 3 times in a row. ", 0));
> > ./src/ui_advancedpracticeoptions.h~:266:
> > kcfg_AltLearn->setWhatsThis(tr2i18n("By checking this, you will use
> > the Leitner method of learning which requires you to answer correctly
> > to each question 3 times in a row. ", 0));
> > ./src/ui_advancedpracticeoptions.h~:269:
> > //kcfg_AltLearn->setText(tr2i18n("&Require 3 consecutive correct
> > answers to count as right", 0));
> > ./src/configure-practice/advancedpracticeoptions.ui:20:       <widget
> > class="QCheckBox" name="kcfg_AltLearn" >
> > ./src/configure-practice/advancedpracticeoptions.ui:331:
> > <tabstop>kcfg_AltLearn</tabstop>
> > Binary file
> > ./src/CMakeFiles/parley.dir/configure-practice/advancedpracticeoptions.o
> > matches
> > Binary file ./src/parley matches
> > ./src/ui_advancedpracticeoptions.h:41:    QCheckBox *kcfg_AltLearn;
> > ./src/ui_advancedpracticeoptions.h:85:    kcfg_AltLearn = new
> > QCheckBox(groupBox);
> > ./src/ui_advancedpracticeoptions.h:86:
> > kcfg_AltLearn->setObjectName(QString::fromUtf8("kcfg_AltLearn"));
> > ./src/ui_advancedpracticeoptions.h:88:
> > vboxLayout1->addWidget(kcfg_AltLearn);
> > ./src/ui_advancedpracticeoptions.h:247:
> > QWidget::setTabOrder(kcfg_SwapDirection, kcfg_AltLearn);
> > ./src/ui_advancedpracticeoptions.h:248:
> > QWidget::setTabOrder(kcfg_AltLearn, kcfg_ShowMore);
> > ./src/ui_advancedpracticeoptions.h:261:
> > kcfg_AltLearn->setToolTip(tr2i18n("By checking this, you will use the
> > Leitner method of learning which requires you to answer correctly to
> > each question 3 times in a row. ", 0));
> > ./src/ui_advancedpracticeoptions.h:266:
> > kcfg_AltLearn->setWhatsThis(tr2i18n("By checking this, you will use
> > the Leitner method of learning which requires you to answer correctly
> > to each question 3 times in a row. ", 0));
> > ./src/ui_advancedpracticeoptions.h:269:
> > kcfg_AltLearn->setText(tr2i18n("&Require 3 consecutive correct answers
> > to count as right", 0));
> >
> > There is nothing which take it's value, but somehow this setting
> > working...
>
> Take a look at parley/src/settings/parley.kcfg:
> <entry name="AltLearn" type="Bool">
>       <label>Use the Leitner learning method</label>
>       <default>false</default>
> </entry>
>
> Also a grep with -i for "AltLearn" shows:
> parley/src/practiceold/testentry.cpp:    if ( !Prefs::altLearn() &&
> m_statisticBadCount == 0 ) { parley/src/practiceold/testentry.cpp:    if (
> !Prefs::altLearn() && m_statisticBadCount == 0 ) {
> parley/src/practiceold/testentrymanager.cpp:        if ( !Prefs::altLearn()
> ) { parley/src/practiceold/testentrymanager.cpp:        if (
> !Prefs::altLearn() ) {
>
> I'm not familiar with the config system, but I hope this helps you to look
> in the right direction. :)
Thanks Daniel :)

Hi Nadav,
for more information I would suggest reading the tutorials on 
techbase.kde.org.
Parley uses KConfig XT
http://techbase.kde.org/Development/Tutorials
The relevant tutorials are:
http://techbase.kde.org/Development/Tutorials/KConfig
http://techbase.kde.org/Development/Tutorials/Using_KConfig_XT

With the xml file that Daniel pointed out, widgets in a KConfigDialog 
automatically get matched to their respective settings when they are named 
"kcfg_settingName".

Hope that helps a little :)

And welcome!

Greetings
Frederik

> > Thanks for your help
> > Nadav
> > _______________________________________________
> > kde-edu mailing list
> > kde-edu at mail.kde.org
> > https://mail.kde.org/mailman/listinfo/kde-edu
>
> _______________________________________________
> kde-edu mailing list
> kde-edu at mail.kde.org
> https://mail.kde.org/mailman/listinfo/kde-edu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-edu/attachments/20090120/a465ce87/attachment.sig 


More information about the kde-edu mailing list