summaryrefslogtreecommitdiff
path: root/editor/editor_file_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_file_dialog.cpp')
-rw-r--r--editor/editor_file_dialog.cpp88
1 files changed, 44 insertions, 44 deletions
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index 625f46f9d3..dd6523e12c 100644
--- a/editor/editor_file_dialog.cpp
+++ b/editor/editor_file_dialog.cpp
@@ -78,7 +78,7 @@ void EditorFileDialog::_notification(int p_what) {
preview_wheel_index++;
if (preview_wheel_index >= 8)
preview_wheel_index = 0;
- Ref<Texture> frame = get_icon("Progress" + itos(preview_wheel_index + 1), "EditorIcons");
+ Ref<Texture2D> frame = get_icon("Progress" + itos(preview_wheel_index + 1), "EditorIcons");
preview->set_texture(frame);
preview_wheel_timeout = 0.1;
}
@@ -263,7 +263,7 @@ void EditorFileDialog::_post_popup() {
_request_single_thumbnail(get_current_dir().plus_file(get_current_file()));
if (is_visible_in_tree()) {
- Ref<Texture> folder = get_icon("folder", "FileDialog");
+ Ref<Texture2D> folder = get_icon("folder", "FileDialog");
const Color folder_color = get_color("folder_icon_modulate", "FileDialog");
recent->clear();
@@ -295,7 +295,7 @@ void EditorFileDialog::_post_popup() {
set_process_unhandled_input(true);
}
-void EditorFileDialog::_thumbnail_result(const String &p_path, const Ref<Texture> &p_preview, const Ref<Texture> &p_small_preview, const Variant &p_udata) {
+void EditorFileDialog::_thumbnail_result(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, const Variant &p_udata) {
if (display_mode == DISPLAY_LIST || p_preview.is_null())
return;
@@ -305,12 +305,12 @@ void EditorFileDialog::_thumbnail_result(const String &p_path, const Ref<Texture
String pname = d["path"];
if (pname == p_path) {
item_list->set_item_icon(i, p_preview);
- item_list->set_item_tag_icon(i, Ref<Texture>());
+ item_list->set_item_tag_icon(i, Ref<Texture2D>());
}
}
}
-void EditorFileDialog::_thumbnail_done(const String &p_path, const Ref<Texture> &p_preview, const Ref<Texture> &p_small_preview, const Variant &p_udata) {
+void EditorFileDialog::_thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, const Variant &p_udata) {
set_process(false);
preview_waiting = false;
@@ -326,7 +326,7 @@ void EditorFileDialog::_thumbnail_done(const String &p_path, const Ref<Texture>
} else {
preview_vb->hide();
- preview->set_texture(Ref<Texture>());
+ preview->set_texture(Ref<Texture2D>());
}
}
@@ -347,7 +347,7 @@ void EditorFileDialog::_action_pressed() {
String fbase = dir_access->get_current_dir();
- PoolVector<String> files;
+ Vector<String> files;
for (int i = 0; i < item_list->get_item_count(); i++) {
if (item_list->is_selected(i))
files.push_back(fbase.plus_file(item_list->get_item_text(i)));
@@ -704,8 +704,8 @@ void EditorFileDialog::update_file_list() {
int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
thumbnail_size *= EDSCALE;
- Ref<Texture> folder_thumbnail;
- Ref<Texture> file_thumbnail;
+ Ref<Texture2D> folder_thumbnail;
+ Ref<Texture2D> file_thumbnail;
item_list->clear();
@@ -745,7 +745,7 @@ void EditorFileDialog::update_file_list() {
dir_access->list_dir_begin();
- Ref<Texture> folder = get_icon("folder", "FileDialog");
+ Ref<Texture2D> folder = get_icon("folder", "FileDialog");
const Color folder_color = get_color("folder_icon_modulate", "FileDialog");
List<String> files;
List<String> dirs;
@@ -841,7 +841,7 @@ void EditorFileDialog::update_file_list() {
if (get_icon_func) {
- Ref<Texture> icon = get_icon_func(cdir.plus_file(files.front()->get()));
+ Ref<Texture2D> icon = get_icon_func(cdir.plus_file(files.front()->get()));
if (display_mode == DISPLAY_THUMBNAILS) {
item_list->set_item_icon(item_list->get_item_count() - 1, file_thumbnail);
@@ -1215,7 +1215,7 @@ void EditorFileDialog::_update_favorites() {
bool res = access == ACCESS_RESOURCES;
String current = get_current_dir();
- Ref<Texture> folder_icon = get_icon("Folder", "EditorIcons");
+ Ref<Texture2D> folder_icon = get_icon("Folder", "EditorIcons");
const Color folder_color = get_color("folder_icon_modulate", "FileDialog");
favorites->clear();
@@ -1419,7 +1419,7 @@ void EditorFileDialog::_bind_methods() {
ClassDB::bind_method(D_METHOD("invalidate"), &EditorFileDialog::invalidate);
ADD_SIGNAL(MethodInfo("file_selected", PropertyInfo(Variant::STRING, "path")));
- ADD_SIGNAL(MethodInfo("files_selected", PropertyInfo(Variant::POOL_STRING_ARRAY, "paths")));
+ ADD_SIGNAL(MethodInfo("files_selected", PropertyInfo(Variant::PACKED_STRING_ARRAY, "paths")));
ADD_SIGNAL(MethodInfo("dir_selected", PropertyInfo(Variant::STRING, "dir")));
ADD_PROPERTY(PropertyInfo(Variant::INT, "access", PROPERTY_HINT_ENUM, "Resources,User data,File system"), "set_access", "get_access");
@@ -1537,9 +1537,9 @@ EditorFileDialog::EditorFileDialog() {
pathhb->add_child(dir_next);
pathhb->add_child(dir_up);
- dir_prev->connect("pressed", this, "_go_back");
- dir_next->connect("pressed", this, "_go_forward");
- dir_up->connect("pressed", this, "_go_up");
+ dir_prev->connect_compat("pressed", this, "_go_back");
+ dir_next->connect_compat("pressed", this, "_go_forward");
+ dir_up->connect_compat("pressed", this, "_go_up");
pathhb->add_child(memnew(Label(TTR("Path:"))));
@@ -1549,20 +1549,20 @@ EditorFileDialog::EditorFileDialog() {
refresh = memnew(ToolButton);
refresh->set_tooltip(TTR("Refresh files."));
- refresh->connect("pressed", this, "_update_file_list");
+ refresh->connect_compat("pressed", this, "_update_file_list");
pathhb->add_child(refresh);
favorite = memnew(ToolButton);
favorite->set_toggle_mode(true);
favorite->set_tooltip(TTR("(Un)favorite current folder."));
- favorite->connect("pressed", this, "_favorite_pressed");
+ favorite->connect_compat("pressed", this, "_favorite_pressed");
pathhb->add_child(favorite);
show_hidden = memnew(ToolButton);
show_hidden->set_toggle_mode(true);
show_hidden->set_pressed(is_showing_hidden_files());
show_hidden->set_tooltip(TTR("Toggle the visibility of hidden files."));
- show_hidden->connect("toggled", this, "set_show_hidden_files");
+ show_hidden->connect_compat("toggled", this, "set_show_hidden_files");
pathhb->add_child(show_hidden);
pathhb->add_child(memnew(VSeparator));
@@ -1571,7 +1571,7 @@ EditorFileDialog::EditorFileDialog() {
view_mode_group.instance();
mode_thumbnails = memnew(ToolButton);
- mode_thumbnails->connect("pressed", this, "set_display_mode", varray(DISPLAY_THUMBNAILS));
+ mode_thumbnails->connect_compat("pressed", this, "set_display_mode", varray(DISPLAY_THUMBNAILS));
mode_thumbnails->set_toggle_mode(true);
mode_thumbnails->set_pressed(display_mode == DISPLAY_THUMBNAILS);
mode_thumbnails->set_button_group(view_mode_group);
@@ -1579,7 +1579,7 @@ EditorFileDialog::EditorFileDialog() {
pathhb->add_child(mode_thumbnails);
mode_list = memnew(ToolButton);
- mode_list->connect("pressed", this, "set_display_mode", varray(DISPLAY_LIST));
+ mode_list->connect_compat("pressed", this, "set_display_mode", varray(DISPLAY_LIST));
mode_list->set_toggle_mode(true);
mode_list->set_pressed(display_mode == DISPLAY_LIST);
mode_list->set_button_group(view_mode_group);
@@ -1588,11 +1588,11 @@ EditorFileDialog::EditorFileDialog() {
drives = memnew(OptionButton);
pathhb->add_child(drives);
- drives->connect("item_selected", this, "_select_drive");
+ drives->connect_compat("item_selected", this, "_select_drive");
makedir = memnew(Button);
makedir->set_text(TTR("Create Folder"));
- makedir->connect("pressed", this, "_make_dir");
+ makedir->connect_compat("pressed", this, "_make_dir");
pathhb->add_child(makedir);
list_hb = memnew(HSplitContainer);
@@ -1614,15 +1614,15 @@ EditorFileDialog::EditorFileDialog() {
fav_hb->add_spacer();
fav_up = memnew(ToolButton);
fav_hb->add_child(fav_up);
- fav_up->connect("pressed", this, "_favorite_move_up");
+ fav_up->connect_compat("pressed", this, "_favorite_move_up");
fav_down = memnew(ToolButton);
fav_hb->add_child(fav_down);
- fav_down->connect("pressed", this, "_favorite_move_down");
+ fav_down->connect_compat("pressed", this, "_favorite_move_down");
favorites = memnew(ItemList);
fav_vb->add_child(favorites);
favorites->set_v_size_flags(SIZE_EXPAND_FILL);
- favorites->connect("item_selected", this, "_favorite_selected");
+ favorites->connect_compat("item_selected", this, "_favorite_selected");
VBoxContainer *rec_vb = memnew(VBoxContainer);
vsc->add_child(rec_vb);
@@ -1631,7 +1631,7 @@ EditorFileDialog::EditorFileDialog() {
recent = memnew(ItemList);
recent->set_allow_reselect(true);
rec_vb->add_margin_child(TTR("Recent:"), recent, true);
- recent->connect("item_selected", this, "_recent_selected");
+ recent->connect_compat("item_selected", this, "_recent_selected");
VBoxContainer *item_vb = memnew(VBoxContainer);
list_hb->add_child(item_vb);
@@ -1650,13 +1650,13 @@ EditorFileDialog::EditorFileDialog() {
item_list = memnew(ItemList);
item_list->set_v_size_flags(SIZE_EXPAND_FILL);
- item_list->connect("item_rmb_selected", this, "_item_list_item_rmb_selected");
- item_list->connect("rmb_clicked", this, "_item_list_rmb_clicked");
+ item_list->connect_compat("item_rmb_selected", this, "_item_list_item_rmb_selected");
+ item_list->connect_compat("rmb_clicked", this, "_item_list_rmb_clicked");
item_list->set_allow_rmb_select(true);
list_vb->add_child(item_list);
item_menu = memnew(PopupMenu);
- item_menu->connect("id_pressed", this, "_item_menu_id_pressed");
+ item_menu->connect_compat("id_pressed", this, "_item_menu_id_pressed");
add_child(item_menu);
// Other stuff.
@@ -1687,19 +1687,19 @@ EditorFileDialog::EditorFileDialog() {
access = ACCESS_RESOURCES;
_update_drives();
- connect("confirmed", this, "_action_pressed");
- item_list->connect("item_selected", this, "_item_selected", varray(), CONNECT_DEFERRED);
- item_list->connect("multi_selected", this, "_multi_selected", varray(), CONNECT_DEFERRED);
- item_list->connect("item_activated", this, "_item_db_selected", varray());
- item_list->connect("nothing_selected", this, "_items_clear_selection");
- dir->connect("text_entered", this, "_dir_entered");
- file->connect("text_entered", this, "_file_entered");
- filter->connect("item_selected", this, "_filter_selected");
+ connect_compat("confirmed", this, "_action_pressed");
+ item_list->connect_compat("item_selected", this, "_item_selected", varray(), CONNECT_DEFERRED);
+ item_list->connect_compat("multi_selected", this, "_multi_selected", varray(), CONNECT_DEFERRED);
+ item_list->connect_compat("item_activated", this, "_item_db_selected", varray());
+ item_list->connect_compat("nothing_selected", this, "_items_clear_selection");
+ dir->connect_compat("text_entered", this, "_dir_entered");
+ file->connect_compat("text_entered", this, "_file_entered");
+ filter->connect_compat("item_selected", this, "_filter_selected");
confirm_save = memnew(ConfirmationDialog);
confirm_save->set_as_toplevel(true);
add_child(confirm_save);
- confirm_save->connect("confirmed", this, "_save_confirm_pressed");
+ confirm_save->connect_compat("confirmed", this, "_save_confirm_pressed");
remove_dialog = memnew(DependencyRemoveDialog);
add_child(remove_dialog);
@@ -1713,7 +1713,7 @@ EditorFileDialog::EditorFileDialog() {
makevb->add_margin_child(TTR("Name:"), makedirname);
add_child(makedialog);
makedialog->register_text_enter(makedirname);
- makedialog->connect("confirmed", this, "_make_dir_confirm");
+ makedialog->connect_compat("confirmed", this, "_make_dir_confirm");
mkdirerr = memnew(AcceptDialog);
mkdirerr->set_text(TTR("Could not create folder."));
add_child(mkdirerr);
@@ -1777,10 +1777,10 @@ EditorLineEditFileChooser::EditorLineEditFileChooser() {
line_edit->set_h_size_flags(SIZE_EXPAND_FILL);
button = memnew(Button);
add_child(button);
- button->connect("pressed", this, "_browse");
+ button->connect_compat("pressed", this, "_browse");
dialog = memnew(EditorFileDialog);
add_child(dialog);
- dialog->connect("file_selected", this, "_chosen");
- dialog->connect("dir_selected", this, "_chosen");
- dialog->connect("files_selected", this, "_chosen");
+ dialog->connect_compat("file_selected", this, "_chosen");
+ dialog->connect_compat("dir_selected", this, "_chosen");
+ dialog->connect_compat("files_selected", this, "_chosen");
}