--
-- DO NOT EDIT THIS FILE. IT WILL BE OVERWRITTEN WHEN YOU UPGRADE RAINLENDAR!
-- If you want to add new hotkeys put the scripts to another file and prefix
-- the functions with "Hotkey_".
--
-- When the hotkey is displayed in the options window the "Hotkey_"-prefix is 
-- stripped from string as well as all '_'-chars. The names of the hotkeys can
-- also be localized.
--

function Hotkey_Current_Month()
  Global_ShowMonth("0")
end

function Hotkey_Next_Month()
  Global_ShowMonth("+1")
end

function Hotkey_Previous_Month()
  Global_ShowMonth("-1")
end

function Hotkey_Hide_Windows()
  local listWindows = Rainlendar_GetWindows()
  for key, value in pairs(listWindows) do
    Rainlendar_HideWindow(value)
  end
end

function Hotkey_Show_Windows()
  local listWindows = Rainlendar_GetWindows()
  for key, value in pairs(listWindows) do
    Rainlendar_ShowWindow(value)
  end
end

function Hotkey_Toggle_Windows()
  local visible = false
  listWindows = Rainlendar_GetWindows()
  for key, value in pairs(listWindows) do
    visible = visible or Rainlendar_IsWindowVisible(value)
  end
  
  if visible then
    Hotkey_Hide_Windows()
  else
    Hotkey_Show_Windows()
  end
end

function Hotkey_Toggle_Today_Window()
  local visible = Rainlendar_IsWindowVisible("Today")
  if visible then
    Rainlendar_HideWindow("Today")
  else
    Rainlendar_ShowWindow("Today")
  end
end

function Hotkey_Refresh()
  Rainlendar_Refresh()
end

function Hotkey_Create_New_Task()
  Rainlendar_OpenDialog("Todo")
end

function Hotkey_Create_New_Event()
  Rainlendar_OpenDialog("Event")
end

function Hotkey_Manager()
  Rainlendar_OpenDialog("Manager")
end

function Hotkey_Options()
  Rainlendar_OpenDialog("Options")
end

function Hotkey_Quit_Application()
  Rainlendar_QuitApplication()
end

function Hotkey_Backup()
  Rainlendar_Backup("")
end
