Merge PR #201: Rework button interface inheritance
This commit is contained in:
commit
bd753212e2
@ -1,2 +1,8 @@
|
|||||||
{
|
{
|
||||||
|
"description": "The base for all buttons that emit a pressed event.",
|
||||||
|
"events": [
|
||||||
|
{
|
||||||
|
"name": "pressed"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,7 @@
|
|||||||
<file>battery.json</file>
|
<file>battery.json</file>
|
||||||
<file>batterylevel.json</file>
|
<file>batterylevel.json</file>
|
||||||
<file>button.json</file>
|
<file>button.json</file>
|
||||||
|
<file>multibutton.json</file>
|
||||||
<file>simplebutton.json</file>
|
<file>simplebutton.json</file>
|
||||||
<file>longpressbutton.json</file>
|
<file>longpressbutton.json</file>
|
||||||
<file>simplemultibutton.json</file>
|
<file>simplemultibutton.json</file>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": "simplebutton",
|
"description": "A button that emits different events, pressed and longpressed, depending on how long the user presses it. Note that the button should only emit one of them at a time. I.e. don't emit pressed on botton down and later longPressed if the user keeps on holding the button. Such a longpress should only emit longPressed. Common practice is to emit pressed if a release event is received before a timeout expires, else emit longpress when the timeout expires.",
|
||||||
|
"extends": "button",
|
||||||
"events": [
|
"events": [
|
||||||
{
|
{
|
||||||
"name": "longPressed"
|
"name": "longPressed"
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": "longpressbutton",
|
"description": "A remote control with multiple buttons that can distinguish between short and long presses. Note that the button should only emit one of them at a time. I.e. don't emit pressed on botton down and later longPressed if the user keeps on holding the button. Such a longpress should only emit longPressed. Common practice is to emit pressed if a release event is received before a timeout expires, else emit longpress when the timeout expires.",
|
||||||
|
"extends": "simplemultibutton",
|
||||||
"events": [
|
"events": [
|
||||||
{
|
{
|
||||||
"name": "longPressed",
|
"name": "longPressed",
|
||||||
|
|||||||
15
libnymea/interfaces/multibutton.json
Normal file
15
libnymea/interfaces/multibutton.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"description": "A remote control with multiple buttons. Emits pressed(buttonName) on button presses.",
|
||||||
|
"extends": "button",
|
||||||
|
"events": [
|
||||||
|
{
|
||||||
|
"name": "pressed",
|
||||||
|
"params": [
|
||||||
|
{
|
||||||
|
"name": "buttonName",
|
||||||
|
"type": "QString"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -1,8 +1,4 @@
|
|||||||
{
|
{
|
||||||
"extends": "button",
|
"extends": "button",
|
||||||
"events": [
|
"description": "Deprecated - Use button instead."
|
||||||
{
|
|
||||||
"name": "pressed"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,14 +1,4 @@
|
|||||||
{
|
{
|
||||||
"extends": "button",
|
"description": "Deprecated - Use multibutton instead",
|
||||||
"events": [
|
"extends": "multibutton"
|
||||||
{
|
|
||||||
"name": "pressed",
|
|
||||||
"params": [
|
|
||||||
{
|
|
||||||
"name": "buttonName",
|
|
||||||
"type": "QString"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user