Changed the file double click behavior in the source and file browser. 5_1_x

Sat, 14 Jan 2012 15:10:25 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 14 Jan 2012 15:10:25 +0100
branch
5_1_x
changeset 1548
3be153fa3060
parent 1545
2738022ed226
child 1549
dcc60b06dc43

Changed the file double click behavior in the source and file browser.
(transplanted from 240f55bb6e26d7c8313cabc32b58f319144951c8)

Project/ProjectSourcesBrowser.py file | annotate | diff | comparison | revisions
UI/Browser.py file | annotate | diff | comparison | revisions
ViewManager/ViewManager.py file | annotate | diff | comparison | revisions
--- a/Project/ProjectSourcesBrowser.py	Fri Jan 13 18:31:27 2012 +0100
+++ b/Project/ProjectSourcesBrowser.py	Sat Jan 14 15:10:25 2012 +0100
@@ -529,13 +529,13 @@
         for itm in itmList:
             if isinstance(itm, BrowserFileItem):
                 if itm.isPython2File():
-                    self.sourceFile[str, int].emit(itm.fileName(), 1)
+                    self.sourceFile[str].emit(itm.fileName())
                 elif itm.isPython3File():
-                    self.sourceFile[str, int].emit(itm.fileName(), 1)
+                    self.sourceFile[str].emit(itm.fileName())
                 elif itm.isRubyFile():
-                    self.sourceFile[str, int, str].emit(itm.fileName(), 1, "Ruby")
+                    self.sourceFile[str, int, str].emit(itm.fileName(), -1, "Ruby")
                 elif itm.isDFile():
-                    self.sourceFile[str, int, str].emit(itm.fileName(), 1, "D")
+                    self.sourceFile[str, int, str].emit(itm.fileName(), -1, "D")
                 else:
                     self.sourceFile[str].emit(itm.fileName())
             elif isinstance(itm, BrowserClassItem):
--- a/UI/Browser.py	Fri Jan 13 18:31:27 2012 +0100
+++ b/UI/Browser.py	Sat Jan 14 15:10:25 2012 +0100
@@ -325,13 +325,13 @@
         for itm in itmList:
             if isinstance(itm, BrowserFileItem):
                 if itm.isPython2File():
-                    self.sourceFile[str, int].emit(itm.fileName(), 1)
+                    self.sourceFile[str].emit(itm.fileName())
                 elif itm.isPython3File():
-                    self.sourceFile[str, int].emit(itm.fileName(), 1)
+                    self.sourceFile[str].emit(itm.fileName())
                 elif itm.isRubyFile():
-                    self.sourceFile[str, int, str].emit(itm.fileName(), 1, "Ruby")
+                    self.sourceFile[str, int, str].emit(itm.fileName(), -1, "Ruby")
                 elif itm.isDFile():
-                    self.sourceFile[str, int, str].emit(itm.fileName(), 1, "D")
+                    self.sourceFile[str, int, str].emit(itm.fileName(), -1, "D")
                 elif itm.isDesignerFile():
                     self.designerFile.emit(itm.fileName())
                 elif itm.isLinguistFile():
--- a/ViewManager/ViewManager.py	Fri Jan 13 18:31:27 2012 +0100
+++ b/ViewManager/ViewManager.py	Sat Jan 14 15:10:25 2012 +0100
@@ -3099,7 +3099,7 @@
             
         self.__setSbFile()
         
-    def openSourceFile(self, fn, lineno = None, filetype = "", 
+    def openSourceFile(self, fn, lineno = -1, filetype = "", 
                        selStart = 0, selEnd = 0, pos = 0):
         """
         Public slot to display a file in an editor.
@@ -3119,12 +3119,12 @@
             self._modificationStatusChanged(editor.isModified(), editor)
         self._checkActions(editor)
         
-        if lineno is not None and lineno >= 0:
+        if lineno >= 0:
             editor.ensureVisibleTop(lineno)
             editor.gotoLine(lineno, pos)
-        
-        if selStart != selEnd:
-            editor.setSelection(lineno - 1, selStart, lineno - 1, selEnd)
+            
+            if selStart != selEnd:
+                editor.setSelection(lineno - 1, selStart, lineno - 1, selEnd)
         
         # insert filename into list of recently opened files
         self.addToRecentList(fn)

eric ide

mercurial