Automatically create folder in project manager create/import/install
This commit is contained in:
parent
aef11a1427
commit
2130f1121a
5 changed files with 618 additions and 604 deletions
|
@ -883,6 +883,9 @@
|
||||||
<member name="project_manager/default_renderer" type="String" setter="" getter="">
|
<member name="project_manager/default_renderer" type="String" setter="" getter="">
|
||||||
The renderer type that will be checked off by default when creating a new project. Accepted strings are "forward_plus", "mobile" or "gl_compatibility".
|
The renderer type that will be checked off by default when creating a new project. Accepted strings are "forward_plus", "mobile" or "gl_compatibility".
|
||||||
</member>
|
</member>
|
||||||
|
<member name="project_manager/directory_naming_convention" type="int" setter="" getter="">
|
||||||
|
Directory naming convention for the project manager. Options are "No convention" (project name is directory name), "kebab-case" (default), "snake_case", "camelCase", "PascalCase", or "Title Case".
|
||||||
|
</member>
|
||||||
<member name="project_manager/sorting_order" type="int" setter="" getter="">
|
<member name="project_manager/sorting_order" type="int" setter="" getter="">
|
||||||
The sorting order to use in the project manager. When changing the sorting order in the project manager, this setting is set permanently in the editor settings.
|
The sorting order to use in the project manager. When changing the sorting order in the project manager, this setting is set permanently in the editor settings.
|
||||||
</member>
|
</member>
|
||||||
|
|
|
@ -838,6 +838,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
|
||||||
|
|
||||||
// TRANSLATORS: Project Manager here refers to the tool used to create/manage Godot projects.
|
// TRANSLATORS: Project Manager here refers to the tool used to create/manage Godot projects.
|
||||||
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "project_manager/sorting_order", 0, "Last Edited,Name,Path")
|
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "project_manager/sorting_order", 0, "Last Edited,Name,Path")
|
||||||
|
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "project_manager/directory_naming_convention", 1, "No convention,kebab-case,snake_case,camelCase,PascalCase,Title Case")
|
||||||
|
|
||||||
#if defined(WEB_ENABLED)
|
#if defined(WEB_ENABLED)
|
||||||
// Web platform only supports `gl_compatibility`.
|
// Web platform only supports `gl_compatibility`.
|
||||||
|
|
|
@ -618,14 +618,15 @@ void ProjectManager::_new_project() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectManager::_rename_project() {
|
void ProjectManager::_rename_project() {
|
||||||
const HashSet<String> &selected_list = project_list->get_selected_project_keys();
|
const Vector<ProjectList::Item> &selected_list = project_list->get_selected_projects();
|
||||||
|
|
||||||
if (selected_list.size() == 0) {
|
if (selected_list.size() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const String &E : selected_list) {
|
for (const ProjectList::Item &E : selected_list) {
|
||||||
project_dialog->set_project_path(E);
|
project_dialog->set_project_name(E.project_name);
|
||||||
|
project_dialog->set_project_path(E.path);
|
||||||
project_dialog->set_mode(ProjectDialog::MODE_RENAME);
|
project_dialog->set_mode(ProjectDialog::MODE_RENAME);
|
||||||
project_dialog->show_dialog();
|
project_dialog->show_dialog();
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -34,6 +34,7 @@
|
||||||
#include "scene/gui/dialogs.h"
|
#include "scene/gui/dialogs.h"
|
||||||
|
|
||||||
class Button;
|
class Button;
|
||||||
|
class CheckButton;
|
||||||
class EditorFileDialog;
|
class EditorFileDialog;
|
||||||
class LineEdit;
|
class LineEdit;
|
||||||
class OptionButton;
|
class OptionButton;
|
||||||
|
@ -65,11 +66,11 @@ private:
|
||||||
Mode mode = MODE_NEW;
|
Mode mode = MODE_NEW;
|
||||||
bool is_folder_empty = true;
|
bool is_folder_empty = true;
|
||||||
|
|
||||||
Button *browse = nullptr;
|
CheckButton *create_dir = nullptr;
|
||||||
|
Button *project_browse = nullptr;
|
||||||
Button *install_browse = nullptr;
|
Button *install_browse = nullptr;
|
||||||
Button *create_dir = nullptr;
|
|
||||||
VBoxContainer *name_container = nullptr;
|
VBoxContainer *name_container = nullptr;
|
||||||
VBoxContainer *path_container = nullptr;
|
VBoxContainer *project_path_container = nullptr;
|
||||||
VBoxContainer *install_path_container = nullptr;
|
VBoxContainer *install_path_container = nullptr;
|
||||||
|
|
||||||
VBoxContainer *renderer_container = nullptr;
|
VBoxContainer *renderer_container = nullptr;
|
||||||
|
@ -78,54 +79,63 @@ private:
|
||||||
Ref<ButtonGroup> renderer_button_group;
|
Ref<ButtonGroup> renderer_button_group;
|
||||||
|
|
||||||
Label *msg = nullptr;
|
Label *msg = nullptr;
|
||||||
LineEdit *project_path = nullptr;
|
|
||||||
LineEdit *project_name = nullptr;
|
LineEdit *project_name = nullptr;
|
||||||
|
LineEdit *project_path = nullptr;
|
||||||
LineEdit *install_path = nullptr;
|
LineEdit *install_path = nullptr;
|
||||||
TextureRect *status_rect = nullptr;
|
TextureRect *project_status_rect = nullptr;
|
||||||
TextureRect *install_status_rect = nullptr;
|
TextureRect *install_status_rect = nullptr;
|
||||||
|
|
||||||
OptionButton *vcs_metadata_selection = nullptr;
|
OptionButton *vcs_metadata_selection = nullptr;
|
||||||
|
|
||||||
EditorFileDialog *fdialog = nullptr;
|
EditorFileDialog *fdialog_project = nullptr;
|
||||||
EditorFileDialog *fdialog_install = nullptr;
|
EditorFileDialog *fdialog_install = nullptr;
|
||||||
AcceptDialog *dialog_error = nullptr;
|
AcceptDialog *dialog_error = nullptr;
|
||||||
|
|
||||||
String zip_path;
|
String zip_path;
|
||||||
String zip_title;
|
String zip_title;
|
||||||
String fav_dir;
|
|
||||||
|
|
||||||
String created_folder_path;
|
void _set_message(const String &p_msg, MessageType p_type, InputType input_type = PROJECT_PATH);
|
||||||
|
void _validate_path();
|
||||||
|
|
||||||
void _set_message(const String &p_msg, MessageType p_type = MESSAGE_SUCCESS, InputType input_type = PROJECT_PATH);
|
// Project path for MODE_NEW and MODE_INSTALL. Install path for MODE_IMPORT.
|
||||||
|
// Install path is only visible when importing a ZIP.
|
||||||
|
String _get_target_path();
|
||||||
|
void _set_target_path(const String &p_text);
|
||||||
|
|
||||||
String _test_path();
|
// Calculated from project name / ZIP name.
|
||||||
void _update_path(const String &p_path);
|
String auto_dir;
|
||||||
void _path_text_changed(const String &p_path);
|
|
||||||
void _path_selected(const String &p_path);
|
// Updates `auto_dir`. If the target path dir name is equal to `auto_dir` (the default state), the target path is also updated.
|
||||||
void _file_selected(const String &p_path);
|
void _update_target_auto_dir();
|
||||||
|
|
||||||
|
// While `create_dir` is disabled, stores the last target path dir name, or an empty string if equal to `auto_dir`.
|
||||||
|
String last_custom_target_dir;
|
||||||
|
void _create_dir_toggled(bool p_pressed);
|
||||||
|
|
||||||
|
void _project_name_changed();
|
||||||
|
void _project_path_changed();
|
||||||
|
void _install_path_changed();
|
||||||
|
|
||||||
|
void _browse_project_path();
|
||||||
|
void _browse_install_path();
|
||||||
|
|
||||||
|
void _project_path_selected(const String &p_path);
|
||||||
void _install_path_selected(const String &p_path);
|
void _install_path_selected(const String &p_path);
|
||||||
|
|
||||||
void _browse_path();
|
|
||||||
void _browse_install_path();
|
|
||||||
void _create_folder();
|
|
||||||
|
|
||||||
void _text_changed(const String &p_text);
|
|
||||||
void _nonempty_confirmation_ok_pressed();
|
|
||||||
void _renderer_selected();
|
void _renderer_selected();
|
||||||
void _remove_created_folder();
|
void _nonempty_confirmation_ok_pressed();
|
||||||
|
|
||||||
void ok_pressed() override;
|
void ok_pressed() override;
|
||||||
void cancel_pressed() override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void _notification(int p_what);
|
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
void set_mode(Mode p_mode);
|
||||||
|
void set_project_name(const String &p_name);
|
||||||
|
void set_project_path(const String &p_path);
|
||||||
void set_zip_path(const String &p_path);
|
void set_zip_path(const String &p_path);
|
||||||
void set_zip_title(const String &p_title);
|
void set_zip_title(const String &p_title);
|
||||||
void set_mode(Mode p_mode);
|
|
||||||
void set_project_path(const String &p_path);
|
|
||||||
|
|
||||||
void ask_for_path_and_show();
|
void ask_for_path_and_show();
|
||||||
void show_dialog();
|
void show_dialog();
|
||||||
|
|
Loading…
Reference in a new issue