Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Improved importing support.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 4 Oct 2015 15:18:57 +0000 (16:18 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 4 Oct 2015 15:18:57 +0000 (16:18 +0100)
source/import/frmImportContacts.cpp
source/import/frmImportContacts.h
source/import/import.cpp

index 0160598..e37e5cd 100644 (file)
@@ -126,6 +126,8 @@ frmImportContactsADT( parent )
        AccName.clear();
        
     }
+    
+    DialogResult = FALSE;
 
 }
 
@@ -153,11 +155,13 @@ void frmImportContacts::GetContacts()
 
 void frmImportContacts::CloseWindow( wxCommandEvent& event )
 {
+       DialogResult = FALSE;
        this->Close();
 }
 
 void frmImportContacts::ImportContacts( wxCommandEvent& event )
 {
+       DialogResult = TRUE;
        this->Close();
 }
 
@@ -293,4 +297,10 @@ wxString frmImportContacts::GetAccountType()
        
        return AccountType;
 
+}
+
+bool frmImportContacts::GetDialogResult(){
+
+       return DialogResult;
+
 }
\ No newline at end of file
index 7862fb4..3f42e6e 100644 (file)
@@ -29,6 +29,7 @@ class frmImportContacts : public frmImportContactsADT
                int AccountID;
                int AccountNetID;
                int AccountGrpID;
+               bool DialogResult;
        protected:
                // Handlers for frmImportContactsADT events.
                void CloseWindow( wxCommandEvent& event );
@@ -41,8 +42,10 @@ class frmImportContacts : public frmImportContactsADT
                ~frmImportContacts();
                void SetupList(std::map<int,ImportDataContact>* ContactDataInc);
                void GetResults(std::map<int,ImportDataContact>* ContactDataInc);
+               bool GetDialogResult();
                wxString GetAccount();
                wxString GetAccountType();
+               wxString GetAccountDirName();
        //// end generated class members
        
 };
index 948f83f..b85c4f6 100644 (file)
@@ -104,6 +104,18 @@ void ImportRun(frmMain *frmMainPtrInc){
        AccountName = frmIC->GetAccount();
        AccountType = frmIC->GetAccountType();
 
+       if (frmIC->GetDialogResult() == FALSE){
+               
+               // User decided not to import. Clean up the
+               // dialog.
+               
+               delete frmIC;
+               frmIC = NULL;
+               frmMainPtrInc->ResumeAllTimers();
+               return;
+               
+       }
+
        delete frmIC;
        frmIC = NULL;
 
@@ -289,10 +301,14 @@ void ImportRun(frmMain *frmMainPtrInc){
        
        if (AccountType != wxT("Local") && AccountType != wxT("local")){
        
-               wxString *AccNamePostEventPtr = new wxString;
+               wxString AccNamePostEvent;
+       
+               AccNamePostEvent.Clear();
+               AccNamePostEvent.Append(AccountName);
+               AccNamePostEvent.Trim();
        
                wxCommandEvent accevent(SYNCACCOUNT);
-               accevent.SetClientData(AccNamePostEventPtr);
+               accevent.SetString(AccNamePostEvent);
        
                wxPostEvent(frmMainPtrInc, accevent);
        
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