diff moreinformationdialog.cpp @ 291:2e34e7ee7baf more_information_dialog

Make several operations use the new more-information dialog
author Chris Cannam
date Mon, 21 Feb 2011 15:55:39 +0000
parents c0c254f67346
children fd9dc5a457d8
line wrap: on
line diff
--- a/moreinformationdialog.cpp	Mon Feb 21 14:23:02 2011 +0000
+++ b/moreinformationdialog.cpp	Mon Feb 21 15:55:39 2011 +0000
@@ -40,14 +40,15 @@
     setLayout(layout);
 
     m_iconLabel = new QLabel;
-    layout->addWidget(m_iconLabel, 0, 0);
+    layout->addWidget(m_iconLabel, 0, 0, 2, 1, Qt::AlignTop);
 
     QLabel *headLabel = new QLabel(QString("<qt><h3>%1</h3></qt>").arg(head));
     layout->addWidget(headLabel, 0, 1);
 
     QLabel *textLabel = new QLabel(text);
     textLabel->setTextFormat(Qt::RichText);
-    layout->addWidget(textLabel, 1, 1);
+    textLabel->setWordWrap(true);
+    layout->addWidget(textLabel, 1, 1, Qt::AlignTop);
 
     QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Ok);
     connect(bb, SIGNAL(accepted()), this, SLOT(accept()));
@@ -55,9 +56,12 @@
 
     m_moreButton = bb->addButton(tr("More Details..."),
                                  QDialogButtonBox::ActionRole);
+    m_moreButton->setDefault(false);
 
     connect(m_moreButton, SIGNAL(clicked()), this, SLOT(moreClicked()));
 
+    bb->button(QDialogButtonBox::Ok)->setDefault(true);
+
     m_moreText = new QTextEdit();
     m_moreText->setAcceptRichText(false);
     m_moreText->document()->setPlainText(more);
@@ -72,7 +76,9 @@
     layout->addWidget(m_moreText, 3, 0, 1, 2);
 
     m_moreText->hide();
+    if (more == "") m_moreButton->hide();
 
+    layout->setRowStretch(1, 20);
     layout->setColumnStretch(1, 20);
     setMinimumWidth(400);
 }