kplato
kptmainprojectdialog.cc00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <qvbox.h>
00021
00022 #include <klocale.h>
00023 #include <kcommand.h>
00024
00025 #include <kdebug.h>
00026
00027 #include "kptmainprojectdialog.h"
00028 #include "kptproject.h"
00029 #include "kptmainprojectpanel.h"
00030
00031 namespace KPlato
00032 {
00033
00034 MainProjectDialog::MainProjectDialog(Project &p, QWidget *parent, const char *name)
00035 : KDialogBase( Swallow, i18n("Project Settings"), Ok|Cancel, Ok, parent, name, true, true),
00036 project(p)
00037 {
00038 panel = new MainProjectPanel(project, this);
00039
00040 setMainWidget(panel);
00041 enableButtonOK(false);
00042 resize( QSize(500, 410).expandedTo(minimumSizeHint()));
00043 connect(panel, SIGNAL(obligatedFieldsFilled(bool)), SLOT(enableButtonOK(bool)));
00044 }
00045
00046
00047 void MainProjectDialog::slotOk() {
00048 if (!panel->ok())
00049 return;
00050
00051 accept();
00052 }
00053
00054 KCommand *MainProjectDialog::buildCommand(Part *part) {
00055 KMacroCommand *m = 0;
00056 QString c = i18n("Modify main project");
00057 KCommand *cmd = panel->buildCommand(part);
00058 if (cmd) {
00059 if (!m) m = new KMacroCommand(c);
00060 m->addCommand(cmd);
00061 }
00062 return m;
00063 }
00064
00065 }
00066
00067 #include "kptmainprojectdialog.moc"
|