- std::cerr << path1 << ": file not found..." << std::endl;
- path1 = path + "/CMakeLists.txt";
- pFile = fopen(path1.c_str(), "r");
- if(pFile == NULL) //not the source folder
- {
- std::cerr << path1 << ": file not found..." << std::endl;
- wxMessageBox( wxT("No project selected."), wxT("Open Project - Error"), wxICON_ERROR);
- event.Skip();
- return;
- }else{//source folder
- std::cout << "sources folder found..." << std::endl;
- fclose(pFile);
- }
- }else{//binary folder
- std::cout << "binary folder found..." << std::endl;
- fclose(pFile);
-
- std::ifstream readFile;
- readFile.open(path1.c_str());
- std::string word;
- bool found = false;
- while(!found && readFile >> word)
- {
- //cout << word << endl;
- if(word == "CMAKE_SOURCE_DIR")
- {
- readFile >> word;
- readFile.ignore();
- getline(readFile, word, '\n');
- path = word;
- found = true;
- }
- }
- readFile.close();
-
- if(!found)
- {
- std::cerr << "sources not found..." << std::endl;
- wxMessageBox( wxString("Sources not found."), wxString("Open Project - Error"), wxICON_ERROR);
- event.Skip();
- return;
- }else{
- pFile = fopen(path.c_str(), "r");
- std::cout << "sources at " << path << " open = " << (pFile != NULL) << std::endl;
- std::cout.flush();
- }
- }
-
-
- this->projectTree.addRoot(path);
- this->projectTree.populateNode(path);
-
- ((wxCreaDevManagerTreeCtrl*)tree_Projects)->BuildTree(this->projectTree);
+ case 1:
+ wxMessageBox( wxT("No project selected."), wxT("Open Project - Error"), wxICON_ERROR);
+ event.Skip();
+ break;
+ case 2:
+ wxMessageBox( wxString("Sources not found."), wxString("Open Project - Error"), wxICON_ERROR);
+ event.Skip();
+ break;
+ case 0:
+ break;
+ };
+
+ ((wxCreaDevManagerTreeCtrl*)tree_Projects)->BuildTree(this->controller->GetActiveProjects());