void Tool::FillOutComboBoxes( const ConfigKeyMapper* const requester ) { for ( size_t i = 0; i < m_collectionCombos.size(); ++i ) { CollectionCombo& collectionCombo( m_collectionCombos.at( i ) ); QComboBox* const comboBox = collectionCombo.comboBox; if ( !requester || !requester->Maps( comboBox ) ) { comboBox->clear(); if ( collectionCombo.hasSelect ) { comboBox->addItem( selectItemString ); } const Collection::StatusType collectionStatus = collectionCombo.collection.SetConfig( GetCurrentConfig() ); if ( collectionStatus == Collection::Status_Ok ) { WbConfigTools::FillOutComboBoxWithCollectionElements( *comboBox, collectionCombo.collection ); } } } }
BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: if(!dll_cs.LockCount && !dll_cs.OwningThread) InitializeCriticalSection(&dll_cs); if (!hook_cs.LockCount && !hook_cs.OwningThread) InitializeCriticalSection(&hook_cs); InitHooks(); GetCurrentConfig(&dxglcfg, true); break; case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: break; case DLL_PROCESS_DETACH: ShutdownHooks(); DeleteCriticalSection(&hook_cs); ZeroMemory(&hook_cs, sizeof(CRITICAL_SECTION)); DeleteCriticalSection(&dll_cs); ZeroMemory(&dll_cs, sizeof(CRITICAL_SECTION)); break; } return TRUE; }
void InputSubsystem::Tick(float DeltaTime) { InputConfig* CurrentConfig = GetCurrentConfig(); if(CurrentConfig != NULL) { CurrentConfig->HandleInput(DeltaTime); } }
ConstConfigRcPtr* OCIO_getCurrentConfig(void) { ConstConfigRcPtr* config = new ConstConfigRcPtr(); try { *config = GetCurrentConfig(); if(*config) return config; } catch(Exception & exception) { std::cerr << "OpenColorIO Error: " << exception.what() << std::endl; } return 0; }
static BOOL PrepareToConfig() { BOOL bMustExit = FALSE; // Use a local copy of the config info to decide what should be configured // or unconfigured. We do this so that if the user cancels for some reason, // the real config state will still be what the user expects (what was // previously read from the system plus the user's changes). CONFIG_STATE configFS = g_CfgData.configFS; // File server CONFIG_STATE configDB = g_CfgData.configDB; // Database server CONFIG_STATE configBak = g_CfgData.configBak; // Backup server CONFIG_STATE configSCS = g_CfgData.configSCS; // System Control server CONFIG_STATE configSCC = g_CfgData.configSCC; // System Control client BOOL bWorkToDo = FALSE; bWorkToDo |= PrepareToConfig(configFS, bFsRunning, bFsOn, IDC_FS_SERVICE); bWorkToDo |= PrepareToConfig(configDB, bDbRunning, bDbOn, IDC_DB_SERVICE); bWorkToDo |= PrepareToConfig(configBak, bBakRunning, bBakOn, IDC_BK_SERVICE); bWorkToDo |= PrepareToConfig(configSCS, bScsRunning, bScsOn, IDC_SCS); bWorkToDo |= PrepareToConfig(configSCC, bSccRunning, bSccOn, IDC_SCC); // If there is nothing to do, then just return TRUE. if (!bWorkToDo) return TRUE; // If we are unconfiguring the last DB server: // 1) Warn user and ask for confirmation // 2) Unconfigure all other servers that are running on this machine // 3) Tell them (after unconfiguring) that they must run the Wizard if they // wish to reconfigure the machine, then exit the program. if (configDB == CS_UNCONFIGURE) { if (g_CfgData.bLastDBServer) { int nChoice = MsgBox(hDlg, IDS_LAST_DB_SERVER, GetAppTitleID(), MB_YESNO | MB_ICONEXCLAMATION); if (nChoice == IDNO) return FALSE; // Make sure these all get unconfigured as well. If they are not configured, then // nothing bad will happen because the config calls are idempotent. configFS = CS_UNCONFIGURE; configBak = CS_UNCONFIGURE; configSCS = CS_UNCONFIGURE; configSCC = CS_UNCONFIGURE; } } // Get additional needed information from the user GET_ADMIN_INFO_OPTIONS eOptions; BOOL bDB = (ShouldConfig(configDB) || ShouldUnconfig(configDB)); // Use this as our default eOptions = GAIO_LOGIN_ONLY; // If we already have a sys control machine, then we don't need to ask for it if (ShouldConfig(configSCC)) { if (szScMachine[0] == 0) { ShowWarning(hDlg, IDS_MUST_ENTER_SCS_NAME); return FALSE; } lstrcpy(g_CfgData.szSysControlMachine, szScMachine); } else if (bDB && !g_CfgData.bLastDBServer) { // We need to know the name of the SCM machine. Are we the SCM machine? if (bScsRunning) lstrcpy(g_CfgData.szSysControlMachine, g_CfgData.szHostname); else eOptions = GAIO_GET_SCS; } // If doing a login only and the admin info is reusable if ((eOptions != GAIO_LOGIN_ONLY) || !g_CfgData.bReuseAdminInfo) { if (!GetAdminInfo(hDlg, eOptions)) return FALSE; // Use the admin info to get new handles if (!GetHandles(hDlg)) return FALSE; } // Now that we are ready to configure, copy our local config info // into the structure that the config engine uses. g_CfgData.configFS = configFS; g_CfgData.configDB = configDB; g_CfgData.configBak = configBak; g_CfgData.configSCS = configSCS; g_CfgData.configSCC = configSCC; // Configure the server BOOL bConfigSucceeded = Configure(hDlg, bMustExit); if (bConfigSucceeded) { if (bMustExit) { PostQuitMessage(0); return TRUE; } g_CfgData.bReuseAdminInfo = TRUE; } else g_CfgData.szAdminPW[0] = 0; // Get current config status BOOL bCanceled = FALSE; DWORD dwStatus = GetCurrentConfig(hDlg, bCanceled); if (dwStatus || bCanceled) { if (!bCanceled) ErrorDialog(dwStatus, IDS_CONFIG_CHECK_FAILED); } // Show the initial services config ShowInitialConfig(); ShowServiceStates(); return TRUE; }
void Tool::CommitDataAndUpdate( ConfigKeyMapper& mapper ) { mapper.CommitData( GetCurrentConfig() ); ReloadCurrentConfig( &mapper ); }
const WbConfig Tool::GetMappedConfig() const { return GetCurrentConfig(); }