3
from yapsy.IPlugin import IPlugin
5
from PyQt4 import QtCore, QtGui, Qt
8
class MyMdiSubWindow(QtGui.QMdiSubWindow):
9
def __init__(self, parent):
11
This MdiSubWindow removes itself from the MdiArea when it closes. It can then be reopened.
15
QtGui.QMdiSubWindow.__init__(self)
17
def set_container(self, container):
18
self.container = container
20
def closeEvent(self, event):
21
self.parent.on_close()
22
self.container.removeSubWindow(self)
23
#self.container.closeActiveSubWindow()
25
class GenericPlugin(IPlugin):
26
name = "GenericPlugin"
31
self.window = MyMdiSubWindow(self)
32
#self.window.setAttribute(QtCore.Qt.WA_DeleteOnClose)
34
self.window.setWindowTitle(self.name)
35
self.is_window_opened = False
37
def set_parent(self, parent):
39
self.window.set_container(self.parent.container)
42
if not self.is_window_opened:
43
self.parent.container.addSubWindow(self.window)
45
self.is_window_opened = True
47
self.parent.container.setActiveSubWindow(self.window)
50
def set_icon(self, path):
51
self.window.setWindowIcon(QtGui.QIcon(path))
54
self.is_window_opened = False
58
return Config.generic_plugin_config.dependencies
b'\\ No newline at end of file'