root/trunk/globals.cpp

Revision 5, 1.1 kB (checked in by qbert, 6 years ago)

Initial ( and last :( ) commit

Line 
1 #include "StdAfx.h"
2 #include "globals.h"
3
4
5 bool Globals::Restore( )
6     {
7
8         CRegistry reg;
9         reg.SetRootKey(HKEY_CURRENT_USER);
10         if ( reg.SetKey("Software\\thirty_four_elephants\\Elephant",false) )
11         {
12             installPath = reg.ReadString("InstallPath","").GetBuffer(0);
13             if ( installPath == "") return false;           
14
15            
16
17
18
19             settings = NULL;
20             settings = new ElephantSettings(installPath , "eide.ini");
21             settings->baseSettings->SetCache("installPath",installPath);
22            
23             return true;
24
25         }
26
27         return false;
28
29     }
30
31
32 void Globals::SetProject(ProjectSettings* p)
33     {
34    
35         if ( currentProject ) {
36             currentProject->Save();
37             delete currentProject;
38             currentProject = NULL;
39         }
40
41        
42
43         //AfxMessageBox(p->path.c_str());
44         currentProject = p;
45         SetCurrentDirectory(p->path.c_str());
46
47         //AfxMessageBox("here");
48     //  AfxMessageBox(p->path.c_str());
49         theApp.StartProject(p);
50        
51        
52         vector<string> files;
53         Split(p->GetCache("files"),",",files);
54         //AfxMessageBox(p->GetCache("files").c_str());
55
56         //if ( files.size() ) AfxGetApp()->OpenDocumentFile(files[0].c_str());
57     }
Note: See TracBrowser for help on using the browser.