-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcleanOrg.cpp
68 lines (68 loc) · 1.42 KB
/
cleanOrg.cpp
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
57
58
59
60
61
62
63
64
65
66
67
68
#include "G.h"
#include "GetOrg_DLG.h"
ORG G::mGetOrg( void )
{
ORG org;
org.nowName = orgName_TXT->GetValue();
org.nowFile = orgFile_TXT->GetValue();
return org;
}
xStr G::mGetOrgFile( void )
{
return gGetOrg().nowFile;
}
void G::mShowOrg( void )
{
ORG org = gGetOrg();
orgName_TXT->ChangeValue( org.nowName );
orgFile_TXT->ChangeValue( org.nowFile );
gEnable( !org.isDefault, SetOrg_P );
}
void G::mSaveOrg( void )
{
ORG org = gGetOrg();
if ( !org.isDefault )
{
xStr path, file;
gGetOrgFile( path, file );
wxFileConfig cfgIni( wxT( "HackerEX" ), wxT( "Shadow Flare Industries" ), file );
cfgIni.SetPath( wxT( "Organisation" ) );
cfgIni.DeleteEntry( org.oldName, false );
path += wxT( "org" ) + gGetSlash();
file = path + org.oldFile + wxT( ".hexp" );
if ( !wxDirExists( path ) )
{
wxMkdir( path );
}
if ( wxFileExists( file ) )
{
wxRenameFile( file, org.nowFile + wxT( ".hexp" ) );
}
cfgIni.Write( org.nowName, org.nowFile );
}
}
void G::mLoadOrg( void )
{
GetOrg_DLG d( this );
if ( d.ShowModal() == wxID_OK )
{
mShowOrg();
mLoadPFM();
}
}
void G::mListOrg_OnClick( wxCommandEvent& event )
{
mLoadOrg();
}
void G::mLoadOrg_OnClick( wxCommandEvent& event )
{
mLoadOrg();
}
void G::mSaveOrg_OnClick( wxCommandEvent& event )
{
mSaveOrg();
}
void G::mSetOrg_OnClick( wxCommandEvent& event )
{
gSetOrg( mGetOrg() );
}