Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use EditorFileDialog instead of FileDialog in the project manager #52742

Merged

Conversation

Geometror
Copy link
Member

@Geometror Geometror commented Sep 16, 2021

Use EditorFileDialog instead of FileDialog in the project manager (primarily because of the favorites/recent_dir functionality), aiming to accelerate the workflow when frequently creating new projects/dealing with many projects in general. This allows for easier navigation to common folders in which you create many small projects (e.g. for testing/prototyping).

Changes:

  • Use EditorFileDialog instead of FileDialog in the project manager
    • Only single files and empty directories can be deleted (for safety/implementation simplicity)
  • Add option to disable previews in EditorFileDialog
  • Add a proper project_manager_hint to the Engine singleton (removed Main::is_project_manager)
  • some refactoring of EditorFileDialog to reduce code duplication and improve code style

main

@Geometror Geometror requested review from a team as code owners September 16, 2021 11:25
@Geometror Geometror force-pushed the improve-project-manager-file-dialog branch from 5579449 to dff8016 Compare September 16, 2021 11:37
@Calinou Calinou added this to the 4.0 milestone Sep 16, 2021
@Geometror Geometror force-pushed the improve-project-manager-file-dialog branch from dff8016 to 3da0df7 Compare February 2, 2022 17:17
@Geometror Geometror requested a review from a team as a code owner February 2, 2022 17:17
@Geometror
Copy link
Member Author

Rebased and changed the following:

  • Add a warning popup (renamed the mkdirerr AcceptDialog and reuse it) when the path of a favorites entry does not exist anymore and remove it.

