Finished implementing functionality to save expanded file and directory entries of the project browsers to the session.

Thu, 22 May 2014 19:49:41 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 22 May 2014 19:49:41 +0200
changeset 3603
cd14023a8ac1
parent 3602
73cad09faca9
child 3604
919ebd27fa78

Finished implementing functionality to save expanded file and directory entries of the project browsers to the session.

APIs/Python3/eric5.api file | annotate | diff | comparison | revisions
Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric5.UI.BrowserModel.html file | annotate | diff | comparison | revisions
Project/ProjectBaseBrowser.py file | annotate | diff | comparison | revisions
UI/BrowserModel.py file | annotate | diff | comparison | revisions
--- a/APIs/Python3/eric5.api	Thu May 22 18:24:25 2014 +0200
+++ b/APIs/Python3/eric5.api	Thu May 22 19:49:41 2014 +0200
@@ -7940,6 +7940,7 @@
 eric5.UI.BrowserModel.BrowserClassItem.isPublic?4()
 eric5.UI.BrowserModel.BrowserClassItem.lessThan?4(other, column, order)
 eric5.UI.BrowserModel.BrowserClassItem.lineno?4()
+eric5.UI.BrowserModel.BrowserClassItem.name?4()
 eric5.UI.BrowserModel.BrowserClassItem?1(parent, cl, filename)
 eric5.UI.BrowserModel.BrowserCodingItem.lessThan?4(other, column, order)
 eric5.UI.BrowserModel.BrowserCodingItem?1(parent, text)
@@ -8002,6 +8003,7 @@
 eric5.UI.BrowserModel.BrowserMethodItem.isPublic?4()
 eric5.UI.BrowserModel.BrowserMethodItem.lessThan?4(other, column, order)
 eric5.UI.BrowserModel.BrowserMethodItem.lineno?4()
+eric5.UI.BrowserModel.BrowserMethodItem.name?4()
 eric5.UI.BrowserModel.BrowserMethodItem?1(parent, fn, filename)
 eric5.UI.BrowserModel.BrowserModel._addItem?5(itm, parentItem)
 eric5.UI.BrowserModel.BrowserModel._addWatchedItem?5(itm)
@@ -8031,6 +8033,7 @@
 eric5.UI.BrowserModel.BrowserModel.rowCount?4(parent=QModelIndex())
 eric5.UI.BrowserModel.BrowserModel.saveToplevelDirs?4()
 eric5.UI.BrowserModel.BrowserModel?1(parent=None, nopopulate=False)
+eric5.UI.BrowserModel.BrowserSysPathItem.name?4()
 eric5.UI.BrowserModel.BrowserSysPathItem?1(parent)
 eric5.UI.BrowserSortFilterProxyModel.BrowserSortFilterProxyModel.filterAcceptsRow?4(source_row, source_parent)
 eric5.UI.BrowserSortFilterProxyModel.BrowserSortFilterProxyModel.hasChildren?4(parent=QModelIndex())
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Thu May 22 18:24:25 2014 +0200
+++ b/Documentation/Help/source.qhp	Thu May 22 19:49:41 2014 +0200
@@ -1791,6 +1791,7 @@
       <keyword name="BrowserClassItem.isPublic" id="BrowserClassItem.isPublic" ref="eric5.UI.BrowserModel.html#BrowserClassItem.isPublic" />
       <keyword name="BrowserClassItem.lessThan" id="BrowserClassItem.lessThan" ref="eric5.UI.BrowserModel.html#BrowserClassItem.lessThan" />
       <keyword name="BrowserClassItem.lineno" id="BrowserClassItem.lineno" ref="eric5.UI.BrowserModel.html#BrowserClassItem.lineno" />
