Esempio n. 1
0
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;
}