Welcome, Guest
Please Login or Register.    Lost Password?

[Solved] How to show 'Snooze Items' ?
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: [Solved] How to show 'Snooze Items' ?
#14971
[Solved] How to show 'Snooze Items' ? 3 Years, 6 Months ago  
For example:
At the 'Alarm' window, i set event A to snooze 10 min, event B to snooze 15 min, ...etc.
If on 5 min after, i want to recall the 'Alarm' window to see all snooze items, HOW CAN I DO ?(use lua)
anoob
Platinum Boarder
Posts: 504
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: TaiChung, Taiwan, R.O.C. Birthday: 02/12
Last Edit: 2013/03/06 12:44 By anoob.
The administrator has disabled public write access.
I couldn't speak English! This skin released to Customize.org(Do you want it? Click Picture) Please contact me if interested: jhg5702@gmail.com
 
#14985
Re: How to show 'Snooze Items' ? 3 Years, 6 Months ago  
The snooze times are written to the rainlendar2.ini file into the [AlarmSnoozeTimes] section so you would have to somehow clear that and refresh the calendar.
Rainy
Moderator
Posts: 5991
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#14997
Re: How to show 'Snooze Items' ? 3 Years, 6 Months ago  
Thanks,
It's my code:
Code:


function Hotkey_Wake_Snooze_Item()
  contents = Rainlendar_ReadFile("D:\\Sharware\\Desktop\\Rainlendar2\\rainlendar2.ini")
  _, _, allsnoozeitems = contents:find("%[alarmsnoozetimes%](.-)%[")
  if allsnoozeitems then
    for itemuid in allsnoozeitems:gfind("\n(.-)=.-") do
  if itemuid:find("\\") then
    itemuid = itemuid:gsub("\\","")
   else
itemuid = string.upper(itemuid)
  end
  IcalData = Rainlendar_GetComponent(itemuid)
  if IcalData then
    Rainlendar_SnoozeAlarm(itemuid,1)
  end
    end
Rainlendar_Refresh()
  end
end



a) If [AlarmSnoozeTimes] section is on the bottom of file, this code can not work.
HOW DO I FIX IT ?
b) Are there built-in variables that can get the path of rainlendar2 ? like: #INI_PATH#
anoob
Platinum Boarder
Posts: 504
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: TaiChung, Taiwan, R.O.C. Birthday: 02/12
Last Edit: 2011/04/12 19:47 By anoob.
The administrator has disabled public write access.
I couldn't speak English! This skin released to Customize.org(Do you want it? Click Picture) Please contact me if interested: jhg5702@gmail.com
 
#14998
Re: How to show 'Snooze Items' ? 3 Years, 6 Months ago  
anoob, I think this could help you (but not too much):

Code:

-- GET ALL THE UIDs
  arrayUIDs = Rainlendar_ListAllComponents()
  size = table.getn(arrayUIDs) 
  for i = 1, size do
    -- CHECK EACH ONE IF HAS A SNOOZE TIME
    value = Rainlendar_GetOption("AlarmSnoozeTimes", arrayUIDs[i]) 
    if (value ~= "") then
      -- IF HAS A SNOOZE TIME THEN 
      -- HERE YOU DELETE THE TIME
    end
  end



This works fast is you have few tasks and events. But it you have too much (I don't know how much) maybe this could be slow.
Jorge_Luis
Platinum Boarder
Posts: 795
graphgraph
User Offline Click here to see the profile of this user
Gender: Male My Rainlendar Skins Location: Argentina Birthday: 03/15
The administrator has disabled public write access.
 
#14999
Re: How to show 'Snooze Items' ? 3 Years, 6 Months ago  
Thanks, Jorge_Luis
your code is better.
anoob
Platinum Boarder
Posts: 504
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: TaiChung, Taiwan, R.O.C. Birthday: 02/12
The administrator has disabled public write access.
I couldn't speak English! This skin released to Customize.org(Do you want it? Click Picture) Please contact me if interested: jhg5702@gmail.com
 
Go to topPage: 1
get the latest posts directly to your desktop