From 4df8884f155f7558c07949426c248e066df7936f Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 11 Feb 2009 07:14:22 +0000 Subject: Added QueryHandler for both Pentominos and Pracro. Added source string to all values, and use these to set the prefill value in the macros. --- server/src/widgetgenerator.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'server/src/widgetgenerator.cc') diff --git a/server/src/widgetgenerator.cc b/server/src/widgetgenerator.cc index 2e51b32..90d2b9e 100644 --- a/server/src/widgetgenerator.cc +++ b/server/src/widgetgenerator.cc @@ -40,20 +40,22 @@ static std::string automap(std::string name) if(name[i] == '.') groupcheck += " and " + group; else groupcheck += name[i]; } - groupcheck += " and " + name + ".value and " + name + ".timestamp"; + groupcheck += " and " + name + ".value and " + name + ".timestamp and " + name + ".source"; groupcheck += ")\n"; std::string automapstring = "-- Returning 0, 0 invalidates the result\n" "value = 0\n" "timestamp = 0\n" + "source = 0\n" "\n" + groupcheck + "then\n" " value = " + name + ".value\n" " timestamp = " + name + ".timestamp\n" + " source = " + name + ".source\n" "end\n" - "return value, timestamp\n"; + "return value, timestamp, source\n"; PRACRO_DEBUG(widget, "Automap:\n%s\n", automapstring.c_str()); @@ -99,7 +101,7 @@ static std::string send_macro_widget(Macro ¯o, if(value.timestamp > time(NULL) - Conf::pentominos_max_ttl) { widget.attributes["value"] = xml_encode(value.value); timestamp = value.timestamp; - prefilled = "pentominos"; + prefilled = xml_encode(value.source); } } // widget.attributes.erase(widget.attributes.find("map")); -- cgit v1.2.3