parley
configurepracticedialog.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "configurepracticedialog.h"
00019
00020 #include "configurepracticewidget.h"
00021 #include "advancedpracticeoptions.h"
00022 #include "thresholdoptions.h"
00023 #include "blockoptions.h"
00024
00025 #include <KLocale>
00026
00027 ConfigurePracticeDialog::ConfigurePracticeDialog(KEduVocDocument *doc, QWidget *parent, const QString &name, KConfigSkeleton *config)
00028 :KConfigDialog(parent, name, config)
00029 {
00030 m_config = config;
00031
00032 setCaption(i18nc("@title:window", "Configure Practice"));
00033 setButtons(Default|Ok|Apply|Cancel|Help);
00034 setDefaultButton(Ok);
00035
00036 m_configurePracticeWidget= new ConfigurePracticeWidget(doc, this);
00037 addPage(m_configurePracticeWidget, i18nc("@title:group", "Practice"), "practice-start", i18n("Practice options"), true);
00038
00039 m_blockOptions = new BlockOptions(this);
00040 addPage(m_blockOptions, i18nc("@title:group vocabulary can be set to be blocked for a certain amount of time", "Blocking"), "cards-block", i18n("Blocking Settings"), true);
00041
00042 m_thresholdOptions = new ThresholdOptions(doc, this);
00043 addPage(m_thresholdOptions, i18nc("@title:group ignore vocabulary based on some properties like word type", "Thresholds"), "practice-setup", i18n("Threshold Settings"), true);
00044
00045 m_advancedPracticeOptions = new AdvancedPracticeOptions(this);
00046 addPage(m_advancedPracticeOptions, i18nc("@title:group Configure advanced settings for practicing vocabulary, short title in config dialog.", "Advanced"), "advanced-setup", i18nc("Configure advanced settings for practicing vocabulary.", "Advanced Practice Settings"), true);
00047 setHelp(QString(),"parley");
00048 }
00049
00050 ConfigurePracticeDialog::~ConfigurePracticeDialog()
00051 {
00052
00053
00054 }
00055
00056
00057 bool ConfigurePracticeDialog::hasChanged()
00058 {
00059 return m_configurePracticeWidget->hasChanged() ||
00060 m_thresholdOptions->hasChanged() ||
00061 m_blockOptions->hasChanged();
00062 }
00063
00064 bool ConfigurePracticeDialog::isDefault()
00065 {
00066 return m_configurePracticeWidget->isDefault() &&
00067 m_thresholdOptions->isDefault() &&
00068 m_blockOptions->isDefault();
00069 }
00070
00071 void ConfigurePracticeDialog::updateSettings()
00072 {
00073 m_configurePracticeWidget->updateSettings();
00074 m_thresholdOptions->updateSettings();
00075 m_blockOptions->updateSettings();
00076 }
00077
00078 void ConfigurePracticeDialog::updateWidgets()
00079 {
00080 m_configurePracticeWidget->updateWidgets();
00081 m_thresholdOptions->updateWidgets();
00082 m_blockOptions->updateWidgets();
00083 }
00084
00085 void ConfigurePracticeDialog::updateWidgetsDefault()
00086 {
00087 m_config->useDefaults(true);
00088 updateWidgets();
00089 m_config->useDefaults(false);
00090 }
00091
00092 #include "configurepracticedialog.moc"