F:/KPlato/koffice/kplato/kptmainprojectdialog.cc

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2003 - 2005 Dag Andersen <danders@get2net.dk>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation;
00007    version 2 of the License.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #include <klocale.h>
00021 #include <kcommand.h>
00022 
00023 #include <kdebug.h>
00024 
00025 #include "kptmainprojectdialog.h"
00026 #include "kptproject.h"
00027 #include "kptmainprojectpanel.h"
00028 
00029 namespace KPlato
00030 {
00031 
00032 MainProjectDialog::MainProjectDialog(Project &p, QWidget *parent, const char *name)
00033     : KDialog( parent),
00034       project(p)
00035 {
00036     setCaption( i18n("Project Settings") );
00037     setButtons( Ok|Cancel );
00038     setDefaultButton( Ok );
00039     showButtonSeparator( true );
00040     panel = new MainProjectPanel(project, this);
00041 
00042     setMainWidget(panel);
00043     enableButtonOk(false);
00044     resize( QSize(500, 410).expandedTo(minimumSizeHint()));
00045     
00046     connect(this, SIGNAL(okClicked()), SLOT(slotOk()));
00047     connect(panel, SIGNAL(obligatedFieldsFilled(bool)), SLOT(enableButtonOk(bool)));
00048 }
00049 
00050 
00051 void MainProjectDialog::slotOk() {
00052     if (!panel->ok())
00053         return;
00054 
00055     accept();
00056 }
00057 
00058 KCommand *MainProjectDialog::buildCommand(Part *part) {
00059     KMacroCommand *m = 0;
00060     QString c = i18n("Modify main project");
00061     KCommand *cmd = panel->buildCommand(part);
00062     if (cmd) {
00063         if (!m) m = new KMacroCommand(c);
00064         m->addCommand(cmd);
00065     }
00066     return m;
00067 }
00068 
00069 }  //KPlato namespace
00070 
00071 #include "kptmainprojectdialog.moc"

Généré le Wed Nov 22 23:40:56 2006 pour KPlato par  doxygen 1.5.1-p1