X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Flanguage_tag_dialog.h;h=ae6ea4ef7a1ca2e69f3e6992320db8168af5007f;hb=31de5b1272d928557a7272977584f5dcc9876c75;hp=1199e2d537a1de956884e251089a4fa82cfa1382;hpb=f3e5bba0d86dcc43bdeb0d132c7cdf85b55941a9;p=dcpomatic.git diff --git a/src/wx/language_tag_dialog.h b/src/wx/language_tag_dialog.h index 1199e2d53..ae6ea4ef7 100644 --- a/src/wx/language_tag_dialog.h +++ b/src/wx/language_tag_dialog.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2020 Carl Hetherington + Copyright (C) 2021 Carl Hetherington This file is part of DCP-o-matic. @@ -19,66 +19,32 @@ */ -#include "lib/warnings.h" +#ifndef DCPOMATIC_LANGUAGE_TAG_DIALOG_H +#define DCPOMATIC_LANGUAGE_TAG_DIALOG_H + + #include -DCPOMATIC_DISABLE_WARNINGS #include -DCPOMATIC_ENABLE_WARNINGS class wxListCtrl; -class LanguageSubtagPanel; class LanguageTagDialog : public wxDialog { public: - class Subtag - { - public: - Subtag (dcp::LanguageTag::SubtagType type_, boost::optional subtag_) - : type (type_) - , subtag (subtag_) - {} - - dcp::LanguageTag::SubtagType type; - boost::optional subtag; - std::string last_search; - }; - - LanguageTagDialog (wxWindow* parent, dcp::LanguageTag tag); + LanguageTagDialog (wxWindow* parent, dcp::LanguageTag tag = dcp::LanguageTag("en")); dcp::LanguageTag get () const; - + void set (dcp::LanguageTag tag); private: + void add_language (); + void populate_list (); - std::string subtag_type_name (dcp::LanguageTag::SubtagType type); - void search_changed (std::string search); - void add_to_current_tag (dcp::LanguageTag::SubtagType type, boost::optional subtag); - void current_tag_selection_changed (); - void chosen_subtag_changed (boost::optional selection); - void setup_sensitivity (); - - std::vector _current_tag_subtags; - wxListCtrl* _current_tag_list; - LanguageSubtagPanel* _choose_subtag_panel; - wxButton* _add_script; - wxButton* _add_region; - wxButton* _add_variant; - wxButton* _add_external; -}; - - - -class RegionSubtagDialog : public wxDialog -{ -public: - RegionSubtagDialog (wxWindow* parent, dcp::LanguageTag::RegionSubtag region); - - boost::optional get () const; - -private: - LanguageSubtagPanel* _panel; + std::vector _presets; + std::vector _custom; + wxListCtrl* _list; }; +#endif