[RELEASE] AutoWidget - Let your widgets work for you!
(2020-08-19, 22:06)drinfernoo Wrote:
(2020-08-19, 20:06)justin150 Wrote: This is a complicated question that may or may not have an easy answer - but I am so far beyond my coding ability I really badly need help!!

I have in the Silvio skin (actually a mod of it) created a new style of widget: the Autowidget panel, which has a dedicated button to refresh the widget beside the panel widget (the skin is designed for use on a tablet).  That button will have assigned to it in the template.xml the refresh command RunPlugin("plugin://plugin.program.autowidget/?mode=refresh&target=YOUR_ID_HERE").  In order to do that I need to parse the relevant widget path to (a) make sure that the widget is an autowidget cycling group and (b) strip out the ID then I can create a command

<onclick>RunPlugin($VAR[Static_String]$VAR[Variable_String])</onclick> where the Static_String would be "plugin://plugin.program.autowidget/?mode=refresh&target=" and the Variable_String would be autowidget ID (or something along those lines).  That way it should work no matter how many different autowidget panel widgets the relevant build has.

Has anyone got ideas and could help with the actual coding - I feel at least part of the solution might be in script.module.routing but as I said I have gone so far beyond my abilities it is embarrassing

For one thing, the path you'll actually need to use is:
syntax:
RunPlugin("plugin://plugin.program.autowidget/?mode=refresh&id=YOUR_ID_HERE")

You were close, but the parameter should be id instead of target.

I think the best way to handle getting the actual ID from the widget may be for me to attach it as a List item property, probably named autoID. Then you could not only control visibility of the control based on whether or not that property is filled, but you could use $INFO[Container(CONTAINER_ID).List item.Property(autoID)] to fill the needed parameter in the plugin path. I can make a small update to add that property Big Grin

At least, that's how I understand it... Perhaps somebody like @jurialmunkey would confirm that my logic is sound there, but I think it should work Wink
That would be a fantastic idea and would really simplify what I am doing
Reply


Messages In This Thread
RE: [RELEASE] AutoWidget - Let your widgets work for you! - by justin150 - 2020-08-21, 20:14
Suggestion for next version - by justin150 - 2021-03-08, 13:37
Android Shortcuts - by JSAKelley - 2022-01-12, 05:33
RE: Android Shortcuts - by jdig4240 - 2022-01-12, 07:11
RE: Android Shortcuts - by JSAKelley - 2022-01-12, 16:10
RE: Android Shortcuts - by jdig4240 - 2022-01-12, 16:51
RE: Android Shortcuts - by JSAKelley - 2022-01-12, 23:19
Logout Mark Read Team Forum Stats Members Help
[RELEASE] AutoWidget - Let your widgets work for you!1