Exemple #1
0
void __fastcall TMainForm::MenuRegistryClick(TObject *Sender)
{
  if (OptionsForm->ShowModal() == mrOk)
  {
    LoadFromRegistry();
    UpdateAllJournalGrid();
  }
}
CallsignTagInfo::CallsignTagInfo()
{
	m_callsignTag = "";
	m_steamGroupID = 0;
	m_index = -1;

	LoadFromRegistry();
}
BOOL CPagePlayers::OnSetActive() 
{
  // Reload the chat MRU from the registry
  LoadFromRegistry();

  // Update the UI
  UpdateUI();

  // Perform default processing
  return CPropertyPage::OnSetActive();
}
Exemple #4
0
COggSplitter::COggSplitter(LPUNKNOWN pUnk, HRESULT *phr) :
    CBaseFilter(NAME("Ogg Splitter"), pUnk, &m_csFilter, CLSID_OggSplitter),
	CPersistPropertyBag(arOggSplitterProps, SIZEOF_ARRAY(arOggSplitterProps), &CLSID_OggSplitter),
	CRegistryStuff(&CLSID_OggSplitter),

	m_rtStart((REFERENCE_TIME)0),
	m_rtStop(_I64_MAX/2),
	m_rtDuration(_I64_MAX/2),
	m_dRate(1),
	m_pLastSeek(NULL)
{
	if (SUCCEEDED(*phr))
	{
		COggSplitInputPin *pIn = new COggSplitInputPin(NAME("In"), this,
									&m_csFilter, phr, L"In");
        if (!pIn) *phr = E_OUTOFMEMORY;
		else
		{
			if (SUCCEEDED(*phr)) m_pInput = pIn; else delete pIn;
		}
	}

	m_paOutput = NULL;
	m_iOutputs = 0;
	m_paStream = NULL;
	m_iStreams = 0;
	m_pChapterInfo = NULL;
	m_iChapters = 0;
	m_bStopPauseRunCalled = false;

	m_bChaptersAsStreams = true;
	
	LoadFromRegistry(idSeekToKeyFrame, &m_bAlwaysSearchToKeyFrame, true);
	LoadFromRegistry(idAlwaysEnableAllStreams, &m_bAlwaysEnableAllStreams, false);
	LoadFromRegistry(idShowTrayIcon, &m_bShowTrayIcon, true);

	m_bEnableAll = m_bAlwaysEnableAllStreams;

	if (m_bShowTrayIcon)
		InitTrayIcon();
}
Exemple #5
0
void CTransferPage::OnChange() 
{
	// TODO: Add your control notification handler code here
   CTransferSettings dlg;
   dlg.m_csChannelName = m_csChannelName;
   if(dlg.DoModal() == IDOK)
   {
      LoadFromRegistry();
   }	

   // refresh the page
   CGeneralSettings *pWnd = (CGeneralSettings *)this->GetParent();
   pWnd->Refresh();
}
Exemple #6
0
HRESULT STDMETHODCALLTYPE CComCatCachedCategory::Initialize(CATID &catID, BOOL reloadCache)
{
    HRESULT hr;

    fCategory = catID;
    if (reloadCache || !LoadFromRegistry())
    {
        hr = LoadFromComCatMgr();
        if (FAILED_UNEXPECTEDLY(hr))
            return hr;

        hr = CacheDSA();
        if (FAILED_UNEXPECTEDLY(hr))
            return hr;
    }
    return S_OK;
}
BOOL CPagePlayers::OnInitDialog() 
{
  // Register for events of interest
  GetSheet()->GetSession()->ActivateEvents(EventID_GameCreated, -1);
  GetSheet()->GetSession()->ActivateEvents(EventID_GameDestroyed, -1);
  GetSheet()->GetSession()->ActivateEvents(EventID_LoginGame, -1);
  GetSheet()->GetSession()->ActivateEvents(EventID_LogoutGame, -1);
  GetSheet()->GetSession()->ActivateEvents(EventID_ShipChangesSectors, -1);
  GetSheet()->GetSession()->ActivateEvents(EventID_LeaveTeam, -1);
  GetSheet()->GetSession()->ActivateEvents(EventID_JoinTeam, -1);
  GetSheet()->GetSession()->ActivateEvents(EventID_TeamInfoChange, -1);

  // Perform default processing
  CPropertyPage::OnInitDialog();

  // Initialize the AutoSize object
  m_AutoSizer.SetWindowAndRules(*this, _AutoSizerMap);

  // Set the list view control extended styles
  DWORD dwExStyle = LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP;
  m_listPlayers.SetExtendedStyle(dwExStyle);

  // Add columns to the list view control
  m_listPlayers.InsertColumn(c_iColumnName  , CString((LPCSTR)IDS_COLUMN_PLAYER));
  m_listPlayers.InsertColumn(c_iColumnTeam  , CString((LPCSTR)IDS_COLUMN_TEAM  ));
  m_listPlayers.InsertColumn(c_iColumnSector, CString((LPCSTR)IDS_COLUMN_SECTOR));

  // Load previous values from registry
  LoadFromRegistry();

  // Update fields from data members
  UpdateData(false);

  // Update the UI
  UpdateUI();

  // Populate the list of players
  PopulatePlayersList();

  // Set the focus to the first tabstop control
  return true;
}
Exemple #8
0
//===========================================================================
CCVGxm_gk::CCVGxm_gk()
{ 
  // ----- Частоты на которых работаем в непрерывном режиме выдачи информации ------
    SamplingFreqsRate.Clear( );
    SamplingFreqsRate.Add(  1);
    SamplingFreqsRate.Add(  5);
    SamplingFreqsRate.Add( 10);
    SamplingFreqsRate.Add( 20);
    SamplingFreqsRate.Add( 50);
    SamplingFreqsRate.Add(100);

    SerialPort->BaudRate    = 115200;
    SerialPort->ByteSize    = 8;

    ExtendedParamCount     = 0;
    ExtendedParamValues[0] = 100;    ExtendedParamNames[0] = strdup("UART_Frequncy:");
    ExtendedParamValues[2] = 80;
    //ExtendedParamValues[2] = 64;

    Parent_ThreadType = 1;

  // --------
    LoadFromRegistry("CVGxm_gk");
}
Exemple #9
0
void __fastcall TMainForm::FormCreate(TObject *Sender)
{
  if (!LoadSettings())
  {
    ShowMessage ("Отсутсвует или не корректный файл настроек !");
    Application->Terminate();
    return;
  }

  LoadFromRegistry ();

  if (m_auto_login)
  {
    OraSession1->LoginPrompt = false;

    OraSession1->Username = m_user_name;
    OraSession1->Password = m_password;
    OraSession1->Server = m_server;
  }
  else
  {
    OraSession1->LoginPrompt = true;
  }

  OraSession1->Connect();


  exec_date_col_index = -1;
  done_col_index = -1;

  DBGridJournalDBTableView1->ClearItems();
  GridFields::iterator iter = m_fields_list.begin();
  while (iter != m_fields_list.end())
  {
    TcxGridDBColumn * col = DBGridJournalDBTableView1->CreateColumn();

    //col->BestFitMaxWidth = 40;

    col->Caption = iter->second;
    col->DataBinding->FieldName = iter->first;

    if (m_use_terms)
    {
      if (col->DataBinding->FieldName.LowerCase() == m_date_execute.LowerCase())
          exec_date_col_index = col->Index;

      if (col->DataBinding->FieldName.LowerCase() == m_done.LowerCase())
          done_col_index = col->Index;
    }

    iter++;
  }

  UpdateAllJournalGrid();
  InitViewList();

  Application->HintPause = 0;
  Application->HintHidePause = 10000;

  m_hint = new THintWindow (ValueListEditorJParam);
  m_row = -1;
  m_col = -1;
  m_show_hint = false;

  OraQueryDocsInsert->TableName = m_shema + "." + m_blob_table;

  Caption = m_caption;

  Application->HelpFile = ExtractFilePath (Application->ExeName) + "..\\journal_admin.hlp";

  // Localization
  LocalizeGrid();

  DBGridJournalDBTableView1->ApplyBestFit();
//  ApplyBestFit
//  dxComponentPrinter1Link1->Preview(true);
//  dxComponentPrinter1Link1->Print
}
ALERROR CGameSettings::Load (const CString &sFilespec, CString *retsError)

