X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2FcreaDevManagerLib%2FwxCDMProjectDescriptionPanel.cpp;h=ac170e0a7f41b9defd3bbe360445678115f6a7ed;hb=f3f98131ffd23351c3cd872a0b04aecdc97b7c92;hp=844d8cb1bf70dbec010dc2ec10f307a4b37e508b;hpb=9877d27eb9a1339d97bc8e13ec5f1f75a5dc9e3f;p=crea.git diff --git a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp index 844d8cb..ac170e0 100644 --- a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp @@ -36,6 +36,7 @@ #include "wxCDMMainFrame.h" #include "wxCDMNewPackageDialog.h" +#include "wxCDMProjectConfigurationDialog.h" #include "wxCDMProjectHelpDialog.h" @@ -47,8 +48,10 @@ BEGIN_EVENT_TABLE(wxCDMProjectDescriptionPanel, wxPanel) EVT_BUTTON(ID_BUTTON_GOTO_PACKAGE_MANAGER, wxCDMProjectDescriptionPanel::OnBtnManagePackages) EVT_BUTTON(ID_BUTTON_GOTO_LIB_MANAGER, wxCDMProjectDescriptionPanel::OnBtnManageLibraries) EVT_BUTTON(ID_BUTTON_GOTO_APPLI_MANAGER, wxCDMProjectDescriptionPanel::OnBtnManageApplications) +EVT_BUTTON(ID_BUTTON_CHOOSE, wxCDMProjectDescriptionPanel::OnBtnConfigProject) 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() @@ -147,10 +150,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); @@ -181,7 +190,7 @@ void wxCDMProjectDescriptionPanel::CreateControls() wxBoxSizer* actionsPanelSizer = new wxBoxSizer(wxHORIZONTAL); //actionsGrid Sizer - wxFlexGridSizer* actionsGridSizer = new wxFlexGridSizer(2, 2, 9, 15); + wxFlexGridSizer* actionsGridSizer = new wxFlexGridSizer(3, 2, 9, 15); //buttons // lib manager // show only if there is a lib folder @@ -208,6 +217,11 @@ void wxCDMProjectDescriptionPanel::CreateControls() appliMgrbt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnAppliMouseExit,NULL,this); actionsGridSizer->Add(appliMgrbt, 1, wxALL | wxEXPAND, 5); } + // edit 3rd Party libraries + wxButton* configPrjbt = new wxButton(actionsPanel, ID_BUTTON_CHOOSE, _T("D. 3rd Party Libraries Manager")); + configPrjbt->SetToolTip(wxT("Select which third party libraries will be used in this project.")); + actionsGridSizer->Add(configPrjbt, 1, wxALL | wxEXPAND, 5); + // edit CMakeLists file wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File")); editCMakebt->SetToolTip(wxT("Edit the CMakeLists.txt file of this project.")); @@ -290,6 +304,13 @@ void wxCDMProjectDescriptionPanel::OnBtnManageApplications(wxCommandEvent& event event.Skip(); } +void wxCDMProjectDescriptionPanel::OnBtnConfigProject(wxCommandEvent& event) +{ + wxCDMProjectConfigurationDialog* dialog = new wxCDMProjectConfigurationDialog(this,this->project); + long userResponse; + userResponse = dialog->ShowModal(); +} + void wxCDMProjectDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event) { std::string* result; @@ -306,8 +327,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()) @@ -319,8 +339,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))