diff options
author | Anton Khirnov <wyskas@gmail.com> | 2009-06-20 17:10:53 +0200 |
---|---|---|
committer | Anton Khirnov <wyskas@gmail.com> | 2009-06-20 17:10:53 +0200 |
commit | c6af9fe01cb3bea21471f839ec26a07b04ac24c2 (patch) | |
tree | 704e0d0542e8bf5a22a3d8632c9885cd989c1d5b /nephilim/plugin.py | |
parent | e7e7093a12fb5eb52fd0bb3071a7c85c7d8aefbd (diff) |
plugin: make mpclient a var instead of a function.
Diffstat (limited to 'nephilim/plugin.py')
-rw-r--r-- | nephilim/plugin.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/nephilim/plugin.py b/nephilim/plugin.py index b443167..d4a248e 100644 --- a/nephilim/plugin.py +++ b/nephilim/plugin.py @@ -25,13 +25,13 @@ import plugins class Plugin(QtCore.QObject): # public, const name = None - logger = None + logger = None + mpclient = None _dock_widget = None _settings = None _loaded = None _parent = None - _mpclient = None o = None DEFAULTS = {} @@ -39,8 +39,8 @@ class Plugin(QtCore.QObject): def __init__(self, parent, mpclient, name): QtCore.QObject.__init__(self) self.name = name + self.mpclient = mpclient self._parent = parent - self._mpclient = mpclient self._loaded = False self._settings = QtCore.QSettings() @@ -60,8 +60,6 @@ class Plugin(QtCore.QObject): return self._parent def set_status(self, status): self._parent.setStatus(status) - def mpclient(self): - return self._mpclient def settings(self): return self._settings @@ -71,7 +69,7 @@ class Plugin(QtCore.QObject): opts = QtGui.QDockWidget.DockWidgetClosable|QtGui.QDockWidget.DockWidgetMovable QtGui.QApplication.instance().main_win.addDock(self.get_dock_widget(opts)) QtGui.QApplication.instance().main_win.restore_layout() - self.connect(self._mpclient, QtCore.SIGNAL('connect_changed'), self.set_enabled) + self.connect(self.mpclient, QtCore.SIGNAL('connect_changed'), self.set_enabled) self._loaded = True def unload(self): if not self._loaded: @@ -83,7 +81,7 @@ class Plugin(QtCore.QObject): QtGui.QApplication.instance().main_win.removeDock(dock_widget) self._dock_widget = None self._settingsWidget = None - self.disconnect(self._mpclient, QtCore.SIGNAL('connect_changed'), self.set_enabled) + self.disconnect(self.mpclient, QtCore.SIGNAL('connect_changed'), self.set_enabled) self._loaded = False def is_loaded(self): return self._loaded |