From 3d7b912951e37046dd2230d91d30d56692ab4a0f Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 6 Dec 2017 23:27:48 +0000 Subject: [PATCH] frmPreferences: Implemented support for CalDAV accounts --- source/forms/preferences/frmPreferences.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/source/forms/preferences/frmPreferences.cpp b/source/forms/preferences/frmPreferences.cpp index 07a4715..a49ed41 100644 --- a/source/forms/preferences/frmPreferences.cpp +++ b/source/forms/preferences/frmPreferences.cpp @@ -23,13 +23,19 @@ frmPreferences::frmPreferences( wxWindow* parent ) frmPreferencesADT( parent ) { - wxMemoryInputStream bstream(icons_acclocal_png, sizeof(icons_acclocal_png)); + wxMemoryInputStream astream(icons_acclocal_png, sizeof(icons_acclocal_png)); + wxMemoryInputStream bstream(icons_accinet_png, sizeof(icons_accinet_png)); wxMemoryInputStream cstream(icons_accunsupported_png, sizeof(icons_accunsupported_png)); - wxImage icons_acclocal_png(bstream, wxBITMAP_TYPE_PNG); + wxImage icons_acclocal_png(astream, wxBITMAP_TYPE_PNG); wxBitmap accNIcon(icons_acclocal_png, -1); wxIcon wxIAccNIcon; wxIAccNIcon.CopyFromBitmap(accNIcon); + + wxImage icons_accinet_png(bstream, wxBITMAP_TYPE_PNG); + wxBitmap accIIcon(icons_accinet_png, -1); + wxIcon wxIAccIIcon; + wxIAccIIcon.CopyFromBitmap(accIIcon); wxImage icons_accunsupported_png(cstream, wxBITMAP_TYPE_PNG); wxBitmap accUIcon(icons_accunsupported_png, -1); @@ -37,6 +43,7 @@ frmPreferencesADT( parent ) wxIAccUIcon.CopyFromBitmap(accUIcon); accountID = accImgList->Add(wxIAccNIcon); + accountNetID = accImgList->Add(wxIAccIIcon); accountUnsupportedID = accImgList->Add(wxIAccUIcon); NbtPreferences->RemovePage(1); @@ -144,6 +151,10 @@ void frmPreferences::ReloadAccounts(){ col0.SetImage(accountID); + } else if (preferences->accounts.GetAccountType(i) == wxT("CalDAV")){ + + col0.SetImage(accountNetID); + } else { col0.SetImage(accountUnsupportedID); @@ -209,7 +220,7 @@ void frmPreferences::ModifyAccount( wxCommandEvent& event ) accType = preferences->accounts.GetAccountType((int)lstAccountsIndex); - if (accType != "CardDAV" && accType != "carddav" && + if (accType != "CalDAV" && accType != "caldav" && accType != "Local" && accType != "local"){ wxMessageBox(_("Cannot modify the selected account settings as the account type is unsupported."), _("Unsupported account type"), wxICON_ERROR); -- 2.39.5