//	Load
//
//	Load game settings from a file. If the file does not exist, then we 
//	set settings to default values

	{
	ALERROR error;
	int i;

	//	Initialize from defaults

	for (i = 0; i < OPTIONS_COUNT; i++)
		SetValue(i, CString(g_OptionData[i].pszDefaultValue, -1, true), true);

	//	Load XML

	CFileReadBlock DataFile(sFilespec);
	CXMLElement *pData;
	CString sError;
	if (error = CXMLElement::ParseXML(&DataFile, &pData, retsError))
		{
		//	ERR_NOTFOUND means that we couldn't find the Settings.xml
		//	file. In that case, initialize from defaults

		if (error == ERR_NOTFOUND)
			{
			LoadFromRegistry();
			m_bModified = true;
			return NOERROR;
			}

		//	Otherwise, it means that we got an error parsing the file.
		//	Return the error, but leave the settings initialized to defaults
		//	(We should be OK to continue, even with an error).

		else
			{
			m_bModified = false;
			return error;
			}
		}

	//	Initialize to unmodified (as we load settings we might change this)

	m_bModified = false;

	//	Loop over all elements

	for (i = 0; i < pData->GetContentElementCount(); i++)
		{
		CXMLElement *pItem = pData->GetContentElement(i);

		if (strEquals(pItem->GetTag(), OPTION_TAG))
			{
			int iOption = FindOptionData(pItem->GetAttribute(NAME_ATTRIB));
			if (iOption == -1)
				{
				kernelDebugLogMessage("Unknown option: %s", pItem->GetAttribute(NAME_ATTRIB).GetASCIIZPointer());
				continue;
				}

			SetValue(iOption, pItem->GetAttribute(VALUE_ATTRIB), true);
			}
		else if (strEquals(pItem->GetTag(), KEY_MAP_TAG))
			{
			if (error = m_KeyMap.ReadFromXML(pItem))
				return error;
			}
		else if (m_pExtra)
			{
			bool bModified;
			if (error = m_pExtra->OnLoadSettings(pItem, &bModified))
				return error;

			if (bModified)
				m_bModified = true;
			}
		}

	//	Done

	delete pData;

	return NOERROR;
	}
Exemple #11
0
ALERROR CGameSettings::Load (const CString &sFilespec, CString *retsError)

//	Load
//
//	Load game settings from a file. If the file does not exist, then we 
//	set settings to default values

	{
	ALERROR error;
	int i;

	//	Initialize from defaults

	for (i = 0; i < OPTIONS_COUNT; i++)
		SetValue(i, CString(g_OptionData[i].pszDefaultValue, -1, true), true);

	//	Look for a file in the current directory and see if it is writable. If
	//	not, then look in AppData. We remember the place where we found a valid
	//	file as our AppData root (and we base other directories off that).

	if (pathIsWritable(sFilespec))
		{
		//	AppData is current directory
		m_sAppData = NULL_STR;
		}
	else
		{
		m_sAppData = pathAddComponent(pathGetSpecialFolder(folderAppData), TRANSCENDENCE_APP_DATA);
		if (!pathCreate(m_sAppData)
				|| !pathIsWritable(m_sAppData))
			{
			*retsError = strPatternSubst(CONSTLIT("Unable to write to AppData folder: %s"), m_sAppData);
			return ERR_FAIL;
			}
		}

	//	Settings file

	CString sSettingsFilespec = pathAddComponent(m_sAppData, sFilespec);

	//	Load XML

	CFileReadBlock DataFile(sSettingsFilespec);
	CXMLElement *pData;
	CString sError;
	if (error = CXMLElement::ParseXML(&DataFile, &pData, retsError))
		{
		//	ERR_NOTFOUND means that we couldn't find the Settings.xml
		//	file. In that case, initialize from defaults

		if (error == ERR_NOTFOUND)
			{
			LoadFromRegistry();
			m_bModified = true;
			return NOERROR;
			}

		//	Otherwise, it means that we got an error parsing the file.
		//	Return the error, but leave the settings initialized to defaults
		//	(We should be OK to continue, even with an error).

		else
			{
			m_bModified = false;
			return error;
			}
		}

	//	Initialize to unmodified (as we load settings we might change this)

	m_bModified = false;

	//	Loop over all elements

	for (i = 0; i < pData->GetContentElementCount(); i++)
		{
		CXMLElement *pItem = pData->GetContentElement(i);

		if (strEquals(pItem->GetTag(), OPTION_TAG))
			{
			int iOption = FindOptionData(pItem->GetAttribute(NAME_ATTRIB));
			if (iOption == -1)
				{
				kernelDebugLogMessage("Unknown option: %s", pItem->GetAttribute(NAME_ATTRIB));
				continue;
				}

			SetValue(iOption, pItem->GetAttribute(VALUE_ATTRIB), true);
			}
		else if (strEquals(pItem->GetTag(), KEY_MAP_TAG))
			{
			if (error = m_KeyMap.ReadFromXML(pItem))
				return error;
			}
		else if (strEquals(pItem->GetTag(), EXTENSION_FOLDER_TAG))
			{
			CString sFolder;
			if (pItem->FindAttribute(PATH_ATTRIB, &sFolder))
				m_ExtensionFolders.Insert(sFolder);
			}
		else if (strEquals(pItem->GetTag(), EXTENSIONS_TAG))
			{
			if (error = m_Extensions.ReadFromXML(pItem))
				return error;
			}
		else if (m_pExtra)
			{
			bool bModified;
			if (error = m_pExtra->OnLoadSettings(pItem, &bModified))
				return error;

			if (bModified)
				m_bModified = true;
			}
		}

	//	Done

	delete pData;

	return NOERROR;
	}