+      <keyword name="BrowserClassItem.name" id="BrowserClassItem.name" ref="eric5.UI.BrowserModel.html#BrowserClassItem.name" />
       <keyword name="BrowserCodingItem" id="BrowserCodingItem" ref="eric5.UI.BrowserModel.html#BrowserCodingItem" />
       <keyword name="BrowserCodingItem (Constructor)" id="BrowserCodingItem (Constructor)" ref="eric5.UI.BrowserModel.html#BrowserCodingItem.__init__" />
       <keyword name="BrowserCodingItem.lessThan" id="BrowserCodingItem.lessThan" ref="eric5.UI.BrowserModel.html#BrowserCodingItem.lessThan" />
@@ -1849,6 +1850,7 @@
       <keyword name="BrowserMethodItem.isPublic" id="BrowserMethodItem.isPublic" ref="eric5.UI.BrowserModel.html#BrowserMethodItem.isPublic" />
       <keyword name="BrowserMethodItem.lessThan" id="BrowserMethodItem.lessThan" ref="eric5.UI.BrowserModel.html#BrowserMethodItem.lessThan" />
       <keyword name="BrowserMethodItem.lineno" id="BrowserMethodItem.lineno" ref="eric5.UI.BrowserModel.html#BrowserMethodItem.lineno" />
+      <keyword name="BrowserMethodItem.name" id="BrowserMethodItem.name" ref="eric5.UI.BrowserModel.html#BrowserMethodItem.name" />
       <keyword name="BrowserModel" id="BrowserModel" ref="eric5.UI.BrowserModel.html#BrowserModel" />
       <keyword name="BrowserModel (Constructor)" id="BrowserModel (Constructor)" ref="eric5.UI.BrowserModel.html#BrowserModel.__init__" />
       <keyword name="BrowserModel (Module)" id="BrowserModel (Module)" ref="eric5.UI.BrowserModel.html" />
@@ -1891,6 +1893,7 @@
       <keyword name="BrowserSortFilterProxyModel.sort" id="BrowserSortFilterProxyModel.sort" ref="eric5.UI.BrowserSortFilterProxyModel.html#BrowserSortFilterProxyModel.sort" />
       <keyword name="BrowserSysPathItem" id="BrowserSysPathItem" ref="eric5.UI.BrowserModel.html#BrowserSysPathItem" />
       <keyword name="BrowserSysPathItem (Constructor)" id="BrowserSysPathItem (Constructor)" ref="eric5.UI.BrowserModel.html#BrowserSysPathItem.__init__" />
+      <keyword name="BrowserSysPathItem.name" id="BrowserSysPathItem.name" ref="eric5.UI.BrowserModel.html#BrowserSysPathItem.name" />
       <keyword name="CallStackViewer" id="CallStackViewer" ref="eric5.Debugger.CallStackViewer.html#CallStackViewer" />
       <keyword name="CallStackViewer (Constructor)" id="CallStackViewer (Constructor)" ref="eric5.Debugger.CallStackViewer.html#CallStackViewer.__init__" />
       <keyword name="CallStackViewer (Module)" id="CallStackViewer (Module)" ref="eric5.Debugger.CallStackViewer.html" />
--- a/Documentation/Source/eric5.UI.BrowserModel.html	Thu May 22 18:24:25 2014 +0200
+++ b/Documentation/Source/eric5.UI.BrowserModel.html	Thu May 22 19:49:41 2014 +0200
@@ -336,6 +336,9 @@
 </tr><tr>
 <td><a href="#BrowserClassItem.lineno">lineno</a></td>
 <td>Public method returning the line number defining this object.</td>
+</tr><tr>
+<td><a href="#BrowserClassItem.name">name</a></td>
+<td>Public method to return the name of the item.</td>
 </tr>
 </table>
 <h3>Static Methods</h3>
@@ -429,6 +432,16 @@
 <dd>
 line number defining the object (integer)
 </dd>
+</dl><a NAME="BrowserClassItem.name" ID="BrowserClassItem.name"></a>
+<h4>BrowserClassItem.name</h4>
+<b>name</b>(<i></i>)
+<p>
+        Public method to return the name of the item.
+</p><dl>
+<dt>Returns:</dt>
+<dd>
+name of the item (string)
+</dd>
 </dl>
 <div align="right"><a href="#top">Up</a></div>
 <hr /><hr />
