summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-11-15 20:23:25 +0000
committerCarl Hetherington <cth@carlh.net>2015-11-15 20:23:25 +0000
commite170d9908c191180aefe71ff7cfa81a5ba08ed83 (patch)
treebfa566bcf3242500e030cc1bbed64a313846ffa8 /src/wx
parent3a67f024a614687a811ecb5c96a56fc664f04c3a (diff)
Save trusted devices.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/screen_dialog.cc3
-rw-r--r--src/wx/screen_dialog.h15
-rw-r--r--src/wx/screens_panel.cc5
3 files changed, 15 insertions, 8 deletions
diff --git a/src/wx/screen_dialog.cc b/src/wx/screen_dialog.cc
index a8cb1cbed..bec531879 100644
--- a/src/wx/screen_dialog.cc
+++ b/src/wx/screen_dialog.cc
@@ -71,9 +71,10 @@ column (dcp::Certificate c)
return c.thumbprint ();
}
-ScreenDialog::ScreenDialog (wxWindow* parent, string title, string name, optional<dcp::Certificate> recipient)
+ScreenDialog::ScreenDialog (wxWindow* parent, string title, string name, optional<dcp::Certificate> recipient, vector<dcp::Certificate> trusted_devices)
: wxDialog (parent, wxID_ANY, std_to_wx (title))
, _recipient (recipient)
+ , _trusted_devices (trusted_devices)
{
wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
SetSizer (overall_sizer);
diff --git a/src/wx/screen_dialog.h b/src/wx/screen_dialog.h
index edfb619b5..2985516c4 100644
--- a/src/wx/screen_dialog.h
+++ b/src/wx/screen_dialog.h
@@ -29,10 +29,19 @@ class FileDialogWrapper;
class ScreenDialog : public wxDialog
{
public:
- ScreenDialog (wxWindow *, std::string, std::string name = "", boost::optional<dcp::Certificate> c = boost::optional<dcp::Certificate> ());
+ ScreenDialog (
+ wxWindow *,
+ std::string,
+ std::string name = "",
+ boost::optional<dcp::Certificate> c = boost::optional<dcp::Certificate> (),
+ std::vector<dcp::Certificate> d = std::vector<dcp::Certificate> ()
+ );
std::string name () const;
boost::optional<dcp::Certificate> recipient () const;
+ std::vector<dcp::Certificate> trusted_devices () {
+ return _trusted_devices;
+ }
private:
void get_recipient_from_file ();
@@ -41,10 +50,6 @@ private:
void setup_sensitivity ();
void set_recipient (boost::optional<dcp::Certificate>);
- std::vector<dcp::Certificate> trusted_devices () {
- return _trusted_devices;
- }
-
void set_trusted_devices (std::vector<dcp::Certificate> d) {
_trusted_devices = d;
}
diff --git a/src/wx/screens_panel.cc b/src/wx/screens_panel.cc
index a8138a893..3328fe61e 100644
--- a/src/wx/screens_panel.cc
+++ b/src/wx/screens_panel.cc
@@ -226,7 +226,7 @@ ScreensPanel::add_screen_clicked ()
return;
}
- shared_ptr<Screen> s (new Screen (d->name(), d->recipient()));
+ shared_ptr<Screen> s (new Screen (d->name(), d->recipient(), d->trusted_devices()));
c->add_screen (s);
add_screen (c, s);
@@ -244,10 +244,11 @@ ScreensPanel::edit_screen_clicked ()
pair<wxTreeItemId, shared_ptr<Screen> > s = selected_screens().front();
- ScreenDialog* d = new ScreenDialog (this, "Edit screen", s.second->name, s.second->recipient);
+ ScreenDialog* d = new ScreenDialog (this, "Edit screen", s.second->name, s.second->recipient, s.second->trusted_devices);
if (d->ShowModal () == wxID_OK) {
s.second->name = d->name ();
s.second->recipient = d->recipient ();
+ s.second->trusted_devices = d->trusted_devices ();
_targets->SetItemText (s.first, std_to_wx (d->name()));
Config::instance()->changed ();
}