Commit b8e8cf2b authored by Pino Toscano's avatar Pino Toscano

Simplify layout of LogDialog

A simple layout with widgets in it is enough, no need for extra
widgets.  Also change the button in the button box, Close instead of
Ok.
parent 56a33e39
......@@ -72,26 +72,18 @@ class LogDialog : public QDialog
: QDialog( parent )
{
setWindowTitle( i18n("Search Error Log") );
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
QFrame *topFrame = new QFrame( this );
mainLayout->addWidget(topFrame);
mainLayout->addWidget(buttonBox);
QBoxLayout *topLayout = new QVBoxLayout( topFrame );
mTextView = new QTextEdit( topFrame );
mTextView->setReadOnly ( true );
QVBoxLayout *mainLayout = new QVBoxLayout( this );
mTextView = new QTextEdit( this );
mTextView->setReadOnly( true );
mTextView->setWordWrapMode( QTextOption::NoWrap );
topLayout->addWidget( mTextView );
mainLayout->addWidget( mTextView );
QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Close );
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
mainLayout->addWidget( buttonBox );
KConfigGroup cg = KSharedConfig::openConfig()->group( "logdialog" );
KWindowConfig::restoreWindowSize( windowHandle(), cg );
......
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