Skip to content
Permalink
Browse files

Fix for #231 - allow parameters with fixed number of line edits, e.g.…

… grid=20,30

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6195 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Dec 6, 2006
1 parent 1b330fc commit a33981c7f3b50dc3ce55cb4688f78db10849cc08
Showing with 29 additions and 5 deletions.
  1. +29 −5 src/plugins/grass/qgsgrassmodule.cpp
@@ -1728,12 +1728,34 @@ QgsGrassModuleOption::QgsGrassModuleOption ( QgsGrassModule *module, QString key
}
}
}

addLineEdit();

// add/delete buttons for multiple options
if ( gelem.attribute("multiple") == "yes" )

QDomNode keydescNode = gnode.namedItem ( "keydesc" );
if (!keydescNode.isNull())
{
// fixed number of line edits
// Example:
// <keydesc>
// <item order="1">rows</item>
// <item order="2">columns</item>
// </keydesc>

QDomNodeList keydescs = keydescNode.childNodes();
for (int k = 0; k < keydescs.count(); k++)
{
QDomNode nodeItem = keydescs.at(k);
QString itemDesc = nodeItem.toElement().text().stripWhiteSpace();
//QString itemDesc = nodeItem.firstChild().toText().data();
std::cerr << "keydesc item = " << itemDesc.toLocal8Bit().data() << std::endl;

addLineEdit();
}

setLayout(mLayout);
}
else if ( gelem.attribute("multiple") == "yes" )
{
// variable number of line edits
// add/delete buttons for multiple options
QHBoxLayout *l = new QHBoxLayout (this);
QVBoxLayout *vl = new QVBoxLayout ();
l->insertLayout( -1, mLayout );
@@ -1753,6 +1775,8 @@ QgsGrassModuleOption::QgsGrassModuleOption ( QgsGrassModule *module, QString key
}
else
{
// only one line edit
addLineEdit();
setLayout ( mLayout );
}
}

0 comments on commit a33981c

Please sign in to comment.
You can’t perform that action at this time.