X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditor-LoadTimeZone.cpp;h=cab9f88b75ccf1ca182d7a828108e4bbc6b797eb;hb=2171887a85a5eca924e73c23422a9fcc91e11bb2;hp=6750b53cec2f9ee003813659259430525b9271d3;hpb=0f855c5d57f952d2aae11759a60de90146e03c68;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditor-LoadTimeZone.cpp b/source/contacteditor/frmContactEditor-LoadTimeZone.cpp index 6750b53..cab9f88 100644 --- a/source/contacteditor/frmContactEditor-LoadTimeZone.cpp +++ b/source/contacteditor/frmContactEditor-LoadTimeZone.cpp @@ -1,5 +1,107 @@ +// frmContactEditor-LoadTimeZone.cpp - frmContactEditor load timezone subroutines. +// +// (c) 2012-2015 Xestia Software Development. +// +// This file is part of Xestia Address Book. +// +// Xestia Address Book is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by the +// Free Software Foundation, version 3 of the license. +// +// Xestia Address Book is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with Xestia Address Book. If not, see + #include "frmContactEditor.h" - + +void frmContactEditor::LoadTimeZone(std::map *GeneralTZListPtr, + std::map *GeneralTZListPrefPtr, + std::map *HomeTZListPtr, + std::map *HomeTZListPrefPtr, + std::map *BusinessTZListPtr, + std::map *BusinessTZListPrefPtr, + int *TZCount){ + + long ListCtrlIndex = -1; + + // Deal with the general addresses. + + for (std::map::iterator Iter = GeneralTZListPtr->begin(); + Iter != GeneralTZListPtr->end(); + Iter++){ + + wxListItem coldata; + + coldata.SetId(*TZCount); + coldata.SetData(*TZCount); + coldata.SetText(Iter->second); + + ListCtrlIndex = lboTimezones->InsertItem(coldata); + + if (MapDataExists(TZCount, GeneralTZListPrefPtr)){ + + lboTimezones->SetItem(ListCtrlIndex, 1, wxString::Format("%i", GeneralTZListPrefPtr->find(*TZCount)->second)); + + } + + (*TZCount)++; + + } + + // Deal with the home addresses. + + for (std::map::iterator Iter = HomeTZListPtr->begin(); + Iter != HomeTZListPtr->end(); + Iter++){ + + wxListItem coldata; + + coldata.SetId(*TZCount); + coldata.SetData(*TZCount); + coldata.SetText(Iter->second); + + ListCtrlIndex = lboHomeTimezones->InsertItem(coldata); + + if (MapDataExists(TZCount, HomeTZListPrefPtr)){ + + lboHomeTimezones->SetItem(ListCtrlIndex, 1, wxString::Format("%i", HomeTZListPrefPtr->find(*TZCount)->second)); + + } + + (*TZCount)++; + + } + + // Deal with the work addresses. + + for (std::map::iterator Iter = BusinessTZListPtr->begin(); + Iter != BusinessTZListPtr->end(); + Iter++){ + + wxListItem coldata; + + coldata.SetId(*TZCount); + coldata.SetData(*TZCount); + coldata.SetText(Iter->second); + + ListCtrlIndex = lboBusinessTimezones->InsertItem(coldata); + + if (MapDataExists(TZCount, BusinessTZListPrefPtr)){ + + lboBusinessTimezones->SetItem(ListCtrlIndex, 1, wxString::Format("%i", BusinessTZListPrefPtr->find(*TZCount)->second)); + + } + + (*TZCount)++; + + } + +} + void frmContactEditor::LoadTimeZone(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *TZCount){ size_t intPropertyLen = wxSPropertySeg1.Len();