Preset saved export path is now shown on the Export window

This commit is contained in:
Marcelo Fernandez 2018-11-05 22:01:34 -03:00
parent 3cf3c4137a
commit 4755a3beed
2 changed files with 22 additions and 0 deletions

View file

@ -170,6 +170,7 @@ void ProjectExportDialog::_edit_preset(int p_index) {
if (p_index < 0 || p_index >= presets->get_item_count()) { if (p_index < 0 || p_index >= presets->get_item_count()) {
name->set_text(""); name->set_text("");
name->set_editable(false); name->set_editable(false);
export_path->set_editable(false);
runnable->set_disabled(true); runnable->set_disabled(true);
parameters->edit(NULL); parameters->edit(NULL);
presets->unselect_all(); presets->unselect_all();
@ -191,9 +192,11 @@ void ProjectExportDialog::_edit_preset(int p_index) {
sections->show(); sections->show();
name->set_editable(true); name->set_editable(true);
export_path->set_editable(true);
duplicate_preset->set_disabled(false); duplicate_preset->set_disabled(false);
delete_preset->set_disabled(false); delete_preset->set_disabled(false);
name->set_text(current->get_name()); name->set_text(current->get_name());
export_path->set_text(current->get_export_path());
runnable->set_disabled(false); runnable->set_disabled(false);
runnable->set_pressed(current->is_runnable()); runnable->set_pressed(current->is_runnable());
parameters->edit(current.ptr()); parameters->edit(current.ptr());
@ -432,6 +435,18 @@ void ProjectExportDialog::_name_changed(const String &p_string) {
_update_presets(); _update_presets();
} }
void ProjectExportDialog::_export_path_changed(const String &p_string) {
if (updating)
return;
Ref<EditorExportPreset> current = EditorExport::get_singleton()->get_export_preset(presets->get_current());
ERR_FAIL_COND(current.is_null());
current->set_export_path(p_string);
_update_presets();
}
void ProjectExportDialog::_duplicate_preset() { void ProjectExportDialog::_duplicate_preset() {
Ref<EditorExportPreset> current = EditorExport::get_singleton()->get_export_preset(presets->get_current()); Ref<EditorExportPreset> current = EditorExport::get_singleton()->get_export_preset(presets->get_current());
@ -929,6 +944,10 @@ ProjectExportDialog::ProjectExportDialog() {
runnable->connect("pressed", this, "_runnable_pressed"); runnable->connect("pressed", this, "_runnable_pressed");
settings_vb->add_child(runnable); settings_vb->add_child(runnable);
export_path = memnew(LineEdit);
settings_vb->add_margin_child(TTR("Export Path:"), export_path);
export_path->connect("text_changed", this, "_export_path_changed");
sections = memnew(TabContainer); sections = memnew(TabContainer);
sections->set_tab_align(TabContainer::ALIGN_LEFT); sections->set_tab_align(TabContainer::ALIGN_LEFT);
settings_vb->add_child(sections); settings_vb->add_child(sections);
@ -1019,6 +1038,7 @@ ProjectExportDialog::ProjectExportDialog() {
//disable by default //disable by default
name->set_editable(false); name->set_editable(false);
export_path->set_editable(false);
runnable->set_disabled(true); runnable->set_disabled(true);
duplicate_preset->set_disabled(true); duplicate_preset->set_disabled(true);
delete_preset->set_disabled(true); delete_preset->set_disabled(true);

View file

@ -66,6 +66,7 @@ private:
ItemList *presets; ItemList *presets;
LineEdit *name; LineEdit *name;
LineEdit *export_path;
EditorInspector *parameters; EditorInspector *parameters;
CheckButton *runnable; CheckButton *runnable;
@ -107,6 +108,7 @@ private:
void _runnable_pressed(); void _runnable_pressed();
void _update_parameters(const String &p_edited_property); void _update_parameters(const String &p_edited_property);
void _name_changed(const String &p_string); void _name_changed(const String &p_string);
void _export_path_changed(const String &p_string);
void _add_preset(int p_platform); void _add_preset(int p_platform);
void _edit_preset(int p_index); void _edit_preset(int p_index);
void _duplicate_preset(); void _duplicate_preset();