summaryrefslogtreecommitdiff
path: root/editor/filesystem_dock.h
diff options
context:
space:
mode:
Diffstat (limited to 'editor/filesystem_dock.h')
-rw-r--r--editor/filesystem_dock.h76
1 files changed, 53 insertions, 23 deletions
diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h
index c33a745ce4..2cb0573a3d 100644
--- a/editor/filesystem_dock.h
+++ b/editor/filesystem_dock.h
@@ -32,6 +32,7 @@
#include "scene/gui/box_container.h"
#include "scene/gui/control.h"
+#include "scene/gui/dialogs.h"
#include "scene/gui/item_list.h"
#include "scene/gui/label.h"
#include "scene/gui/menu_button.h"
@@ -67,9 +68,11 @@ private:
FILE_DEPENDENCIES,
FILE_OWNERS,
FILE_MOVE,
+ FILE_RENAME,
FILE_REMOVE,
FILE_REIMPORT,
FILE_INFO,
+ FILE_NEW_FOLDER,
FILE_SHOW_IN_EXPLORER,
FILE_COPY_PATH
};
@@ -77,7 +80,12 @@ private:
enum FolderMenu {
FOLDER_EXPAND_ALL,
FOLDER_COLLAPSE_ALL,
- FOLDER_SHOW_IN_EXPLORER
+ FOLDER_MOVE,
+ FOLDER_RENAME,
+ FOLDER_REMOVE,
+ FOLDER_NEW_FOLDER,
+ FOLDER_SHOW_IN_EXPLORER,
+ FOLDER_COPY_PATH
};
VBoxContainer *scanning_vb;
@@ -90,7 +98,7 @@ private:
Button *button_reload;
Button *button_favorite;
- Button *button_back;
+ Button *button_tree;
Button *button_display_mode;
Button *button_hist_next;
Button *button_hist_prev;
@@ -99,7 +107,7 @@ private:
TextureRect *search_icon;
HBoxContainer *path_hb;
- bool split_mode;
+ bool low_height_mode;
DisplayMode display_mode;
PopupMenu *file_options;
@@ -110,13 +118,27 @@ private:
DependencyRemoveDialog *remove_dialog;
EditorDirDialog *move_dialog;
- EditorFileDialog *rename_dialog;
+ ConfirmationDialog *rename_dialog;
+ LineEdit *rename_dialog_text;
+ ConfirmationDialog *make_dir_dialog;
+ LineEdit *make_dir_dialog_text;
- Vector<String> move_dirs;
- Vector<String> move_files;
+ class FileOrFolder {
+ public:
+ String path;
+ bool is_file;
+
+ FileOrFolder()
+ : path(""), is_file(false) {}
+ FileOrFolder(const String &p_path, bool p_is_file)
+ : path(p_path), is_file(p_is_file) {}
+ };
+ FileOrFolder to_rename;
+ Vector<FileOrFolder> to_move;
Vector<String> history;
int history_pos;
+ int history_max_size;
String path;
@@ -126,41 +148,47 @@ private:
Tree *tree; //directories
ItemList *files;
- void _file_multi_selected(int p_index, bool p_selected);
- void _file_selected();
+ bool _create_tree(TreeItem *p_parent, EditorFileSystemDirectory *p_dir, Vector<String> &uncollapsed_paths);
+ void _update_tree(bool keep_collapse_state);
+
+ void _update_files(bool p_keep_selection);
+ void _update_file_display_toggle_button();
+ void _change_file_display();
+ void _fs_changed();
void _go_to_tree();
- void _go_to_dir(const String &p_dir);
+ void _go_to_file_list();
+
void _select_file(int p_idx);
+ void _file_multi_selected(int p_index, bool p_selected);
- bool _create_tree(TreeItem *p_parent, EditorFileSystemDirectory *p_dir);
- void _thumbnail_done(const String &p_path, const Ref<Texture> &p_preview, const Variant &p_udata);
- void _find_inside_move_files(EditorFileSystemDirectory *efsd, Vector<String> &files);
- void _find_remaps(EditorFileSystemDirectory *efsd, Map<String, String> &renames, List<String> &to_remaps);
+ void _file_selected();
+ void _dir_selected();
+
+ void _get_all_files_in_dir(EditorFileSystemDirectory *efsd, Vector<String> &files) const;
+ void _find_remaps(EditorFileSystemDirectory *efsd, const Map<String, String> &renames, Vector<String> &to_remaps) const;
+ void _try_move_item(const FileOrFolder &p_item, const String &p_new_path, Map<String, String> &p_renames) const;
+ void _update_dependencies_after_move(const Map<String, String> &p_renames) const;
- void _rename_operation(const String &p_to_path);
- void _move_operation(const String &p_to_path);
+ void _make_dir_confirm();
+ void _rename_operation_confirm();
+ void _move_operation_confirm(const String &p_to_path);
void _file_option(int p_option);
void _folder_option(int p_option);
- void _update_files(bool p_keep_selection);
- void _change_file_display();
- void _fs_changed();
void _fw_history();
void _bw_history();
+ void _update_history();
void _push_to_history();
- void _dir_selected();
- void _update_tree();
- void _rescan();
void _set_scanning_mode();
+ void _rescan();
void _favorites_pressed();
- void _open_pressed();
- void _dir_rmb_pressed(const Vector2 &p_pos);
void _search_changed(const String &p_text);
+ void _dir_rmb_pressed(const Vector2 &p_pos);
void _files_list_rmb_select(int p_item, const Vector2 &p_pos);
struct FileInfo {
@@ -169,6 +197,7 @@ private:
StringName type;
int import_status; //0 not imported, 1 - ok, 2- must reimport, 3- broken
Vector<String> sources;
+ bool import_broken;
bool operator<(const FileInfo &fi) const {
return name < fi.name;
@@ -182,6 +211,7 @@ private:
void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from);
void _preview_invalidated(const String &p_path);
+ void _thumbnail_done(const String &p_path, const Ref<Texture> &p_preview, const Variant &p_udata);
protected:
void _notification(int p_what);