1
kdevelop-python-templates/plugin/%{APPNAMELC}/__init__.py

31 lines
848 B
Python
Raw Permalink Normal View History

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}())