Path: blob/master/editor/plugins/plugin_config_dialog.h
9902 views
/**************************************************************************/1/* plugin_config_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/check_box.h"33#include "scene/gui/dialogs.h"34#include "scene/gui/line_edit.h"35#include "scene/gui/option_button.h"36#include "scene/gui/text_edit.h"3738class ConfigFile;39class EditorValidationPanel;4041class PluginConfigDialog : public ConfirmationDialog {42GDCLASS(PluginConfigDialog, ConfirmationDialog);4344enum {45MSG_ID_PLUGIN,46MSG_ID_SUBFOLDER,47MSG_ID_SCRIPT,48MSG_ID_ACTIVE,49};5051LineEdit *name_edit = nullptr;52LineEdit *subfolder_edit = nullptr;53TextEdit *desc_edit = nullptr;54LineEdit *author_edit = nullptr;55LineEdit *version_edit = nullptr;56OptionButton *script_option_edit = nullptr;57LineEdit *script_edit = nullptr;58CheckBox *active_edit = nullptr;5960LocalVector<Control *> plugin_edit_hidden_controls;6162EditorValidationPanel *validation_panel = nullptr;6364bool _edit_mode = false;6566void _clear_fields();67void _on_confirmed();68void _on_canceled();69void _on_required_text_changed();70void _create_script_for_plugin(const String &p_plugin_path, Ref<ConfigFile> p_config_file, int p_script_lang_index);71String _get_subfolder();7273static String _to_absolute_plugin_path(const String &p_plugin_name);7475protected:76virtual void _notification(int p_what);77static void _bind_methods();7879public:80void config(const String &p_config_path);8182PluginConfigDialog();83};848586