1
kdevelop-python-templates/plugin/%{APPNAMELC}/__init__.py
Juraj Oravec 3eee9f43ec
Rename plugin template directory to "plugin"
Signed-off-by: Juraj Oravec <sgd.orava@gmail.com>
2019-06-12 17:19:41 +02:00

31 lines
848 B
Python

import Falkon
from PySide2 import QtCore
class %{APPNAME}(Falkon.PluginInterface, QtCore.QObject):
def init(self, state, settingsPath):
plugins = Falkon.MainApplication.instance().plugins()
plugins.mainWindowCreated.connect(self.onMainWindowCreated)
plugins.mainWindowDeleted.connect(self.mainWindowDeleted)
if state == Falkon.PluginInterface.LateInitState:
for window in Falkon.MainApplication.instance().windows():
self.onMainWindowCreated(window)
def unload(self):
for window in Falkon.MainApplication.instance().windows():
self.mainWindowDeleted(window)
def testPlugin(self):
return True
def onMainWindowCreated(self, window):
pass
def mainWindowDeleted(self, window):
pass
Falkon.registerPlugin(%{APPNAME}())