diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-05-20 22:51:49 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-05-06 20:42:50 +0200 |
| commit | a3fcbb3a76e079a5485a0552ea5d35b8d6739116 (patch) | |
| tree | 58f6476b7197c0e32b5aa3d52d0859a9b04db268 /src/wx/load_config_from_zip_dialog.cc | |
| parent | a4105c6e8dc83407abc9b12e80c958673c942888 (diff) | |
Use sqlite for cinema and DKDM recipient lists.
Diffstat (limited to 'src/wx/load_config_from_zip_dialog.cc')
| -rw-r--r-- | src/wx/load_config_from_zip_dialog.cc | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/wx/load_config_from_zip_dialog.cc b/src/wx/load_config_from_zip_dialog.cc new file mode 100644 index 000000000..a7d573ded --- /dev/null +++ b/src/wx/load_config_from_zip_dialog.cc @@ -0,0 +1,59 @@ +/* + Copyright (C) 2024 Carl Hetherington <cth@carlh.net> + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>. + +*/ + + +#include "load_config_from_zip_dialog.h" +#include "wx_util.h" +#include "lib/config.h" +#include "lib/unzipper.h" + + +LoadConfigFromZIPDialog::LoadConfigFromZIPDialog(wxWindow* parent, boost::filesystem::path zip_file) + : TableDialog(parent, _("Load configuration from ZIP file"), 1, 0, true) +{ + _use_current = add(new wxRadioButton(this, wxID_ANY, _("Copy the cinemas in the ZIP file over the current list at"))); + auto current_path = add(new wxStaticText(this, wxID_ANY, std_to_wx(Config::instance()->cinemas_file().string()))); + auto current_path_font = current_path->GetFont(); + current_path_font.SetFamily(wxFONTFAMILY_TELETYPE); + current_path->SetFont(current_path_font); + + _use_zip = add(new wxRadioButton(this, wxID_ANY, _("Copy the cinemas in the ZIP file to the original location at"))); + auto zip_path = add(new wxStaticText(this, wxID_ANY, std_to_wx(Config::cinemas_file_from_zip(zip_file).string()))); + auto zip_path_font = zip_path->GetFont(); + zip_path_font.SetFamily(wxFONTFAMILY_TELETYPE); + zip_path->SetFont(zip_path_font); + + _ignore = add(new wxRadioButton(this, wxID_ANY, _("Do not use the cinemas in the ZIP file"))); + + layout(); +} + + +Config::CinemasAction +LoadConfigFromZIPDialog::action() const +{ + if (_use_current->GetValue()) { + return Config::CinemasAction::WRITE_TO_CURRENT_PATH; + } else if (_use_zip->GetValue()) { + return Config::CinemasAction::WRITE_TO_PATH_IN_ZIPPED_CONFIG; + } + + return Config::CinemasAction::IGNORE; +} |
