kplato

kptsummarytaskdialog.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2002 Bo Thorsen bo@sonofthor.dk
3 Copyright (C) 2004, 2006 Dag Andersen <danders@get2net.dk>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#include "kptsummarytaskdialog.h"
22#include "kptsummarytaskgeneralpanel.h"
23
24#include <tdelocale.h>
25#include <kcommand.h>
26
27#include <tqvbox.h>
28#include <kdebug.h>
29
30namespace KPlato
31{
32
34 : KDialogBase(Swallow, i18n("Summary Task Settings"), Ok|Cancel, Ok, p, "Summary Task Settings Dialog", true, true)
35{
36 m_generalTab = new SummaryTaskGeneralPanel(task, this);
37 setMainWidget(m_generalTab);
38 enableButtonOK(false);
39
40 connect(m_generalTab, TQ_SIGNAL(obligatedFieldsFilled(bool)), TQ_SLOT(enableButtonOK(bool)));
41}
42
43
44KCommand *SummaryTaskDialog::buildCommand(Part *part) {
45 KMacroCommand *m = new KMacroCommand(i18n("Modify Summary Task"));
46 bool modified = false;
47 KCommand *cmd = m_generalTab->buildCommand(part);
48 if (cmd) {
49 m->addCommand(cmd);
50 modified = true;
51 }
52 if (!modified) {
53 delete m;
54 return 0;
55 }
56 return m;
57}
58
59void SummaryTaskDialog::slotOk() {
60 if (!m_generalTab->ok())
61 return;
62
63 accept();
64}
65
66
67} //KPlato namespace
68
69#include "kptsummarytaskdialog.moc"
SummaryTaskDialog(Task &task, TQWidget *parent=0)
The constructor for the summary task settings dialog.
A task in the scheduling software is represented by this class.
Definition kpttask.h:40