Falkon Develop
Cross-platform Qt-based web browser
__init__.py
Go to the documentation of this file.
1# ============================================================
2# MiddleClickLoader - plugin for Falkon
3# Copyright (C) 2018 Juraj Oravec <sgd.orava@gmail.com>
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
17# ============================================================
18
19import Falkon
20from PySide6 import QtCore
21from middleclickloader.mcl_handler import MCL_Handler
22
23
24class MCL_Plugin(Falkon.PluginInterface, QtCore.QObject):
25 handler = None
26
27 def init(self, state, settingsPath):
28 plugins = Falkon.MainApplication.instance().plugins()
29 plugins.registerAppEventHandler(Falkon.PluginProxy.MousePressHandler, self)
30
31 self.handler = MCL_Handler(settingsPath)
32
33 def unload(self):
34 del self.handler
35 self.handler = None
36
37 def testPlugin(self):
38 return True
39
40 def mousePress(self, type, obj, event):
41 if type == Falkon.Qz.ON_WebView:
42 return self.handler.mousePress(obj, event)
43
44 return False
45
46 def showSettings(self, parent):
47 pass
48 self.handler.showSettings(parent)
49
50
51Falkon.registerPlugin(MCL_Plugin())
def mousePress(self, type, obj, event)
Definition: __init__.py:40
def init(self, state, settingsPath)
Definition: __init__.py:27
def showSettings(self, parent)
Definition: __init__.py:46