projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3a67f02
)
Save trusted devices.
author
Carl Hetherington
<cth@carlh.net>
Sun, 15 Nov 2015 20:23:25 +0000
(20:23 +0000)
committer
Carl Hetherington
<cth@carlh.net>
Sun, 15 Nov 2015 20:23:25 +0000
(20:23 +0000)
src/lib/screen.cc
patch
|
blob
|
history
src/lib/screen.h
patch
|
blob
|
history
src/wx/screen_dialog.cc
patch
|
blob
|
history
src/wx/screen_dialog.h
patch
|
blob
|
history
src/wx/screens_panel.cc
patch
|
blob
|
history
diff --git
a/src/lib/screen.cc
b/src/lib/screen.cc
index 0876e770b03b4cd43b86d8d4892f11f45ec4a718..159c4326bc5b08e7e4ad26af87cffd7f54391efe 100644
(file)
--- a/
src/lib/screen.cc
+++ b/
src/lib/screen.cc
@@
-19,6
+19,7
@@
#include "screen.h"
#include <libxml++/libxml++.h>
#include "screen.h"
#include <libxml++/libxml++.h>
+#include <boost/foreach.hpp>
Screen::Screen (cxml::ConstNodePtr node)
: name (node->string_child ("Name"))
Screen::Screen (cxml::ConstNodePtr node)
: name (node->string_child ("Name"))
@@
-28,6
+29,10
@@
Screen::Screen (cxml::ConstNodePtr node)
} else if (node->optional_string_child ("Recipient")) {
recipient = dcp::Certificate (node->string_child ("Recipient"));
}
} else if (node->optional_string_child ("Recipient")) {
recipient = dcp::Certificate (node->string_child ("Recipient"));
}
+
+ BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children ("TrustedDevice")) {
+ trusted_devices.push_back (dcp::Certificate (i->content ()));
+ }
}
void
}
void
@@
-37,4
+42,8
@@
Screen::as_xml (xmlpp::Element* parent) const
if (recipient) {
parent->add_child("Recipient")->add_child_text (recipient->certificate (true));
}
if (recipient) {
parent->add_child("Recipient")->add_child_text (recipient->certificate (true));
}
+
+ BOOST_FOREACH (dcp::Certificate const & i, trusted_devices) {
+ parent->add_child("TrustedDevice")->add_child_text (i.certificate (true));
+ }
}
}
diff --git
a/src/lib/screen.h
b/src/lib/screen.h
index 6e3b8b01dc32b0342100b80de96e900e355587cb..0ae4835446187616a8f927387de244a6eb41ca8b 100644
(file)
--- a/
src/lib/screen.h
+++ b/
src/lib/screen.h
@@
-33,9
+33,10
@@
class Cinema;
class Screen
{
public:
class Screen
{
public:
- Screen (std::string const & n, boost::optional<dcp::Certificate> rec)
+ Screen (std::string const & n, boost::optional<dcp::Certificate> rec
, std::vector<dcp::Certificate> td
)
: name (n)
, recipient (rec)
: name (n)
, recipient (rec)
+ , trusted_devices (td)
{}
Screen (cxml::ConstNodePtr);
{}
Screen (cxml::ConstNodePtr);
@@
-45,4
+46,5
@@
public:
boost::shared_ptr<Cinema> cinema;
std::string name;
boost::optional<dcp::Certificate> recipient;
boost::shared_ptr<Cinema> cinema;
std::string name;
boost::optional<dcp::Certificate> recipient;
+ std::vector<dcp::Certificate> trusted_devices;
};
};
diff --git
a/src/wx/screen_dialog.cc
b/src/wx/screen_dialog.cc
index a8cb1cbed49c9c8d89035efa4335bcaabcf36237..bec5318799e43cf16f6b52fae6265df7315945c3 100644
(file)
--- a/
src/wx/screen_dialog.cc
+++ b/
src/wx/screen_dialog.cc
@@
-71,9
+71,10
@@
column (dcp::Certificate c)
return c.thumbprint ();
}
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)
: wxDialog (parent, wxID_ANY, std_to_wx (title))
, _recipient (recipient)
+ , _trusted_devices (trusted_devices)
{
wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
SetSizer (overall_sizer);
{
wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
SetSizer (overall_sizer);
diff --git
a/src/wx/screen_dialog.h
b/src/wx/screen_dialog.h
index edfb619b5181a3cd3b877af72f1273762c28bb35..2985516c48870a6f6d68cb1613eef8b288c3470c 100644
(file)
--- a/
src/wx/screen_dialog.h
+++ b/
src/wx/screen_dialog.h
@@
-29,10
+29,19
@@
class FileDialogWrapper;
class ScreenDialog : public wxDialog
{
public:
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::string name () const;
boost::optional<dcp::Certificate> recipient () const;
+ std::vector<dcp::Certificate> trusted_devices () {
+ return _trusted_devices;
+ }
private:
void get_recipient_from_file ();
private:
void get_recipient_from_file ();
@@
-41,10
+50,6
@@
private:
void setup_sensitivity ();
void set_recipient (boost::optional<dcp::Certificate>);
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;
}
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 a8138a8930d420882da92e44f965aff62b7afa8a..3328fe61eb137cd4232076f0ed941de2c98cb68b 100644
(file)
--- a/
src/wx/screens_panel.cc
+++ b/
src/wx/screens_panel.cc
@@
-226,7
+226,7
@@
ScreensPanel::add_screen_clicked ()
return;
}
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);
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();
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 ();
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 ();
}
_targets->SetItemText (s.first, std_to_wx (d->name()));
Config::instance()->changed ();
}