Path: blob/master/editor/translations/editor_locale_dialog.h
9896 views
/**************************************************************************/1/* editor_locale_dialog.h */2/**************************************************************************/3/* This file is part of: */4/* GODOT ENGINE */5/* https://godotengine.org */6/**************************************************************************/7/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */8/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */9/* */10/* Permission is hereby granted, free of charge, to any person obtaining */11/* a copy of this software and associated documentation files (the */12/* "Software"), to deal in the Software without restriction, including */13/* without limitation the rights to use, copy, modify, merge, publish, */14/* distribute, sublicense, and/or sell copies of the Software, and to */15/* permit persons to whom the Software is furnished to do so, subject to */16/* the following conditions: */17/* */18/* The above copyright notice and this permission notice shall be */19/* included in all copies or substantial portions of the Software. */20/* */21/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */22/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */23/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */24/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */25/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */26/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */27/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */28/**************************************************************************/2930#pragma once3132#include "scene/gui/dialogs.h"3334class Button;35class HBoxContainer;36class VBoxContainer;37class LineEdit;38class Tree;39class OptionButton;4041class EditorLocaleDialog : public ConfirmationDialog {42GDCLASS(EditorLocaleDialog, ConfirmationDialog);4344enum LocaleFilter {45SHOW_ALL_LOCALES,46SHOW_ONLY_SELECTED_LOCALES,47};4849HBoxContainer *hb_locale = nullptr;50VBoxContainer *vb_script_list = nullptr;51OptionButton *filter_mode = nullptr;52Button *edit_filters = nullptr;53Button *advanced = nullptr;54LineEdit *lang_code = nullptr;55LineEdit *script_code = nullptr;56LineEdit *country_code = nullptr;57LineEdit *variant_code = nullptr;58Tree *lang_list = nullptr;59Tree *script_list = nullptr;60Tree *cnt_list = nullptr;6162Label *script_label1 = nullptr;63Label *script_label2 = nullptr;6465bool locale_set = false;66bool updating_lists = false;6768protected:69void _notification(int p_what);70static void _bind_methods();71virtual void _post_popup() override;72virtual void ok_pressed() override;7374void _item_selected();75void _filter_lang_option_changed();76void _filter_script_option_changed();77void _filter_cnt_option_changed();78void _filter_mode_changed(int p_mode);79void _edit_filters(bool p_checked);80void _toggle_advanced(bool p_checked);8182void _update_tree();8384public:85EditorLocaleDialog();8687void set_locale(const String &p_locale);88void popup_locale_dialog();89};909192