src/eric7/Plugins/PluginVmTabview.py

branch
eric7
changeset 9209
b99e7fd55fd3
parent 8881
54e42bc2437a
child 9221
bf71ee032bb4
equal deleted inserted replaced
9208:3fc8dfeb6ebe 9209:b99e7fd55fd3
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2007 - 2022 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing the Tabview view manager plugin.
8 """
9
10 import os
11
12 from PyQt6.QtCore import QT_TRANSLATE_NOOP, QObject
13 from PyQt6.QtGui import QPixmap
14
15 import UI.Info
16
17 # Start-Of-Header
18 name = "Tabview Plugin"
19 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
20 autoactivate = False
21 deactivateable = False
22 version = UI.Info.VersionOnly
23 pluginType = "viewmanager"
24 pluginTypename = "tabview"
25 displayString = QT_TRANSLATE_NOOP('VmTabviewPlugin', 'Tabbed View')
26 className = "VmTabviewPlugin"
27 packageName = "__core__"
28 shortDescription = "Implements the Tabview view manager."
29 longDescription = """This plugin provides the tabbed view view manager."""
30 pyqtApi = 2
31 # End-Of-Header
32
33 error = ""
34
35
36 def previewPix():
37 """
38 Module function to return a preview pixmap.
39
40 @return preview pixmap (QPixmap)
41 """
42 fname = os.path.join(os.path.dirname(__file__),
43 "ViewManagerPlugins", "Tabview", "preview.png")
44 return QPixmap(fname)
45
46
47 class VmTabviewPlugin(QObject):
48 """
49 Class implementing the Tabview view manager plugin.
50 """
51 def __init__(self, ui):
52 """
53 Constructor
54
55 @param ui reference to the user interface object (UI.UserInterface)
56 """
57 super().__init__(ui)
58 self.__ui = ui
59
60 def activate(self):
61 """
62 Public method to activate this plugin.
63
64 @return tuple of reference to instantiated viewmanager and
65 activation status (boolean)
66 """
67 from ViewManagerPlugins.Tabview.Tabview import Tabview
68 self.__object = Tabview(self.__ui)
69 return self.__object, True
70
71 def deactivate(self):
72 """
73 Public method to deactivate this plugin.
74 """
75 # do nothing for the moment
76 pass

eric ide

mercurial