[go: up one dir, main page]

Menu

[r9]: / toucan / trunk / secure.h  Maximize  Restore  History

Download this file

56 lines (48 with data), 1.5 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <wx/file.h>
#include <wx/filefn.h>
#include <wx/dir.h>
#include "cryptfile.h"
#include "cryptdir.h"
#include "normalise.h"
#include "frmprogress.h"
bool Secure(wxArrayString arrLocation, wxString strFunction, wxString strPass, bool blBox)
{
wxGetApp().SetStrTemp(wxEmptyString);
wxGetApp().SetStrAbort(wxEmptyString);
frmProgress* window = new frmProgress(NULL, ID_FRMPROGRESS, _("Progress"));
window->m_OK->Enable(false);
window->m_Save->Enable(false);
window->m_Progress_Text->SetValue(_("Starting..."));
if(blBox)
{
window->Show();
}
window->Update();
wxGetApp().SetStrAbort(wxEmptyString);
unsigned int i;
for(i = 0; i < arrLocation.Count(); i++)
{
if(wxGetApp().GetStrAbort() == wxT("ABORT"))
{
return false;
}
arrLocation.Item(i) = Normalise(arrLocation.Item(i));
arrLocation.Item(i) = Normalise(arrLocation.Item(i));
//wxMessageBox(arrLocation.Item(i));
if(wxDirExists(arrLocation.Item(i)))
{
//wxMessageBox(wxT("Crypt Dir ") + arrLocation.Item(i));
CryptDir(arrLocation.Item(i), strPass, strFunction, window);
}
else
{
//wxMessageBox(wxT("Crypt File ") + arrLocation.Item(i));
CryptFile(arrLocation.Item(i), strPass, strFunction, window);
}
}
window->m_Progress_Text->AppendText(_("\nFinished"));
window->m_OK->Enable(true);
window->m_Save->Enable(true);
window->m_Abort->Enable(false);
return true;
}