Patch #2017 2007-05-21 14:06

raph_

activate project by doubleclick in projectmanager
Download
2017-activate_proje.patch (951 bytes)
Category
Application::Refinement
Status
Accepted
Close date
2007-05-22 09:31
Assigned to
 
Index: projectmanager.cpp
===================================================================
--- projectmanager.cpp    (revision 3977)
+++ projectmanager.cpp    (working copy)
@@ -1758,7 +1758,21 @@
     if(!MiscTreeItemData::OwnerCheck(event,m_pTree,this))
         return;
     #endif
-    DoOpenSelectedFile();
+
+    wxTreeItemId id = event.GetItem();
+    FileTreeData* ftd = (FileTreeData*)m_pTree->GetItemData(id);
+    if (ftd && ftd->GetKind() == FileTreeData::ftdkProject)
+    {
+        if (ftd->GetProject() != m_pActiveProject)
+        {
+            SetProject(ftd->GetProject(), false);
+            // prevent item expand state toggle when project is activated
+            // toggle it one time so that it is toggled back by wx
+            m_pTree->IsExpanded(id) ? m_pTree->Collapse(id) : m_pTree->Expand(id);
+        }
+    }
+    else
+        DoOpenSelectedFile();
 }
 
 void ProjectManager::OnExecParameters(wxCommandEvent& event)
mandrav 2007-05-22 09:31

Patch applied.