1 // frmImportResults.h - frmImportResults form.
3 // (c) 2012-2015 Xestia Software Development.
5 // This file is part of Xestia Address Book.
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.
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.
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/>
21 #include <wx/clipbrd.h>
22 #include <wx/dataobj.h>
24 #include "frmImportResults.h"
26 frmImportResults::frmImportResults( wxWindow* parent )
28 frmImportResultsADT( parent )
33 void frmImportResults::CopyClipboard( wxCommandEvent& event )
36 if (wxTheClipboard->Open()){
38 wxTextDataObject ResultData;
40 ResultData.SetText(txtResults->GetValue());
42 wxTheClipboard->Clear();
43 wxTheClipboard->AddData(&ResultData);
44 wxTheClipboard->Close();
45 wxTheClipboard->Flush();
47 wxMessageBox(_("The results have been copied to the clipboard."), _("Results copied to clipboard"));
51 wxMessageBox(_("The results have not been copied to the clipboard due to an error."), _("Results not copied to clipboard"));
57 void frmImportResults::CloseWindow( wxCommandEvent& event )
62 void frmImportResults::LoadData(std::map<int,wxString> *ResultDataInc, int ImportCount, int ImportErrorCount)
65 wxString ResultDataText;
67 for (std::map<int,wxString>::iterator iter = ResultDataInc->begin();
68 iter != ResultDataInc->end(); iter++){
70 ResultDataText.Append(iter->second + wxT("\n"));
74 // Display the results in the form.
76 txtResults->SetValue(ResultDataText);
77 lblText->SetLabel(wxString::Format(_("%i contacts imported. %i contacts had errors and could not be imported."), ImportCount, ImportErrorCount));