From 6bb41c012fbc5a0ded6a2ed4e294f3ea0e1ab0c5 Mon Sep 17 00:00:00 2001 From: Daniel Felipe Gonzalez Date: Wed, 6 Feb 2013 11:19:35 +0100 Subject: [PATCH] Feature #1711 CreaDevManager application implementation - Fixed new project open when another project is already open. - Fixed project open when another project is already open. --- lib/creaDevManagerLib/wxCDMMainFrame.cpp | 31 ++++++++++++++++++++---- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/lib/creaDevManagerLib/wxCDMMainFrame.cpp b/lib/creaDevManagerLib/wxCDMMainFrame.cpp index 5305703..441d99e 100755 --- a/lib/creaDevManagerLib/wxCDMMainFrame.cpp +++ b/lib/creaDevManagerLib/wxCDMMainFrame.cpp @@ -262,6 +262,17 @@ void wxCDMMainFrame::OnMenuNewProject(wxCommandEvent& event) event.Skip(); return; } + if(this->panel_Properties != NULL) + { + auiManager.DetachPane(this->panel_Properties); + this->panel_Properties->Hide(); + } + if(this->panel_ProjectActions != NULL) + { + auiManager.DetachPane(this->panel_ProjectActions); + this->panel_ProjectActions->Hide(); + } + } @@ -301,10 +312,10 @@ void wxCDMMainFrame::OnMenuNewProject(wxCommandEvent& event) auiManager.Update(); //populate tree control + tree_Projects->BuildTree(this->model->GetModelElements(),this->model->GetProject()); tree_Projects->Unselect(); this->actualTreeItem.Unset(); - tree_Projects->BuildTree(this->model->GetModelElements(),this->model->GetProject()); - tree_Projects->SelectItem(this->model->GetProject()->GetId().GetWxId()); + tree_Projects->SelectItem(this->model->GetProject()->GetId().GetWxId(), true); //wxMessageBox(wxT("ProjectSelected") ,_T("New Project - Success!"),wxOK | wxICON_ERROR); } } @@ -335,6 +346,16 @@ void wxCDMMainFrame::OnMenuOpenProject(wxCommandEvent& event) event.Skip(); return; } + if(this->panel_Properties != NULL) + { + auiManager.DetachPane(this->panel_Properties); + this->panel_Properties->Hide(); + } + if(this->panel_ProjectActions != NULL) + { + auiManager.DetachPane(this->panel_ProjectActions); + this->panel_ProjectActions->Hide(); + } } if (!this->model->OpenProject(path, result)) @@ -348,9 +369,9 @@ void wxCDMMainFrame::OnMenuOpenProject(wxCommandEvent& event) std::cout << "building ui" << std::endl; //populate tree control - tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject()); - tree_Projects->Unselect(); - this->actualTreeItem.Unset(); + tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject()); + tree_Projects->Unselect(); + this->actualTreeItem.Unset(); tree_Projects->SelectItem(this->model->GetProject()->GetId().GetWxId(), true); -- 2.47.1