Added code to save the editor zoom factor in the session file.

Sat, 08 May 2010 17:33:47 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 08 May 2010 17:33:47 +0200
changeset 228
1cce8982e636
parent 227
923897a18b6a
child 229
fa7024a3cd58

Added code to save the editor zoom factor in the session file.

DTDs/Session-4.4.dtd file | annotate | diff | comparison | revisions
E5XML/Config.py file | annotate | diff | comparison | revisions
E5XML/SessionHandler.py file | annotate | diff | comparison | revisions
E5XML/SessionWriter.py file | annotate | diff | comparison | revisions
changelog file | annotate | diff | comparison | revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DTDs/Session-4.4.dtd	Sat May 08 17:33:47 2010 +0200
@@ -0,0 +1,105 @@
+<!-- This is the DTD for eric's (project) session file version 4.4 -->
+
+<!ELEMENT   MultiProject    (#PCDATA)>
+
+<!ELEMENT   Project         (#PCDATA)>
+
+<!ELEMENT   Filename        (#PCDATA)>
+<!ATTLIST   Filename
+    cline       CDATA   #REQUIRED
+    cindex      CDATA   #REQUIRED
+    folds       CDATA   #REQUIRED
+    zoom        CDATA   #REQUIRED>
+
+<!ELEMENT   Filenames       (Filename*)>
+
+<!ELEMENT   ActiveWindow    (#PCDATA)>
+<!ATTLIST   ActiveWindow
+    cline       CDATA   #REQUIRED
+    cindex      CDATA   #REQUIRED>
+
+<!ELEMENT   BpFilename      (#PCDATA)>
+<!ELEMENT   Linenumber      EMPTY>
+<!ATTLIST   Linenumber
+    value       CDATA   #REQUIRED>
+<!ELEMENT   Condition       (#PCDATA)>
+<!ELEMENT   Temporary       EMPTY>
+<!ATTLIST   Temporary
+    value       CDATA   #REQUIRED>
+<!ELEMENT   Enabled         EMPTY>
+<!ATTLIST   Enabled
+    value       CDATA   #REQUIRED>
+<!ELEMENT   Count           EMPTY>
+<!ATTLIST   Count
+    value       CDATA   #REQUIRED>
+
+<!ELEMENT   Breakpoint      (BpFilename,
+                             Linenumber,
+                             Condition,
+                             Temporary,
+                             Enabled,
+                             Count)>
+
+<!ELEMENT   Breakpoints     (Breakpoint*)>
+
+<!ELEMENT   Special         (#PCDATA)>
+
+<!ELEMENT   Watchexpression (Condition,
+                             Temporary,
+                             Enabled,
+                             Count,
+                             Special)>
+
+<!ELEMENT   Watchexpressions (Watchexpression*)>
+
+<!ELEMENT   Exception       (#PCDATA)>
+
+<!ELEMENT   IgnoredException (#PCDATA)>
+
+<!ELEMENT   CommandLine      (#PCDATA)>
+<!ELEMENT   WorkingDirectory (#PCDATA)>
+<!ELEMENT   Environment      (#PCDATA)>
+<!ELEMENT   ReportExceptions EMPTY>
+<!ATTLIST   ReportExceptions
+    value       CDATA   #REQUIRED>
+<!ELEMENT   Exceptions       (Exception*)>
+<!ELEMENT   IgnoredExceptions (IgnoredException*)>
+<!ELEMENT   AutoClearShell   EMPTY>
+<!ATTLIST   AutoClearShell
+    value       CDATA   #REQUIRED>
+<!ELEMENT   TracePython      EMPTY>
+<!ATTLIST   TracePython
+    value       CDATA   #REQUIRED>
+<!ELEMENT   AutoContinue     EMPTY>
+<!ATTLIST   AutoContinue
+    value       CDATA   #REQUIRED>
+<!ELEMENT   CovexcPattern    (#PCDATA)>
+
+<!ELEMENT   DebugInfo       (CommandLine,
+                             WorkingDirectory,
+                             Environment,
+                             ReportExceptions,
+                             Exceptions,
+                             IgnoredExceptions,
+                             AutoClearShell,
+                             TracePython,
+                             AutoContinue,
+                             CovexcPattern)>
+
+<!ELEMENT   BmFilename      (#PCDATA)>
+
+<!ELEMENT   Bookmark        (BmFilename,
+                             Linenumber)>
+
+<!ELEMENT   Bookmarks       (Bookmark*)>
+
+<!ELEMENT   Session         (MultiProject?,
+                             Project?,
+                             Filenames,
+                             ActiveWindow?,
+                             Breakpoints,
+                             Watchexpressions,
+                             DebugInfo,
+                             Bookmarks)>
+<!ATTLIST   Session
+    version     CDATA   #REQUIRED>
--- a/E5XML/Config.py	Sat May 08 15:23:56 2010 +0200
+++ b/E5XML/Config.py	Sat May 08 17:33:47 2010 +0200
@@ -17,7 +17,7 @@
 userProjectFileFormatVersion = "4.0"
 
 # version number of the project session file
-sessionFileFormatVersion = "4.3"
+sessionFileFormatVersion = "4.4"
 
 # version number of the shortcuts file
 shortcutsFileFormatVersion = "3.6"
--- a/E5XML/SessionHandler.py	Sat May 08 15:23:56 2010 +0200
+++ b/E5XML/SessionHandler.py	Sat May 08 17:33:47 2010 +0200
@@ -112,6 +112,7 @@
         self.buffer = ""
         self.cline = int(attrs.get("cline", "0"))
         self.cindex = int(attrs.get("cindex", "0"))
+        self.zoom = int(attrs.get("zoom", "-1"))
         
         folds = attrs.get("folds", "")
         if folds:
@@ -126,6 +127,8 @@
         self.vm.openFiles(self.buffer)
         ed = self.vm.getOpenEditor(self.buffer)
         if ed is not None:
+            if self.zoom > -1:
+                ed.zoomTo(self.zoom)
             if self.folds:
                 ed.recolor()
                 for line in self.folds:
@@ -400,4 +403,4 @@
         
         @return String containing the version number.
         """
-        return self.version
\ No newline at end of file
+        return self.version
--- a/E5XML/SessionWriter.py	Sat May 08 15:23:56 2010 +0200
+++ b/E5XML/SessionWriter.py	Sat May 08 17:33:47 2010 +0200
@@ -76,11 +76,14 @@
                 if ed is not None:
                     line, index = ed.getCursorPosition()
                     folds = ','.join([str(i + 1) for i in ed.getFolds()])
+                    zoom = ed.getZoom()
                 else:
                     line, index = 0, 0
                     folds = ''
-                self._write('    <Filename cline="%d" cindex="%d" folds="%s">%s</Filename>' % \
-                    (line, index, folds, of))
+                    zoom = -1
+                self._write('    <Filename cline="%d" cindex="%d" folds="%s" zoom="%d">'
+                            '%s</Filename>' % \
+                    (line, index, folds, zoom, of))
         self._write("  </Filenames>")
         
         aw = self.vm.getActiveName()
--- a/changelog	Sat May 08 15:23:56 2010 +0200
+++ b/changelog	Sat May 08 17:33:47 2010 +0200
@@ -2,6 +2,7 @@
 ----------
 Version 5.0-snapshot-2010mmdd:
 - bug fixes
+- added code to save the editor zoom factor in the session file
 
 Version 5.0-snapshot-20100508:
 - bug fixes

eric ide

mercurial