summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-03-15 19:34:27 +0000
committerCarl Hetherington <cth@carlh.net>2014-03-15 19:34:27 +0000
commit9c04891e53ef3f0693a91ca6f50f0e6625c109eb (patch)
treeaf061bb16659b0b822681ae454577c9ceb2e7bc4
parent400feca360a5b39c05959f0fdc2d0fe847090972 (diff)
Fix KDM dialog to initialise its time period to a week from now.
-rw-r--r--ChangeLog5
-rw-r--r--src/wx/kdm_dialog.cc15
2 files changed, 15 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 0abedf5b1..f42277184 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-03-15 Carl Hetherington <cth@carlh.net>
+
+ * Fix KDM dialog to predictably set up its initial range to
+ a week from now.
+
2014-03-12 Carl Hetherington <cth@carlh.net>
* Hopefully fix i18n on OS X (#324).
diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc
index 5410f6cec..7d136955c 100644
--- a/src/wx/kdm_dialog.cc
+++ b/src/wx/kdm_dialog.cc
@@ -83,15 +83,20 @@ KDMDialog::KDMDialog (wxWindow* parent, boost::shared_ptr<const Film> film)
wxFlexGridSizer* table = new wxFlexGridSizer (3, 2, 6);
add_label_to_sizer (table, this, _("From"), true);
- _from_date = new wxDatePickerCtrl (this, wxID_ANY);
+ wxDateTime from;
+ from.SetToCurrent ();
+ _from_date = new wxDatePickerCtrl (this, wxID_ANY, from);
table->Add (_from_date, 1, wxEXPAND);
- _from_time = new wxTimePickerCtrl (this, wxID_ANY);
+ _from_time = new wxTimePickerCtrl (this, wxID_ANY, from);
table->Add (_from_time, 1, wxEXPAND);
-
+
add_label_to_sizer (table, this, _("Until"), true);
- _until_date = new wxDatePickerCtrl (this, wxID_ANY);
+ wxDateTime to = from;
+ /* 1 week from now */
+ to.Add (wxDateSpan (0, 0, 1, 0));
+ _until_date = new wxDatePickerCtrl (this, wxID_ANY, to);
table->Add (_until_date, 1, wxEXPAND);
- _until_time = new wxTimePickerCtrl (this, wxID_ANY);
+ _until_time = new wxTimePickerCtrl (this, wxID_ANY, to);
table->Add (_until_time, 1, wxEXPAND);
vertical->Add (table, 0, wxEXPAND | wxALL, 6);