// **************************************************************************** // Method: XMLEditFunctions::functionlistNew // // Programmer: Jeremy Meredith // Creation: October 17, 2002 // // Modifications: // Brad Whitlock, Thu Mar 6 15:57:07 PST 2008 // Added default target of xml2atts. // // Brad Whitlock, Mon Apr 28 16:11:51 PDT 2008 // Added tr(). // // Cyrus Harrison, Thu May 15 16:00:46 PDT 2008 // First pass at porting to Qt 4.4.0 // // **************************************************************************** void XMLEditFunctions::functionlistNew() { Attribute *a = xmldoc->attribute; int newid = 1; bool okay = false; QString newname; while (!okay) { okay = true; newname = tr("unnamed%1").arg(newid); for (int i=0; i<functionlist->count() && okay; i++) { if (functionlist->item(i)->text() == newname) okay = false; } if (!okay) newid++; } Function *f = new Function(newname,"","",true,true,"xml2atts"); a->functions.push_back(f); UpdateWindowContents(); for (int i=0; i<functionlist->count(); i++) { if (functionlist->item(i)->text() == newname) { functionlist->setCurrentRow(i); UpdateWindowSingleItem(); } } }
// **************************************************************************** // Method: XMLEditFunctions::functionlistDel // // Programmer: Jeremy Meredith // Creation: October 17, 2002 // // Modifications: // Cyrus Harrison, Thu May 15 16:00:46 PDT 2008 // First pass at porting to Qt 4.4.0 // // **************************************************************************** void XMLEditFunctions::functionlistDel() { Attribute *a = xmldoc->attribute; int index = functionlist->currentRow(); if (index == -1) return; Function *f = a->functions[index]; std::vector<Function*> newlist; for (size_t i=0; i<a->functions.size(); i++) { if (a->functions[i] != f) newlist.push_back(a->functions[i]); } a->functions = newlist; delete f; UpdateWindowContents(); if (index >= functionlist->count()) index = functionlist->count()-1; functionlist->setCurrentRow(index); }
// **************************************************************************** // Method: XMLEditConstants::constantlistDel // // Programmer: Jeremy Meredith // Creation: October 17, 2002 // // Modifications: // Cyrus Harrison, Thu May 15 16:00:46 PDT 200 // First pass at porting to Qt 4.4.0 // // **************************************************************************** void XMLEditConstants::constantlistDel() { Attribute *a = xmldoc->attribute; int index = constantlist->currentRow(); if (index == -1) return; Constant *c = a->constants[index]; std::vector<Constant*> newlist; for (size_t i=0; i<a->constants.size(); i++) { if (a->constants[i] != c) newlist.push_back(a->constants[i]); } a->constants = newlist; delete c; UpdateWindowContents(); if (index >= constantlist->count()) index = constantlist->count()-1; constantlist->setCurrentRow(index); }
// **************************************************************************** // Method: XMLEditConstants::constantlistNew // // Programmer: Jeremy Meredith // Creation: October 17, 2002 // // Modifications: // Brad Whitlock, Thu Mar 6 16:17:13 PST 2008 // Added xml2atts target. // // Cyrus Harrison, Thu May 15 16:00:46 PDT 200 // First pass at porting to Qt 4.4.0 // // **************************************************************************** void XMLEditConstants::constantlistNew() { Attribute *a = xmldoc->attribute; int newid = 1; bool okay = false; QString newname; while (!okay) { okay = true; newname = tr("unnamed%1").arg(newid); for (int i=0; i<constantlist->count() && okay; i++) { if (constantlist->item(i)->text() == newname) okay = false; } if (!okay) newid++; } Constant *c = new Constant(newname,"","",false, "xml2atts"); a->constants.push_back(c); UpdateWindowContents(); for (int i=0; i<constantlist->count(); i++) { if (constantlist->item(i)->text() == newname) { constantlist->setCurrentRow(i); UpdateWindowSingleItem(); } } }
void XMLEditPlugin::hasIconChanged(bool val) { if (xmldoc->docType != "Plugin") return; if(val) xmldoc->plugin->iconFile = xmldoc->plugin->name + ".xpm"; else xmldoc->plugin->iconFile = ""; UpdateWindowContents(); UpdateWindowSensitivity(); }
// **************************************************************************** // Method: XMLEditPlugin::pluginTypeChanged // // Programmer: Jeremy Meredith // Creation: October 17, 2002 // // **************************************************************************** void XMLEditPlugin::pluginTypeChanged(int index) { if (xmldoc->docType != "Plugin") return; switch (index) { case 1: xmldoc->plugin->type = "plot"; break; case 2: xmldoc->plugin->type = "operator"; break; case 3: xmldoc->plugin->type = "database"; break; default: xmldoc->plugin->type = ""; break; } UpdateWindowContents(); }
// **************************************************************************** // Method: XMLEditPlugin::attpluginGroupChanged // // Programmer: Jeremy Meredith // Creation: October 17, 2002 // // Modifications: // Brad Whitlock, Thu Mar 13 13:02:53 PST 2003 // I added another argument to the plugin constructor. // // Hank Childs, Sat Sep 13 08:27:57 PDT 2003 // Added another argument to plugin constructor. // // Jeremy Meredith, Wed Aug 25 11:57:08 PDT 2004 // Added the "no-engine" and "engine-only" options to the plugin // constructor. // // Hank Childs, Tue May 24 10:19:40 PDT 2005 // Added another argument to plugin constructor. // // **************************************************************************** void XMLEditPlugin::attpluginGroupChanged(int id) { if (id == 0) { xmldoc->docType = "Plugin"; if (!xmldoc->plugin) { xmldoc->plugin = new Plugin("","","","","","","",false,false,false, false); xmldoc->plugin->atts = xmldoc->attribute; } } else { xmldoc->docType = "Attribute"; } UpdateWindowContents(); }
// **************************************************************************** // Method: XMLEditMakefile::engSpecificCodeChanged // // Programmer: Cyrus Harrison // Creation: March 7, 2007 // // **************************************************************************** void XMLEditMakefile::engSpecificCodeChanged() { xmldoc->plugin->hasEngineSpecificCode = engSpecificCode->isChecked(); UpdateWindowContents(); }
// **************************************************************************** // Method: XMLEditMakefile::mdSpecificCodeChanged // // Programmer: Jeremy Meredith // Creation: July 7, 2004 // // **************************************************************************** void XMLEditMakefile::mdSpecificCodeChanged() { xmldoc->plugin->has_MDS_specific_code = mdSpecificCode->isChecked(); UpdateWindowContents(); }
// **************************************************************************** // Method: XMLEditMakefile::customvwfilesChanged // // Programmer: Brad Whitlock // Creation: Fri Feb 23 17:54:08 PST 2007 // // **************************************************************************** void XMLEditMakefile::customvwfilesChanged() { xmldoc->plugin->customvwfiles = customVWFiles->isChecked(); UpdateWindowContents(); }
// **************************************************************************** // Method: XMLEditMakefile::customelibsParChanged // // Programmer: Cyrus Harrison // Creation: September 19, 2008 // // Modifications: // Jeremy Meredith, Tue Sep 8 14:57:13 EDT 2009 // Split into ser/par versions. // // **************************************************************************** void XMLEditMakefile::customelibsParChanged() { xmldoc->plugin->customelibsPar = customELibsPar->isChecked(); UpdateWindowContents(); }
// **************************************************************************** // Method: XMLEditMakefile::custommlibsChanged // // Programmer: Cyrus Harrison // Creation: September 19, 2008 // // **************************************************************************** void XMLEditMakefile::custommlibsChanged() { xmldoc->plugin->custommlibs = customMLibs->isChecked(); UpdateWindowContents(); }