Commit 84429f7b authored by Christian Loose's avatar Christian Loose
Browse files

* Make ChangeLog dialog more KDE standard conformant

  QDialog -> KDialogBase

svn path=/trunk/kdesdk/cervisia/; revision=192896
parent 5f181c93
2002-12-08 Christian Loose <christian.loose@hamburg.de>
* Make ChangeLog dialog more KDE standard conformant
QDialog -> KDialogBase
2002-12-05 Christian Loose <christian.loose@hamburg.de>
* Don't add a new line to the end of changelog
......
......@@ -16,7 +16,7 @@
#include <qfile.h>
#include <qfileinfo.h>
#include <qlayout.h>
#include <qvbox.h>
#include <qmultilinedit.h>
#include <qpushbutton.h>
#include <qtextstream.h>
......@@ -41,35 +41,24 @@ ChangeLogDialog::Options *ChangeLogDialog::options = 0;
ChangeLogDialog::ChangeLogDialog(QWidget *parent, const char *name)
: QDialog(parent, name, true,
WStyle_Customize|WStyle_NormalBorder|WStyle_Title|WStyle_MinMax)
: KDialogBase(parent, name, true, QString::null, Ok | Cancel)
{
setCaption(i18n("Edit ChangeLog"));
QBoxLayout *layout = new QVBoxLayout(this, 10);
edit = new QMultiLineEdit(this);
QVBox* box = new QVBox(this);
setMainWidget(box);
box->setSpacing(10);
edit = new QMultiLineEdit(box);
QFontMetrics fm(fontMetrics());
edit->setMinimumSize(fm.width("0123456789")*8,
fm.lineSpacing()*20);
edit->setFont(KGlobalSettings::fixedFont());
edit->setFocus();
layout->addWidget(edit, 10);
QFrame *frame = new QFrame(this);
QFrame *frame = new QFrame(box);
frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
layout->addWidget(frame, 0);
KButtonBox *buttonbox = new KButtonBox(this);
buttonbox->addStretch();
QPushButton *ok = buttonbox->addButton(i18n("&OK"));
QPushButton *cancel = buttonbox->addButton(i18n("Cancel"));
connect( ok, SIGNAL(clicked()), this, SLOT(accept()) );
connect( cancel, SIGNAL(clicked()), this, SLOT(reject()) );
buttonbox->layout();
layout->addWidget(buttonbox, 0);
layout->activate();
resize(sizeHint());
if (options)
......@@ -99,7 +88,7 @@ void ChangeLogDialog::done(int res)
if (!options)
options = new Options;
options->size = size();
QDialog::done(res);
}
......
......@@ -15,13 +15,13 @@
#ifndef CHANGELOGDLG_H
#define CHANGELOGDLG_H
#include <qdialog.h>
#include <kdialogbase.h>
class QMultiLineEdit;
class KConfig;
class ChangeLogDialog : public QDialog
class ChangeLogDialog : public KDialogBase
{
Q_OBJECT
......@@ -33,7 +33,7 @@ public:
static void loadOptions(KConfig *config);
static void saveOptions(KConfig *config);
protected slots:
virtual void done(int res);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment