summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2019-05-09 22:06:35 +0200
committerMitch Curtis <mitch.curtis@qt.io>2019-05-28 18:27:18 +0200
commitffb6aab1f4c4402352c99579b49c7ffb3eb56324 (patch)
treebcdad025ff48ccf102cb0fa6c8f89669207f98c0
parent7112a45d9928562722e6b91d3482b29df8ed5ff8 (diff)
Add Quick Open dialog
This dialog searches every Resource-derived file in the project, making it extremely useful for searching everything from audio files to scripts. Unlike the Quick Open Script and Quick Open Scene dialogs, you don't need to think about the type of file you're opening, just its name. Shift + Alt + O was chosen to match the existing shortcuts for Quick Open Scene and Quick Open Script.
-rw-r--r--editor/editor_node.cpp7
-rw-r--r--editor/editor_node.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 23d1f25641..7a32c7be87 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -1922,6 +1922,12 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
file->popup_centered_ratio();
} break;
+ case FILE_QUICK_OPEN: {
+
+ quick_open->popup_dialog("Resource", true);
+ quick_open->set_title(TTR("Quick Open..."));
+
+ } break;
case FILE_QUICK_OPEN_SCENE: {
quick_open->popup_dialog("PackedScene", true);
@@ -5694,6 +5700,7 @@ EditorNode::EditorNode() {
p->add_separator();
p->add_submenu_item(TTR("Open Recent"), "RecentScenes", FILE_OPEN_RECENT);
p->add_separator();
+ p->add_shortcut(ED_SHORTCUT("editor/quick_open", TTR("Quick Open..."), KEY_MASK_SHIFT + KEY_MASK_ALT + KEY_O), FILE_QUICK_OPEN);
p->add_shortcut(ED_SHORTCUT("editor/quick_open_scene", TTR("Quick Open Scene..."), KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_O), FILE_QUICK_OPEN_SCENE);
p->add_shortcut(ED_SHORTCUT("editor/quick_open_script", TTR("Quick Open Script..."), KEY_MASK_ALT + KEY_MASK_CMD + KEY_O), FILE_QUICK_OPEN_SCRIPT);
p->add_separator();
diff --git a/editor/editor_node.h b/editor/editor_node.h
index 0084d421f9..52a5a06c1d 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -146,6 +146,7 @@ private:
FILE_SAVE_OPTIMIZED,
FILE_OPEN_RECENT,
FILE_OPEN_OLD_SCENE,
+ FILE_QUICK_OPEN,
FILE_QUICK_OPEN_SCENE,
FILE_QUICK_OPEN_SCRIPT,
FILE_OPEN_PREV,