@@ -1248,6 +1261,9 @@
 </tr><tr>
 <td><a href="#BrowserMethodItem.lineno">lineno</a></td>
 <td>Public method returning the line number defining this object.</td>
+</tr><tr>
+<td><a href="#BrowserMethodItem.name">name</a></td>
+<td>Public method to return the name of the item.</td>
 </tr>
 </table>
 <h3>Static Methods</h3>
@@ -1341,6 +1357,16 @@
 <dd>
 line number defining the object (integer)
 </dd>
+</dl><a NAME="BrowserMethodItem.name" ID="BrowserMethodItem.name"></a>
+<h4>BrowserMethodItem.name</h4>
+<b>name</b>(<i></i>)
+<p>
+        Public method to return the name of the item.
+</p><dl>
+<dt>Returns:</dt>
+<dd>
+name of the item (string)
+</dd>
 </dl>
 <div align="right"><a href="#top">Up</a></div>
 <hr /><hr />
@@ -1849,6 +1875,9 @@
 <tr>
 <td><a href="#BrowserSysPathItem.__init__">BrowserSysPathItem</a></td>
 <td>Constructor</td>
+</tr><tr>
+<td><a href="#BrowserSysPathItem.name">name</a></td>
+<td>Public method to return the name of the item.</td>
 </tr>
 </table>
 <h3>Static Methods</h3>
@@ -1865,6 +1894,16 @@
 <dd>
 parent item
 </dd>
+</dl><a NAME="BrowserSysPathItem.name" ID="BrowserSysPathItem.name"></a>
+<h4>BrowserSysPathItem.name</h4>
+<b>name</b>(<i></i>)
+<p>
+        Public method to return the name of the item.
+</p><dl>
+<dt>Returns:</dt>
+<dd>
+name of the item (string)
+</dd>
 </dl>
 <div align="right"><a href="#top">Up</a></div>
 <hr />
--- a/Project/ProjectBaseBrowser.py	Thu May 22 18:24:25 2014 +0200
+++ b/Project/ProjectBaseBrowser.py	Thu May 22 19:49:41 2014 +0200
@@ -597,9 +597,13 @@
         for name in names:
             childIndex = model.index(0, 0)
             while childIndex.isValid():
-                if model.item(childIndex).name() == name:
-                    self.setExpanded(childIndex, True)
-                    break
+                try:
+                    if model.item(childIndex).name() == name:
+                        self.setExpanded(childIndex, True)
+                        break
+                except AttributeError:
+                    # ignore items not supporting this method
+                    pass
                 childIndex = self.indexBelow(childIndex)
         
     def _prepareRepopulateItem(self, name):
--- a/UI/BrowserModel.py	Thu May 22 18:24:25 2014 +0200
+++ b/UI/BrowserModel.py	Thu May 22 19:49:41 2014 +0200
@@ -1020,6 +1020,14 @@
         self.icon = UI.PixmapCache.getIcon("filePython.png")
         self._populated = False
         self._lazyPopulation = True
+    
+    def name(self):
+        """
+        Public method to return the name of the item.
+        
+        @return name of the item (string)
+        """
+        return "sys.path"
 
 
 class BrowserFileItem(BrowserItem):
@@ -1358,6 +1366,14 @@
             self._populated = False
             self._lazyPopulation = True
     
+    def name(self):
+        """
+        Public method to return the name of the item.
+        
+        @return name of the item (string)
+        """
+        return '{0}@@{1}'.format(self._filename, self.lineno())
+    
     def fileName(self):
         """
         Public method returning the filename.
@@ -1464,6 +1480,14 @@
             self._populated = False
             self._lazyPopulation = True
     
+    def name(self):
+        """
+        Public method to return the name of the item.
+        
+        @return name of the item (string)
+        """
+        return '{0}@@{1}'.format(self._filename, self.lineno())
+    
     def fileName(self):
         """
         Public method returning the filename.

eric ide

mercurial