Patch #3119 2011-01-16 15:08

tpetrov

Show the Project's title in the Goto file dialog
Download
3119-Show_the_Proje.patch (1.4 KB)
Category
Application::Refinement
Status
Accepted
Close date
2011-02-13 11:06
Assigned to
mortenmacfly
Index: src/sdk/projectmanager.cpp
===================================================================
--- src/sdk/projectmanager.cpp    (revision 6922)
+++ src/sdk/projectmanager.cpp    (working copy)
@@ -2436,17 +2436,24 @@
     class Iterator : public IncrementalSelectIterator
     {
         public:
-            Iterator(ProjectFiles &files) : m_Files(files)
-            { ; }
-            virtual long GetCount() const
-            { return m_Files.size(); }
+            Iterator(ProjectFiles &files, bool showProject) : m_Files(files), m_ShowProject(showProject) {}
+            virtual long GetCount() const { return m_Files.size(); }
             virtual wxString GetItem(long index) const
-            { return m_Files[index]->relativeFilename; }
+            {
+                if (m_ShowProject)
+                {
+                    ProjectFile *f = m_Files[index];
+                    return f->relativeFilename + wxT(" (") + f->GetParentProject()->GetTitle() + wxT(")");
+                }
+                else
+                    return m_Files[index]->relativeFilename;
+            }
         private:
             ProjectFiles &m_Files;
+            bool m_ShowProject;
     };
 
-    Iterator iterator(files);
+    Iterator iterator(files, m_pProjects->GetCount() > 1);
     IncrementalSelectListDlg dlg(Manager::Get()->GetAppWindow(), iterator,
                                  _("Select file..."), _("Please select file to open:"));
     PlaceWindow(&dlg);