Recursively load themes
Themes (other than the default theme) can specify a `parent-name` in the json file. This theme will be used as a base for the theme. Events and profiles of the children override those in the parents. For this we move the lookup code into it's separate class and also add tests. Closes: #38
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name" : "custom",
|
||||
"parent-name": "default",
|
||||
"profiles" : [
|
||||
{
|
||||
"name" : "full",
|
||||
"feedbacks" : [
|
||||
{
|
||||
"event-name" : "test-dummy-0",
|
||||
"type" : "Dummy",
|
||||
"duration" : 0x10
|
||||
},
|
||||
{
|
||||
"event-name" : "test-dummy-2",
|
||||
"type" : "Dummy",
|
||||
"duration" : 0x30
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name" : "$device",
|
||||
"parent-name": "default"
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"name" : "default",
|
||||
"profiles" : [
|
||||
{
|
||||
"name" : "full",
|
||||
"feedbacks" : [
|
||||
{
|
||||
"event-name" : "test-dummy-0",
|
||||
"type" : "Dummy"
|
||||
},
|
||||
{
|
||||
"event-name" : "test-dummy-1",
|
||||
"type" : "Dummy"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "quiet",
|
||||
"feedbacks" : [
|
||||
{
|
||||
"event-name" : "test-dummy-0",
|
||||
"type" : "Dummy"
|
||||
},
|
||||
{
|
||||
"event-name" : "test-dummy-1",
|
||||
"type" : "Dummy"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name" : "$device",
|
||||
"parent-name": "default",
|
||||
"profiles" : [
|
||||
{
|
||||
"name" : "full",
|
||||
"feedbacks" : [
|
||||
{
|
||||
"event-name" : "test-dummy-0",
|
||||
"type" : "Dummy",
|
||||
"duration" : 0x10
|
||||
},
|
||||
{
|
||||
"event-name" : "test-dummy-2",
|
||||
"type" : "Dummy",
|
||||
"duration" : 0x20
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user