1
/* This file is part of the KDE project
2
Copyright (C) 2002 Bo Thorsen bo@sonofthor.dk
3
Copyright (C) 2004 - 2010 Dag Andersen <danders@get2net.dk>
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.
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.
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.
21
#include "kptsummarytaskdialog.h"
22
#include "kptsummarytaskgeneralpanel.h"
23
#include "kptcommand.h"
26
#include "kptproject.h"
28
#include <KLocalizedString>
34
SummaryTaskDialog::SummaryTaskDialog(Task &task, QWidget *p)
38
setCaption( i18n("Summary Task Settings") );
39
setButtons( Ok|Cancel );
40
setDefaultButton( Ok );
41
showButtonSeparator( true );
42
m_generalTab = new SummaryTaskGeneralPanel(task, this);
43
setMainWidget(m_generalTab);
44
enableButtonOk(false);
46
connect(m_generalTab, SIGNAL(obligatedFieldsFilled(bool)), SLOT(enableButtonOk(bool)));
48
Project *proj = static_cast<Project*>( task.projectNode() );
50
connect(proj, SIGNAL(nodeRemoved(Node*)), this, SLOT(slotTaskRemoved(Node*)));
54
void SummaryTaskDialog::slotTaskRemoved( Node *node )
56
if ( node == m_node ) {
62
MacroCommand *SummaryTaskDialog::buildCommand() {
63
MacroCommand *m = new MacroCommand(kundo2_i18n("Modify Summary Task"));
64
bool modified = false;
65
MacroCommand *cmd = m_generalTab->buildCommand();
77
void SummaryTaskDialog::slotButtonClicked(int button) {
78
if (button == KoDialog::Ok) {
79
if (!m_generalTab->ok())
83
KoDialog::slotButtonClicked(button);