X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcreaDevManagerLib%2FwxCDMProjectActionsPanel.cpp;h=514d247faf7c32e3728ec5b640a5a4b5f8662232;hb=f3f98131ffd23351c3cd872a0b04aecdc97b7c92;hp=35a98be2edae555c1206e95872204c6e0dca11b9;hpb=e992e2085f2a767ab390c3168599047de2ef1d3b;p=crea.git diff --git a/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp b/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp index 35a98be..514d247 100755 --- a/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp @@ -134,32 +134,46 @@ void wxCDMProjectActionsPanel::OnBtnBuildProject(wxCommandEvent& event) return; } #else - //get author from user - wxTextEntryDialog* buildDlg = new wxTextEntryDialog( - this, - wxT("Enter the compilation instruction:"), - wxT("Project Compilation- creaDevManager"), - crea::std2wx(this->project->GetBuildInstruction()), - wxTE_MULTILINE | wxOK | wxCANCEL - ); - - if (buildDlg->ShowModal() == wxID_OK) + + std::string* result; + int isDir = wxMessageBox(crea::std2wx("Is this the path of the project compilation?:\n"+this->project->GetBuildPath()), wxT("Project Compilation - CreaDevManager"), wxYES_NO|wxCANCEL); + if(isDir != wxCANCEL) { - std::string buildDlgStr = crea::wx2std(buildDlg->GetValue()); - //check name - if (buildDlgStr != "") + wxString file = crea::std2wx(this->project->GetBuildPath()); + if(isDir == wxNO) { - std::string* result; - //wxProgressDialog* loadBar = new wxProgressDialog(wxT("Compiling"), wxT("Please wait while the compilation is executing..."), 100, this); - //loadBar->Pulse(); - if(!this->project->Build(result, buildDlgStr)) + file = wxDirSelector( + wxT("Please select the folder where your project is to be built."), + crea::std2wx(this->project->GetBuildPath()) + ); + } + + if(!file.IsEmpty()) + { + this->project->SetBuildPath(crea::wx2std(file), result); + + wxTextEntryDialog* buildDlg = new wxTextEntryDialog( + this, + wxT("Check the compilation instruction:"), + wxT("Project Compilation - CreaDevManager"), + crea::std2wx(this->project->GetBuildInstruction()), + wxTE_MULTILINE | wxOK | wxCANCEL + ); + + if (buildDlg->ShowModal() == wxID_OK) { - //loadBar->Destroy(); - wxMessageBox(crea::std2wx(result->c_str()), wxT("Project Compilation - Error!")); - return; + std::string buildDlgStr = crea::wx2std(buildDlg->GetValue()); + //check line + if (buildDlgStr != "") + { + std::string* result; + if(!this->project->Build(result, buildDlgStr)) + { + wxMessageBox(crea::std2wx(result->c_str()), wxT("Project Compilation - Error!")); + return; + } + } } - //loadBar->Destroy(); - //wxMessageBox(crea::std2wx("The compilation was executed successfully. Please check the \"building.log\" file located in the build folder to check the compilation result."), wxT("Project Compilation")); } } #endif