void nsPrinterFeatures::SetPaperRecord(PRInt32 aIndex, const char *aPaperName, PRInt32 aWidthMM, PRInt32 aHeightMM, PRBool aIsInch) { SetCharValue(nsPrintfCString(256, "paper.%d.name", aIndex).get(), aPaperName); SetIntValue( nsPrintfCString(256, "paper.%d.width_mm", aIndex).get(), aWidthMM); SetIntValue( nsPrintfCString(256, "paper.%d.height_mm", aIndex).get(), aHeightMM); SetBoolValue(nsPrintfCString(256, "paper.%d.is_inch", aIndex).get(), aIsInch); }
nsPrinterFeatures::nsPrinterFeatures( const char *printername ) { DO_PR_DEBUG_LOG(("nsPrinterFeatures::nsPrinterFeatures('%s')\n", printername)); mPrinterName.Assign(printername); mPrefs = do_GetService(NS_PREFSERVICE_CONTRACTID); SetBoolValue("has_special_printerfeatures", PR_TRUE); }
LONG ServiceRegistry::SetBoolValue(String hKey, String ValueName, bool data) { HKEY key; LONG l = GetKey(hKey, key); if (l == ERROR_SUCCESS) return SetBoolValue(key, ValueName, data); return l; }
void CGridAlerts::OnCellChange(wxGridEvent &e) { if( !(m_nInCellChangeEvent || IsTableReadOnly()) ) { CIncrementer x(m_nInCellChangeEvent); nwxGridBatch xxxx(this); int nRow = e.GetRow(); int nCol = e.GetCol(); COARmessage *pMsg = m_pMsgEdit->GetMessage((size_t) nRow); int nCols = GetNumberCols(); const wxString &sName(pMsg->GetMessageName()); if(nCol == (nCols - 1)) { UpdateTextFromRow(nRow,pMsg); } else if(nCol == (nCols - 2)) { UpdateDisabledFromRow(nRow,pMsg); if((!sName.IsEmpty()) && GetBoolValue(nRow,nCol)) { // a row has been enabled // check for mutually exclusive rows // that are enabled and disable them set<wxString> ss; const COARmsgExportMap *pMsgExp = m_pMsgEdit->GetMsgExport(); if(pMsgExp->GetGroupsByMsgName(sName,&ss)) { // we found group names size_t nCount = m_pMsgEdit->GetMessageCount(); size_t iRow; for(iRow = 0; iRow < nCount; iRow++) { if(iRow == (size_t)nRow) {} else if(!GetBoolValue(iRow,nCol)) {} // already unchecked, fuhgeddaboudit. else { COARmessage *pMsgA = m_pMsgEdit->GetMessage(iRow); const wxString &sNameA(pMsgA->GetMessageName()); if(sNameA.IsEmpty()) {} else if( (sNameA == sName) || (pMsgExp->HasGroupByMsgName(sNameA,ss)) ) { // need to uncheck message SetBoolValue(iRow,nCol,false); UpdateDisabledFromRow(iRow,pMsgA); } } } } } } } e.Skip(true); }
void UPnpDeviceDesc::_InternalLoad( QDomNode oNode, UPnpDevice *pCurDevice ) { QString pin = GetMythDB()->GetSetting( "SecurityPin", ""); pCurDevice->m_securityPin = !(pin.isEmpty() || pin == "0000"); for ( oNode = oNode.firstChild(); !oNode.isNull(); oNode = oNode.nextSibling() ) { QDomElement e = oNode.toElement(); if (e.isNull()) continue; // TODO: make this table driven (using offset within structure) if ( e.tagName() == "deviceType" ) SetStrValue( e, pCurDevice->m_sDeviceType); else if ( e.tagName() == "friendlyName" ) SetStrValue( e, pCurDevice->m_sFriendlyName ); else if ( e.tagName() == "manufacturer" ) SetStrValue( e, pCurDevice->m_sManufacturer ); else if ( e.tagName() == "manufacturerURL" ) SetStrValue( e, pCurDevice->m_sManufacturerURL ); else if ( e.tagName() == "modelDescription" ) SetStrValue( e, pCurDevice->m_sModelDescription); else if ( e.tagName() == "modelName" ) SetStrValue( e, pCurDevice->m_sModelName ); else if ( e.tagName() == "modelNumber" ) SetStrValue( e, pCurDevice->m_sModelNumber ); else if ( e.tagName() == "modelURL" ) SetStrValue( e, pCurDevice->m_sModelURL ); else if ( e.tagName() == "serialNumber" ) SetStrValue( e, pCurDevice->m_sSerialNumber ); else if ( e.tagName() == "UPC" ) SetStrValue( e, pCurDevice->m_sUPC ); else if ( e.tagName() == "presentationURL" ) SetStrValue( e, pCurDevice->m_sPresentationURL ); else if ( e.tagName() == "UDN" ) SetStrValue( e, pCurDevice->m_sUDN ); else if ( e.tagName() == "iconList" ) ProcessIconList( oNode, pCurDevice ); else if ( e.tagName() == "serviceList" ) ProcessServiceList( oNode, pCurDevice ); else if ( e.tagName() == "deviceList" ) ProcessDeviceList ( oNode, pCurDevice ); else if ( e.tagName() == "mythtv:X_secure" ) SetBoolValue( e, pCurDevice->m_securityPin ); else if ( e.tagName() == "mythtv:X_protocol" ) SetStrValue( e, pCurDevice->m_protocolVersion ); else { // Not one of the expected element names... add to extra list. QString sValue = ""; SetStrValue( e, sValue ); pCurDevice->m_lstExtra.push_back(NameValue(e.tagName(), sValue)); } } }
bool CGridSampleLimits::TransferDataToWindow() { bool bRtn = (m_pData != NULL) && (m_pMessageBook != NULL); if(bRtn) { SetCellValue(ROW_PULLUP,0,CPanelLabSettings::Number2Str( m_pData->GetMaxNumberOfPullupsPerSample())); SetCellValue(ROW_STUTTER,0,CPanelLabSettings::Number2Str( m_pData->GetMaxNumberOfStutterPeaksPerSample())); SetCellValue(ROW_ADENYLATION,0,CPanelLabSettings::Number2Str( m_pData->GetMaxNumberOfAdenylationsPerSample())); SetCellValue(ROW_OFF_LADDER,0,CPanelLabSettings::Number2Str( m_pData->GetMaxNumberOfOLAllelesPerSample())); SetCellValue(ROW_RESIDUAL,0,CPanelLabSettings::Number2Str( m_pData->GetMaxResidualForAlleleCall())); SetCellValue(ROW_EXCESSIVE_RESIDUAL,0,CPanelLabSettings::Number2Str( m_pData->GetMaxExcessiveResidual())); SetCellValue(ROW_RFU_INCOMPLETE_SAMPLE,0,CPanelLabSettings::Number2Str( m_pData->GetMaxRFUForIncompleteSample())); SetCellValue(ROW_MIN_BPS_ARTIFACTS,0,CPanelLabSettings::Number2Str( m_pData->GetMinBPSForArtifacts())); // message book stuff int nRow = ROW_MESSAGE_BOOK_OFFSET; int nValue; // int nRowHeight = GetRowHeight(0); vector<const CXMLmessageBookSM *>::iterator itrMsg = m_vpMsgBookSM.begin(); for(itrMsg = m_vpMsgBookSM.begin(); itrMsg != m_vpMsgBookSM.end(); ++itrMsg) { if(!(*itrMsg)->EmptyDescriptor()) { nValue = m_pData->GetValue((*itrMsg)->GetName(),(*itrMsg)->GetThreshold()); if((*itrMsg)->IsPreset()) { SetBoolCell(nRow,0); SetBoolValue(nRow,0,!!nValue); // SetRowHeight(nRow,nRowHeight); } else { SetCellValue(nRow,0, CPanelLabSettings::Number2Str(nValue)); } ++nRow; } } } return bRtn; }
void wxGxDBConnectionFactory::Serialize(wxXmlNode* const pConfig, bool bStore) { wxGxObjectFactory::Serialize(pConfig, bStore); if(bStore) { if(pConfig->HasAttribute(wxT("load_system_tables_schemes"))) pConfig->DeleteAttribute(wxT("load_system_tables_schemes")); SetBoolValue(pConfig, wxT("load_system_tables_schemes"), m_bLoadSystemTablesAndSchemes); } else { m_bLoadSystemTablesAndSchemes = GetBoolValue(pConfig, wxT("load_system_tables_schemes"), m_bLoadSystemTablesAndSchemes); } }
bool CGridAlerts::TransferDataToRow(int nRow, const COARmessage *pMsg) { bool bHidden = pMsg->GetHidden(); int nCol = GetNumberCols() - 2; SetBoolValue(nRow,nCol++,!bHidden); SetCellValue(nRow,nCol,pMsg->GetText()); if(IsTableReadOnly()) { SetGrayBackgroundRow(nRow,bHidden); } else { DisableEdit(nRow,nCol,bHidden); } return true; }
//----------------------------------------------------------------------------- void Profile::SetValue(JSON* val) { if (val->Type == JSON_Number) SetDoubleValue(val->Name, val->dValue); else if (val->Type == JSON_Bool) SetBoolValue(val->Name, (val->dValue != 0)); else if (val->Type == JSON_String) SetValue(val->Name, val->Value); else if (val->Type == JSON_Array) { if (val == NULL) return; // Create a copy of the array JSON* value = val->Copy(); Values.PushBack(value); ValMap.Set(value->Name, value); } }
void nsPrinterFeatures::SetCanChangePrintInColor( PRBool aCanSetPrintInColor ) { SetBoolValue("can_change_printincolor", aCanSetPrintInColor); }
void nsPrinterFeatures::SetMultipleConcurrentDeviceContextsSupported( PRBool aCanUseMultipleInstances ) { SetBoolValue("can_use_multiple_devicecontexts_concurrently", aCanUseMultipleInstances); }
void nsPrinterFeatures::SetCanChangeNumCopies( PRBool aCanSetNumCopies ) { SetBoolValue("can_change_num_copies", aCanSetNumCopies); }
void nsPrinterFeatures::SetSupportsPlexChange( PRBool aSupportsPlexChange ) { SetBoolValue("supports_plex_change", aSupportsPlexChange); }
void wxCheckBox::SetValue(bool val) { SetBoolValue(val); }
void nsPrinterFeatures::SetCanChangeResolutionName( PRBool aCanSetResolutionName ) { SetBoolValue("can_change_resolution", aCanSetResolutionName); }
void nsPrinterFeatures::SetSupportsDownloadFontsChange( PRBool aSupportDownloadFontsChange ) { SetBoolValue("supports_downloadfonts_change", aSupportDownloadFontsChange); }
void nsPrinterFeatures::SetCanChangeDownloadFonts( PRBool aCanSetDownloadFonts ) { SetBoolValue("can_change_downloadfonts", aCanSetDownloadFonts); }
void nsPrinterFeatures::SetSupportsColorspaceChange( PRBool aSupportsColorspaceChange ) { SetBoolValue("supports_colorspace_change", aSupportsColorspaceChange); }
void nsPrinterFeatures::SetCanChangeColorspace( PRBool aCanSetColorspace ) { SetBoolValue("can_change_colorspace", aCanSetColorspace); }
void nsPrinterFeatures::SetSupportsResolutionNameChange( PRBool aSupportsResolutionNameChange ) { SetBoolValue("supports_resolution_change", aSupportsResolutionNameChange); }
/*! @param filename - the name of the configuration file @return CFG_FILE_NOT_SPECIFIED if filename is "" @return CFG_FILE_NOT_WRITABLE if the file cannot be opened for writing @return CFG_OK if successful Saves the configuration of the ConfigMgr to file. */ ConfigMgrStatusType ConfigMgr::Save(string filename) { int i; FILE *fp; xmlDocPtr document; xmlNodePtr rootNode; xmlNodePtr repositoryNode; xmlNodePtr featureNode; int numRepositories; string appRoverDir = APP_ROVER_DIR; map<string,bool>::iterator feature; if ( filename == "" ) return CFG_FILE_NOT_SPECIFIED; fp = fopen(filename.c_str(), "w"); if ( !fp ) return CFG_FILE_NOT_WRITABLE; mCfgFilename = filename; document = xmlNewDoc(NULL); rootNode = xmlNewDocNode(document,NULL,(const xmlChar *)CONFIG_HDR_STR,NULL); SetDoubleValue(rootNode, VERSION_STR, 1); xmlDocSetRootElement(document,rootNode); if ( mInstallLogFilename == "" ) SetStringValue(rootNode, LOG_STR, appRoverDir+"AppRover.log"); else SetStringValue(rootNode, LOG_STR, mInstallLogFilename); if ( mStorageDirectory == "" ) SetStringValue(rootNode, STORAGE_STR, appRoverDir+"storage/"); else SetStringValue(rootNode, STORAGE_STR, mStorageDirectory); if ( mWorkDirectory == "" ) SetStringValue(rootNode, WORK_STR, appRoverDir + "work/"); else SetStringValue(rootNode, WORK_STR, mWorkDirectory); if ( mInstallFileDirectory == "" ) SetStringValue(rootNode, INSTALL_FILE_STR, appRoverDir + "files/"); else SetStringValue(rootNode, INSTALL_FILE_STR, mInstallFileDirectory); if ( mNumProcessors < 1 ) DetectNumProcessors(); SetIntValue(rootNode, PROCESSOR_STR, mNumProcessors); numRepositories = mRepositoryDirectories.size(); if ( !numRepositories ) { repositoryNode = xmlNewNode(NULL,(const xmlChar*)REPOSITORY_STR); SetStringValue(repositoryNode, DIR_STR, appRoverDir+"repo/"); xmlAddChild(rootNode,repositoryNode); } else { for (i = 0; i < numRepositories; i++) { repositoryNode = xmlNewNode(NULL,(const xmlChar*)REPOSITORY_STR); SetStringValue(repositoryNode, DIR_STR, mRepositoryDirectories[i]); xmlAddChild(rootNode,repositoryNode); } } for (feature=mFeatureSettings.begin(); feature!=mFeatureSettings.end(); feature++) { featureNode = xmlNewNode(NULL,(const xmlChar*)FEATURE_STR); SetStringValue(featureNode, FEATURE_NAME_STR, (*feature).first); SetBoolValue(featureNode, ENABLED_STR, (*feature).second); xmlAddChild(rootNode,featureNode); } xmlDocFormatDump(fp,document,1); fclose(fp); xmlFreeDoc(document); return CFG_OK; }
void nsPrinterFeatures::SetSupportsPrintInColorChange( PRBool aSupportPrintInColorChange ) { SetBoolValue("supports_printincolor_change", aSupportPrintInColorChange); }
BOOL COptionsMisc::Save() { SetBoolValue("ParentFolder", m_bParentFolder ? TRUE : FALSE); // Save Thumbnails Info SetBoolValue("ShowIcons", m_bShowIcons ? TRUE : FALSE); // Save Thumbnails Info SetBoolValue("ShowThumbnails", m_bShowThumbnails ? TRUE : FALSE); SetBoolValue("AutoExtractIcons", IsAutoExtractIcons() ? TRUE : FALSE); SetBoolValue("AutoExtractClassHelp", IsAutoExtractClassHelp() ? TRUE : FALSE); SetBoolValue("ShowUndoWarnings", GetShowUndoWarnings() ? TRUE : FALSE); SetBoolValue("ShowFullPathInTitle", IsShowFullPathTitle() ? TRUE : FALSE); SetBoolValue("AutoLoadProj", IsAutoLoadProj() ? TRUE : FALSE); SetBoolValue("DefaultCompressed", IsDefaultCompressed() ? TRUE : FALSE); SetBoolValue("LoadLYTFile", IsLoadLYTFile() ? TRUE : FALSE); SetBoolValue("UndoFreezeHide", IsUndoFreezeHide() ? TRUE : FALSE); //for formatting the floats CString sVal; sVal.Format("%f", GetVectorEditIncrement()); SetStringValue("VectorEditIncrement", sVal); SetBoolValue("VectorEditAutoApply", IsVectorEditAutoApply() ? TRUE : FALSE); SetBoolValue("RotationEditAutoApply", IsRotationEditAutoApply() ? TRUE : FALSE); // Save undo data SetDWordValue("NumUndos", m_dwUndos); return TRUE; }
void nsPrinterFeatures::SetCanChangeSpoolerCommand( PRBool aCanSetSpoolerCommand ) { SetBoolValue("can_change_spoolercommand", aCanSetSpoolerCommand); }
void wxToggleButton::SetValue(bool val) { SetBoolValue(val); }
void nsPrinterFeatures::SetSupportsSpoolerCommandChange( PRBool aSupportSpoolerCommandChange ) { SetBoolValue("supports_spoolercommand_change", aSupportSpoolerCommandChange); }
void wxGxContentView::Serialize(wxXmlNode* pRootNode, bool bStore) { if(pRootNode == NULL) return; if(bStore) { if(pRootNode->HasAttribute(wxT("style"))) pRootNode->DeleteAttribute(wxT("style")); SetDecimalValue(pRootNode, wxT("style"), m_current_style); if(pRootNode->HasAttribute(wxT("sort"))) pRootNode->DeleteAttribute(wxT("sort")); SetBoolValue(pRootNode, wxT("sort"), m_bSortAsc); if(pRootNode->HasAttribute(wxT("sort_col"))) pRootNode->DeleteAttribute(wxT("sort_col")); SetDecimalValue(pRootNode, wxT("sort_col"), m_currentSortCol); if(m_current_style == enumGISCVReport) { //store values m_anWidth.Clear(); for (int i = 0; i < GetColumnCount(); ++i) { m_anWidth.Add( GetColumnWidth(i) ); } #ifdef wxHAS_LISTCTRL_COLUMN_ORDER m_anOrder = GetColumnsOrder(); #endif } wxString sCols; for(size_t i = 0; i < m_anWidth.GetCount(); ++i) { sCols += wxString::Format(wxT("%d"), m_anWidth[i]); sCols += wxT("|"); } if(pRootNode->HasAttribute(wxT("cols_width"))) pRootNode->DeleteAttribute(wxT("cols_width")); pRootNode->AddAttribute(wxT("cols_width"), sCols); #ifdef wxHAS_LISTCTRL_COLUMN_ORDER wxString sOrd; for(size_t i = 0; i < m_anOrder.GetCount(); ++i) { sOrd += wxString::Format(wxT("%d"), m_anOrder[i]); sOrd += wxT("|"); } if(pRootNode->HasAttribute(wxT("cols_order"))) pRootNode->DeleteAttribute(wxT("cols_order")); pRootNode->AddAttribute(wxT("cols_order"), sOrd); #endif } else { m_bSortAsc = GetBoolValue(pRootNode, wxT("sort"), true); m_currentSortCol = GetDecimalValue(pRootNode, wxT("sort_col"), 0); wxGISEnumContentsViewStyle style = (wxGISEnumContentsViewStyle)GetDecimalValue(pRootNode, wxT("style"), 0); //load col width wxString sCol = pRootNode->GetAttribute(wxT("cols_width")); wxStringTokenizer tkz(sCol, wxString(wxT("|")), wxTOKEN_RET_EMPTY ); while ( tkz.HasMoreTokens() ) { wxString token = tkz.GetNextToken(); //token.Replace(wxT("|"), wxT("")); int nWidth = wxAtoi(token); //wxLIST_AUTOSIZE m_anWidth.Add(nWidth); } #ifdef wxHAS_LISTCTRL_COLUMN_ORDER //load col order wxString sOrd = pRootNode->GetAttribute(wxT("cols_order")); wxStringTokenizer tkz_ord(sOrd, wxString(wxT("|")), wxTOKEN_RET_EMPTY ); while ( tkz_ord.HasMoreTokens() ) { wxString token = tkz_ord.GetNextToken(); //token.Replace(wxT("|"), wxT("")); m_anOrder.Add( wxAtoi(token) ); } #endif SetStyle(style); SORTDATA sortdata = {m_bSortAsc, m_currentSortCol}; SortItems(GxObjectCVCompareFunction, (long)&sortdata); } }
void nsPrinterFeatures::SetCanChangeJobTitle( PRBool aCanSetJobTitle ) { SetBoolValue("can_change_jobtitle", aCanSetJobTitle); }
void wxRadioButton::SetValue(bool value) { SetBoolValue(value); }
void nsPrinterFeatures::SetSupportsJobTitleChange( PRBool aSupportsJobTitle ) { SetBoolValue("supports_jobtitle_change", aSupportsJobTitle); }