summaryrefslogtreecommitdiffstats
path: root/vcs/clearcase/commentdlg.cpp
blob: 36b3bc6f4fbd2cd8cef97a108b15b34b2d08dc80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/***************************************************************************
 *   Copyright (C) 2003 by Ajay Guleria                                    *
 *   ajay_guleria at yahoo dot com                                         *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include "commentdlg.h"

#include <qlayout.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <kapplication.h>
#include <kbuttonbox.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <kstdguiitem.h>

CcaseCommentDlg::CcaseCommentDlg(bool bCheckin)
  : QDialog(0, "", true)
{
  setCaption( i18n("Clearcase Comment") );

  QBoxLayout *layout = new QVBoxLayout(this, 10);

  QLabel *messagelabel = new QLabel(i18n("Enter log message:"), this);
  messagelabel->setMinimumSize(messagelabel->sizeHint());
  layout->addWidget(messagelabel, 0);

  _edit = new QMultiLineEdit(this);
  QFontMetrics fm(_edit->fontMetrics());
  _edit->setMinimumSize(fm.width("0")*40, fm.lineSpacing()*3);
  layout->addWidget(_edit, 10);

  QBoxLayout *layout2 = new QHBoxLayout(layout);
  if(bCheckin) {
    _check = new QCheckBox(i18n("Reserve"), this);
    layout2->addWidget(_check);
  }

  KButtonBox *buttonbox = new KButtonBox(this);
  buttonbox->addStretch();
  QPushButton *ok = buttonbox->addButton(KStdGuiItem::ok());
  QPushButton *cancel = buttonbox->addButton(KStdGuiItem::cancel());
  connect(ok, SIGNAL(clicked()), SLOT(accept()) );
  connect(cancel, SIGNAL(clicked()), SLOT(reject()) );
  ok->setDefault(true);
  buttonbox->layout();
  layout2->addWidget(buttonbox, 0);

  layout->activate();
  adjustSize();
}



#include "commentdlg.moc"