X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcreaDevManagerLib%2FwxCDMProjectActionsPanel.cpp;h=0b33c8c311532189a2307eb194091ad78f5ad816;hb=edff8f949ff69c2c720478437a65bf1beff7923d;hp=9871519ac6df89f2dc55748e51706b44cbb5f1de;hpb=78a3d08edf8e9b8b11ba87c5a6a4f9211ae107d3;p=crea.git diff --git a/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp b/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp index 9871519..0b33c8c 100755 --- a/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp @@ -125,12 +125,12 @@ void wxCDMProjectActionsPanel::OnBtnConfigureBuild(wxCommandEvent& event) void wxCDMProjectActionsPanel::OnBtnBuildProject(wxCommandEvent& event) { #ifdef _WIN32 - std::string* result; - if(!this->project->Build(result, "")) - { - wxMessageBox(crea::std2wx(result->c_str()), wxT("Project Compilation - Error!")); - return; - } + std::string* result; + if(!this->project->Build(result, "")) + { + wxMessageBox(crea::std2wx(result->c_str()), wxT("Project Compilation - Error!")); + return; + } #else //get author from user wxTextEntryDialog* buildDlg = new wxTextEntryDialog( @@ -166,22 +166,31 @@ void wxCDMProjectActionsPanel::OnBtnBuildProject(wxCommandEvent& event) void wxCDMProjectActionsPanel::OnBtnConnectProject(wxCommandEvent& event) { std::string* result; - wxString file = wxDirSelector( - wxT("Please select the folder containing the bbtkPackage file you want to use. Usually it is where you built your project."), - crea::std2wx(this->project->GetBuildPath()) - ); - - if(crea::wx2std(file) == "" || !this->project->Connect(result, crea::wx2std(file))) + int isDir = wxMessageBox(crea::std2wx("Is this the path of the project compilation to plug?:\n"+this->project->GetBuildPath()), wxT("Plug BBTK Packages"), wxYES_NO|wxCANCEL); + if(isDir != wxCANCEL) { - if (crea::wx2std(file) == "") - result = new std::string("Folder not specified."); - wxMessageBox(crea::std2wx(result->c_str()), wxT("Plug BBTK Packages - Error!"), wxICON_ERROR); - return; + wxString file = crea::std2wx(this->project->GetBuildPath()); + if(isDir == wxNO) + { + file = wxDirSelector( + wxT("Please select the folder containing the bbtkPackage file you want to use. Usually it is where you built your project."), + crea::std2wx(this->project->GetBuildPath()) + ); + } + + if(!file.IsEmpty()) + { + if(!this->project->Connect(result, crea::wx2std(file))) + { + wxMessageBox(crea::std2wx(result->c_str()), wxT("Plug BBTK Packages - Error!"), wxICON_ERROR); + return; + } + else + { + wxMessageBox(crea::std2wx("The connection was executed successfully. Please check the console to see the compilation result.\n Also, don't forget to restart the BBTK Graphical Editor (if already opened) to see the plugged packages."), wxT("Plug Package")); + } + + } + } -#ifdef _WIN32 - wxMessageBox(crea::std2wx("The connection was executed successfully. Please check the console to see the compilation result."), wxT("Plug Package")); -#else - wxMessageBox(crea::std2wx("The connection was executed successfully. Please check the \"plugging.log\" file located in the build folder to see the compilation result."), wxT("Plug Package")); -#endif - }