ToolbarTools/toolbartools/__init__.py

31 lines
852 B
Python
Raw Normal View History

2019-06-24 20:57:25 +02:00
import Falkon
from PySide2 import QtCore
class ToolbarTools(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(ToolbarTools())