Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Move INSTALL, LICENSE, README, THANKS and TODO into root directory
[xestiaab/.git] / source / import / frmImportResults.cpp
1 // frmImportResults.h - frmImportResults form.
2 //
3 // (c) 2012-2015 Xestia Software Development.
4 //
5 // This file is part of Xestia Address Book.
6 //
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
10 //
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
19 #include <map>
20 #include <wx/wx.h>
21 #include <wx/clipbrd.h>
22 #include <wx/dataobj.h>
24 #include "frmImportResults.h"
26 frmImportResults::frmImportResults( wxWindow* parent )
27 :
28 frmImportResultsADT( parent )
29 {
31 }
33 void frmImportResults::CopyClipboard( wxCommandEvent& event )
34 {
36         // Copy the results to the clipboard.
37         
38         if (wxTheClipboard->Open()){
39         
40                 wxTextDataObject ResultData;
41         
42                 ResultData.SetText(txtResults->GetValue());
43                 
44                 wxTheClipboard->Clear();        
45                 wxTheClipboard->AddData(&ResultData);
46                 wxTheClipboard->Close();
47                 wxTheClipboard->Flush();
48         
49                 wxMessageBox(_("The results have been copied to the clipboard."), _("Results copied to clipboard"));
50         
51         } else {
52         
53                 wxMessageBox(_("The results have not been copied to the clipboard due to an error."), _("Results not copied to clipboard"));
54         
55         }
56         
57 }
59 void frmImportResults::CloseWindow( wxCommandEvent& event )
60 {
61         
62         // Close the window.
63         
64         this->Close();
65         
66 }
68 void frmImportResults::LoadData(std::map<int,wxString> *ResultDataInc, int ImportCount, int ImportErrorCount)
69 {
71         // Load and process the data from the ResultDataInc pointer.
72         
73         wxString ResultDataText;
74         
75         for (std::map<int,wxString>::iterator iter = ResultDataInc->begin(); 
76         iter != ResultDataInc->end(); iter++){
77         
78                 ResultDataText.Append(iter->second + wxT("\n"));
79         
80         }
81         
82         // Display the results in the form.
83         
84         txtResults->SetValue(ResultDataText);
85         lblText->SetLabel(wxString::Format(_("%i contacts imported. %i contacts had errors and could not be imported."), ImportCount, ImportErrorCount));
87 }
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