Welcome, Guest
Please Login or Register.    Lost Password?

New context menu button?
(1 viewing) (1) Guest
Go to bottomPage: 12345
TOPIC: New context menu button?
#10612
Re:New context menu button? 5 Years, 2 Months ago  
hm damn it. so I can't finish my nice plugin do you think you'll be able to help me with the second one out in the next beta or so? perhaps you could just transmit the date of the date for which the event is clicked as a variable?!
yoodilo
Expert Boarder
Posts: 103
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#10618
Re:New context menu button? 5 Years, 2 Months ago  
Yes, it will be in the next build.
Rainy
Moderator
Posts: 6003
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#10656
Re:New context menu button? 5 Years, 2 Months ago  
Nice thanks! Hope it'll work as I want it to be :>
yoodilo
Expert Boarder
Posts: 103
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#10674
Re:New context menu button? 5 Years, 2 Months ago  
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.
yoodilo
Expert Boarder
Posts: 103
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2009/08/23 02:16 By yoodilo.
The administrator has disabled public write access.
 
#10684
Re:New context menu button? 5 Years, 2 Months ago  
You can add it to the Scripts section in the wiki: wiki.rainlendar.info/index.php?title=Scripts
Rainy
Moderator
Posts: 6003
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#10707
Re:New context menu button? 5 Years, 2 Months ago  
Hey,

ok, thanks. There's still a problem when adding the hidden category (non-recurrent events):

I looked into the ics file and saw that categorie-format is not like:

cat1,cat2,...

but

CATEGORIES:cat1
CATEGORIES:cat2

etc...

So I changed the script:

Code:

function Global_AddCategoryToEvent(strGuid, eventDate)
  strEvent = Rainlendar_GetComponent(strGuid)

  if (strEvent) then
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", "Ausblenden")
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



so that the hidden category "Ausblenden" is being added while keeping existing categories. the strang thing about it: it's the same as when I add an "EXDATE", the existing ones are being kept. but when using this for categories, every category is deleted and there's only the category "ausblenden" and no more...

how to fix it? thanks!
yoodilo
Expert Boarder
Posts: 103
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 12345
get the latest posts directly to your desktop