• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdeedu
  • Sitemap
  • Contact Us
 

parley

configurepracticedialog.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002 
00003     copyright     : (C) 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
00004 
00005     -----------------------------------------------------------------------
00006 
00007  ***************************************************************************
00008 
00009  ***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
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 //     KConfigGroup cg(KGlobal::config(), "DocumentPropertiesDialog");
00058 //     KDialog::saveDialogSize(cg);
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"

parley

Skip menu "parley"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeedu

Skip menu "kdeedu"
  • kalzium
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
  •   stepcore
Generated for kdeedu by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal