]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp
Feature #1711 CreaDevManager application implementation
[crea.git] / lib / creaDevManagerLib / wxCDMProjectDescriptionPanel.cpp
index 503d51113b292c6e874a048b1971cca1e3894c0d..a6f121b7d02b26c624475e9c5260efd2b5b8a4e1 100644 (file)
@@ -49,6 +49,7 @@ EVT_BUTTON(ID_BUTTON_GOTO_LIB_MANAGER, wxCDMProjectDescriptionPanel::OnBtnManage
 EVT_BUTTON(ID_BUTTON_GOTO_APPLI_MANAGER, wxCDMProjectDescriptionPanel::OnBtnManageApplications)
 EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMProjectDescriptionPanel::OnBtnEditCMakeLists)
 EVT_BUTTON(ID_BUTTON_SET_BUILD_PATH, wxCDMProjectDescriptionPanel::OnBtnSetBuildPath)
+EVT_BUTTON(ID_BUTTON_OPEN_BUILD_PATH, wxCDMProjectDescriptionPanel::OnBtnOpenBuild)
 EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMProjectDescriptionPanel::OnBtnOpenFolder)
 EVT_BUTTON(ID_BUTTON_SET_VERSION, wxCDMProjectDescriptionPanel::OnBtnSetVersion)
 END_EVENT_TABLE()
@@ -81,12 +82,11 @@ bool wxCDMProjectDescriptionPanel::Create(
 )
 {
   wxPanel::Create(parent, id, pos, size, style);
+  this->project = project;
+  CreateControls();
   // this part makes the scrollbars show up
   this->FitInside(); // ask the sizer about the needed size
   this->SetScrollRate(5, 5);
-
-  this->project = project;
-  CreateControls();
   return TRUE;
 }
 
@@ -148,10 +148,16 @@ void wxCDMProjectDescriptionPanel::CreateControls()
   wxBoxSizer* pBuildLocationsz = new wxBoxSizer(wxHORIZONTAL);
   this->buildPathtc = new wxStaticText(propertiesPanel, -1, crea::std2wx(this->project->GetBuildPath()));
   this->buildPathtc->SetMaxSize(wxSize(200,-1));
-  wxButton* pBuildLocationbt = new wxButton(propertiesPanel, ID_BUTTON_SET_BUILD_PATH, wxT("Choose"));
+
+  wxButton* pBuildLocationbt = new wxButton(propertiesPanel, ID_BUTTON_SET_BUILD_PATH, wxT("Choose..."));
   pBuildLocationbt->SetToolTip(wxT("Select a new location for compiling the project."));
+
+  wxButton* pBuildOpenbt = new wxButton(propertiesPanel, ID_BUTTON_OPEN_BUILD_PATH, wxT("Open"));
+  pBuildOpenbt->SetToolTip(wxT("Open the binaries folder in the file explorer."));
+
   pBuildLocationsz->Add(this->buildPathtc, 1, wxALIGN_CENTER, 1);
   pBuildLocationsz->Add(pBuildLocationbt, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 10);
+  pBuildLocationsz->Add(pBuildOpenbt, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 10);
 
   propertiesGridSizer->Add(pVersion, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
   propertiesGridSizer->Add(pVersionsz, 1, wxEXPAND);
@@ -307,8 +313,7 @@ void wxCDMProjectDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
     }
 }
 
-void
-wxCDMProjectDescriptionPanel::OnBtnSetBuildPath(wxCommandEvent& event)
+void wxCDMProjectDescriptionPanel::OnBtnSetBuildPath(wxCommandEvent& event)
 {
   wxDirDialog* dialog = new wxDirDialog(this, wxT("Choose the new build location for the project"));
   if(dialog->ShowModal())
@@ -320,8 +325,13 @@ wxCDMProjectDescriptionPanel::OnBtnSetBuildPath(wxCommandEvent& event)
   this->buildPathtc->SetLabel(crea::std2wx(this->project->GetBuildPath()));
 }
 
-void
-wxCDMProjectDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
+void wxCDMProjectDescriptionPanel::OnBtnOpenBuild(wxCommandEvent& event)
+{
+  if(CDMUtilities::openFileExplorer(this->project->GetBuildPath()))
+    wxMessageBox(crea::std2wx("The folder doesn't exist or hasn't yet been created."),_T("Open Folder - Error!"),wxOK | wxICON_ERROR);
+}
+
+void wxCDMProjectDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
 {
   std::string* result;
   if(!this->project->OpenInFileExplorer(result))