|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2007 - 2021 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 PyQt5.QtCore import QT_TRANSLATE_NOOP, QObject |
|
13 from PyQt5.QtGui import QPixmap |
|
14 |
|
15 import UI.Info |
|
16 |
|
17 # Start-Of-Header |
|
18 name = "Listspace 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 = "listspace" |
|
25 displayString = QT_TRANSLATE_NOOP('VmListspacePlugin', 'Listspace') |
|
26 className = "VmListspacePlugin" |
|
27 packageName = "__core__" |
|
28 shortDescription = "Implements the Listspace view manager." |
|
29 longDescription = """This plugin provides the listspace 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", "Listspace", "preview.png") |
|
44 return QPixmap(fname) |
|
45 |
|
46 |
|
47 class VmListspacePlugin(QObject): |
|
48 """ |
|
49 Class implementing the Listspace 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.Listspace.Listspace import Listspace |
|
68 self.__object = Listspace(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 |