/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
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);
}
}
- table = new wxFlexGridSizer (3, 2, 6);
+ table = new wxFlexGridSizer (2, 2, 6);
_write_to = new wxRadioButton (this, wxID_ANY, _("Write to"));
table->Add (_write_to, 1, wxEXPAND);
#ifdef DCPOMATIC_USE_OWN_DIR_PICKER
_folder = new DirPickerCtrl (this);
#else
- _folder = new wxDirPickerCtrl (this, wxID_ANY);
+ _folder = new wxDirPickerCtrl (this, wxID_ANY, wxEmptyString, wxDirSelectorPromptStr, wxDefaultPosition, wxSize (300, -1));
#endif
_folder->SetPath (wxStandardPaths::Get().GetDocumentsDir());
table->Add (_folder, 1, wxEXPAND);
- table->AddSpacer (0);
_email = new wxRadioButton (this, wxID_ANY, _("Send by email"));
table->Add (_email, 1, wxEXPAND);
vertical->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
}
+ _write_to->SetValue (true);
+
_targets->Bind (wxEVT_COMMAND_TREE_SEL_CHANGED, boost::bind (&KDMDialog::setup_sensitivity, this));
_add_cinema->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&KDMDialog::add_cinema_clicked, this));
Config::instance()->add_cinema (c);
add_cinema (c);
- Config::instance()->write ();
-
d->Destroy ();
}
c.second->email = d->email ();
_targets->SetItemText (c.first, std_to_wx (d->name()));
- Config::instance()->write ();
+ Config::instance()->changed ();
d->Destroy ();
}
Config::instance()->remove_cinema (c.second);
_targets->Delete (c.first);
-
- Config::instance()->write ();
}
void
c->add_screen (s);
add_screen (c, s);
- Config::instance()->write ();
+ Config::instance()->changed ();
d->Destroy ();
}
s.second->certificate = d->certificate ();
_targets->SetItemText (s.first, std_to_wx (d->name()));
- Config::instance()->write ();
+ Config::instance()->changed ();
d->Destroy ();
}
i->second->remove_screen (s.second);
_targets->Delete (s.first);
- Config::instance()->write ();
+ Config::instance()->changed ();
}
list<shared_ptr<Screen> >