Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Implemented loading for TZ using ContactDataObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 29 Dec 2015 01:12:39 +0000 (01:12 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 29 Dec 2015 01:12:39 +0000 (01:12 +0000)
source/contacteditor/frmContactEditor-Load.cpp
source/contacteditor/frmContactEditor-LoadTimeZone.cpp
source/contacteditor/frmContactEditor.h

index 56e4b9f..c8e1362 100644 (file)
@@ -185,6 +185,16 @@ bool frmContactEditor::LoadContact(wxString Filename){
                &ContactEditorData.BusinessAddressListPref,
                &ADRCount);
 
+       // Process the timezone (TZ) (frmContactEditor-LoadTimeZone.cpp)
+       
+       LoadTimeZone(&ContactEditorData.GeneralTZList,
+               &ContactEditorData.GeneralTZListPref,
+               &ContactEditorData.HomeTZList,
+               &ContactEditorData.HomeTZListPref,
+               &ContactEditorData.BusinessTZList,
+               &ContactEditorData.BusinessTZListPref,
+               &TZCount);
+
        for (std::map<int,wxString>::iterator iter = ContactFileLines.begin(); 
         iter != ContactFileLines.end(); ++iter){
        
@@ -334,13 +344,13 @@ bool frmContactEditor::LoadContact(wxString Filename){
                        
                        LoadAnniversary(wxSPropertySeg1, wxSPropertySeg2, &AnniversaryProcessed);
                
-               }*/ else if (wxSProperty == wxT("TZ")){
+               } else if (wxSProperty == wxT("TZ")){
                
                        // See frmContactEditor-LoadTimeZone.cpp
                
                        LoadTimeZone(wxSPropertySeg1, wxSPropertySeg2, &TZCount);       
                
-               }/* else if (wxSProperty == wxT("ADR")){
+               }  else if (wxSProperty == wxT("ADR")){
                        
                        // See frmContactEditor-LoadAddress.cpp
                
index 72ac89a..cab9f88 100644 (file)
 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
 
 #include "frmContactEditor.h"
-                       
+
+void frmContactEditor::LoadTimeZone(std::map<int, wxString> *GeneralTZListPtr,
+               std::map<int, int> *GeneralTZListPrefPtr,
+               std::map<int, wxString> *HomeTZListPtr,
+               std::map<int, int> *HomeTZListPrefPtr,
+               std::map<int, wxString> *BusinessTZListPtr,
+               std::map<int, int> *BusinessTZListPrefPtr,
+               int *TZCount){
+
+       long ListCtrlIndex = -1;
+
+       // Deal with the general addresses.
+       
+       for (std::map<int,wxString>::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<int,wxString>::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<int,wxString>::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();
index 8c05165..e5ceb88 100644 (file)
@@ -663,6 +663,13 @@ class frmContactEditor : public frmContactEditorADT
                        std::map<int, wxString> *BusinessAddressListPostCode,
                        std::map<int, int> *BusinessAddressListPref,
                        int *AddressCount);
+               void LoadTimeZone(std::map<int, wxString> *GeneralTZListPtr,
+                       std::map<int, int> *GeneralTZListPrefPtr,
+                       std::map<int, wxString> *HomeTZListPtr,
+                       std::map<int, int> *HomeTZListPrefPtr,
+                       std::map<int, wxString> *BusinessTZListPtr,
+                       std::map<int, int> *BusinessTZListPrefPtr,
+                       int *TZCount);
        
                int intValueSeek = 1;
                bool IsGroup = FALSE;
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy