#include "check_box.h"
#include "confirm_kdm_email_dialog.h"
#include "dcpomatic_button.h"
+#include "dcpomatic_choice.h"
#include "extra_kdm_email_dialog.h"
#include "kdm_advanced_dialog.h"
#include "kdm_choice.h"
_folder->SetPath(wxStandardPaths::Get().GetDocumentsDir());
}
- _write_flat = new wxRadioButton(parent, wxID_ANY, _("Write all KDMs to the same folder"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
- _write_folder = new wxRadioButton(parent, wxID_ANY, _("Write a folder for each cinema's KDMs"));
- _write_zip = new wxRadioButton(parent, wxID_ANY, _("Write a ZIP file for each cinema's KDMs"));
+ _write_collect = new Choice(parent);
+ _write_collect->add_entry(_("Write all KDMs to the same folder"));
+ _write_collect->add_entry(_("Write a folder for each cinema's KDMs"));
+ _write_collect->add_entry(_("Write a ZIP file for each cinema's KDMs"));
_email = new CheckBox(parent, _("Send by email"));
_add_email_addresses = new wxButton(parent, wxID_ANY, _("Set additional email addresses..."));
switch (Config::instance()->last_kdm_write_type().get_value_or(Config::KDM_WRITE_FLAT)) {
case Config::KDM_WRITE_FLAT:
- _write_flat->SetValue(true);
+ _write_collect->set(0);
break;
case Config::KDM_WRITE_FOLDER:
- _write_folder->SetValue(true);
+ _write_collect->set(1);
break;
case Config::KDM_WRITE_ZIP:
- _write_zip->SetValue(true);
+ _write_collect->set(2);
break;
}
_write_to->bind(&KDMOutputPanel::write_to_changed, this);
_email->bind(&KDMOutputPanel::email_changed, this);
_add_email_addresses->Bind(wxEVT_BUTTON, boost::bind(&KDMOutputPanel::add_email_addresses_clicked, this));
- _write_flat->Bind (wxEVT_RADIOBUTTON, boost::bind (&KDMOutputPanel::kdm_write_type_changed, this));
- _write_folder->Bind (wxEVT_RADIOBUTTON, boost::bind (&KDMOutputPanel::kdm_write_type_changed, this));
- _write_zip->Bind (wxEVT_RADIOBUTTON, boost::bind (&KDMOutputPanel::kdm_write_type_changed, this));
+ _write_collect->bind(&KDMOutputPanel::kdm_write_type_changed, this);
}
{
bool const write = _write_to->GetValue ();
_folder->Enable (write);
- _write_flat->Enable (write);
- _write_folder->Enable (write);
- _write_zip->Enable (write);
+ _write_collect->Enable(write);
}
void
KDMOutputPanel::kdm_write_type_changed ()
{
- if (_write_flat->GetValue()) {
- Config::instance()->set_last_kdm_write_type (Config::KDM_WRITE_FLAT);
- } else if (_write_folder->GetValue()) {
- Config::instance()->set_last_kdm_write_type (Config::KDM_WRITE_FOLDER);
- } else if (_write_zip->GetValue()) {
- Config::instance()->set_last_kdm_write_type (Config::KDM_WRITE_ZIP);
+ switch (_write_collect->get().get_value_or(0)) {
+ case 0:
+ Config::instance()->set_last_kdm_write_type(Config::KDM_WRITE_FLAT);
+ break;
+ case 1:
+ Config::instance()->set_last_kdm_write_type(Config::KDM_WRITE_FOLDER);
+ break;
+ case 2:
+ Config::instance()->set_last_kdm_write_type(Config::KDM_WRITE_ZIP);
+ break;
}
}
try {
if (_write_to->GetValue()) {
- if (_write_flat->GetValue()) {
+ switch (_write_collect->get().get_value_or(0)) {
+ case 0:
written = write_files (
kdms,
directory(),
_filename_format->get(),
confirm_overwrite
);
- } else if (_write_folder->GetValue()) {
+ break;
+ case 1:
written = write_directories (
collect (kdms),
directory(),
_filename_format->get(),
confirm_overwrite
);
- } else if (_write_zip->GetValue()) {
+ break;
+ case 2:
written = write_zip_files (
collect (kdms),
directory(),
_filename_format->get(),
confirm_overwrite
);
+ break;
}
}
#include "check_box.h"
+#include "dcpomatic_choice.h"
#include "kdm_choice.h"
#include "name_format_editor.h"
#include "short_kdm_output_panel.h"
auto table = new wxFlexGridSizer(2, DCPOMATIC_SIZER_X_GAP, 0);
table->AddGrowableCol(1);
- table->Add(_write_to, 1, wxEXPAND);
+ table->Add(_write_to, 1, wxEXPAND | wxLEFT);
table->Add(_folder, 1, wxEXPAND);
- auto write_options = new wxBoxSizer(wxVERTICAL);
- write_options->Add(_write_flat, 1, wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
- write_options->Add(_write_folder, 1, wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
- write_options->Add(_write_zip, 1, wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
- table->AddSpacer(0);
- table->Add(write_options);
+ add_label_to_sizer(table, panel, _("Collection"), true, 0, wxALIGN_CENTRE_VERTICAL | wxLEFT | wxRIGHT);
+ table->Add(_write_collect, 1, wxEXPAND);
table->Add(_email, 1, wxEXPAND);
table->Add(_add_email_addresses);
#include "check_box.h"
#include "confirm_kdm_email_dialog.h"
#include "dcpomatic_button.h"
+#include "dcpomatic_choice.h"
#include "extra_kdm_email_dialog.h"
#include "kdm_advanced_dialog.h"
#include "kdm_choice.h"
table->Add (align, 0, wxTOP | wxRIGHT | wxALIGN_TOP, DCPOMATIC_SIZER_GAP);
#endif
table->Add (_filename_format->panel(), 1, wxEXPAND);
- table->Add (_write_to, 1, wxEXPAND);
+ table->Add (_write_to, 1, wxEXPAND | wxLEFT);
table->Add (_folder, 1, wxEXPAND);
- auto write_options = new wxBoxSizer(wxVERTICAL);
- write_options->Add (_write_flat, 1, wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
- write_options->Add (_write_folder, 1, wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
- write_options->Add (_write_zip, 1, wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
- table->AddSpacer (0);
- table->Add (write_options);
+ add_label_to_sizer(table, this, _("Collection"), true, 0, wxALIGN_CENTRE_VERTICAL | wxLEFT | wxRIGHT);
+ table->Add(_write_collect, 1, wxEXPAND);
table->Add (_email, 1, wxEXPAND);
table->Add (_add_email_addresses);