// **************************************************************************** // Method: XMLEditFunctions::UpdateWindowSingleItem // // Purpose: // Update the window based on the state a single item in the list. // // Programmer: Jeremy Meredith // Creation: October 17, 2002 // // Modifications: // Brad Whitlock, Thu Mar 6 15:50:51 PST 2008 // Added target. // // Brad Whitlock, Mon Apr 28 16:08:06 PDT 2008 // Added access. // // Cyrus Harrison, Thu May 15 16:00:46 PDT 2008 // First pass at porting to Qt 4.4.0 // // **************************************************************************** void XMLEditFunctions::UpdateWindowSingleItem() { BlockAllSignals(true); Attribute *a = xmldoc->attribute; int index = functionlist->currentRow(); if (index == -1) { name->setText(""); typeGroup->button(0)->setChecked(false); member->setChecked(false); target->setText(""); declaration->setText(""); definition->setText(""); access->setCurrentIndex(0); } else { Function *f = a->functions[index]; name->setText(f->name); typeGroup->button(f->user ? 0 : 1)->setChecked(true); target->setText(f->target); declaration->setText(f->decl); definition->setText(f->def); member->setChecked(f->member); access->setCurrentIndex((int)f->accessType); } UpdateWindowSensitivity(); BlockAllSignals(false); }
// **************************************************************************** // Method: XMLEditConstants::UpdateWindowSingleItem // // Purpose: // Update the window based on the state a single item in the list. // // Programmer: Jeremy Meredith // Creation: October 17, 2002 // // Modifications: // Brad Whitlock, Thu Mar 6 16:12:45 PST 2008 // Added targets. // // Cyrus Harrison, Thu May 15 16:00:46 PDT 200 // First pass at porting to Qt 4.4.0 // // **************************************************************************** void XMLEditConstants::UpdateWindowSingleItem() { BlockAllSignals(true); Attribute *a = xmldoc->attribute; int index = constantlist->currentRow(); if (index == -1) { target->setText(""); name->setText(""); member->setChecked(false); declaration->setText(""); definition->setText(""); } else { Constant *c = a->constants[index]; target->setText(c->target); name->setText(c->name); declaration->setText(c->decl); definition->setText(c->def); member->setChecked(c->member); } UpdateWindowSensitivity(); BlockAllSignals(false); }
void XMLEditPlugin::hasOptionsChanged(bool val) { if (xmldoc->docType != "Plugin") return; xmldoc->plugin->hasoptions = val; UpdateWindowSensitivity(); }
void XMLEditPlugin::hasWriterChanged(bool val) { if (xmldoc->docType != "Plugin") return; xmldoc->plugin->haswriter = val; UpdateWindowSensitivity(); }
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: XMLEditAttribute::UpdateWindowContents // // Purpose: // Update the window based on the current state. // // Programmer: Jeremy Meredith // Creation: October 17, 2002 // // Modifications: // Brad Whitlock, Wed Mar 7 16:06:43 PST 2007 // Added keyframe. // // Brad Whitlock, Thu Mar 6 14:51:29 PST 2008 // Adapted to newer CodeFile implementation. // // Mark C. Miller, Wed Aug 26 11:03:19 PDT 2009 // Added support for custom base class for derived state objects. // **************************************************************************** void XMLEditAttribute::UpdateWindowContents() { BlockAllSignals(true); bool plugin = (xmldoc->docType == "Plugin"); Attribute *a = xmldoc->attribute; name->setText(a->name); purpose->setText(a->purpose); if (a->codeFile) codefile->setText(a->codeFile->FileBase()); else codefile->setText(""); if (plugin) { exportAPI->setText(""); exportInclude->setText(""); } else { exportAPI->setText(a->exportAPI); exportInclude->setText(a->exportInclude); } persistent->setChecked(a->persistent); keyframe->setChecked(a->keyframe); customBaseClass->setChecked(a->custombase); if (customBaseClass->isChecked()) baseClass->setText(a->baseClass.isNull()?"AttributeSubject":a->baseClass); else baseClass->setText("AttributeSubject"); UpdateWindowSensitivity(); BlockAllSignals(false); }
void XMLEditPlugin::UpdateWindowContents() { BlockAllSignals(true); if (xmldoc->docType == "Plugin") { attpluginGroup->button(0)->setChecked(true); name->setText(xmldoc->plugin->name); label->setText(xmldoc->plugin->label); version->setText(xmldoc->plugin->version); varTypeMesh->setChecked(false); varTypeScalar->setChecked(false); varTypeVector->setChecked(false); varTypeMaterial->setChecked(false); varTypeSubset->setChecked(false); varTypeSpecies->setChecked(false); varTypeCurve->setChecked(false); varTypeTensor->setChecked(false); varTypeSymmetricTensor->setChecked(false); varTypeLabel->setChecked(false); varTypeArray->setChecked(false); createExpressions->setChecked(false); inOpVarTypeMesh->setChecked(false); inOpVarTypeScalar->setChecked(false); inOpVarTypeVector->setChecked(false); inOpVarTypeMaterial->setChecked(false); inOpVarTypeSubset->setChecked(false); inOpVarTypeSpecies->setChecked(false); inOpVarTypeCurve->setChecked(false); inOpVarTypeTensor->setChecked(false); inOpVarTypeSymmetricTensor->setChecked(false); inOpVarTypeLabel->setChecked(false); inOpVarTypeArray->setChecked(false); outOpVarTypeMesh->setChecked(false); outOpVarTypeScalar->setChecked(false); outOpVarTypeVector->setChecked(false); outOpVarTypeMaterial->setChecked(false); outOpVarTypeSubset->setChecked(false); outOpVarTypeSpecies->setChecked(false); outOpVarTypeCurve->setChecked(false); outOpVarTypeTensor->setChecked(false); outOpVarTypeSymmetricTensor->setChecked(false); outOpVarTypeLabel->setChecked(false); outOpVarTypeArray->setChecked(false); enabledByDefault->setChecked(xmldoc->plugin->enabledByDefault); dbType->setCurrentIndex(0); filePatterns->setText(""); if (xmldoc->plugin->type == "plot") { iconFile->setText(xmldoc->plugin->iconFile); hasIcon->setChecked(xmldoc->plugin->iconFile.length() > 0); pluginType->setCurrentIndex(1); std::vector<QString> types = SplitValues(xmldoc->plugin->vartype); for (size_t i=0; i<types.size(); i++) { if (types[i] == "mesh") varTypeMesh->setChecked(true); else if (types[i] == "scalar") varTypeScalar->setChecked(true); else if (types[i] == "vector") varTypeVector->setChecked(true); else if (types[i] == "material") varTypeMaterial->setChecked(true); else if (types[i] == "subset") varTypeSubset->setChecked(true); else if (types[i] == "species") varTypeSpecies->setChecked(true); else if (types[i] == "curve") varTypeCurve->setChecked(true); else if (types[i] == "tensor") varTypeTensor->setChecked(true); else if (types[i] == "symmetrictensor") varTypeSymmetricTensor->setChecked(true); else if (types[i] == "label") varTypeLabel->setChecked(true); else if (types[i] == "array") varTypeArray->setChecked(true); } } else if (xmldoc->plugin->type == "operator") { iconFile->setText(xmldoc->plugin->iconFile); hasIcon->setChecked(xmldoc->plugin->iconFile.length() > 0); createExpressions->setChecked(xmldoc->plugin->createExpression); std::vector<QString> types = SplitValues(xmldoc->plugin->exprInType); for (size_t i=0; i<types.size(); i++) { if (types[i] == "mesh") inOpVarTypeMesh->setChecked(true); else if (types[i] == "scalar") inOpVarTypeScalar->setChecked(true); else if (types[i] == "vector") inOpVarTypeVector->setChecked(true); else if (types[i] == "material") inOpVarTypeMaterial->setChecked(true); else if (types[i] == "subset") inOpVarTypeSubset->setChecked(true); else if (types[i] == "species") inOpVarTypeSpecies->setChecked(true); else if (types[i] == "curve") inOpVarTypeCurve->setChecked(true); else if (types[i] == "tensor") inOpVarTypeTensor->setChecked(true); else if (types[i] == "symmetrictensor") inOpVarTypeSymmetricTensor->setChecked(true); else if (types[i] == "label") inOpVarTypeLabel->setChecked(true); else if (types[i] == "array") inOpVarTypeArray->setChecked(true); } types = SplitValues(xmldoc->plugin->exprOutType); for (size_t i=0; i<types.size(); i++) { if (types[i] == "mesh") outOpVarTypeMesh->setChecked(true); else if (types[i] == "scalar") outOpVarTypeScalar->setChecked(true); else if (types[i] == "vector") outOpVarTypeVector->setChecked(true); else if (types[i] == "material") outOpVarTypeMaterial->setChecked(true); else if (types[i] == "subset") outOpVarTypeSubset->setChecked(true); else if (types[i] == "species") outOpVarTypeSpecies->setChecked(true); else if (types[i] == "curve") outOpVarTypeCurve->setChecked(true); else if (types[i] == "tensor") outOpVarTypeTensor->setChecked(true); else if (types[i] == "symmetrictensor") outOpVarTypeSymmetricTensor->setChecked(true); else if (types[i] == "label") outOpVarTypeLabel->setChecked(true); else if (types[i] == "array") outOpVarTypeArray->setChecked(true); } pluginType->setCurrentIndex(2); } else if (xmldoc->plugin->type == "database") { iconFile->setText(""); hasIcon->setChecked(false); hasWriter->setChecked(xmldoc->plugin->haswriter); hasOptions->setChecked(xmldoc->plugin->hasoptions); filePatternsStrict->setChecked(xmldoc->plugin->filePatternsStrict); opensWholeDirectory->setChecked(xmldoc->plugin->opensWholeDirectory); pluginType->setCurrentIndex(3); filePatterns->setText(JoinValues(xmldoc->plugin->filePatterns, ' ')); if (xmldoc->plugin->dbtype == "STSD") dbType->setCurrentIndex(1); else if (xmldoc->plugin->dbtype == "MTSD") dbType->setCurrentIndex(2); else if (xmldoc->plugin->dbtype == "STMD") dbType->setCurrentIndex(3); else if (xmldoc->plugin->dbtype == "MTMD") dbType->setCurrentIndex(4); else if (xmldoc->plugin->dbtype == "Custom") dbType->setCurrentIndex(5); } else { iconFile->setText(""); hasIcon->setChecked(false); hasWriter->setChecked(false); hasOptions->setChecked(false); enabledByDefault->setChecked(true); pluginType->setCurrentIndex(0); } } else { attpluginGroup->button(1)->setChecked(true); name->setText(xmldoc->attribute->name); label->setText(""); version->setText(""); varTypeMesh->setChecked(false); varTypeScalar->setChecked(false); varTypeVector->setChecked(false); varTypeMaterial->setChecked(false); varTypeSubset->setChecked(false); varTypeSpecies->setChecked(false); varTypeCurve->setChecked(false); varTypeTensor->setChecked(false); varTypeSymmetricTensor->setChecked(false); varTypeLabel->setChecked(false); varTypeArray->setChecked(false); hasIcon->setChecked(false); iconFile->setText(""); hasWriter->setChecked(false); hasOptions->setChecked(false); pluginType->setCurrentIndex(0); dbType->setCurrentIndex(0); filePatterns->setText(""); filePatternsStrict->setChecked(false); opensWholeDirectory->setChecked(false); enabledByDefault->setChecked(true); } UpdateWindowSensitivity(); BlockAllSignals(false); }
void QvisAppearanceWindow::UpdateWindow(bool doAll) { AppearanceAttributes *atts = (AppearanceAttributes *)subject; int j; for(int i = 0; i < atts->NumAttributes(); ++i) { if(!doAll) { if(!atts->IsSelected(i)) continue; } switch(i) { case AppearanceAttributes::ID_useSystemDefault: { // new scope bool val = atts->GetUseSystemDefault(); useSysDefaultCheckBox->blockSignals(true); if(val) useSysDefaultCheckBox->setCheckState(Qt::Checked); else useSysDefaultCheckBox->setCheckState(Qt::Unchecked); useSysDefaultCheckBox->blockSignals(false); } break; case AppearanceAttributes::ID_background: { // new scope QColor bg; if(atts->GetUseSystemDefault()) bg = QColor(atts->GetDefaultBackground().c_str()); else bg = QColor(atts->GetBackground().c_str()); backgroundColorButton->blockSignals(true); backgroundColorButton->setButtonColor(bg); backgroundColorButton->blockSignals(false); } break; case AppearanceAttributes::ID_foreground: { // new scope QColor fg; if(atts->GetUseSystemDefault()) fg = QColor(atts->GetDefaultForeground().c_str()); else fg = QColor(atts->GetForeground().c_str()); foregroundColorButton->blockSignals(true); foregroundColorButton->setButtonColor(fg); foregroundColorButton->blockSignals(false); } break; case AppearanceAttributes::ID_fontName: fontName->blockSignals(true); if(atts->GetUseSystemDefault()) fontName->setText(atts->GetDefaultFontName().c_str()); else fontName->setText(atts->GetFontName().c_str()); fontName->blockSignals(false); break; case AppearanceAttributes::ID_style: { // new scope std::string styleName; if(atts->GetUseSystemDefault()) styleName = atts->GetDefaultStyle(); else styleName = atts->GetStyle(); for(j = 0; j < numStyleNames; ++j) { if(styleName == styleNames[j]) { styleComboBox->blockSignals(true); styleComboBox->setCurrentIndex(j); styleComboBox->blockSignals(false); break; } } } break; case AppearanceAttributes::ID_orientation: orientationComboBox->blockSignals(true); if(atts->GetOrientation() == 0) orientationComboBox->setCurrentIndex(0); else orientationComboBox->setCurrentIndex(1); orientationComboBox->blockSignals(false); break; } } UpdateWindowSensitivity(); }
// **************************************************************************** // Method: XMLEditMakefile::UpdateWindowContents // // Purpose: // Update the window based on the current state. // // Programmer: Jeremy Meredith // Creation: October 17, 2002 // // Modifications: // Sean Ahern, Fri Nov 15 15:25:23 PST 2002 // Added "widget files" so we can have custom GUI elements. // // Jeremy Meredith, Wed Jul 7 17:08:03 PDT 2004 // Allow for mdserver-specific code in a plugin's source files. // // Brad Whitlock, Fri Feb 23 17:49:59 PST 2007 // Added viewer widgets. // // Cyrus Harrison, Wed Mar 7 09:07:37 PST 2007 // Allow for engine-specific code in a plugin's source files. // // Cyrus Harrison, Fri Sep 19 13:58:39 PDT 2008 // Added support for custom libs for gui,engine,mdserver, and viewer libs. // // **************************************************************************** void XMLEditMakefile::UpdateWindowContents() { BlockAllSignals(true); if (xmldoc->docType == "Plugin") { Plugin *p = xmldoc->plugin; CXXFLAGS->setText(JoinValues(p->cxxflags, ' ')); LDFLAGS->setText(JoinValues(p->ldflags, ' ')); LIBS->setText(JoinValues(p->libs, ' ')); // gui if (p->customgfiles) GFiles->setText(JoinValues(p->gfiles, ' ')); else GFiles->setText(JoinValues(p->defaultgfiles, ' ')); customGFiles->setChecked(p->customgfiles); // scripting if (p->customglibs) GLibs->setText(JoinValues(p->glibs, ' ')); customGLibs->setChecked(p->customglibs); if (p->customsfiles) SFiles->setText(JoinValues(p->sfiles, ' ')); else SFiles->setText(JoinValues(p->defaultsfiles, ' ')); customSFiles->setChecked(p->customsfiles); // viewer if (p->customvfiles) VFiles->setText(JoinValues(p->vfiles, ' ')); else VFiles->setText(JoinValues(p->defaultvfiles, ' ')); customVFiles->setChecked(p->customvfiles); if (p->customvlibs) VLibs->setText(JoinValues(p->vlibs, ' ')); customVLibs->setChecked(p->customvlibs); // mdserver if (p->custommfiles) MFiles->setText(JoinValues(p->mfiles, ' ')); else MFiles->setText(JoinValues(p->defaultmfiles, ' ')); customMFiles->setChecked(p->custommfiles); if (p->custommlibs) MLibs->setText(JoinValues(p->mlibs, ' ')); customMLibs->setChecked(p->custommlibs); // engine if (p->customefiles) EFiles->setText(JoinValues(p->efiles, ' ')); else EFiles->setText(JoinValues(p->defaultefiles, ' ')); customEFiles->setChecked(p->customefiles); if (p->customelibsSer) ELibsSer->setText(JoinValues(p->elibsSer, ' ')); customELibsSer->setChecked(p->customelibsSer); if (p->customelibsPar) ELibsPar->setText(JoinValues(p->elibsPar, ' ')); customELibsPar->setChecked(p->customelibsPar); // widgets if (p->customwfiles) WFiles->setText(JoinValues(p->wfiles, ' ')); else WFiles->setText(JoinValues(p->defaultwfiles, ' ')); customWFiles->setChecked(p->customwfiles); // viewer widgets if (p->customvwfiles) VWFiles->setText(JoinValues(p->vwfiles, ' ')); else VWFiles->setText(""); customVWFiles->setChecked(p->customvwfiles); // engine spec code engSpecificCode->setChecked(p->hasEngineSpecificCode); // only allow mdserver-specific code if this is a database plugin if(xmldoc->plugin->type !="database") p->has_MDS_specific_code=false; mdSpecificCode->setChecked(p->has_MDS_specific_code); } else { mdSpecificCode->setChecked(false); engSpecificCode->setChecked(false); } UpdateWindowSensitivity(); BlockAllSignals(false); }