Skip to content

Commit

Permalink
Sets the pluginApp category on the EntryButton
Browse files Browse the repository at this point in the history
  • Loading branch information
hufman committed Feb 25, 2024
1 parent e37f146 commit 0b177e3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package io.bimmergestalt.idriveconnectkit.rhmi
import de.bmw.idrive.BMWRemoting
import de.bmw.idrive.BMWRemotingServer
import io.bimmergestalt.idriveconnectkit.xmlutils.XMLUtils
import io.bimmergestalt.idriveconnectkit.xmlutils.getAttribute
import io.bimmergestalt.idriveconnectkit.xmlutils.getChildElements
import io.bimmergestalt.idriveconnectkit.xmlutils.getChildNamed
import org.w3c.dom.Document
Expand Down Expand Up @@ -64,7 +65,13 @@ abstract class RHMIApplication {
val entryButtonNode = pluginAppNode.getChildNamed("entryButton")
if (entryButtonNode != null) {
val component = RHMIComponent.loadFromXML(this, entryButtonNode)
if (component != null) {
if (component is RHMIComponent.EntryButton) {
pluginAppNode.getAttribute("applicationType")?.also {
component.applicationType = it
}
pluginAppNode.getAttribute("applicationWeight")?.toIntOrNull()?.also {
component.applicationWeight = it
}
components[component.id] = component
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ abstract class RHMIComponent private constructor(open val app: RHMIApplication,
fun getAction(): RHMIAction? {
return app.actions[action]
}
// What category to put the entrybutton
var applicationType = "OnlineServices"
// How to sort the button
var applicationWeight = 500
}
class InstrumentCluster(override val app: RHMIApplication, override val id: Int): RHMIComponent(app, id) {
var textModel: Int = 0
Expand Down

0 comments on commit 0b177e3

Please sign in to comment.