From 2bb467c3caa4f7d0ca378776c89eebaaf1e912c3 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 13 Sep 2008 21:12:46 +0000 Subject: [FIX] Sigmod description field fixed [FIX] Fixed a bug with the Validation dialog being called twice with the same editor widget git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@261 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- sigmodr/ValidationDialog.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'sigmodr/ValidationDialog.cpp') diff --git a/sigmodr/ValidationDialog.cpp b/sigmodr/ValidationDialog.cpp index 643303af..fe87bb82 100644 --- a/sigmodr/ValidationDialog.cpp +++ b/sigmodr/ValidationDialog.cpp @@ -35,9 +35,8 @@ Sigmodr::ValidationDialog::ValidationDialog(Sigmod::Object* object, QWidget* par QWidget(parent), m_processed(false), m_object(object), - m_valTree(new QTreeWidget) + m_valTree(NULL) { - m_valTree->setHeaderHidden(true); connect(m_object, SIGNAL(changed()), this, SLOT(objectChanged())); } @@ -57,7 +56,8 @@ void Sigmodr::ValidationDialog::process() { m_errors = 0; m_warnings = 0; - m_valTree->clear(); + m_valTree = new QTreeWidget; + m_valTree->setHeaderHidden(true); m_parents.clear(); m_parents.push(ObjectErrorCount(m_valTree->invisibleRootItem(), 0)); KProgressDialog* progress = new KProgressDialog(this, "Validating", "Please wait"); @@ -87,13 +87,15 @@ void Sigmodr::ValidationDialog::show() KDialog* dialog = new KDialog(this); dialog->setCaption("Validation Messages"); dialog->setButtons(KDialog::Ok); - QWidget* widget = new QWidget(this); - QVBoxLayout* layout = new QVBoxLayout(widget); - layout->addWidget(new QLabel(QString("Warnings: %1\nErrors: %2").arg(m_warnings).arg(m_errors), widget)); + QWidget* widget = new QWidget; + QVBoxLayout* layout = new QVBoxLayout; + layout->addWidget(new QLabel(QString("Warnings: %1\nErrors: %2").arg(m_warnings).arg(m_errors))); layout->addWidget(m_valTree); + widget->setLayout(layout); dialog->setMainWidget(widget); dialog->exec(); delete dialog; + m_processed = false; } else KMessageBox::information(this, "No messages", "Validation"); -- cgit