23from PySide6
import QtCore, QtGui
28 Invalid, Url, Command = range(3)
31 Page, Link, Image, Media, Text = range(5)
37 actionType = Type.Invalid
38 typeCondition = [ TypeCondition.Page, TypeCondition.Link, TypeCondition.Image, TypeCondition.Media ]
46 data = Falkon.DesktopFile(fileName)
47 self.
id = os.path.splitext(os.path.basename(fileName))[0]
50 self.
icon = QtGui.QIcon.fromTheme(data.icon(), QtGui.QIcon(os.path.join(os.path.dirname(fileName), data.icon())))
69 url = str(url.toEncoded(),
"utf-8")
71 url = shlex.quote(url)
72 text = shlex.quote(text)
74 url = str(QtCore.QUrl.toPercentEncoding(url),
"utf-8")
75 text = str(QtCore.QUrl.toPercentEncoding(text),
"utf-8")
77 command = command.replace(
"{url}", url)
78 command = command.replace(
"{text}", text)
79 command = command.replace(
"{lang}", QtCore.QLocale.system().name()[:2])
def execAction(self, url, text="")
def __init__(self, fileName)
def testAction(self, condition, url)