summaryrefslogtreecommitdiff
path: root/src/wx/content_properties_dialog.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-05-31 22:20:30 +0100
committerCarl Hetherington <cth@carlh.net>2016-05-31 22:20:30 +0100
commit291e2fe2e7df95019feba8097b68b31ec64be794 (patch)
treecdac55d0ed47721190529b3443664bd3f64aa862 /src/wx/content_properties_dialog.cc
parent7d9321ff829498c2c87d924a9b660acbfdafa6b3 (diff)
Restore some missing stuff to the content properties dialogue.
Diffstat (limited to 'src/wx/content_properties_dialog.cc')
-rw-r--r--src/wx/content_properties_dialog.cc46
1 files changed, 26 insertions, 20 deletions
diff --git a/src/wx/content_properties_dialog.cc b/src/wx/content_properties_dialog.cc
index 9871c1f3f..5df9ea5cf 100644
--- a/src/wx/content_properties_dialog.cc
+++ b/src/wx/content_properties_dialog.cc
@@ -37,11 +37,6 @@ using boost::dynamic_pointer_cast;
ContentPropertiesDialog::ContentPropertiesDialog (wxWindow* parent, shared_ptr<Content> content)
: TableDialog (parent, _("Content Properties"), 2, 1, false)
{
- string n = content->path(0).string();
- boost::algorithm::replace_all (n, "&", "&&");
- add (_("Filename"), true);
- add (new wxStaticText (this, wxID_ANY, std_to_wx (n)));
-
map<string, list<UserProperty> > grouped;
BOOST_FOREACH (UserProperty i, content->user_properties()) {
if (grouped.find(i.category) == grouped.end()) {
@@ -50,23 +45,34 @@ ContentPropertiesDialog::ContentPropertiesDialog (wxWindow* parent, shared_ptr<C
grouped[i.category].push_back (i);
}
- for (map<string, list<UserProperty> >::const_iterator i = grouped.begin(); i != grouped.end(); ++i) {
-
- wxStaticText* m = new wxStaticText (this, wxID_ANY, std_to_wx (i->first));
- wxFont font (*wxNORMAL_FONT);
- font.SetWeight (wxFONTWEIGHT_BOLD);
- m->SetFont (font);
+ maybe_add_group (grouped, wx_to_std (_("General")));
+ maybe_add_group (grouped, wx_to_std (_("Video")));
+ maybe_add_group (grouped, wx_to_std (_("Audio")));
+ maybe_add_group (grouped, wx_to_std (_("Length")));
- add_spacer ();
- add_spacer ();
- add (m, false);
- add_spacer ();
+ layout ();
+}
- BOOST_FOREACH (UserProperty j, i->second) {
- add (std_to_wx (j.key), true);
- add (new wxStaticText (this, wxID_ANY, std_to_wx (j.value + " " + j.unit)));
- }
+void
+ContentPropertiesDialog::maybe_add_group (map<string, list<UserProperty> > const & groups, string name)
+{
+ map<string, list<UserProperty> >::const_iterator i = groups.find (name);
+ if (i == groups.end()) {
+ return;
}
- layout ();
+ wxStaticText* m = new wxStaticText (this, wxID_ANY, std_to_wx (i->first));
+ wxFont font (*wxNORMAL_FONT);
+ font.SetWeight (wxFONTWEIGHT_BOLD);
+ m->SetFont (font);
+
+ add_spacer ();
+ add_spacer ();
+ add (m, false);
+ add_spacer ();
+
+ BOOST_FOREACH (UserProperty j, i->second) {
+ add (std_to_wx (j.key), true);
+ add (new wxStaticText (this, wxID_ANY, std_to_wx (j.value + " " + j.unit)));
+ }
}