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

parley

  • sources
  • kde-4.12
  • kdeedu
  • parley
  • src
  • configure-practice
configurepracticedialog.cpp
Go to the documentation of this file.
1 /***************************************************************************
2 
3  copyright : (C) 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
4 
5  -----------------------------------------------------------------------
6 
7  ***************************************************************************
8 
9  ***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "configurepracticedialog.h"
19 
20 #include "advancedpracticeoptions.h"
21 #include "thresholdoptions.h"
22 #include "blockoptions.h"
23 
24 #include <KLocale>
25 
26 ConfigurePracticeDialog::ConfigurePracticeDialog(KEduVocDocument *doc, QWidget *parent, const QString &name, KConfigSkeleton *config)
27  :KConfigDialog(parent, name, config)
28 {
29  m_config = config;
30 
31  setCaption(i18nc("@title:window", "Configure Practice"));
32  setButtons(Default|Ok|Apply|Cancel|Help);
33  setDefaultButton(Ok);
34 
35  m_blockOptions = new BlockOptions(this);
36  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);
37 
38  m_thresholdOptions = new ThresholdOptions(doc, this);
39  addPage(m_thresholdOptions, i18nc("@title:group ignore vocabulary based on some properties like word type", "Thresholds"), "practice-setup", i18n("Threshold Settings"), true);
40 
41  m_advancedPracticeOptions = new AdvancedPracticeOptions(this);
42  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);
43  setHelp(QString(),"parley");
44 
45  KConfigGroup cg(KSharedConfig::openConfig("parleyrc"), "ConfigurePracticeDialog");
46  KDialog::restoreDialogSize(cg);
47 }
48 
49 ConfigurePracticeDialog::~ConfigurePracticeDialog()
50 {
51  KConfigGroup cg(KSharedConfig::openConfig("parleyrc"), "ConfigurePracticeDialog");
52  KDialog::saveDialogSize(cg);
53 }
54 
55 
56 bool ConfigurePracticeDialog::hasChanged()
57 {
58  return m_thresholdOptions->hasChanged() ||
59  m_blockOptions->hasChanged();
60 }
61 
62 bool ConfigurePracticeDialog::isDefault()
63 {
64  return m_thresholdOptions->isDefault() &&
65  m_blockOptions->isDefault();
66 }
67 
68 void ConfigurePracticeDialog::updateSettings()
69 {
70  m_thresholdOptions->updateSettings();
71  m_blockOptions->updateSettings();
72 }
73 
74 void ConfigurePracticeDialog::updateWidgets()
75 {
76  m_thresholdOptions->updateWidgets();
77  m_blockOptions->updateWidgets();
78 }
79 
80 void ConfigurePracticeDialog::updateWidgetsDefault()
81 {
82  m_config->useDefaults(true);
83  updateWidgets();
84  m_config->useDefaults(false);
85 }
86 
87 #include "configurepracticedialog.moc"
BlockOptions::updateWidgets
void updateWidgets()
Definition: blockoptions.cpp:138
advancedpracticeoptions.h
BlockOptions::hasChanged
bool hasChanged()
Definition: blockoptions.cpp:361
thresholdoptions.h
ThresholdOptions::updateSettings
void updateSettings()
Definition: thresholdoptions.cpp:52
QWidget
configurepracticedialog.h
KConfigSkeleton
KConfigDialog
blockoptions.h
ConfigurePracticeDialog::ConfigurePracticeDialog
ConfigurePracticeDialog(KEduVocDocument *doc, QWidget *parent, const QString &name, KConfigSkeleton *config)
Definition: configurepracticedialog.cpp:26
AdvancedPracticeOptions
Definition: advancedpracticeoptions.h:30
ThresholdOptions
Definition: thresholdoptions.h:34
BlockOptions
Definition: blockoptions.h:34
BlockOptions::isDefault
bool isDefault()
Definition: blockoptions.cpp:291
ThresholdOptions::isDefault
bool isDefault()
Definition: thresholdoptions.cpp:45
ThresholdOptions::hasChanged
bool hasChanged()
Definition: thresholdoptions.cpp:57
BlockOptions::updateSettings
void updateSettings()
Definition: blockoptions.cpp:326
ConfigurePracticeDialog::~ConfigurePracticeDialog
~ConfigurePracticeDialog()
Definition: configurepracticedialog.cpp:49
ThresholdOptions::updateWidgets
void updateWidgets()
Definition: thresholdoptions.cpp:40
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

parley

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

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal