Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Improved importing support.
[xestiaab/.git] / source / import / frmImportContacts.cpp
index 9031a3a..0160598 100644 (file)
@@ -77,6 +77,7 @@ frmImportContactsADT( parent )
     wxString AccDirFull;
     wxString AccDirFullSfx;
     wxString AccName;
+    wxString AccType;
     wxString AccDirFinal;
     wxTreeItemId AccountTreeId;
     wxTreeItemId GroupTreeId;
@@ -100,7 +101,10 @@ frmImportContactsADT( parent )
        AccDirFull.Append(AccDirFullSfx);
        AccName = preferences.accounts.GetAccountName(i);
        AccName.Trim();
+       AccType = preferences.accounts.GetAccountType(i);
+       AccType.Trim();
        AccountAccDirList.insert(std::make_pair(i, AccDirFull));
+       AccountAccTypeList.insert(std::make_pair(i, AccType));
        
        if (preferences.accounts.GetAccountType(i) == wxT("CardDAV") ||
        preferences.accounts.GetAccountType(i) == wxT("carddav")){
@@ -125,6 +129,18 @@ frmImportContactsADT( parent )
 
 }
 
+frmImportContacts::~frmImportContacts()
+{
+       
+       /*delete AccControl;
+       AccControl = NULL;
+       delete treAccounts;
+       treAccounts = NULL;
+       delete AccImgList;
+       AccImgList = NULL;*/
+       
+}
+
 void frmImportContacts::GetResult()
 {
 
@@ -237,4 +253,44 @@ wxString frmImportContacts::GetAccount()
        
        return AccountName;
 
+}
+
+wxString frmImportContacts::GetAccountType()
+{
+
+       wxString preffilename = GetUserPrefDir();
+
+       XABPreferences preferences(preffilename);
+
+       wxString AccountType;
+       
+       //XABPrefAccounts prefaccounts;
+       
+       wxTreeItemIdValue cookie;
+       wxTreeItemId next = treAccounts->GetRootItem();
+
+       wxTreeItemId selectedChild = treAccounts->GetSelection();
+       wxTreeItemId nextChild;
+
+       for (int i = 0; i < preferences.accounts.GetCount(); i++){
+
+               if (!nextChild){
+                       nextChild = treAccounts->GetFirstChild(next, cookie);
+               } else {
+                       nextChild = treAccounts->GetNextSibling(nextChild);
+               }
+               
+               if (nextChild == selectedChild){
+       
+                       std::map<int, wxString>::iterator AccTypeIter = AccountAccTypeList.find(i);
+                       
+                       AccountType = AccTypeIter->second;
+       
+               }
+       
+
+       }
+       
+       return AccountType;
+
 }
\ No newline at end of file
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