diff options
author | deva <deva> | 2009-02-11 07:14:22 +0000 |
---|---|---|
committer | deva <deva> | 2009-02-11 07:14:22 +0000 |
commit | 4df8884f155f7558c07949426c248e066df7936f (patch) | |
tree | 61030bad443e366b8fb0e097200693ab56df01c4 /server/src/widgetgenerator.cc | |
parent | bbe2b5f899a9c1bd7c99181f8702ec03c60f3028 (diff) |
Added QueryHandler for both Pentominos and Pracro. Added source string to all values, and use these to set the prefill value in the macros.
Diffstat (limited to 'server/src/widgetgenerator.cc')
-rw-r--r-- | server/src/widgetgenerator.cc | 8 |
1 files changed, 5 insertions, 3 deletions
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")); |