KDevelop API Documentation

commentdlg.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2003 by Ajay Guleria                                    *
00003  *   ajay_guleria at yahoo dot com                                         *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  ***************************************************************************/
00011 
00012 #include "commentdlg.h"
00013 
00014 #include <qlayout.h>
00015 #include <qlabel.h>
00016 #include <qpushbutton.h>
00017 #include <kapplication.h>
00018 #include <kbuttonbox.h>
00019 #include <klocale.h>
00020 #include <kmessagebox.h>
00021 #include <kstdguiitem.h>
00022 
00023 CcaseCommentDlg::CcaseCommentDlg(bool bCheckin)
00024   : QDialog(0, "", true)
00025 {
00026   setCaption( i18n("Clearcase Comment") );
00027 
00028   QBoxLayout *layout = new QVBoxLayout(this, 10);
00029 
00030   QLabel *messagelabel = new QLabel(i18n("Enter log message:"), this);
00031   messagelabel->setMinimumSize(messagelabel->sizeHint());
00032   layout->addWidget(messagelabel, 0);
00033 
00034   _edit = new QMultiLineEdit(this);
00035   QFontMetrics fm(_edit->fontMetrics());
00036   _edit->setMinimumSize(fm.width("0")*40, fm.lineSpacing()*3);
00037   layout->addWidget(_edit, 10);
00038 
00039   QBoxLayout *layout2 = new QHBoxLayout(layout);
00040   if(bCheckin) {
00041     _check = new QCheckBox("Reserve", this);
00042     layout2->addWidget(_check);
00043   }
00044 
00045   KButtonBox *buttonbox = new KButtonBox(this);
00046   buttonbox->addStretch();
00047 #if KDE_IS_VERSION( 3, 2, 90 )
00048   QPushButton *ok = buttonbox->addButton(KStdGuiItem::ok());
00049   QPushButton *cancel = buttonbox->addButton(KStdGuiItem::cancel());
00050 #else
00051   QPushButton *ok = buttonbox->addButton(i18n("OK"));
00052   QPushButton *cancel = buttonbox->addButton(i18n("Cancel"));
00053 #endif
00054   connect(ok, SIGNAL(clicked()), SLOT(accept()) );
00055   connect(cancel, SIGNAL(clicked()), SLOT(reject()) );
00056   ok->setDefault(true);
00057   buttonbox->layout();
00058   layout2->addWidget(buttonbox, 0);
00059 
00060   layout->activate();
00061   adjustSize();
00062 }
00063 
00064 
00065 
00066 #include "commentdlg.moc"
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:22:43 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003