*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:
thilo
2011-10-28 21:57:23 +00:00
parent b265df5204
commit c8e76315ce
3 changed files with 33 additions and 9 deletions

View File

@@ -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 ?