X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Fwx%2Fcontent_properties_dialog.cc;h=8920ad9130c78e69358826ff84e3daa3080d2135;hp=0b9bd0bb85b8b88f36a18700384f0a8be74fe816;hb=d8a19dca28268e3ac92f117d00c1064c0b06515c;hpb=1b81ba7c24e7f117d1960021d7e28c8f0147009f diff --git a/src/wx/content_properties_dialog.cc b/src/wx/content_properties_dialog.cc index 0b9bd0bb8..8920ad913 100644 --- a/src/wx/content_properties_dialog.cc +++ b/src/wx/content_properties_dialog.cc @@ -25,10 +25,12 @@ #include "lib/audio_content.h" #include "lib/single_stream_audio_content.h" #include +#include using std::string; using std::list; using std::pair; +using std::map; using boost::shared_ptr; using boost::dynamic_pointer_cast; @@ -40,10 +42,22 @@ ContentPropertiesDialog::ContentPropertiesDialog (wxWindow* parent, shared_ptr > properties = content->properties (); - for (list >::const_iterator i = properties.begin(); i != properties.end(); ++i) { - add (std_to_wx (i->first), true); - add (new wxStaticText (this, wxID_ANY, std_to_wx (i->second))); + map > grouped; + BOOST_FOREACH (Content::UserProperty i, content->user_properties()) { + if (grouped.find(i.category) == grouped.end()) { + grouped[i.category] = list (); + } + grouped[i.category].push_back (i); + } + + for (map >::const_iterator i = grouped.begin(); i != grouped.end(); ++i) { + add (std_to_wx ("" + i->first + ""), false); + add_spacer (); + + BOOST_FOREACH (Content::UserProperty j, i->second) { + add (std_to_wx (j.key), true); + add (new wxStaticText (this, wxID_ANY, std_to_wx (j.value + " " + j.unit))); + } } layout ();