summaryrefslogtreecommitdiffstats
path: root/sigmodr/ValidationDialog.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-09-13 21:12:46 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-09-13 21:12:46 +0000
commit2bb467c3caa4f7d0ca378776c89eebaaf1e912c3 (patch)
tree691542caead65355b0adae5e1407d6c6fba416ab /sigmodr/ValidationDialog.cpp
parent493a35f02cc558ce7f06ef2a749b22359c608281 (diff)
downloadsigen-2bb467c3caa4f7d0ca378776c89eebaaf1e912c3.tar.gz
sigen-2bb467c3caa4f7d0ca378776c89eebaaf1e912c3.tar.xz
sigen-2bb467c3caa4f7d0ca378776c89eebaaf1e912c3.zip
[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
Diffstat (limited to 'sigmodr/ValidationDialog.cpp')
-rw-r--r--sigmodr/ValidationDialog.cpp14
1 files changed, 8 insertions, 6 deletions
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");