50 lines
983 B
Python
50 lines
983 B
Python
|
{% load kdev_filters %}
|
||
|
{% block license_header %}
|
||
|
{% if license %}
|
||
|
{{ license|lines_prepend:"# " }}
|
||
|
{% endif %}
|
||
|
{% endblock license_header %}
|
||
|
|
||
|
|
||
|
import Falkon
|
||
|
import os
|
||
|
from PySide2 import QtGui
|
||
|
|
||
|
|
||
|
class {{ class_name }}(Falkon.AbstractButtonInterface):
|
||
|
def __init__(self):
|
||
|
super().__init__()
|
||
|
|
||
|
|
||
|
{% if icon %}
|
||
|
self.setIcon(QtGui.QIcon(os.path.join(os.path.dirname(__file__), "{{ icon }}")))
|
||
|
{% endif %}
|
||
|
self.setTitle("{{ class_name }}")
|
||
|
{% if tooltip %}
|
||
|
self.setToolTip("{{ tooltip }}")
|
||
|
{% endif %}
|
||
|
|
||
|
|
||
|
self.clicked.connect(self.onClicked)
|
||
|
|
||
|
|
||
|
def id(self):
|
||
|
{% if button_id %}
|
||
|
return "{{ button_id }}"
|
||
|
{% else %}
|
||
|
return "{{ class_name|lower }}"
|
||
|
{% endif %}
|
||
|
|
||
|
|
||
|
def name(self):
|
||
|
{% if button_name %}
|
||
|
return "{{ button_name }}"
|
||
|
{% else %}
|
||
|
return "{{ class_name }}"
|
||
|
{% endif %}
|
||
|
|
||
|
|
||
|
def onClicked(self, controller):
|
||
|
pass
|
||
|
|