31 lines
852 B
Python
31 lines
852 B
Python
|
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())
|