Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added copyright and license to the C++ source and header files in the import 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         if (wxTheClipboard->Open()){
37         
38                 wxTextDataObject ResultData;
39         
40                 ResultData.SetText(txtResults->GetValue());
41                 
42                 wxTheClipboard->Clear();        
43                 wxTheClipboard->AddData(&ResultData);
44                 wxTheClipboard->Close();
45                 wxTheClipboard->Flush();
46         
47                 wxMessageBox(_("The results have been copied to the clipboard."), _("Results copied to clipboard"));
48         
49         } else {
50         
51                 wxMessageBox(_("The results have not been copied to the clipboard due to an error."), _("Results not copied to clipboard"));
52         
53         }
54         
55 }
57 void frmImportResults::CloseWindow( wxCommandEvent& event )
58 {
59         this->Close();
60 }
62 void frmImportResults::LoadData(std::map<int,wxString> *ResultDataInc, int ImportCount, int ImportErrorCount)
63 {
65         wxString ResultDataText;
66         
67         for (std::map<int,wxString>::iterator iter = ResultDataInc->begin(); 
68         iter != ResultDataInc->end(); iter++){
69         
70                 ResultDataText.Append(iter->second + wxT("\n"));
71         
72         }
73         
74         // Display the results in the form.
75         
76         txtResults->SetValue(ResultDataText);
77         lblText->SetLabel(wxString::Format(_("%i contacts imported. %i contacts had errors and could not be imported."), ImportCount, ImportErrorCount));
79 }
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