Mon, 03 Oct 2011 16:08:32 +0200
Removed the MdiArea viewmanager plug-in.
Documentation/Source/eric5.Plugins.PluginVmMdiArea.html | file | annotate | diff | comparison | revisions | |
Documentation/Source/eric5.Plugins.ViewManagerPlugins.MdiArea.MdiArea.html | file | annotate | diff | comparison | revisions | |
Documentation/Source/index-eric5.Plugins.ViewManagerPlugins.MdiArea.html | file | annotate | diff | comparison | revisions | |
Plugins/PluginVmMdiArea.py | file | annotate | diff | comparison | revisions | |
Plugins/ViewManagerPlugins/MdiArea/MdiArea.py | file | annotate | diff | comparison | revisions | |
Plugins/ViewManagerPlugins/MdiArea/__init__.py | file | annotate | diff | comparison | revisions | |
Plugins/ViewManagerPlugins/MdiArea/preview.png | file | annotate | diff | comparison | revisions |
--- a/Documentation/Source/eric5.Plugins.PluginVmMdiArea.html Mon Oct 03 12:51:39 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' -'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> -<html><head> -<title>eric5.Plugins.PluginVmMdiArea</title> -<style> -body { - background: #EDECE6; - margin: 0em 1em 10em 1em; - color: black; -} - -h1 { color: white; background: #85774A; } -h2 { color: white; background: #85774A; } -h3 { color: white; background: #9D936E; } -h4 { color: white; background: #9D936E; } - -a { color: #BA6D36; } - -</style> -</head> -<body><a NAME="top" ID="top"></a> -<h1>eric5.Plugins.PluginVmMdiArea</h1> -<p> -Module implementing the mdi area view manager plugin. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>author</td></tr><tr><td>autoactivate</td></tr><tr><td>className</td></tr><tr><td>deactivateable</td></tr><tr><td>displayString</td></tr><tr><td>error</td></tr><tr><td>longDescription</td></tr><tr><td>name</td></tr><tr><td>packageName</td></tr><tr><td>pluginType</td></tr><tr><td>pluginTypename</td></tr><tr><td>pyqtApi</td></tr><tr><td>shortDescription</td></tr><tr><td>version</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#VmMdiAreaPlugin">VmMdiAreaPlugin</a></td> -<td>Class implementing the Workspace view manager plugin.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr> -<td><a href="#previewPix">previewPix</a></td> -<td>Module function to return a preview pixmap.</td> -</tr> -</table> -<hr /><hr /> -<a NAME="VmMdiAreaPlugin" ID="VmMdiAreaPlugin"></a> -<h2>VmMdiAreaPlugin</h2> -<p> - Class implementing the Workspace view manager plugin. -</p> -<h3>Derived from</h3> -QObject -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#VmMdiAreaPlugin.__init__">VmMdiAreaPlugin</a></td> -<td>Constructor</td> -</tr><tr> -<td><a href="#VmMdiAreaPlugin.activate">activate</a></td> -<td>Public method to activate this plugin.</td> -</tr><tr> -<td><a href="#VmMdiAreaPlugin.deactivate">deactivate</a></td> -<td>Public method to deactivate this plugin.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="VmMdiAreaPlugin.__init__" ID="VmMdiAreaPlugin.__init__"></a> -<h4>VmMdiAreaPlugin (Constructor)</h4> -<b>VmMdiAreaPlugin</b>(<i>ui</i>) -<p> - Constructor -</p><dl> -<dt><i>ui</i></dt> -<dd> -reference to the user interface object (UI.UserInterface) -</dd> -</dl><a NAME="VmMdiAreaPlugin.activate" ID="VmMdiAreaPlugin.activate"></a> -<h4>VmMdiAreaPlugin.activate</h4> -<b>activate</b>(<i></i>) -<p> - Public method to activate this plugin. -</p><dl> -<dt>Returns:</dt> -<dd> -tuple of reference to instantiated viewmanager and - activation status (boolean) -</dd> -</dl><a NAME="VmMdiAreaPlugin.deactivate" ID="VmMdiAreaPlugin.deactivate"></a> -<h4>VmMdiAreaPlugin.deactivate</h4> -<b>deactivate</b>(<i></i>) -<p> - Public method to deactivate this plugin. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="previewPix" ID="previewPix"></a> -<h2>previewPix</h2> -<b>previewPix</b>(<i></i>) -<p> - Module function to return a preview pixmap. -</p><dl> -<dt>Returns:</dt> -<dd> -preview pixmap (QPixmap) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.Plugins.ViewManagerPlugins.MdiArea.MdiArea.html Mon Oct 03 12:51:39 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,398 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' -'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> -<html><head> -<title>eric5.Plugins.ViewManagerPlugins.MdiArea.MdiArea</title> -<style> -body { - background: #EDECE6; - margin: 0em 1em 10em 1em; - color: black; -} - -h1 { color: white; background: #85774A; } -h2 { color: white; background: #85774A; } -h3 { color: white; background: #9D936E; } -h4 { color: white; background: #9D936E; } - -a { color: #BA6D36; } - -</style> -</head> -<body><a NAME="top" ID="top"></a> -<h1>eric5.Plugins.ViewManagerPlugins.MdiArea.MdiArea</h1> -<p> -Module implementing the mdi area viewmanager class. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#MdiArea">MdiArea</a></td> -<td>Class implementing the mdi area viewmanager class.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr><td>None</td></tr> -</table> -<hr /><hr /> -<a NAME="MdiArea" ID="MdiArea"></a> -<h2>MdiArea</h2> -<p> - Class implementing the mdi area viewmanager class. -</p><h3>Signals</h3> -<dl> -<dt>bookmarkToggled(Editor)</dt> -<dd> -emitted when a bookmark is toggled. -</dd><dt>breakpointToggled(Editor)</dt> -<dd> -emitted when a breakpoint is toggled. -</dd><dt>changeCaption(str)</dt> -<dd> -emitted if a change of the caption is necessary -</dd><dt>checkActions(Editor)</dt> -<dd> -emitted when some actions should be checked - for their status -</dd><dt>cursorChanged(Editor)</dt> -<dd> -emitted after the cursor position of the active - window has changed -</dd><dt>editorChanged(str)</dt> -<dd> -emitted when the current editor has changed -</dd><dt>editorClosed(str)</dt> -<dd> -emitted just before an editor window gets closed -</dd><dt>editorClosedEd(Editor)</dt> -<dd> -emitted just before an editor window gets closed -</dd><dt>editorOpened(str)</dt> -<dd> -emitted after an editor window was opened -</dd><dt>editorOpenedEd(Editor)</dt> -<dd> -emitted after an editor window was opened -</dd><dt>editorSaved(str)</dt> -<dd> -emitted after an editor window was saved -</dd><dt>lastEditorClosed()</dt> -<dd> -emitted after the last editor window was closed -</dd> -</dl> -<h3>Derived from</h3> -QMdiArea, ViewManager -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#MdiArea.__init__">MdiArea</a></td> -<td>Constructor</td> -</tr><tr> -<td><a href="#MdiArea.__iconizeAllWindows">__iconizeAllWindows</a></td> -<td>Private slot to iconize all windows.</td> -</tr><tr> -<td><a href="#MdiArea.__mapped">__mapped</a></td> -<td>Private slot to handle the activation of a sub window.</td> -</tr><tr> -<td><a href="#MdiArea.__restoreAllWindows">__restoreAllWindows</a></td> -<td>Private slot to restore all windows.</td> -</tr><tr> -<td><a href="#MdiArea.__setSubWindowIcon">__setSubWindowIcon</a></td> -<td>Private method to set the icon of a subwindow given it's internal widget.</td> -</tr><tr> -<td><a href="#MdiArea.__subWindowActivated">__subWindowActivated</a></td> -<td>Private slot to handle the windowActivated signal.</td> -</tr><tr> -<td><a href="#MdiArea._addView">_addView</a></td> -<td>Protected method to add a view (i.e.</td> -</tr><tr> -<td><a href="#MdiArea._initWindowActions">_initWindowActions</a></td> -<td>Protected method to define the user interface actions for window handling.</td> -</tr><tr> -<td><a href="#MdiArea._modificationStatusChanged">_modificationStatusChanged</a></td> -<td>Protected slot to handle the modificationStatusChanged signal.</td> -</tr><tr> -<td><a href="#MdiArea._removeAllViews">_removeAllViews</a></td> -<td>Protected method to remove all views (i.e.</td> -</tr><tr> -<td><a href="#MdiArea._removeView">_removeView</a></td> -<td>Protected method to remove a view (i.e.</td> -</tr><tr> -<td><a href="#MdiArea._showView">_showView</a></td> -<td>Private method to show a view (i.e.</td> -</tr><tr> -<td><a href="#MdiArea._syntaxErrorToggled">_syntaxErrorToggled</a></td> -<td>Protected slot to handle the syntaxerrorToggled signal.</td> -</tr><tr> -<td><a href="#MdiArea.activeWindow">activeWindow</a></td> -<td>Private method to return the active (i.e.</td> -</tr><tr> -<td><a href="#MdiArea.canCascade">canCascade</a></td> -<td>Public method to signal if cascading of managed windows is available.</td> -</tr><tr> -<td><a href="#MdiArea.canSplit">canSplit</a></td> -<td>public method to signal if splitting of the view is available.</td> -</tr><tr> -<td><a href="#MdiArea.canTile">canTile</a></td> -<td>Public method to signal if tiling of managed windows is available.</td> -</tr><tr> -<td><a href="#MdiArea.cascade">cascade</a></td> -<td>Public method to cascade the managed windows.</td> -</tr><tr> -<td><a href="#MdiArea.eventFilter">eventFilter</a></td> -<td>Public method called to filter the event queue.</td> -</tr><tr> -<td><a href="#MdiArea.setEditorName">setEditorName</a></td> -<td>Public method to change the displayed name of the editor.</td> -</tr><tr> -<td><a href="#MdiArea.showWindowMenu">showWindowMenu</a></td> -<td>Public method to set up the viewmanager part of the Window menu.</td> -</tr><tr> -<td><a href="#MdiArea.tile">tile</a></td> -<td>Public method to tile the managed windows.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="MdiArea.__init__" ID="MdiArea.__init__"></a> -<h4>MdiArea (Constructor)</h4> -<b>MdiArea</b>(<i>parent</i>) -<p> - Constructor -</p><dl> -<dt><i>parent</i></dt> -<dd> -parent widget (QWidget) -</dd><dt><i>ui</i></dt> -<dd> -reference to the main user interface -</dd><dt><i>dbs</i></dt> -<dd> -reference to the debug server object -</dd> -</dl><a NAME="MdiArea.__iconizeAllWindows" ID="MdiArea.__iconizeAllWindows"></a> -<h4>MdiArea.__iconizeAllWindows</h4> -<b>__iconizeAllWindows</b>(<i></i>) -<p> - Private slot to iconize all windows. -</p><a NAME="MdiArea.__mapped" ID="MdiArea.__mapped"></a> -<h4>MdiArea.__mapped</h4> -<b>__mapped</b>(<i>subWindow</i>) -<p> - Private slot to handle the activation of a sub window. -</p><dl> -<dt><i>subWindow</i></dt> -<dd> -sub window to be activated (QMdiSubWindow) -</dd> -</dl><a NAME="MdiArea.__restoreAllWindows" ID="MdiArea.__restoreAllWindows"></a> -<h4>MdiArea.__restoreAllWindows</h4> -<b>__restoreAllWindows</b>(<i></i>) -<p> - Private slot to restore all windows. -</p><a NAME="MdiArea.__setSubWindowIcon" ID="MdiArea.__setSubWindowIcon"></a> -<h4>MdiArea.__setSubWindowIcon</h4> -<b>__setSubWindowIcon</b>(<i>widget, icon</i>) -<p> - Private method to set the icon of a subwindow given it's internal widget. -</p><dl> -<dt><i>widget</i></dt> -<dd> -reference to the internal widget (QWidget) -</dd><dt><i>icon</i></dt> -<dd> -reference to the icon (QIcon) -</dd> -</dl><a NAME="MdiArea.__subWindowActivated" ID="MdiArea.__subWindowActivated"></a> -<h4>MdiArea.__subWindowActivated</h4> -<b>__subWindowActivated</b>(<i>subWindow</i>) -<p> - Private slot to handle the windowActivated signal. -</p><dl> -<dt><i>subWindow</i></dt> -<dd> -the activated subwindow (QMdiSubWindow) -</dd> -</dl><a NAME="MdiArea._addView" ID="MdiArea._addView"></a> -<h4>MdiArea._addView</h4> -<b>_addView</b>(<i>win, fn=None, noName=""</i>) -<p> - Protected method to add a view (i.e. window) -</p><dl> -<dt><i>win</i></dt> -<dd> -editor window to be added -</dd><dt><i>fn</i></dt> -<dd> -filename of this editor -</dd><dt><i>noName</i></dt> -<dd> -name to be used for an unnamed editor (string) -</dd> -</dl><a NAME="MdiArea._initWindowActions" ID="MdiArea._initWindowActions"></a> -<h4>MdiArea._initWindowActions</h4> -<b>_initWindowActions</b>(<i></i>) -<p> - Protected method to define the user interface actions for window handling. -</p><a NAME="MdiArea._modificationStatusChanged" ID="MdiArea._modificationStatusChanged"></a> -<h4>MdiArea._modificationStatusChanged</h4> -<b>_modificationStatusChanged</b>(<i>m, editor</i>) -<p> - Protected slot to handle the modificationStatusChanged signal. -</p><dl> -<dt><i>m</i></dt> -<dd> -flag indicating the modification status (boolean) -</dd><dt><i>editor</i></dt> -<dd> -editor window changed -</dd> -</dl><a NAME="MdiArea._removeAllViews" ID="MdiArea._removeAllViews"></a> -<h4>MdiArea._removeAllViews</h4> -<b>_removeAllViews</b>(<i></i>) -<p> - Protected method to remove all views (i.e. windows) -</p><a NAME="MdiArea._removeView" ID="MdiArea._removeView"></a> -<h4>MdiArea._removeView</h4> -<b>_removeView</b>(<i>win</i>) -<p> - Protected method to remove a view (i.e. window) -</p><dl> -<dt><i>win</i></dt> -<dd> -editor window to be removed -</dd> -</dl><a NAME="MdiArea._showView" ID="MdiArea._showView"></a> -<h4>MdiArea._showView</h4> -<b>_showView</b>(<i>win, fn=None</i>) -<p> - Private method to show a view (i.e. window) -</p><dl> -<dt><i>win</i></dt> -<dd> -editor window to be shown -</dd><dt><i>fn</i></dt> -<dd> -filename of this editor (string) -</dd> -</dl><a NAME="MdiArea._syntaxErrorToggled" ID="MdiArea._syntaxErrorToggled"></a> -<h4>MdiArea._syntaxErrorToggled</h4> -<b>_syntaxErrorToggled</b>(<i>editor</i>) -<p> - Protected slot to handle the syntaxerrorToggled signal. -</p><dl> -<dt><i>editor</i></dt> -<dd> -editor that sent the signal -</dd> -</dl><a NAME="MdiArea.activeWindow" ID="MdiArea.activeWindow"></a> -<h4>MdiArea.activeWindow</h4> -<b>activeWindow</b>(<i></i>) -<p> - Private method to return the active (i.e. current) window. -</p><dl> -<dt>Returns:</dt> -<dd> -reference to the active editor -</dd> -</dl><a NAME="MdiArea.canCascade" ID="MdiArea.canCascade"></a> -<h4>MdiArea.canCascade</h4> -<b>canCascade</b>(<i></i>) -<p> - Public method to signal if cascading of managed windows is available. -</p><dl> -<dt>Returns:</dt> -<dd> -flag indicating cascading of windows is available -</dd> -</dl><a NAME="MdiArea.canSplit" ID="MdiArea.canSplit"></a> -<h4>MdiArea.canSplit</h4> -<b>canSplit</b>(<i></i>) -<p> - public method to signal if splitting of the view is available. -</p><dl> -<dt>Returns:</dt> -<dd> -flag indicating splitting of the view is available. -</dd> -</dl><a NAME="MdiArea.canTile" ID="MdiArea.canTile"></a> -<h4>MdiArea.canTile</h4> -<b>canTile</b>(<i></i>) -<p> - Public method to signal if tiling of managed windows is available. -</p><dl> -<dt>Returns:</dt> -<dd> -flag indicating tiling of windows is available -</dd> -</dl><a NAME="MdiArea.cascade" ID="MdiArea.cascade"></a> -<h4>MdiArea.cascade</h4> -<b>cascade</b>(<i></i>) -<p> - Public method to cascade the managed windows. -</p><a NAME="MdiArea.eventFilter" ID="MdiArea.eventFilter"></a> -<h4>MdiArea.eventFilter</h4> -<b>eventFilter</b>(<i>watched, event</i>) -<p> - Public method called to filter the event queue. -</p><dl> -<dt><i>watched</i></dt> -<dd> -the QObject being watched -</dd><dt><i>event</i></dt> -<dd> -the event that occurred -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -flag indicating, whether the event was handled (boolean) -</dd> -</dl><a NAME="MdiArea.setEditorName" ID="MdiArea.setEditorName"></a> -<h4>MdiArea.setEditorName</h4> -<b>setEditorName</b>(<i>editor, newName</i>) -<p> - Public method to change the displayed name of the editor. -</p><dl> -<dt><i>editor</i></dt> -<dd> -editor window to be changed -</dd><dt><i>newName</i></dt> -<dd> -new name to be shown (string) -</dd> -</dl><a NAME="MdiArea.showWindowMenu" ID="MdiArea.showWindowMenu"></a> -<h4>MdiArea.showWindowMenu</h4> -<b>showWindowMenu</b>(<i>windowMenu</i>) -<p> - Public method to set up the viewmanager part of the Window menu. -</p><dl> -<dt><i>windowMenu</i></dt> -<dd> -reference to the window menu -</dd> -</dl><a NAME="MdiArea.tile" ID="MdiArea.tile"></a> -<h4>MdiArea.tile</h4> -<b>tile</b>(<i></i>) -<p> - Public method to tile the managed windows. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/Documentation/Source/index-eric5.Plugins.ViewManagerPlugins.MdiArea.html Mon Oct 03 12:51:39 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' -'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> -<html><head> -<title>eric5.Plugins.ViewManagerPlugins.MdiArea</title> -<style> -body { - background: #EDECE6; - margin: 0em 1em 10em 1em; - color: black; -} - -h1 { color: white; background: #85774A; } -h2 { color: white; background: #85774A; } -h3 { color: white; background: #9D936E; } -h4 { color: white; background: #9D936E; } - -a { color: #BA6D36; } - -</style> -</head> -<body> -<h1>eric5.Plugins.ViewManagerPlugins.MdiArea</h1> -<p> -Package containing the mdi area view manager plugin. -</p> - - -<h3>Modules</h3> -<table> -<tr> -<td><a href="eric5.Plugins.ViewManagerPlugins.MdiArea.MdiArea.html">MdiArea</a></td> -<td>Module implementing the mdi area viewmanager class.</td> -</tr> -</table> -</body></html> \ No newline at end of file
--- a/Plugins/PluginVmMdiArea.py Mon Oct 03 12:51:39 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2008 - 2011 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Module implementing the mdi area view manager plugin. -""" - -import os - -from PyQt4.QtCore import QT_TRANSLATE_NOOP, QObject -from PyQt4.QtGui import QPixmap - -# Start-Of-Header -name = "Workspace Plugin" -author = "Detlev Offenbach <detlev@die-offenbachs.de>" -autoactivate = False -deactivateable = False -version = "5.1.0" -pluginType = "viewmanager" -pluginTypename = "mdiarea" -displayString = QT_TRANSLATE_NOOP('VmMdiAreaPlugin', 'MDI Area') -className = "VmMdiAreaPlugin" -packageName = "__core__" -shortDescription = "Implements the MDI Area view manager." -longDescription = """This plugin provides the mdi area view manager.""" -pyqtApi = 2 -# End-Of-Header - -error = "" - - -def previewPix(): - """ - Module function to return a preview pixmap. - - @return preview pixmap (QPixmap) - """ - fname = os.path.join(os.path.dirname(__file__), - "ViewManagerPlugins", "MdiArea", "preview.png") - return QPixmap(fname) - - -class VmMdiAreaPlugin(QObject): - """ - Class implementing the Workspace view manager plugin. - """ - def __init__(self, ui): - """ - Constructor - - @param ui reference to the user interface object (UI.UserInterface) - """ - super().__init__(ui) - self.__ui = ui - - def activate(self): - """ - Public method to activate this plugin. - - @return tuple of reference to instantiated viewmanager and - activation status (boolean) - """ - from ViewManagerPlugins.MdiArea.MdiArea import MdiArea - self.__object = MdiArea(self.__ui) - return self.__object, True - - def deactivate(self): - """ - Public method to deactivate this plugin. - """ - # do nothing for the moment - pass
--- a/Plugins/ViewManagerPlugins/MdiArea/MdiArea.py Mon Oct 03 12:51:39 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,410 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2008 - 2011 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Module implementing the mdi area viewmanager class. -""" - -from PyQt4.QtCore import QSignalMapper, pyqtSignal, QEvent, QSize, Qt -from PyQt4.QtGui import QWidget, QMdiArea, QMenu - -from ViewManager.ViewManager import ViewManager - -import QScintilla.Editor -from QScintilla.Editor import Editor - -import UI.PixmapCache - -from E5Gui.E5Action import E5Action, addActions - -import Utilities - - -class MdiArea(QMdiArea, ViewManager): - """ - Class implementing the mdi area viewmanager class. - - @signal changeCaption(str) emitted if a change of the caption is necessary - @signal editorChanged(str) emitted when the current editor has changed - @signal lastEditorClosed() emitted after the last editor window was closed - @signal editorOpened(str) emitted after an editor window was opened - @signal editorOpenedEd(Editor) emitted after an editor window was opened - @signal editorClosed(str) emitted just before an editor window gets closed - @signal editorClosedEd(Editor) emitted just before an editor window gets closed - @signal editorSaved(str) emitted after an editor window was saved - @signal checkActions(Editor) emitted when some actions should be checked - for their status - @signal cursorChanged(Editor) emitted after the cursor position of the active - window has changed - @signal breakpointToggled(Editor) emitted when a breakpoint is toggled. - @signal bookmarkToggled(Editor) emitted when a bookmark is toggled. - """ - changeCaption = pyqtSignal(str) - editorChanged = pyqtSignal(str) - - lastEditorClosed = pyqtSignal() - editorOpened = pyqtSignal(str) - editorOpenedEd = pyqtSignal(Editor) - editorClosed = pyqtSignal(str) - editorClosedEd = pyqtSignal(Editor) - editorSaved = pyqtSignal(str) - checkActions = pyqtSignal(Editor) - cursorChanged = pyqtSignal(Editor) - breakpointToggled = pyqtSignal(Editor) - bookmarkToggled = pyqtSignal(Editor) - syntaxerrorToggled = pyqtSignal(Editor) - - def __init__(self, parent): - """ - Constructor - - @param parent parent widget (QWidget) - @param ui reference to the main user interface - @param dbs reference to the debug server object - """ - QMdiArea.__init__(self, parent) - ViewManager.__init__(self) - self.lastFN = '' - self.__removingView = False - - self.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded) - self.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded) - - self.__windowMapper = QSignalMapper(self) - - self.__windowMapper.mapped[QWidget].connect(self.__mapped) - self.subWindowActivated.connect(self.__subWindowActivated) - - def __mapped(self, subWindow): - """ - Private slot to handle the activation of a sub window. - - @param subWindow sub window to be activated (QMdiSubWindow) - """ - self.setActiveSubWindow(subWindow) - - def canCascade(self): - """ - Public method to signal if cascading of managed windows is available. - - @return flag indicating cascading of windows is available - """ - return True - - def canTile(self): - """ - Public method to signal if tiling of managed windows is available. - - @return flag indicating tiling of windows is available - """ - return True - - def canSplit(self): - """ - public method to signal if splitting of the view is available. - - @return flag indicating splitting of the view is available. - """ - return False - - def tile(self): - """ - Public method to tile the managed windows. - """ - self.tileSubWindows() - - def cascade(self): - """ - Public method to cascade the managed windows. - """ - self.cascadeSubWindows() - - def _removeAllViews(self): - """ - Protected method to remove all views (i.e. windows) - """ - for win in self.editors: - self._removeView(win) - - def _removeView(self, win): - """ - Protected method to remove a view (i.e. window) - - @param win editor window to be removed - """ - self.__removingView = True - self.lastFN = '' - win.removeEventFilter(self) - self.closeActiveSubWindow() - win.closeIt() - self.__removingView = False - - def _addView(self, win, fn=None, noName=""): - """ - Protected method to add a view (i.e. window) - - @param win editor window to be added - @param fn filename of this editor - @param noName name to be used for an unnamed editor (string) - """ - self.addSubWindow(win) - if fn is None: - if not noName: - self.untitledCount += 1 - noName = self.trUtf8("Untitled {0}").format(self.untitledCount) - win.setWindowTitle(noName) - win.setNoName(noName) - else: - if self.lastFN != fn: - self.lastFN = fn - win.show() - if win.hasSyntaxErrors(): - self.__setSubWindowIcon(win, UI.PixmapCache.getIcon("syntaxError.png")) - elif win.hasFlakesWarnings(): - self.__setSubWindowIcon(win, UI.PixmapCache.getIcon("warning.png")) - else: - self.__setSubWindowIcon(win, UI.PixmapCache.getIcon("empty.png")) - - # Make the editor window a little bit smaller to make the whole - # window with all decorations visible. This is not the most elegant - # solution but more of a workaround for another QWorkspace strangeness. - # 25 points are subtracted to give space for the scrollbars - pw = win.parentWidget() - sz = QSize(self.width() - 25, self.height() - 25) - pw.resize(sz) - - win.setFocus() - win.installEventFilter(self) - - def _showView(self, win, fn=None): - """ - Private method to show a view (i.e. window) - - @param win editor window to be shown - @param fn filename of this editor (string) - """ - if fn is not None and self.lastFN != fn: - self.lastFN = fn - win.show() - win.setFocus() - - def activeWindow(self): - """ - Private method to return the active (i.e. current) window. - - @return reference to the active editor - """ - subWindow = self.activeSubWindow() - if subWindow is None: - return None - else: - return subWindow.widget() - - def showWindowMenu(self, windowMenu): - """ - Public method to set up the viewmanager part of the Window menu. - - @param windowMenu reference to the window menu - """ - self.windowsMenu = QMenu(self.trUtf8('&Windows')) - - menu = self.windowsMenu - idx = 1 - for subWindow in self.subWindowList(): - sv = subWindow.widget() - if idx == 10: - menu.addSeparator() - menu = menu.addMenu(self.trUtf8("&More")) - fn = sv.fileName - if fn: - txt = Utilities.compactPath(fn, self.ui.maxMenuFilePathLen) - else: - txt = sv.windowTitle() - accel = "" - if idx < 10: - accel = "&{0:d}. ".format(idx) - elif idx < 36: - accel = "&{0}. ".format(chr(idx - 9 + ord("@"))) - act = menu.addAction("{0}{1}".format(accel, txt)) - act.triggered[()].connect(self.__windowMapper.map) - self.__windowMapper.setMapping(act, subWindow) - idx += 1 - - addActions(windowMenu, - [None, self.nextChildAct, self.prevChildAct, - self.tileAct, self.cascadeAct, - self.restoreAllAct, self.iconizeAllAct, - None]) - for act in [self.restoreAllAct, self.iconizeAllAct]: - act.setEnabled(len(self.editors) != 0) - for act in [self.nextChildAct, self.prevChildAct, self.tileAct, - self.cascadeAct]: - act.setEnabled(len(self.editors) > 1) - - act = windowMenu.addMenu(self.windowsMenu) - if len(self.editors) == 0: - act.setEnabled(False) - - def _initWindowActions(self): - """ - Protected method to define the user interface actions for window handling. - """ - self.tileAct = E5Action(self.trUtf8('Tile'), - self.trUtf8('&Tile'), 0, 0, self, 'vm_window_tile') - self.tileAct.setStatusTip(self.trUtf8('Tile the windows')) - self.tileAct.setWhatsThis(self.trUtf8( - """<b>Tile the windows</b>""" - """<p>Rearrange and resize the windows so that they are tiled.</p>""" - )) - self.tileAct.triggered[()].connect(self.tile) - self.windowActions.append(self.tileAct) - - self.cascadeAct = E5Action(self.trUtf8('Cascade'), - self.trUtf8('&Cascade'), 0, 0, self, 'vm_window_cascade') - self.cascadeAct.setStatusTip(self.trUtf8('Cascade the windows')) - self.cascadeAct.setWhatsThis(self.trUtf8( - """<b>Cascade the windows</b>""" - """<p>Rearrange and resize the windows so that they are cascaded.</p>""" - )) - self.cascadeAct.triggered[()].connect(self.cascade) - self.windowActions.append(self.cascadeAct) - - self.nextChildAct = E5Action(self.trUtf8('Next'), - self.trUtf8('&Next'), 0, 0, self, 'vm_window_next') - self.nextChildAct.setStatusTip(self.trUtf8('Activate next window')) - self.nextChildAct.setWhatsThis(self.trUtf8( - """<b>Next</b>""" - """<p>Activate the next window of the list of open windows.</p>""" - )) - self.nextChildAct.triggered[()].connect(self.activateNextSubWindow) - self.windowActions.append(self.nextChildAct) - - self.prevChildAct = E5Action(self.trUtf8('Previous'), - self.trUtf8('&Previous'), 0, 0, self, 'vm_window_previous') - self.prevChildAct.setStatusTip(self.trUtf8('Activate previous window')) - self.prevChildAct.setWhatsThis(self.trUtf8( - """<b>Previous</b>""" - """<p>Activate the previous window of the list of open windows.</p>""" - )) - self.prevChildAct.triggered[()].connect(self.activatePreviousSubWindow) - self.windowActions.append(self.prevChildAct) - - self.restoreAllAct = E5Action(self.trUtf8('Restore All'), - self.trUtf8('&Restore All'), 0, 0, self, 'vm_window_restore_all') - self.restoreAllAct.setStatusTip(self.trUtf8('Restore all windows')) - self.restoreAllAct.setWhatsThis(self.trUtf8( - """<b>Restore All</b>""" - """<p>Restores all windows to their original size.</p>""" - )) - self.restoreAllAct.triggered[()].connect(self.__restoreAllWindows) - self.windowActions.append(self.restoreAllAct) - - self.iconizeAllAct = E5Action(self.trUtf8('Iconize All'), - self.trUtf8('&Iconize All'), 0, 0, self, 'vm_window_iconize_all') - self.iconizeAllAct.setStatusTip(self.trUtf8('Iconize all windows')) - self.iconizeAllAct.setWhatsThis(self.trUtf8( - """<b>Iconize All</b>""" - """<p>Iconizes all windows.</p>""" - )) - self.iconizeAllAct.triggered[()].connect(self.__iconizeAllWindows) - self.windowActions.append(self.iconizeAllAct) - - def setEditorName(self, editor, newName): - """ - Public method to change the displayed name of the editor. - - @param editor editor window to be changed - @param newName new name to be shown (string) - """ - pass - - def __setSubWindowIcon(self, widget, icon): - """ - Private method to set the icon of a subwindow given it's internal widget. - - @param widget reference to the internal widget (QWidget) - @param icon reference to the icon (QIcon) - """ - for subWindow in self.subWindowList(): - if subWindow.widget() == widget: - subWindow.setWindowIcon(icon) - return - - def _modificationStatusChanged(self, m, editor): - """ - Protected slot to handle the modificationStatusChanged signal. - - @param m flag indicating the modification status (boolean) - @param editor editor window changed - """ - if m: - self.__setSubWindowIcon(editor, UI.PixmapCache.getIcon("fileModified.png")) - elif editor.hasSyntaxErrors(): - self.__setSubWindowIcon(editor, UI.PixmapCache.getIcon("syntaxError.png")) - elif editor.hasFlakesWarnings(): - self.__setSubWindowIcon(editor, UI.PixmapCache.getIcon("warning.png")) - else: - self.__setSubWindowIcon(editor, UI.PixmapCache.getIcon("empty.png")) - self._checkActions(editor) - - def _syntaxErrorToggled(self, editor): - """ - Protected slot to handle the syntaxerrorToggled signal. - - @param editor editor that sent the signal - """ - if editor.hasSyntaxErrors(): - self.__setSubWindowIcon(editor, UI.PixmapCache.getIcon("syntaxError.png")) - elif editor.hasFlakesWarnings(): - self.__setSubWindowIcon(editor, UI.PixmapCache.getIcon("warning.png")) - elif editor.isModified(): - self.__setSubWindowIcon(editor, UI.PixmapCache.getIcon("fileModified.png")) - else: - self.__setSubWindowIcon(editor, UI.PixmapCache.getIcon("empty.png")) - - ViewManager._syntaxErrorToggled(self, editor) - - def __subWindowActivated(self, subWindow): - """ - Private slot to handle the windowActivated signal. - - @param subWindow the activated subwindow (QMdiSubWindow) - """ - if subWindow is not None: - editor = subWindow.widget() - self._checkActions(editor) - if editor is not None: - fn = editor.getFileName() - self.editorChanged.emit(fn) - - def eventFilter(self, watched, event): - """ - Public method called to filter the event queue. - - @param watched the QObject being watched - @param event the event that occurred - @return flag indicating, whether the event was handled (boolean) - """ - if event.type() == QEvent.Close and \ - not self.__removingView and \ - isinstance(watched, QScintilla.Editor.Editor): - watched.close() - return True - - return QMdiArea.eventFilter(self, watched, event) - - def __restoreAllWindows(self): - """ - Private slot to restore all windows. - """ - for win in self.subWindowList(): - win.showNormal() - - def __iconizeAllWindows(self): - """ - Private slot to iconize all windows. - """ - for win in self.subWindowList(): - win.showMinimized()
--- a/Plugins/ViewManagerPlugins/MdiArea/__init__.py Mon Oct 03 12:51:39 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -# -*- coding: utf-8 -*- - - # Copyright (c) 2008 - 2011 Detlev Offenbach <detlev@die-offenbachs.de> - # - -""" -Package containing the mdi area view manager plugin. -"""