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|User1|Ok|Apply|Cancel|Help);
00034 setDefaultButton(Ok);
00035
00036 setButtonText(User1, i18n("Start Practice..."));
00037 setButtonIcon(User1, KIcon("practice-start"));
00038
00039 connect(this, SIGNAL(user1Clicked()), SLOT(slotStartPractice()));
00040
00041 m_configurePracticeWidget= new ConfigurePracticeWidget(doc, this);
00042 addPage(m_configurePracticeWidget, i18nc("@title:group", "Practice"), "practice-start", i18n("Practice options"), true);
00043
00044 m_blockOptions = new BlockOptions(this);
00045 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);
00046
00047 m_thresholdOptions = new ThresholdOptions(doc, this);
00048 addPage(m_thresholdOptions, i18nc("@title:group ignore vocabulary based on some properties like word type", "Thresholds"), "practice-setup", i18n("Threshold Settings"), true);
00049
00050 m_advancedPracticeOptions = new AdvancedPracticeOptions(this);
00051 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);
00052 setHelp(QString(),"parley");
00053 }
00054
00055 ConfigurePracticeDialog::~ConfigurePracticeDialog()
00056 {
00057
00058
00059 }
00060
00061
00062 bool ConfigurePracticeDialog::hasChanged()
00063 {
00064 return m_configurePracticeWidget->hasChanged() ||
00065 m_thresholdOptions->hasChanged() ||
00066 m_blockOptions->hasChanged();
00067 }
00068
00069 bool ConfigurePracticeDialog::isDefault()
00070 {
00071 return m_configurePracticeWidget->isDefault() &&
00072 m_thresholdOptions->isDefault() &&
00073 m_blockOptions->isDefault();
00074 }
00075
00076 void ConfigurePracticeDialog::updateSettings()
00077 {
00078 m_configurePracticeWidget->updateSettings();
00079 m_thresholdOptions->updateSettings();
00080 m_blockOptions->updateSettings();
00081 }
00082
00083 void ConfigurePracticeDialog::updateWidgets()
00084 {
00085 m_configurePracticeWidget->updateWidgets();
00086 m_thresholdOptions->updateWidgets();
00087 m_blockOptions->updateWidgets();
00088 }
00089
00090 void ConfigurePracticeDialog::updateWidgetsDefault()
00091 {
00092 m_config->useDefaults(true);
00093 updateWidgets();
00094 m_config->useDefaults(false);
00095 }
00096
00097 void ConfigurePracticeDialog::slotStartPractice()
00098 {
00099 done(ConfigurePracticeDialog::StartPractice);
00100 }
00101
00102
00103 #include "configurepracticedialog.moc"