Skip to content
Snippets Groups Projects
Commit f839d6ef authored by Bigot Quentin's avatar Bigot Quentin
Browse files

modify buttons text in FilterChoice.cpp and reorganize code in FilterEditor.cpp

parent a0002f0a
No related branches found
No related tags found
No related merge requests found
......@@ -116,8 +116,8 @@ void FilterChoice::initUI()
_stdDevBox->setVisible(false);
QGroupBox* radioBox = new QGroupBox(tr("Resulting image type"));
_stdResButton = new QRadioButton(tr("Standard"));
_dblResButton = new QRadioButton(tr("Floating point"));
_stdResButton = new QRadioButton(tr("UChar"));
_dblResButton = new QRadioButton(tr("Double"));
radioBox->setLayout(new QHBoxLayout());
radioBox->layout()->addWidget(_stdResButton);
radioBox->layout()->addWidget(_dblResButton);
......
......@@ -151,33 +151,33 @@ void FilterEditor::saveXML(vector<Filter*> filtersToSave)
}
else
{
file.open(QIODevice::ReadOnly);
doc.setContent(&file);
file.close();
QDomElement root = doc.documentElement();
QDomNode child = root.firstChild();
while(!child.isNull())
{
QDomElement e = child.toElement();
// We know how to treat appearance and geometry
if (e.attribute("name") == _name->text())
{
QMessageBox msgBox(QMessageBox::Warning, tr("Warning!"), tr("This filter name is already use."));
msgBox.setInformativeText(tr("Do you want to replace it?"));
msgBox.setStandardButtons(QMessageBox::No|QMessageBox::Yes);
msgBox.setDefaultButton(QMessageBox::No);
int ret = msgBox.exec();
if(ret == QMessageBox::Yes)
file.open(QIODevice::ReadOnly);
doc.setContent(&file);
file.close();
QDomElement root = doc.documentElement();
QDomNode child = root.firstChild();
while(!child.isNull())
{
oldFilter = e;
replace = true;
QDomElement e = child.toElement();
// We know how to treat appearance and geometry
if (e.attribute("name") == _name->text())
{
QMessageBox msgBox(QMessageBox::Warning, tr("Warning!"), tr("This filter name is already use."));
msgBox.setInformativeText(tr("Do you want to replace it?"));
msgBox.setStandardButtons(QMessageBox::No|QMessageBox::Yes);
msgBox.setDefaultButton(QMessageBox::No);
int ret = msgBox.exec();
if(ret == QMessageBox::Yes)
{
oldFilter = e;
replace = true;
}
else
return;
}
child = child.nextSibling();
}
else
return;
}
child = child.nextSibling();
}
}
// root node
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment