X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2FfrmPreferences.cpp;h=2b2f48152bcc01eb8a41a1be3e3e7ccad2e66b17;hb=458cff8813367583466a3d208140573ce9d9c561;hp=b12e71298445b3ce00da732275e4b51c61918231;hpb=9492d632a61167505d24453c3c746ba730c2995d;p=xestiaab%2F.git diff --git a/source/frmPreferences.cpp b/source/frmPreferences.cpp index b12e712..2b2f481 100644 --- a/source/frmPreferences.cpp +++ b/source/frmPreferences.cpp @@ -23,6 +23,7 @@ #include "common/preferences.h" #include "common/dirs.h" #include "bitmaps.h" +#include "bitmaps/preferences.h" #include "import/import.h" #include "export/export.h" @@ -33,7 +34,6 @@ #include #include - frmPreferences::frmPreferences( wxWindow* parent ) : frmPreferencesADT( parent ) @@ -43,6 +43,18 @@ frmPreferencesADT( parent ) wxMemoryInputStream astream(icons_accinet_png, sizeof(icons_accinet_png)); wxMemoryInputStream bstream(icons_acclocal_png, sizeof(icons_acclocal_png)); + wxMemoryInputStream cstream(icons_accunsupported_png, sizeof(icons_accunsupported_png)); + wxMemoryInputStream windowposstream(icons_windowpos_png, sizeof(icons_windowpos_png)); + wxMemoryInputStream hideaddressbooksstream(icons_hideaddressbooks_png, sizeof(icons_hideaddressbooks_png)); + + wxImage icons_windowpos_png(windowposstream, wxBITMAP_TYPE_PNG); + wxBitmap WindowPosition(icons_windowpos_png, -1); + + wxImage icons_hideaddressbooks_png(hideaddressbooksstream, wxBITMAP_TYPE_PNG); + wxBitmap HideAddressBooks(icons_hideaddressbooks_png, -1); + + bmpWindowPosition->SetBitmap(WindowPosition); + bmpLocalAddressBooks->SetBitmap(HideAddressBooks); wxImage icons_accinet_png(astream, wxBITMAP_TYPE_PNG); wxBitmap AccInet(icons_accinet_png, -1); @@ -53,9 +65,15 @@ frmPreferencesADT( parent ) wxBitmap AccNIcon(icons_acclocal_png, -1); wxIcon wxIAccNIcon; wxIAccNIcon.CopyFromBitmap(AccNIcon); + + wxImage icons_accunsupported_png(cstream, wxBITMAP_TYPE_PNG); + wxBitmap AccUIcon(icons_accunsupported_png, -1); + wxIcon wxIAccUIcon; + wxIAccUIcon.CopyFromBitmap(AccUIcon); AccountID = AccImgList->Add(wxIAccNIcon); AccountNetID = AccImgList->Add(wxIAccInet); + AccountUnsupportedID = AccImgList->Add(wxIAccUIcon); NbtPreferences->RemovePage(1); @@ -125,14 +143,27 @@ void frmPreferences::ModifyABAccount( wxCommandEvent& event ) long lstAccountsIndex = -1; wxString AccFilename = GetAccountsFile(); wxString AccName; + wxString AccType; wxFileConfig *cfgfile = new wxFileConfig("", "", AccFilename); - + // Get the account name. lstAccountsIndex = lstAccounts->GetNextItem(lstAccountsIndex, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); + + // Check that the account type is a supported account type. + + AccType = preferences->accounts.GetAccountType((int)lstAccountsIndex); + + if (AccType != "CardDAV" && AccType != "carddav" && + AccType != "Local" && AccType != "local"){ + + wxMessageBox(_("Cannot modify the selected account settings as the account type is unsupported."), _("Unsupported account type"), wxICON_ERROR); + return; + + } AccName = preferences->accounts.GetAccountName((int)lstAccountsIndex); @@ -226,6 +257,10 @@ void frmPreferences::DeleteABAccount( wxCommandEvent& event ) AccountDirFull.Append(wxT("carddav")); + } else { + + AccountDirFull.Append(AccountType.Lower()); + } lstAccounts->DeleteItem(lstAccountsIndex); @@ -254,6 +289,9 @@ void frmPreferences::DeleteABAccount( wxCommandEvent& event ) } + btnAccountModify->Enable(FALSE); + btnAccountDelete->Enable(FALSE); + } void frmPreferences::LoadPreferences( wxInitDialogEvent& event ) @@ -344,6 +382,10 @@ void frmPreferences::ReloadAccounts(){ col0.SetImage(AccountID); + } else { + + col0.SetImage(AccountUnsupportedID); + } long itemindex = lstAccounts->InsertItem( col0 );