mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 01:11:06 +02:00
neutrino: add timeout parameter for message via web api
based up patch by FlatTV
see also: http://www.dbox2world.net/board293-coolstream-hd1/board314-coolstream-development/10855-nachrichten-%C3%BCber-das-yweb-mit-variablem-timeout-senden/
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1782 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Commit: c8e76315ce
Author: Thilo Graf <dbt@novatux.de>
Date: 2011-10-28 (Fri, 28 Oct 2011)
Origin message was:
------------------
*neutrino: add timeout parameter for message via web api
based up patch by FlatTV
see also: http://www.dbox2world.net/board293-coolstream-hd1/board314-coolstream-development/10855-nachrichten-%C3%BCber-das-yweb-mit-variablem-timeout-senden/
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1782 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -3023,18 +3023,27 @@ _repeat:
|
||||
fclose(f);
|
||||
ExitRun(true);
|
||||
}
|
||||
else if (msg == NeutrinoMessages::EVT_POPUP) {
|
||||
if (mode != mode_scart)
|
||||
ShowHintUTF(LOCALE_MESSAGEBOX_INFO, (const char *) data); // UTF-8
|
||||
else if (msg == NeutrinoMessages::EVT_POPUP || msg == NeutrinoMessages::EVT_EXTMSG) {
|
||||
if (mode != mode_scart) {
|
||||
std::string timeout="-1";
|
||||
std::string text = (char*)data;
|
||||
std::string::size_type pos;
|
||||
|
||||
pos = text.find("&timeout=", 0);
|
||||
if (pos != std::string::npos) {
|
||||
timeout = text.substr( pos+9, text.length()+1 );
|
||||
text[pos] = '\0';
|
||||
}
|
||||
|
||||
if (msg == NeutrinoMessages::EVT_POPUP)
|
||||
ShowHintUTF(LOCALE_MESSAGEBOX_INFO, text.c_str(), NULL, atoi(timeout.c_str())); // UTF-8
|
||||
else if (msg == NeutrinoMessages::EVT_EXTMSG)
|
||||
ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, text, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO, NULL, atoi(timeout.c_str())); // UTF-8
|
||||
|
||||
}
|
||||
delete (unsigned char*) data;
|
||||
return messages_return::handled;
|
||||
}
|
||||
else if (msg == NeutrinoMessages::EVT_EXTMSG) {
|
||||
if (mode != mode_scart)
|
||||
ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, (const char *) data, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8
|
||||
delete[] (unsigned char*) data;
|
||||
return messages_return::handled;
|
||||
}
|
||||
else if (msg == NeutrinoMessages::EVT_RECORDING_ENDED) {
|
||||
/* FIXME TODO, when/if needed, monitor record status somewhere
|
||||
* and report possible error to user if any with this message ?
|
||||
|
@@ -1048,12 +1048,16 @@ Neutrino opens a pop up (popup) or message (nmsg) window in which the<br>
|
||||
text part of the parameter is displayed. A pop up window closes<br>
|
||||
itself after a few seconds whereas a message window must be closed<br>
|
||||
using the remote control.<br>
|
||||
To change the time, after the window closes automaticly, use the parameter "timeout"<br>
|
||||
<div class="example">
|
||||
Examples:<br>
|
||||
<br>
|
||||
>>>http://dbox/control/message?popup=Hello%20World<br>
|
||||
opens a popup window on the TV screen with content "Hello World"<br>
|
||||
<br>
|
||||
>>>http://dbox/control/message?popup=Hello%20World&timeout=30<br>
|
||||
opens a popup window on the TV screen with content "Hello World". The window closes automaticly after 30 seconds.<br>
|
||||
<br>
|
||||
>>>http://dbox/control/message?nmsg=Hello%20Welt<br>
|
||||
opens a message window on the TV screen with content "Hello World"<br>
|
||||
</div>
|
||||
@@ -1090,12 +1094,17 @@ Neutrino oeffnet ein Popup(popup)- oder Message(nmsg)-Fenster, in dem<br>
|
||||
der Text des Parameters dargestellt wird. Ein Popupfenster schliesst<br>
|
||||
sich nach wenigen Sekunden selbst, wohingegen ein Message-Fenster mit<br>
|
||||
der Fernbedienung geschlossen werden muss.<br>
|
||||
Um die Zeit zu <20>ndern, wie lange das Fenster ge<67>ffnet bleiben soll,<br>
|
||||
kann der Parameter "timeout" angegeben werden.<br>
|
||||
<div class="example">
|
||||
Beispiele:<br>
|
||||
<br>
|
||||
>>>http://dbox/control/message?popup=Hallo%20World<br>
|
||||
<EFBFBD>ffnet ein Popup-Fenster auf dem Fernseher, in dem "Hallo World" steht<br>
|
||||
<br>
|
||||
>>>http://dbox/control/message?popup=Hallo%20World&timeout=30<br>
|
||||
<EFBFBD>ffnet ein Popup-Fenster auf dem Fernseher, in dem "Hallo World" steht und sich nach 30 Sekunden schlie<69>t.<br>
|
||||
<br>
|
||||
>>>http://dbox/control/message?nmsg=Hallo%20Welt<br>
|
||||
<EFBFBD>ffnet ein Message-Fenster auf dem Fernseher, in dem "Hallo Welt" steht<br>
|
||||
</div>
|
||||
|
@@ -546,6 +546,12 @@ void CControlAPI::MessageCGI(CyhookHandler *hh)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(hh->ParamList["timeout"].empty()))
|
||||
{
|
||||
message += "&timeout=";
|
||||
message += hh->ParamList["timeout"];
|
||||
}
|
||||
|
||||
if (event != 0)
|
||||
{
|
||||
message=decodeString(message);
|
||||
|
Reference in New Issue
Block a user