summaryrefslogtreecommitdiff
path: root/src/wx/kdm_dialog.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-01-10 21:54:45 +0000
committerCarl Hetherington <cth@carlh.net>2013-01-10 21:54:45 +0000
commit0b45af42b5a30c3a71d2e1de491843d125e46793 (patch)
tree8b7e55d9f8ab53cb115c56779bd4e1df23ba6b62 /src/wx/kdm_dialog.cc
parent6bfdd0f45927a4dfecf10e851b1902a899de5aa2 (diff)
Fixes to times for KDMs.
Diffstat (limited to 'src/wx/kdm_dialog.cc')
-rw-r--r--src/wx/kdm_dialog.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc
index 43d904d90..0febdf38e 100644
--- a/src/wx/kdm_dialog.cc
+++ b/src/wx/kdm_dialog.cc
@@ -329,7 +329,7 @@ KDMDialog::screens () const
list<pair<wxTreeItemId, shared_ptr<Cinema> > > cinemas = selected_cinemas ();
for (list<pair<wxTreeItemId, shared_ptr<Cinema> > >::iterator i = cinemas.begin(); i != cinemas.end(); ++i) {
- for (list<Screen>::iterator j = i->second->screens.begin(); j != i->second->screens.end(); ++j) {
+ for (list<shared_ptr<Screen> >::iterator j = i->second->screens.begin(); j != i->second->screens.end(); ++j) {
s.push_back (*j);
}
}
@@ -340,21 +340,32 @@ KDMDialog::screens () const
}
s.sort ();
- s.uniq ();
+ s.unique ();
return s;
}
-boost::locale::date_time
+boost::posix_time::ptime
KDMDialog::from () const
{
+ return posix_time (_from_date, _from_time);
+}
+boost::posix_time::ptime
+KDMDialog::posix_time (wxDatePickerCtrl* date_picker, wxTimePickerCtrl* time_picker)
+{
+ wxDateTime const date = date_picker->GetValue ();
+ wxDateTime const time = time_picker->GetValue ();
+ return boost::posix_time::ptime (
+ boost::gregorian::date (date.GetYear(), date.GetMonth() + 1, date.GetDay()),
+ boost::posix_time::time_duration (time.GetHour(), time.GetMinute(), time.GetSecond())
+ );
}
-boost::locale::date_time
+boost::posix_time::ptime
KDMDialog::until () const
{
-
+ return posix_time (_until_date, _until_time);
}
string