コード例 #1
0
void MainFrame::OnAppOptions(wxCommandEvent& event){

	OptionsDialog optionsDialog;
	optionsDialog.SetAppOptions(&m_appOptions);
	optionsDialog.Create(this);

	if (optionsDialog.ShowModal() == wxID_OK) {
		m_appOptions.SaveAppOptions();
		m_raceAnalyzerComm.SetSerialPort(m_appOptions.GetSerialPort());
	}
}
コード例 #2
0
ファイル: VAutoDialog.cpp プロジェクト: kovihome/VAuto
void VAutoDialog::DoInvokeOptionsDialog(void)
{
	wxString mountType = Properties::Instance().Get(MOUNT_TYPE);
	wxString mountPort = Properties::Instance().Get(MOUNT_PORT);
	wxString cameraType = Properties::Instance().Get(CAMERA_TYPE);
	wxString cameraPort = Properties::Instance().Get(CAMERA_PORT);
	wxString observationLogPath = Properties::Instance().Get (OBSERVATION_LOG_FOLDER);
	wxString isoSpeed = Properties::Instance().Get (CAMERA_ISO_SPEED);

	OptionsDialog *dlg = new OptionsDialog (this);
	int rv = dlg->ShowModal ();
	if (rv == wxID_OK) {
		Properties::Instance().Save(CONFIG_FILE);

		if (Properties::Instance().Get(MOUNT_TYPE) != mountType ||
			Properties::Instance().Get(MOUNT_PORT) != mountPort) {
			TelescopeFactory::Instance().ClearTelescope();
			m_telescope = TelescopeFactory::Instance().GetTelescope (
				Properties::Instance().Get(MOUNT_TYPE),
				Properties::Instance().Get(MOUNT_PORT));
			}

		bool newCamera = false;
		if (Properties::Instance().Get(CAMERA_TYPE) != cameraType ||
			Properties::Instance().Get(CAMERA_PORT) != cameraPort) {
//			CameraFactory::Instance().ClearCamera();
			wxDELETE (m_camera);
			m_camera = CameraFactory::Instance().GetCamera (
				Properties::Instance().Get(CAMERA_TYPE),
				Properties::Instance().Get(CAMERA_PORT));
			newCamera = true;
			}

		if (Properties::Instance().Get (OBSERVATION_LOG_FOLDER) != observationLogPath) {
			ObservationLog::Instance().SetPath (Properties::Instance().Get (OBSERVATION_LOG_FOLDER));
			}

		if (m_camera->HasFeature (Camera::DCP_CAN_SET_ISO_SPEED) && (newCamera || Properties::Instance().Get(CAMERA_ISO_SPEED) != isoSpeed)) {
			unsigned long iso = wxAtol (Properties::Instance().Get(CAMERA_ISO_SPEED));
			if (iso > 0)
				m_camera->SetIsoSpeed (iso);
			}

		SetDeviceText ();

		DoDisableControls (FALSE);

		m_LogWindow->Show (Properties::Instance().GetBool(DEBUG_LOG_WINDOW));
		}
}
コード例 #3
0
ファイル: findit_pi.cpp プロジェクト: CarCode/Cocoa-OCPN
void findit_pi::ShowPreferencesDialog( wxWindow* parent )
{
	int buyNotemp = buyNo;
	int  toBuyZerotemp = toBuyZero;
	int lastRowDefaulttemp = lastRowDefault;

	OptionsDialog* dlg = new OptionsDialog(parent,this);

    wxColour cl;
    GetGlobalColor(_T("DILG1"), &cl);
    dlg->SetBackgroundColour(cl);

//	dlg->m_checkBoxShowLogbook->SetValue(m_bLOGShowIcon);

    if(dlg->ShowModal() == wxID_OK)
    {
        buyNo = dlg->m_radioBox11->GetSelection();
        toBuyZero = dlg->m_radioBox1->GetSelection();
        lastRowDefault = dlg->m_radioBox5->GetSelection();
        
        if((buyNo != buyNotemp) || (toBuyZero != toBuyZerotemp) || (lastRowDefault != lastRowDefaulttemp))
            if(m_pFindItWindow)
                m_pFindItWindow->reloadData();
        
        //    Show Icon changed value?
        if(m_bFINDITShowIcon != dlg->m_checkBoxFindItIcon->GetValue())
        {
            m_bFINDITShowIcon = dlg->m_checkBoxFindItIcon->GetValue();
            
            if(m_bFINDITShowIcon)
                m_leftclick_tool_id  = InsertPlugInTool(_T(""), _img_findit, _img_findit, wxITEM_NORMAL,
                                                        _("FindIt"), _T(""), NULL, FINDIT_TOOL_POSITION, 0, this);
            else
                RemovePlugInTool(m_leftclick_tool_id);
        }
        SaveConfig();
    }
    else
    {
        if(buyNo != buyNotemp || toBuyZero != toBuyZerotemp || lastRowDefault != lastRowDefaulttemp)
            if(m_pFindItWindow)
                m_pFindItWindow->reloadData();
	 }
	 delete dlg;
}