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

parley

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