X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2FfrmPreferences.cpp;h=f2a156a6398abcb3804fa89caaa412b6b2f5e2f5;hp=b8757ba5c04873a06721626ce0f96f571717e4cd;hb=d1663f3d3931bb05c791ef2c86926a22932c6014;hpb=56ae8d824bd9183aa8658dccda528fba2548d834 diff --git a/source/frmPreferences.cpp b/source/frmPreferences.cpp index b8757ba..f2a156a 100644 --- a/source/frmPreferences.cpp +++ b/source/frmPreferences.cpp @@ -325,19 +325,32 @@ void frmPreferences::LoadPreferences( wxInitDialogEvent& event ) bool SaveWindowPos = preferences->GetBoolData(wxT("SaveWindowPosition")); bool HideLocalABs = preferences->GetBoolData(wxT("HideLocalAddressBooks")); + bool UseBackgroundContactColour = preferences->GetBoolData(wxT("UseBackgroundContactColour")); - if (SaveWindowPos == TRUE){ + if (SaveWindowPos == true){ - chkSaveWindowPosition->SetValue(TRUE); + chkSaveWindowPosition->SetValue(true); } - if (HideLocalABs == TRUE){ + if (HideLocalABs == true){ - chkHideLocal->SetValue(TRUE); + chkHideLocal->SetValue(true); } + if (UseBackgroundContactColour == true){ + + chkUseBackgroundColour->SetValue(true); + std::cout << preferences->GetBackgroundContactColourData().GetAsString().ToStdString() << std::endl; + clpContactBackgroundColour->SetColour(preferences->GetBackgroundContactColourData()); + + } else { + + clpContactBackgroundColour->Enable(false); + + } + // Setup the Themes tab. wxListItem themecol0; @@ -474,6 +487,19 @@ void frmPreferences::SavePreferences(wxCommandEvent &event){ *ReloadAccountConfig = TRUE; } + + if (chkUseBackgroundColour->GetValue() == TRUE){ + + cfgfile->Write(wxT("UseBackgroundContactColour"), wxT("true")); + cfgfile->Write(wxT("BackgroundContactColour"), clpContactBackgroundColour->GetColour().GetAsString(wxC2S_HTML_SYNTAX)); + *ReloadAccountConfig = TRUE; + + } else { + + cfgfile->Write(wxT("UseBackgroundContactColour"), wxT("false")); + *ReloadAccountConfig = TRUE; + + } delete cfgfile; cfgfile = NULL; @@ -482,6 +508,16 @@ void frmPreferences::SavePreferences(wxCommandEvent &event){ } +void frmPreferences::EnableBackgroundColourPicker(wxCommandEvent &event){ + + if (chkUseBackgroundColour->GetValue() == true){ + clpContactBackgroundColour->Enable(true); + } else { + clpContactBackgroundColour->Enable(false); + } + +} + void frmPreferences::CloseWindow(wxCommandEvent &event){ // Close the preferences window.