diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 024f7cca0..2507faa68 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -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 ? diff --git a/src/nhttpd/doc/nhttpd_controlapi.html b/src/nhttpd/doc/nhttpd_controlapi.html index 74b8344ff..296145147 100644 --- a/src/nhttpd/doc/nhttpd_controlapi.html +++ b/src/nhttpd/doc/nhttpd_controlapi.html @@ -1048,12 +1048,16 @@ Neutrino opens a pop up (popup) or message (nmsg) window in which the
text part of the parameter is displayed. A pop up window closes
itself after a few seconds whereas a message window must be closed
using the remote control.
+To change the time, after the window closes automaticly, use the parameter "timeout"
Examples:

>>>http://dbox/control/message?popup=Hello%20World
opens a popup window on the TV screen with content "Hello World"

+>>>http://dbox/control/message?popup=Hello%20World&timeout=30
+opens a popup window on the TV screen with content "Hello World". The window closes automaticly after 30 seconds.
+
>>>http://dbox/control/message?nmsg=Hello%20Welt
opens a message window on the TV screen with content "Hello World"
@@ -1090,12 +1094,17 @@ Neutrino oeffnet ein Popup(popup)- oder Message(nmsg)-Fenster, in dem
der Text des Parameters dargestellt wird. Ein Popupfenster schliesst
sich nach wenigen Sekunden selbst, wohingegen ein Message-Fenster mit
der Fernbedienung geschlossen werden muss.
+Um die Zeit zu ändern, wie lange das Fenster geöffnet bleiben soll,
+kann der Parameter "timeout" angegeben werden.
Beispiele:

>>>http://dbox/control/message?popup=Hallo%20World
öffnet ein Popup-Fenster auf dem Fernseher, in dem "Hallo World" steht

+>>>http://dbox/control/message?popup=Hallo%20World&timeout=30
+öffnet ein Popup-Fenster auf dem Fernseher, in dem "Hallo World" steht und sich nach 30 Sekunden schließt.
+
>>>http://dbox/control/message?nmsg=Hallo%20Welt
öffnet ein Message-Fenster auf dem Fernseher, in dem "Hallo Welt" steht
diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 365f7f8a1..c90687242 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -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);