summaryrefslogtreecommitdiff
path: root/src/lib/cinema.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-04-24 01:49:09 +0200
committerCarl Hetherington <cth@carlh.net>2024-04-24 19:12:36 +0200
commit401da185ca664fc8d819fc842ffc08e14d4f6486 (patch)
tree5c2ea2d1a7b1b537c04e7e9b3d32c8a44080f168 /src/lib/cinema.cc
parentdbcd1675732d59f6337f7f60d0a39aaa6a1aa3a6 (diff)
Restore time zone to Cinema and improve UI to use it (#2473).
Diffstat (limited to 'src/lib/cinema.cc')
-rw-r--r--src/lib/cinema.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/cinema.cc b/src/lib/cinema.cc
index 6bd063733..b1681fc28 100644
--- a/src/lib/cinema.cc
+++ b/src/lib/cinema.cc
@@ -41,6 +41,18 @@ Cinema::Cinema (cxml::ConstNodePtr node)
for (auto i: node->node_children("Email")) {
emails.push_back (i->content ());
}
+
+ int hour = 0;
+
+ if (node->optional_number_child<int>("UTCOffset")) {
+ hour = node->number_child<int>("UTCOffset");
+ } else {
+ hour = node->optional_number_child<int>("UTCOffsetHour").get_value_or(0);
+ }
+
+ int minute = node->optional_number_child<int>("UTCOffsetMinute").get_value_or(0);
+
+ utc_offset= { hour, minute };
}
/* This is necessary so that we can use shared_from_this in add_screen (which cannot be done from
@@ -65,6 +77,9 @@ Cinema::as_xml (xmlpp::Element* parent) const
cxml::add_text_child(parent, "Notes", notes);
+ cxml::add_text_child(parent, "UTCOffsetHour", raw_convert<string>(utc_offset.hour()));
+ cxml::add_text_child(parent, "UTCOffsetMinute", raw_convert<string>(utc_offset.minute()));
+
for (auto i: _screens) {
i->as_xml(cxml::add_child(parent, "Screen"));
}