diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-06-02 21:03:03 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-06-02 21:03:03 +0100 |
| commit | 31150ddd0fafac4426d11a758be9d77699b7377c (patch) | |
| tree | aa0ac01afb3295f2aa326e394e37247c68d7a431 /src/wx | |
| parent | cec71ef08475af291b968873757979c5e977facb (diff) | |
Fix missing content properties when using translations.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/content_properties_dialog.cc | 32 | ||||
| -rw-r--r-- | src/wx/content_properties_dialog.h | 3 |
2 files changed, 26 insertions, 9 deletions
diff --git a/src/wx/content_properties_dialog.cc b/src/wx/content_properties_dialog.cc index 8bb0a6b1f..bd20d48e6 100644 --- a/src/wx/content_properties_dialog.cc +++ b/src/wx/content_properties_dialog.cc @@ -37,7 +37,7 @@ using boost::dynamic_pointer_cast; ContentPropertiesDialog::ContentPropertiesDialog (wxWindow* parent, shared_ptr<Content> content) : TableDialog (parent, _("Content Properties"), 2, 1, false) { - map<string, list<UserProperty> > grouped; + map<UserProperty::Category, list<UserProperty> > grouped; BOOST_FOREACH (UserProperty i, content->user_properties()) { if (grouped.find(i.category) == grouped.end()) { grouped[i.category] = list<UserProperty> (); @@ -45,10 +45,10 @@ ContentPropertiesDialog::ContentPropertiesDialog (wxWindow* parent, shared_ptr<C grouped[i.category].push_back (i); } - 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"))); + maybe_add_group (grouped, UserProperty::GENERAL); + maybe_add_group (grouped, UserProperty::VIDEO); + maybe_add_group (grouped, UserProperty::AUDIO); + maybe_add_group (grouped, UserProperty::LENGTH); layout (); @@ -60,14 +60,30 @@ ContentPropertiesDialog::ContentPropertiesDialog (wxWindow* parent, shared_ptr<C } void -ContentPropertiesDialog::maybe_add_group (map<string, list<UserProperty> > const & groups, string name) +ContentPropertiesDialog::maybe_add_group (map<UserProperty::Category, list<UserProperty> > const & groups, UserProperty::Category category) { - map<string, list<UserProperty> >::const_iterator i = groups.find (name); + map<UserProperty::Category, list<UserProperty> >::const_iterator i = groups.find (category); if (i == groups.end()) { return; } - wxStaticText* m = new wxStaticText (this, wxID_ANY, std_to_wx (i->first)); + wxString category_name; + switch (i->first) { + case UserProperty::GENERAL: + category_name = _("General"); + break; + case UserProperty::VIDEO: + category_name = _("Video"); + break; + case UserProperty::AUDIO: + category_name = _("Audio"); + break; + case UserProperty::LENGTH: + category_name = _("Length"); + break; + } + + wxStaticText* m = new wxStaticText (this, wxID_ANY, category_name); wxFont font (*wxNORMAL_FONT); font.SetWeight (wxFONTWEIGHT_BOLD); m->SetFont (font); diff --git a/src/wx/content_properties_dialog.h b/src/wx/content_properties_dialog.h index eb6f11ddb..92aa5c6d7 100644 --- a/src/wx/content_properties_dialog.h +++ b/src/wx/content_properties_dialog.h @@ -19,6 +19,7 @@ */ #include "table_dialog.h" +#include "lib/user_property.h" #include <boost/shared_ptr.hpp> #include <list> #include <map> @@ -32,5 +33,5 @@ public: ContentPropertiesDialog (wxWindow* parent, boost::shared_ptr<Content> content); private: - void maybe_add_group (std::map<std::string, std::list<UserProperty> > const & groups, std::string name); + void maybe_add_group (std::map<UserProperty::Category, std::list<UserProperty> > const & groups, UserProperty::Category category); }; |
