2023-09-28 Fred Gleason <fredg@paravelsystems.com>

* Added a 'RDJsonEscape(const QString &str)' function in
	'lib/rdweb.cpp' and 'lib/rdweb.h'.
	* Added a '--dump-panel-updates' switch to rdpanel(1).
	* Added a rdpanel(1) man page.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2023-09-28 15:51:08 -04:00
parent 4e48d86522
commit 5118c36219
14 changed files with 302 additions and 7 deletions

View File

@@ -323,6 +323,45 @@ int RDPanelButton::duckVolume() const
}
bool RDPanelButton::isEmpty() const
{
return button_cart==0;
}
QString RDPanelButton::json(int padding,bool final)
{
QString ret;
ret+=RDJsonPadding(padding)+"\"button\": {\r\n";
ret+=RDJsonField("column",button_col,4+padding);
ret+=RDJsonField("row",button_row,4+padding);
if(isEmpty()) {
ret+=RDJsonNullField("cart",4+padding);
ret+=RDJsonNullField("defaultColor",4+padding);
ret+=RDJsonNullField("length",4+padding);
ret+=RDJsonNullField("hookLength",4+padding);
ret+=RDJsonNullField("label",4+padding,true);
}
else {
ret+=RDJsonField("cart",button_cart,4+padding);
ret+=RDJsonField("defaultColor",button_default_color.name(),4+padding);
ret+=RDJsonField("length",RDGetTimeLength(button_length[0],true,false),
4+padding);
ret+=RDJsonField("hookLength",RDGetTimeLength(button_length[1],true,false),
4+padding);
ret+=RDJsonField("label",button_text,4+padding,true);
}
ret+=RDJsonPadding(padding)+"}";
if(!final) {
ret+=",";
}
ret+="\r\n";
return ret;
}
void RDPanelButton::tickClock()
{
int msecs;