Thanks so far. But this doesn't work:
| Code: |
function Global_AddCategoryToEvent(strGuid, eventDate)
strEvent = Rainlendar_GetComponent(strGuid)
if (strEvent) then
-- Something to do here:
cats = Private_GetIcalProperty(strEvent, "CATEGORIES")..",Ausblenden"
prule = Private_GetIcalProperty(strEvent, "RRULE")
if(prule) then
-- if the event is recurrent -> add date of day to ignore-list
strEvent = Private_SetIcalProperty(strEvent, "EXDATE", eventDate)
else
-- else -> add hidden category
strEvent = Private_SetIcalProperty(strEvent, "CATEGORIES", cats)
end
Rainlendar_UpdateComponent(strEvent)
bChanges = Rainlendar_FlushComponents()
if (bChanges == true) then
-- Redraw the windows if there were changes that need to be shown
Rainlendar_Redraw(1)
end
end
end
|
it only works for non recurrent items. This is how I call it from xml/eventlist.xml as <item>:
| Code: |
<button element="bitmap.todo.item" origin="TOP-LEFT" x="0" y="0" action="Global_AddCategoryToEvent('#GUID#', '#DATE#')" tooltip="Mark done" />
|
the strange thing is: first I wrote as tooltip "mark done (add hidden category)", and when I now hover the button, I still read it instead of only "Mark done" as written in the code. So my though is, that the skin perhaps doesn't get re-read and so, the button still calls my Global_AddCategoryToEvent-Function e´without the second parameter #DATE# and thus it doesn't work...
Hope you can clear things up

thanks
Edit: My suggestion works quite good now

I worked in the wrong directory and that's also why the tooltip wasn't changed since I did edit the right skin from the wrong directory (an rainlendar backup^^).
thanks!
ifn you like the script (I like it), it would be awesome if you include it or make it available for others

feel free to do so. but than please add my homepage to the author list.