kplato

kptsummarytaskdialog.cc

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002 Bo Thorsen  bo@sonofthor.dk
00003    Copyright (C) 2004, 2006 Dag Andersen <danders@get2net.dk>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #include "kptsummarytaskdialog.h"
00022 #include "kptsummarytaskgeneralpanel.h"
00023 
00024 #include <klocale.h>
00025 #include <kcommand.h>
00026 
00027 #include <qvbox.h>
00028 #include <kdebug.h>
00029 
00030 namespace KPlato
00031 {
00032 
00033 SummaryTaskDialog::SummaryTaskDialog(Task &task, QWidget *p)
00034     : KDialogBase(Swallow, i18n("Summary Task Settings"), Ok|Cancel, Ok, p, "Summary Task Settings Dialog", true, true)
00035 {
00036     m_generalTab = new SummaryTaskGeneralPanel(task, this);
00037     setMainWidget(m_generalTab);
00038     enableButtonOK(false);
00039     
00040     connect(m_generalTab, SIGNAL(obligatedFieldsFilled(bool)), SLOT(enableButtonOK(bool)));
00041 }
00042 
00043 
00044 KCommand *SummaryTaskDialog::buildCommand(Part *part) {
00045     KMacroCommand *m = new KMacroCommand(i18n("Modify Summary Task"));
00046     bool modified = false;
00047     KCommand *cmd = m_generalTab->buildCommand(part);
00048     if (cmd) {
00049         m->addCommand(cmd);
00050         modified = true;
00051     }
00052     if (!modified) {
00053         delete m;
00054         return 0;
00055     }
00056     return m;
00057 }
00058 
00059 void SummaryTaskDialog::slotOk() {
00060     if (!m_generalTab->ok())
00061         return;
00062     
00063     accept();
00064 }
00065 
00066 
00067 }  //KPlato namespace
00068 
00069 #include "kptsummarytaskdialog.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys