Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Introduced simplified LoadBirthday and LoadAnniversary.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 28 Dec 2015 19:20:44 +0000 (19:20 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 28 Dec 2015 19:20:44 +0000 (19:20 +0000)
source/contacteditor/frmContactEditor-Load.cpp
source/contacteditor/frmContactEditor-LoadBADays.cpp
source/contacteditor/frmContactEditor.h

index 6d63680..8449f61 100644 (file)
@@ -136,7 +136,15 @@ bool frmContactEditor::LoadContact(wxString Filename){
        int XTokenCount = 0;
        //int intValueSeek = 1;
 
-       // Process the Gender (GENDER).
+       // Process the Birthday (BDAY) (frmContactEditor-LoadBADays.cpp)
+       
+       LoadBirthday(&ContactEditorData.Birthday, &ContactEditorData.BirthdayText);
+
+       // Process the Anniversary (ANNIVERSARY) (frmContactEditor-LoadBADays.cpp)
+       
+       LoadAnniversary(&ContactEditorData.Anniversary, &ContactEditorData.AnniversaryText);
+
+       // Process the Gender (GENDER) (frmContactEditor-LoadGender.cpp)
        
        LoadGender(&ContactEditorData.Gender, &ContactEditorData.GenderDetails);
 
@@ -271,11 +279,11 @@ bool frmContactEditor::LoadContact(wxString Filename){
                        
                        LoadNickname(wxSPropertySeg1, wxSPropertySeg2, &NicknameCount, &ContactData);
                        
-               } else if (wxSProperty == wxT("GENDER") && GenderProcessed == FALSE){
+               }/* else if (wxSProperty == wxT("GENDER") && GenderProcessed == FALSE){
                
                        // See frmContactEditor-LoadGender.cpp
                
-                       //LoadGender(wxSPropertySeg1, wxSPropertySeg2, &GenderProcessed, &ContactData);
+                       LoadGender(wxSPropertySeg1, wxSPropertySeg2, &GenderProcessed, &ContactData);
                
                } else if (wxSProperty == wxT("BDAY") && BirthdayProcessed == FALSE){
 
@@ -289,7 +297,7 @@ bool frmContactEditor::LoadContact(wxString Filename){
                        
                        LoadAnniversary(wxSPropertySeg1, wxSPropertySeg2, &AnniversaryProcessed);
                
-               } else if (wxSProperty == wxT("TZ")){
+               }*/ else if (wxSProperty == wxT("TZ")){
                
                        // See frmContactEditor-LoadTimeZone.cpp
                
index 0318762..4b3e669 100644 (file)
 
 #include "frmContactEditor.h"
 
+void frmContactEditor::LoadBirthday(wxString *BirthdayData, bool *BirthdayText){
+
+       if (*BirthdayText == FALSE){
+       
+               int DateYear = 0;
+               wxDateTime::Month DateMonth;
+               unsigned int DateDay;
+               
+               wxString wxSData;
+               
+               if (Birthday.Mid(0, 2) == wxT("--")){
+               
+                       // Skip year.
+               
+               } else {
+               
+                       DateYear = wxAtoi(BirthdayData->Mid(0,4));
+               
+               }
+               
+               DateMonth = (wxDateTime::Month)(wxAtoi(BirthdayData->Mid(4,2)) - 1);
+               DateDay = wxAtoi(BirthdayData->Mid(6,2));
+       
+               wxDateTime BDayDate(DateDay,DateMonth,DateYear);
+       
+               dapBirthday->SetValue(BDayDate);                                
+       
+       } else {
+       
+               txtBirthday->SetValue(*BirthdayData);
+       
+       }
+
+}
+
+void frmContactEditor::LoadAnniversary(wxString *AnniversaryData, bool *AnniversaryText){
+
+       if (*AnniversaryText == FALSE){
+       
+               int DateYear = 0;
+               wxDateTime::Month DateMonth;
+               int DateDay;
+               
+               wxString wxSData;
+               
+               if (Anniversary.Mid(0, 2) == wxT("--")){
+               
+                       // Skip year.
+               
+               } else {
+               
+                       DateYear = wxAtoi(AnniversaryData->Mid(0,4));
+               
+               }
+               
+               DateMonth = (wxDateTime::Month)(wxAtoi(AnniversaryData->Mid(4,2)) - 1);
+               DateDay = wxAtoi(AnniversaryData->Mid(6,2));                                    
+       
+               wxDateTime ADayDate(DateDay,DateMonth,DateYear);
+       
+               dapAnniversary->SetValue(ADayDate);
+       
+       } else {
+       
+               txtAnniversary->SetValue(*AnniversaryData);
+       
+       }
+
+}
+
 void frmContactEditor::LoadBDay(wxString wxSPropertySeg1, wxString wxSPropertySeg2, bool *BirthdayProcessed){
 
        // Process date. Preserve the remainder in the string.
index 873fd82..8b872b3 100644 (file)
@@ -640,6 +640,8 @@ class frmContactEditor : public frmContactEditorADT
                void LoadKey(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *KeyCount);
                
                void LoadGender(wxString *GenderComponent, wxString *GenderIdentity);
+               void LoadBirthday(wxString *BirthdayData, bool *BirthdayText);
+               void LoadAnniversary(wxString *AnniversaryData, bool *AnniversaryText);
        
                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