void OGRGDALImportExtension::addWFSSource()
{
  WFSSourceAddDialog AddDlg(m_TempDir,this);

  if (AddDlg.exec() == QDialog::Accepted)
  {
    addSource(AddDlg.sourceInfos());
  }
}
void OGRGDALImportExtension::addFileSource()
{
  FileSourceAddDialog AddDlg(m_InputDir,this);

  if (AddDlg.exec() == QDialog::Accepted)
  {
    addSource(AddDlg.sourceInfos());
  }
}
void CSVObsParamsWidget::addFormat()
{
  QStringList FormatNames;

  for (auto& Format : m_Formats)
    FormatNames << QString::fromStdString(Format.first);

  EditFormatDialog AddDlg(FormatNames,this);

  if (AddDlg.exec() == QDialog::Accepted)
  {
    openfluid::ware::WareParams_t Params = AddDlg.getFormatParams();

    mp_Params->insert(Params.begin(),Params.end());

    update();
    emit changed();
  }

}
void CSVObsParamsWidget::addSet()
{
  QStringList SetNames;
  for (auto& Set : m_Sets)
    SetNames << QString::fromStdString(Set.first);

  QStringList FormatNames;
  for (auto& Format : m_Formats)
    FormatNames << QString::fromStdString(Format.first);

  QStringList ClassNames = openfluid::tools::toQStringList(mp_Desc->spatialDomain().getClassNames());

  EditSetDialog AddDlg(SetNames,FormatNames,ClassNames,this);

  if (AddDlg.exec() == QDialog::Accepted)
  {
    openfluid::ware::WareParams_t Params = AddDlg.getSetParams();

    mp_Params->insert(Params.begin(),Params.end());

    update();
    emit changed();
  }
}
Beispiel #5
0
BOOL CServerDlg::OnInitDialog()
{
	CSubDlg::OnInitDialog();
	//-------------------------------------------------------
	int CX = 0; RECT R;
	m_pMapList.GetWindowRect(&R);
//	CX = R.right + 0;
	//-------------------------------------------------------
	m_pSVO2 = new ServerOpts2();
	if (m_pSVO2)
	{
		BOOL ret = m_pSVO2->Create(IDD_SERVEROPTS2,this);
		if(!ret)   //Create failed.
			AfxMessageBox("Error creating Respawn Dialog");
		m_pSVO2->ShowWindow(SW_SHOW);
//		m_pSVO2->SetParent(GetParent()->GetParent());
		m_pSVO2->SetParent(this);
//		m_pSVO2->CenterWindow(NULL);
		m_pSVO2->SetWindowPos(NULL, CX, 0, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
	}
	else
		AfxMessageBox("Error Creating Respawn Dialog Object");
	//-------------------------------------------------------
	CX = 5;
	int CY = 3;
	if (m_pSVO2)
	{
		m_pSVServerOptDlg = new SVServerOptDlg();
		if (m_pSVServerOptDlg)
		{
			BOOL ret = m_pSVServerOptDlg->Create(IDD_SERVEROPT,m_pSVO2);
			if(!ret)   //Create failed.
				AfxMessageBox("Error Creating Server Options Dialog");
			AddDlg(m_pSVServerOptDlg, m_pSVO2, CX, CY);			
		}
		else
			AfxMessageBox("Error Creating Dialog Object");
		//-------------------------------------------------------
		m_pSVGameTypeDlg = new SVGameTypeDlg();
		if (m_pSVGameTypeDlg)
		{
			BOOL ret = m_pSVGameTypeDlg->Create(IDD_GAMETYPE,m_pSVO2);
			if(!ret)   //Create failed.
				AfxMessageBox("Error Creating Game Type Dialog");
			AddDlg(m_pSVGameTypeDlg, m_pSVO2, CX, CY);			
		}
		else
			AfxMessageBox("Error Creating Dialog Object");
		//-------------------------------------------------------
		m_pSVGameOptDlg = new SVGameOptDlg();
		if (m_pSVGameOptDlg)
		{
			BOOL ret = m_pSVGameOptDlg->Create(IDD_GAMEOPTIONS,m_pSVO2);
			if(!ret)   //Create failed.
				AfxMessageBox("Error Creating Game Options Dialog");
			AddDlg(m_pSVGameOptDlg, m_pSVO2, CX, CY);			
		}
		else
			AfxMessageBox("Error Creating Dialog Object");
		//-------------------------------------------------------
		
//		int LastCY = CY;
		m_pSVRepawnDlg = new SVRespawnDlg();
		if (m_pSVRepawnDlg)
		{
			BOOL ret = m_pSVRepawnDlg->Create(IDD_RESPAWN,m_pSVO2);
			if(!ret)   //Create failed.
				AfxMessageBox("Error Creating Respawn Options Dialog");
			AddDlg(m_pSVRepawnDlg, m_pSVO2, CX, CY);
		}
		else
			AfxMessageBox("Error Creating Dialog Object");
		//-------------------------------------------------------
		m_pSVSpectatorOptsDlg = new SVSpectatorDlg();
		if (m_pSVSpectatorOptsDlg)
		{
			BOOL ret = m_pSVSpectatorOptsDlg->Create(IDD_SPECTATOROPTS,m_pSVO2);
			if(!ret)   //Create failed.
				AfxMessageBox("Error Creating Spectator Options Dialog");
			AddDlg(m_pSVSpectatorOptsDlg, m_pSVO2, CX, CY);
		}
		else
			AfxMessageBox("Error Creating Dialog Object");		
		//-------------------------------------------------------
		m_pSVWeatherOptDlg = new SVWeatherOptions();
		if (m_pSVWeatherOptDlg)
		{
			BOOL ret = m_pSVWeatherOptDlg->Create(IDD_WEATHEROPTIONS,m_pSVO2);
			if(!ret)   //Create failed.
				AfxMessageBox("Error Creating Weather Options Dialog");
			AddDlg(m_pSVWeatherOptDlg, m_pSVO2, CX, CY);
		}
		else
			AfxMessageBox("Error Creating Dialog Object");		
		
		//-------------------------------------------------------
		m_pSVO2->GetClientRect(&R);
		if (CY > R.bottom)
			m_pSVO2->SetScrollRange(SB_VERT, 0, CY - R.bottom, TRUE);
		else
			m_pSVO2->SetScrollRange(SB_VERT, 0, 0, TRUE);
	};	
	//---------------------------------------	
	LoadMapList();

	m_pStartServerBtn.EnableWindow(false);
	//---------------------------------------
	SwitchGameType(GAME_DEATHMATCH);
	
	if (m_maps[ST_GAME_DEATHMATCH].size() == 0) 
	{
		m_pSVGameTypeDlg->m_pGameDM.EnableWindow(false);
		SwitchGameType(GAME_TEAMDEATHMATCH);
	};
	if (m_maps[ST_GAME_TEAMDEATHMATCH].size() == 0) 
	{
		m_pSVGameTypeDlg->m_pGameTDM.EnableWindow(false);
		SwitchGameType(GAME_ARTEFACTHUNT);
	};
	if (m_maps[ST_GAME_ARTEFACTHUNT].size() == 0) 
	{
		m_pSVGameTypeDlg->m_pGameAHunt.EnableWindow(false);
		SwitchGameType(GAME_DEATHMATCH);
	};
	
	//-------------------------------------------
	OnBnClickedServerOptions();
	return TRUE;  // return TRUE  unless you set the focus to a control
}