Plugins/PluginVmMdiArea.py

changeset 0
de9c2efb9d02
child 13
1af94a91f439
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Plugins/PluginVmMdiArea.py	Mon Dec 28 16:03:33 2009 +0000
@@ -0,0 +1,71 @@
+# -*- coding: utf-8 -*-
+
+# Copyright (c) 2008 - 2009 Detlev Offenbach <detlev@die-offenbachs.de>
+#
+
+"""
+Module implementing the mdi area view manager plugin.
+"""
+
+import os
+
+from PyQt4.QtCore import QT_TRANSLATE_NOOP, qVersion
+from PyQt4.QtGui import QPixmap
+
+# Start-Of-Header
+name = "Workspace Plugin"
+author = "Detlev Offenbach <detlev@die-offenbachs.de>"
+autoactivate = False
+deactivateable = False
+version = "5.0.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(object):
+    """
+    Class implementing the Workspace view manager plugin.
+    """
+    def __init__(self, ui):
+        """
+        Constructor
+        
+        @param ui reference to the user interface object (UI.UserInterface)
+        """
+        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

eric ide

mercurial