summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-04-27 01:50:00 +0100
committerCarl Hetherington <cth@carlh.net>2016-04-29 22:51:18 +0100
commit068291b7233b01573863d7fb5eda2a82883c748d (patch)
tree1bca551006315fd234b2408e1be47fcd2970916d /src/wx
parent1863fff137bda1c0d3702a845cc79afbfc8c74c4 (diff)
Add free-text notes field to cinemas and screens.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/cinema_dialog.cc13
-rw-r--r--src/wx/cinema_dialog.h5
-rw-r--r--src/wx/screen_dialog.cc15
-rw-r--r--src/wx/screen_dialog.h3
-rw-r--r--src/wx/screens_panel.cc8
5 files changed, 38 insertions, 6 deletions
diff --git a/src/wx/cinema_dialog.cc b/src/wx/cinema_dialog.cc
index df56b9cbe..debc06795 100644
--- a/src/wx/cinema_dialog.cc
+++ b/src/wx/cinema_dialog.cc
@@ -37,7 +37,7 @@ column (string s)
return s;
}
-CinemaDialog::CinemaDialog (wxWindow* parent, wxString title, string name, list<string> emails, int utc_offset_hour, int utc_offset_minute)
+CinemaDialog::CinemaDialog (wxWindow* parent, wxString title, string name, list<string> emails, string notes, int utc_offset_hour, int utc_offset_minute)
: wxDialog (parent, wxID_ANY, title)
{
wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
@@ -56,6 +56,11 @@ CinemaDialog::CinemaDialog (wxWindow* parent, wxString title, string name, list<
sizer->Add (_utc_offset, wxGBPosition (r, 1));
++r;
+ add_label_to_sizer (sizer, this, _("Notes"), true, wxGBPosition (r, 0));
+ _notes = new wxTextCtrl (this, wxID_ANY, std_to_wx (notes), wxDefaultPosition, wxSize (500, -1));
+ sizer->Add (_notes, wxGBPosition (r, 1));
+ ++r;
+
add_label_to_sizer (sizer, this, _("Email addresses for KDM delivery"), false, wxGBPosition (r, 0), wxGBSpan (1, 2));
++r;
@@ -166,3 +171,9 @@ CinemaDialog::utc_offset_minute () const
return _offsets[sel].minute;
}
+
+string
+CinemaDialog::notes () const
+{
+ return wx_to_std (_notes->GetValue ());
+}
diff --git a/src/wx/cinema_dialog.h b/src/wx/cinema_dialog.h
index 187bd11f2..7323f7889 100644
--- a/src/wx/cinema_dialog.h
+++ b/src/wx/cinema_dialog.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2016 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
@@ -32,11 +32,13 @@ public:
wxString,
std::string name = "",
std::list<std::string> emails = std::list<std::string> (),
+ std::string notes = "",
int utc_offset_hour = 0,
int utc_offset_minute = 0
);
std::string name () const;
+ std::string notes () const;
std::list<std::string> emails () const;
int utc_offset_hour () const;
int utc_offset_minute () const;
@@ -46,6 +48,7 @@ private:
void set_emails (std::vector<std::string>);
wxTextCtrl* _name;
+ wxTextCtrl* _notes;
EditableList<std::string, EmailDialog>* _email_list;
std::vector<std::string> _emails;
wxChoice* _utc_offset;
diff --git a/src/wx/screen_dialog.cc b/src/wx/screen_dialog.cc
index ddedb71ec..5afb50a2a 100644
--- a/src/wx/screen_dialog.cc
+++ b/src/wx/screen_dialog.cc
@@ -50,7 +50,9 @@ public:
}
};
-ScreenDialog::ScreenDialog (wxWindow* parent, wxString title, string name, optional<dcp::Certificate> recipient, vector<dcp::Certificate> trusted_devices)
+ScreenDialog::ScreenDialog (
+ wxWindow* parent, wxString title, string name, string notes, optional<dcp::Certificate> recipient, vector<dcp::Certificate> trusted_devices
+ )
: wxDialog (parent, wxID_ANY, title)
, _recipient (recipient)
, _trusted_devices (trusted_devices)
@@ -66,6 +68,11 @@ ScreenDialog::ScreenDialog (wxWindow* parent, wxString title, string name, optio
_sizer->Add (_name, wxGBPosition (r, 1));
++r;
+ add_label_to_sizer (_sizer, this, _("Notes"), true, wxGBPosition (r, 0));
+ _notes = new wxTextCtrl (this, wxID_ANY, std_to_wx (notes), wxDefaultPosition, wxSize (320, -1));
+ _sizer->Add (_notes, wxGBPosition (r, 1));
+ ++r;
+
wxClientDC dc (this);
wxFont font = _name->GetFont ();
font.SetFamily (wxFONTFAMILY_TELETYPE);
@@ -127,6 +134,12 @@ ScreenDialog::name () const
return wx_to_std (_name->GetValue());
}
+string
+ScreenDialog::notes () const
+{
+ return wx_to_std (_notes->GetValue());
+}
+
optional<dcp::Certificate>
ScreenDialog::recipient () const
{
diff --git a/src/wx/screen_dialog.h b/src/wx/screen_dialog.h
index 5b786f6c1..6740b35a3 100644
--- a/src/wx/screen_dialog.h
+++ b/src/wx/screen_dialog.h
@@ -33,11 +33,13 @@ public:
wxWindow *,
wxString,
std::string name = "",
+ std::string notes = "",
boost::optional<dcp::Certificate> c = boost::optional<dcp::Certificate> (),
std::vector<dcp::Certificate> d = std::vector<dcp::Certificate> ()
);
std::string name () const;
+ std::string notes () const;
boost::optional<dcp::Certificate> recipient () const;
std::vector<dcp::Certificate> trusted_devices () {
return _trusted_devices;
@@ -56,6 +58,7 @@ private:
wxGridBagSizer* _sizer;
wxTextCtrl* _name;
+ wxTextCtrl* _notes;
wxStaticText* _recipient_thumbprint;
wxButton* _get_recipient_from_file;
wxButton* _download_recipient;
diff --git a/src/wx/screens_panel.cc b/src/wx/screens_panel.cc
index 8eb8ba670..03c07e1c8 100644
--- a/src/wx/screens_panel.cc
+++ b/src/wx/screens_panel.cc
@@ -148,7 +148,7 @@ ScreensPanel::add_cinema_clicked ()
{
CinemaDialog* d = new CinemaDialog (this, _("Add Cinema"));
if (d->ShowModal () == wxID_OK) {
- shared_ptr<Cinema> c (new Cinema (d->name(), d->emails(), d->utc_offset_hour(), d->utc_offset_minute()));
+ shared_ptr<Cinema> c (new Cinema (d->name(), d->emails(), d->notes(), d->utc_offset_hour(), d->utc_offset_minute()));
Config::instance()->add_cinema (c);
add_cinema (c);
}
@@ -166,12 +166,13 @@ ScreensPanel::edit_cinema_clicked ()
pair<wxTreeItemId, shared_ptr<Cinema> > c = *_selected_cinemas.begin();
CinemaDialog* d = new CinemaDialog (
- this, _("Edit cinema"), c.second->name, c.second->emails, c.second->utc_offset_hour(), c.second->utc_offset_minute()
+ this, _("Edit cinema"), c.second->name, c.second->emails, c.second->notes, c.second->utc_offset_hour(), c.second->utc_offset_minute()
);
if (d->ShowModal () == wxID_OK) {
c.second->name = d->name ();
c.second->emails = d->emails ();
+ c.second->notes = d->notes ();
c.second->set_utc_offset_hour (d->utc_offset_hour ());
c.second->set_utc_offset_minute (d->utc_offset_minute ());
_targets->SetItemText (c.first, std_to_wx (d->name()));
@@ -227,9 +228,10 @@ ScreensPanel::edit_screen_clicked ()
pair<wxTreeItemId, shared_ptr<Screen> > s = *_selected_screens.begin();
- ScreenDialog* d = new ScreenDialog (this, _("Edit screen"), s.second->name, s.second->recipient, s.second->trusted_devices);
+ ScreenDialog* d = new ScreenDialog (this, _("Edit screen"), s.second->name, s.second->notes, s.second->recipient, s.second->trusted_devices);
if (d->ShowModal () == wxID_OK) {
s.second->name = d->name ();
+ s.second->notes = d->notes ();
s.second->recipient = d->recipient ();
s.second->trusted_devices = d->trusted_devices ();
_targets->SetItemText (s.first, std_to_wx (d->name()));