kplato

kptconfigbehaviorpanel.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2004 Dag Andersen <danders@get2net.dk>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation;
7 version 2 of the License.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#include "kptconfigbehaviorpanel.h"
21
22#include "kptdatetime.h"
23#include "kptfactory.h"
24
25#include <tdemessagebox.h>
26#include <klineedit.h>
27#include <ktextedit.h>
28#include <kcombobox.h>
29#include <kdatetimewidget.h>
30#include <tdelocale.h>
31#include <kcommand.h>
32#include <tdeconfig.h>
33#include <kstandarddirs.h>
34#include <kdebug.h>
35
36#include <tqlayout.h>
37#include <tqdatetime.h>
38#include <tqbuttongroup.h>
39#include <tqcheckbox.h>
40
41namespace KPlato
42{
43
44ConfigBehaviorPanel::ConfigBehaviorPanel(Behavior &behavior, TQWidget *p, const char *n)
45 : ConfigBehaviorPanelBase(p, n),
46 m_oldvalues(behavior),
47 m_behavior(behavior)
48{
49 setStartValues();
50
51 allowOverbooking->setEnabled(false); // not yet used
52}
53
54void ConfigBehaviorPanel::setStartValues() {
55 calculationGroup->setButton(m_oldvalues.calculationMode);
56 allowOverbooking->setChecked(m_oldvalues.allowOverbooking);
57}
58
59bool ConfigBehaviorPanel::ok() {
60 return true;
61}
62
63bool ConfigBehaviorPanel::apply() {
64 m_behavior.calculationMode = calculationGroup->selectedId();
65 m_behavior.allowOverbooking = allowOverbooking->isChecked();
66 return true;
67}
68
69
70} //KPlato namespace
71
72#include "kptconfigbehaviorpanel.moc"