.godot/.gdignore Outdated Show resolved Hide resolved
core/config/engine.h Outdated Show resolved Hide resolved
_push_history();
Error change_dir_result = dir_access->change_dir(favorites->get_item_metadata(p_idx));
if (change_dir_result != OK) {
error_dialog->set_text(TTR("Favorized folder does not exist anymore and will be removed."));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure "Favorized" will be understood / is a common term for this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The English term for this would be "Favorited", not "Favorized".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you are right, changed it to "favorited".

@Geometror Geometror force-pushed the improve-project-manager-file-dialog branch from 3da0df7 to 565b9b7 Compare February 3, 2022 00:22
@Geometror
Copy link
Member Author

Fixed the addressed issues, resulting in some changes to EditorFileDialog:

  • It does no longer contain project manager related code. Dialogs which access the "global" filesystem (meaning not the project directory) now support deletion (only files and empty folders for safety), not only the file dialogs in the project manager (for example, the editor feature import dialog/export GLTF dialog). This option was already there in those dialogs, but resulted in an error since the DependencyRemoveDialog was always used for deletion.

In addition:

  • Some minor refactoring and style improvements (e.g. added method _update_icons to reduce code duplication/ removed some comments)

@Geometror Geometror force-pushed the improve-project-manager-file-dialog branch from 565b9b7 to ca05ee0 Compare February 12, 2022 03:01
@akien-mga
Copy link
Member

Needs a rebase to solve merge conflicts.

@Geometror Geometror force-pushed the improve-project-manager-file-dialog branch from ca05ee0 to 77fb65d Compare February 12, 2022 11:07
@akien-mga akien-mga merged commit 7d0b9ec into godotengine:master Feb 12, 2022
@akien-mga
Copy link
Member

Thanks!

@bruvzg
Copy link
Member

bruvzg commented Feb 12, 2022

This change is causing Project Manager to crash on exit:

Trace:

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [22513]

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   godot.osx.opt.tools.arm64     	       0x107c8e928 ImageTexture::~ImageTexture() + 48 (texture.cpp:290)
1   godot.osx.opt.tools.arm64     	       0x107c8e924 ImageTexture::~ImageTexture() + 44 (texture.cpp:290)
2   godot.osx.opt.tools.arm64     	       0x10639ddf4 void memdelete<Texture2D>(Texture2D*) + 28 (memory.h:108) [inlined]
3   godot.osx.opt.tools.arm64     	       0x10639ddf4 Ref<Texture2D>::unref() + 48 (ref_counted.h:221) [inlined]
4   godot.osx.opt.tools.arm64     	       0x10639ddf4 Ref<Texture2D>::~Ref() + 48 (ref_counted.h:233) [inlined]
5   godot.osx.opt.tools.arm64     	       0x10639ddf4 Ref<Texture2D>::~Ref() + 48 (ref_counted.h:232) [inlined]
6   godot.osx.opt.tools.arm64     	       0x10639ddf4 KeyValue<String, Ref<Texture2D> >::~KeyValue() + 48 (pair.h:73) [inlined]
7   godot.osx.opt.tools.arm64     	       0x10639ddf4 KeyValue<String, Ref<Texture2D> >::~KeyValue() + 48 (pair.h:73) [inlined]
8   godot.osx.opt.tools.arm64     	       0x10639ddf4 Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::Element::~Element() + 48 (map.h:50) [inlined]
9   godot.osx.opt.tools.arm64     	       0x10639ddf4 Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::Element::~Element() + 48 (map.h:50) [inlined]
10  godot.osx.opt.tools.arm64     	       0x10639ddf4 void memdelete_allocator<Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::Element, DefaultAllocator>(Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::Element*) + 64 (memory.h:120)
11  godot.osx.opt.tools.arm64     	       0x10639dd98 Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::_cleanup_tree(Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::Element*) + 52 (map.h:571)
12  godot.osx.opt.tools.arm64     	       0x10639dd8c Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::_cleanup_tree(Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::Element*) + 40 (map.h:570)
13  godot.osx.opt.tools.arm64     	       0x10639dd8c Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::_cleanup_tree(Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::Element*) + 40 (map.h:570)
14  godot.osx.opt.tools.arm64     	       0x10639dd8c Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::_cleanup_tree(Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::Element*) + 40 (map.h:570)
15  godot.osx.opt.tools.arm64     	       0x10639dd8c Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::_cleanup_tree(Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::Element*) + 40 (map.h:570)
16  godot.osx.opt.tools.arm64     	       0x10639dd8c Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::_cleanup_tree(Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::Element*) + 40 (map.h:570)
17  godot.osx.opt.tools.arm64     	       0x10639dd8c Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::_cleanup_tree(Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::Element*) + 40 (map.h:570)
18  godot.osx.opt.tools.arm64     	       0x10639dd8c Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::_cleanup_tree(Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::Element*) + 40 (map.h:570)
19  godot.osx.opt.tools.arm64     	       0x106601608 Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::clear() + 20 (map.h:732) [inlined]
20  godot.osx.opt.tools.arm64     	       0x106601608 Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::~Map() + 20 (map.h:749) [inlined]
21  godot.osx.opt.tools.arm64     	       0x106601608 Map<String, Ref<Texture2D>, Comparator<String>, DefaultAllocator>::~Map() + 36 (map.h:748)
22  libsystem_c.dylib             	       0x1a3e747d8 __cxa_finalize_ranges + 460
23  libsystem_c.dylib             	       0x1a3e74580 exit + 44
24  libdyld.dylib                 	       0x1a3f91ea8 dyld4::LibSystemHelpers::exit(int) const + 20
25  dyld                          	       0x10e3a9140 start + 596

Seems like something wrong with loading/unloading editor icons.

@bruvzg
Copy link
Member

bruvzg commented Feb 12, 2022

Also, it seems to completly break editor setting saving/loading, everything is written to the current directory instead of proper global location.

akien-mga added a commit to akien-mga/godot that referenced this pull request Feb 16, 2022
gaudecker pushed a commit to gaudecker/godot that referenced this pull request Apr 3, 2022
chippmann added a commit to utopia-rise/godot-kotlin-jvm that referenced this pull request Nov 15, 2022
chippmann added a commit to utopia-rise/godot-kotlin-jvm that referenced this pull request Nov 16, 2022
chippmann added a commit to utopia-rise/godot-kotlin-jvm that referenced this pull request Nov 22, 2022
* Fix compilation errors in export plugin

* Comment rpc stuff fixes in #369

* Replace `plus_file` with `path_join`. See: godotengine/godot#65066

* Replace `call` with `callp` and `call_deferred` witch `call_deferredp`. See: godotengine/godot@d4433ae

* Replace `Main::is_project_manager()` with `Engine::get_singleton()->is_project_manager_hint()`. See: godotengine/godot#52742

* Fix `save` overridden method structure

* Add overrides for new pure virtual functions

* Add overrides for missing pure virtual functions

* Fix bottom panel

* Fix import and tooltip

* Implement missing function

* Make `KotlinEditorExportPlugin` header only to make it compile. See: `GDExtensionExportPlugin`

* Fix godot actions input

* Fix wrong arch input

* Rename osx to macos for platform input

* Rename job matrix name for macos targets

* Remove remaining `tools` inputs

* Add setup vulkan sdk

* Fix target

* Replace all occurrences of osx with macos

* Replace `OSX_ENABLED` with `MACOS_ENABLED`

* Rename directory

* Fix x86_64 binary name

* Fix android export template builds

* Replace `tools` with `editor`

* Fix download binary name

* Fix kotlin compilation errors (except rpc stuff from entry gen)

* Fix template release target after rebase

* Fix reference typos

* Fix reference typos

* fix: bring back kotlin_editor_export_plugin.cpp

* Fix imports

* Improve import path to match other occurrences

* Fix wrong alignment

Co-authored-by: Pierre-Thomas Meisels <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants