rc_lock: lock for rc_lock, use only once, supplement to b0b4b885ed

Origin commit data
------------------
Branch: ni/coolstream
Commit: 9a2d6aea26
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2012-10-22 (Mon, 22 Oct 2012)

Origin message was:
------------------
rc_lock: lock for rc_lock, use only once, supplement to b0b4b885ed

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2012-10-22 15:52:07 +02:00
parent b0b4b885ed
commit bb097d5d95
4 changed files with 16 additions and 9 deletions

View File

@@ -37,6 +37,8 @@
#include "gui/plugins.h"//for relodplugins
#include <neutrino.h>
#include <driver/screenshot.h>
#include "gui/rc_lock.h"
// yhttpd
#include "yhttpd.h"
#include "ytypes_globals.h"
@@ -456,20 +458,17 @@ void CControlAPI::RCCGI(CyhookHandler *hh)
{
if (!(hh->ParamList.empty()))
{
static bool on_off = false;
if (hh->ParamList["1"] == "lock"){ // lock remote control
if(!on_off){
if(!CRCLock::locked){
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::LOCK_RC, CEventServer::INITID_HTTPD);
on_off = true;
}else{
hh->WriteLn("remote is already locked");
return;
}
}
else if (hh->ParamList["1"] == "unlock"){// unlock remote control
if(on_off){
if(CRCLock::locked){
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::UNLOCK_RC, CEventServer::INITID_HTTPD);
on_off = false;
}else{
hh->WriteLn("remote is already unlocked");