PopupMenu now emits both index_pressed and id_pressed instead of item_pressed, closes #3188

This commit is contained in:
Juan Linietsky 2017-01-08 18:18:54 -03:00
parent 1b0930c435
commit fa170cbc58
43 changed files with 89 additions and 87 deletions

View file

@ -1267,7 +1267,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) {
settings_vbc->add_margin_child("Pick Distance:", settings_pick_distance);
clip_mode=CLIP_DISABLED;
options->get_popup()->connect("item_pressed", this,"_menu_option");
options->get_popup()->connect("id_pressed", this,"_menu_option");
HBoxContainer *hb = memnew( HBoxContainer );
add_child(hb);

View file

@ -3306,7 +3306,7 @@ VisualScriptEditor::VisualScriptEditor() {
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/cut_nodes"), EDIT_CUT_NODES);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/paste_nodes"), EDIT_PASTE_NODES);
edit_menu->get_popup()->connect("item_pressed",this,"_menu_option");
edit_menu->get_popup()->connect("id_pressed",this,"_menu_option");
main_hsplit = memnew( HSplitContainer );
add_child(main_hsplit);
@ -3446,7 +3446,7 @@ VisualScriptEditor::VisualScriptEditor() {
undo_redo = EditorNode::get_singleton()->get_undo_redo();
new_function_menu = memnew( PopupMenu );
new_function_menu->connect("item_pressed",this,"_override_pressed");
new_function_menu->connect("id_pressed",this,"_override_pressed");
add_child(new_function_menu);
updating_members=false;
@ -3468,7 +3468,7 @@ VisualScriptEditor::VisualScriptEditor() {
port_action_popup = memnew( PopupMenu );
add_child(port_action_popup);
port_action_popup->connect("item_pressed",this,"_port_action_menu");
port_action_popup->connect("id_pressed",this,"_port_action_menu");
}

View file

@ -1361,7 +1361,7 @@ LineEdit::LineEdit() {
menu->add_item(TTR("Clear"),MENU_CLEAR);
menu->add_separator();
menu->add_item(TTR("Undo"),MENU_UNDO,KEY_MASK_CMD|KEY_Z);
menu->connect("item_pressed",this,"menu_option");
menu->connect("id_pressed",this,"menu_option");
expand_to_text_length=false;

View file

@ -326,7 +326,7 @@ OptionButton::OptionButton() {
popup->hide();
popup->set_as_toplevel(true);
add_child(popup);
popup->connect("item_pressed", this,"_selected");
popup->connect("id_pressed", this,"_selected");
current=-1;
set_text_align(ALIGN_LEFT);

View file

@ -912,7 +912,8 @@ void PopupMenu::activate_item(int p_item) {
ERR_FAIL_INDEX(p_item,items.size());
ERR_FAIL_COND(items[p_item].separator);
int id = items[p_item].ID>=0?items[p_item].ID:p_item;
emit_signal("item_pressed",id);
emit_signal("id_pressed",id);
emit_signal("index_pressed",p_item);
//hide all parent PopupMenue's
Node *next = get_parent();
@ -1157,7 +1158,8 @@ void PopupMenu::_bind_methods() {
ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"items",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_items"),_SCS("_get_items") );
ADD_PROPERTYNO( PropertyInfo(Variant::BOOL, "hide_on_item_selection" ), _SCS("set_hide_on_item_selection"), _SCS("is_hide_on_item_selection") );
ADD_SIGNAL( MethodInfo("item_pressed", PropertyInfo( Variant::INT,"ID") ) );
ADD_SIGNAL( MethodInfo("id_pressed", PropertyInfo( Variant::INT,"ID") ) );
ADD_SIGNAL( MethodInfo("index_pressed", PropertyInfo( Variant::INT,"index") ) );
}

View file

@ -4836,7 +4836,7 @@ TextEdit::TextEdit() {
menu->add_item(TTR("Clear"),MENU_CLEAR);
menu->add_separator();
menu->add_item(TTR("Undo"),MENU_UNDO,KEY_MASK_CMD|KEY_Z);
menu->connect("item_pressed",this,"menu_option");
menu->connect("id_pressed",this,"menu_option");
}

View file

@ -3688,7 +3688,7 @@ Tree::Tree() {
v_scroll->connect("value_changed", this,"_scroll_moved");
text_editor->connect("text_entered", this,"_text_editor_enter");
text_editor->connect("modal_close", this,"_text_editor_modal_close");
popup_menu->connect("item_pressed", this,"_popup_select");
popup_menu->connect("id_pressed", this,"_popup_select");
value_editor->connect("value_changed", this,"_value_editor_changed");
value_editor->set_as_toplevel(true);

View file

@ -3012,7 +3012,7 @@ void AnimationKeyEditor::_notification(int p_what) {
tpp->add_item(TTR("In-Out"),TRACK_MENU_SET_ALL_TRANS_INOUT);
tpp->add_item(TTR("Out-In"),TRACK_MENU_SET_ALL_TRANS_OUTIN);
tpp->set_name(TTR("Transitions"));
tpp->connect("item_pressed",this,"_menu_track");
tpp->connect("id_pressed",this,"_menu_track");
optimize_dialog->connect("confirmed",this,"_animation_optimize");
menu_track->get_popup()->add_child(tpp);
@ -3986,7 +3986,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
menu_add_track = memnew( MenuButton );
hb->add_child(menu_add_track);
menu_add_track->get_popup()->connect("item_pressed",this,"_menu_add_track");
menu_add_track->get_popup()->connect("id_pressed",this,"_menu_add_track");
menu_add_track->set_tooltip(TTR("Add new tracks."));
move_up_button = memnew( ToolButton );
@ -4014,7 +4014,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
menu_track = memnew( MenuButton );
hb->add_child(menu_track);
menu_track->get_popup()->connect("item_pressed",this,"_menu_track");
menu_track->get_popup()->connect("id_pressed",this,"_menu_track");
menu_track->set_tooltip(TTR("Track tools"));
edit_button = memnew( ToolButton );
@ -4071,7 +4071,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
l->set_pos(Point2(0,3));
// dr_panel->add_child(l);*/
// menu->get_popup()->connect("item_pressed",this,"_menu_callback");
// menu->get_popup()->connect("id_pressed",this,"_menu_callback");
hb = memnew( HBoxContainer);
@ -4127,7 +4127,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
add_child(type_menu);
for(int i=0;i<Variant::VARIANT_MAX;i++)
type_menu->add_item(Variant::get_type_name(Variant::Type(i)),i);
type_menu->connect("item_pressed",this,"_create_value_item");
type_menu->connect("id_pressed",this,"_create_value_item");
VBoxContainer *curve_vb = memnew( VBoxContainer );
curve_vb->set_name(TTR("Transition"));
@ -4166,7 +4166,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
track_name->connect("text_entered",this,"_track_name_changed");
track_menu = memnew( PopupMenu );
add_child(track_menu);
track_menu->connect("item_pressed",this,"_track_menu_selected");
track_menu->connect("id_pressed",this,"_track_menu_selected");
key_editor_tab->hide();

View file

@ -1418,7 +1418,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
support->get_popup()->add_check_item(TTR("Testing"),SUPPORT_TESTING);
support->get_popup()->set_item_checked(SUPPORT_OFFICIAL,true);
support->get_popup()->set_item_checked(SUPPORT_COMMUNITY,true);
support->get_popup()->connect("item_pressed",this,"_support_toggled");
support->get_popup()->connect("id_pressed",this,"_support_toggled");
/////////

View file

@ -421,7 +421,7 @@ ConnectDialog::ConnectDialog() {
// dst_method_list->get_popup()->connect("item_pressed", this,"_dst_method_list_selected");
// dst_method_list->get_popup()->connect("id_pressed", this,"_dst_method_list_selected");
tree->connect("node_selected", this,"_tree_node_selected");
set_as_toplevel(true);

View file

@ -5771,7 +5771,7 @@ EditorNode::EditorNode() {
pm_export->add_separator();
pm_export->add_shortcut(ED_SHORTCUT("editor/convert_to_MeshLibrary", TTR("MeshLibrary..")), FILE_EXPORT_MESH_LIBRARY);
pm_export->add_shortcut(ED_SHORTCUT("editor/convert_to_TileSet", TTR("TileSet..")), FILE_EXPORT_TILESET);
pm_export->connect("item_pressed",this,"_menu_option");
pm_export->connect("id_pressed",this,"_menu_option");
p->add_separator();
p->add_shortcut(ED_SHORTCUT("editor/undo", TTR("Undo"),KEY_MASK_CMD+KEY_Z),EDIT_UNDO,true);
@ -5793,7 +5793,7 @@ EditorNode::EditorNode() {
recent_scenes = memnew( PopupMenu );
recent_scenes->set_name("RecentScenes");
p->add_child(recent_scenes);
recent_scenes->connect("item_pressed",this,"_open_recent_scene");
recent_scenes->connect("id_pressed",this,"_open_recent_scene");
{
Control *sp = memnew( Control );
@ -5850,7 +5850,7 @@ EditorNode::EditorNode() {
left_menu_hb->add_child( import_menu );
p=import_menu->get_popup();
p->connect("item_pressed",this,"_menu_option");
p->connect("id_pressed",this,"_menu_option");
tool_menu = memnew( MenuButton );
tool_menu->set_tooltip(TTR("Miscellaneous project or scene-wide tools."));
@ -5860,7 +5860,7 @@ EditorNode::EditorNode() {
left_menu_hb->add_child( tool_menu );
p=tool_menu->get_popup();
p->connect("item_pressed",this,"_menu_option");
p->connect("id_pressed",this,"_menu_option");
p->add_item(TTR("Orphan Resource Explorer"),TOOLS_ORPHAN_RESOURCES);
export_button = memnew( ToolButton );
@ -5930,7 +5930,7 @@ EditorNode::EditorNode() {
native_play_button->set_text("NTV");
menu_hb->add_child(native_play_button);
native_play_button->hide();
native_play_button->get_popup()->connect("item_pressed",this,"_run_in_device");
native_play_button->get_popup()->connect("id_pressed",this,"_run_in_device");
run_native->connect("native_run",this,"_menu_option",varray(RUN_PLAY_NATIVE));
// VSeparator *s1 = memnew( VSeparator );
@ -5979,7 +5979,7 @@ EditorNode::EditorNode() {
p->set_item_tooltip(p->get_item_count()-1,TTR("When this option is turned on, any changes made to the scene in the editor will be replicated in the running game.\nWhen used remotely on a device, this is more efficient with network filesystem."));
p->add_check_item(TTR("Sync Script Changes"),RUN_RELOAD_SCRIPTS);
p->set_item_tooltip(p->get_item_count()-1,TTR("When this option is turned on, any script that is saved will be reloaded on the running game.\nWhen used remotely on a device, this is more efficient with network filesystem."));
p->connect("item_pressed",this,"_menu_option");
p->connect("id_pressed",this,"_menu_option");
/*
run_settings_button = memnew( ToolButton );
@ -6053,7 +6053,7 @@ EditorNode::EditorNode() {
editor_layouts = memnew( PopupMenu );
editor_layouts->set_name("Layouts");
p->add_child(editor_layouts);
editor_layouts->connect("item_pressed",this,"_layout_menu_option");
editor_layouts->connect("id_pressed",this,"_layout_menu_option");
p->add_submenu_item(TTR("Editor Layout"), "Layouts");
p->add_shortcut(ED_SHORTCUT("editor/fullscreen_mode",TTR("Toggle Fullscreen"),KEY_MASK_SHIFT|KEY_F11),SETTINGS_TOGGLE_FULLSCREN);
@ -6165,7 +6165,7 @@ EditorNode::EditorNode() {
prop_editor_hb->add_child(resource_save_button);
resource_save_button->get_popup()->add_item(TTR("Save"),RESOURCE_SAVE);
resource_save_button->get_popup()->add_item(TTR("Save As.."),RESOURCE_SAVE_AS);
resource_save_button->get_popup()->connect("item_pressed",this,"_menu_option");
resource_save_button->get_popup()->connect("id_pressed",this,"_menu_option");
resource_save_button->set_focus_mode(Control::FOCUS_NONE);
resource_save_button->set_disabled(true);
@ -6193,7 +6193,7 @@ EditorNode::EditorNode() {
editor_history_menu->set_icon( gui_base->get_icon("History","EditorIcons"));
prop_editor_hb->add_child(editor_history_menu);
editor_history_menu->connect("about_to_show",this,"_prepare_history");
editor_history_menu->get_popup()->connect("item_pressed",this,"_select_history");
editor_history_menu->get_popup()->connect("id_pressed",this,"_select_history");
prop_editor_hb = memnew( HBoxContainer ); //again...
@ -6504,11 +6504,11 @@ EditorNode::EditorNode() {
file_menu->get_popup()->connect("item_pressed", this,"_menu_option");
object_menu->get_popup()->connect("item_pressed", this,"_menu_option");
file_menu->get_popup()->connect("id_pressed", this,"_menu_option");
object_menu->get_popup()->connect("id_pressed", this,"_menu_option");
update_menu->get_popup()->connect("item_pressed", this,"_menu_option");
settings_menu->get_popup()->connect("item_pressed", this,"_menu_option");
update_menu->get_popup()->connect("id_pressed", this,"_menu_option");
settings_menu->get_popup()->connect("id_pressed", this,"_menu_option");
file->connect("file_selected", this,"_dialog_action");

View file

@ -207,7 +207,7 @@ EditorPath::EditorPath(EditorHistory *p_history) {
history=p_history;
mouse_over=false;
popup = memnew( PopupMenu );
popup->connect("item_pressed",this,"_popup_select");
popup->connect("id_pressed",this,"_popup_select");
add_child(popup);

View file

@ -54,7 +54,7 @@ void EditorRunNative::_notification(int p_what) {
Ref<ImageTexture> small_icon = memnew( ImageTexture);
small_icon->create_from_image(im);
MenuButton *mb = memnew( MenuButton );
mb->get_popup()->connect("item_pressed",this,"_run_native",varray(E->get()));
mb->get_popup()->connect("id_pressed",this,"_run_native",varray(E->get()));
mb->connect("pressed",this,"_run_native",varray(-1, E->get()));
mb->set_icon(small_icon);
add_child(mb);

View file

@ -160,7 +160,7 @@ void FileSystemDock::_notification(int p_what) {
button_hist_next->set_icon( get_icon("Forward","EditorIcons"));
button_hist_prev->set_icon( get_icon("Back","EditorIcons"));
file_options->connect("item_pressed",this,"_file_option");
file_options->connect("id_pressed",this,"_file_option");
button_back->connect("pressed",this,"_go_to_tree",varray(),CONNECT_DEFERRED);

View file

@ -101,7 +101,7 @@ void AnimationPlayerEditor::_notification(int p_what) {
autoplay->set_icon( get_icon("AutoPlay","EditorIcons") );
load_anim->set_icon( get_icon("Folder","EditorIcons") );
save_anim->set_icon(get_icon("Save", "EditorIcons"));
save_anim->get_popup()->connect("item_pressed", this, "_animation_save_menu");
save_anim->get_popup()->connect("id_pressed", this, "_animation_save_menu");
remove_anim->set_icon( get_icon("Remove","EditorIcons") );
blend_anim->set_icon( get_icon("Blend","EditorIcons") );
@ -115,7 +115,7 @@ void AnimationPlayerEditor::_notification(int p_what) {
resource_edit_anim->set_icon( get_icon("EditResource","EditorIcons") );
pin->set_icon(get_icon("Pin","EditorIcons") );
tool_anim->set_icon(get_icon("Tools","EditorIcons"));
tool_anim->get_popup()->connect("item_pressed",this,"_animation_tool_menu");
tool_anim->get_popup()->connect("id_pressed",this,"_animation_tool_menu");
blend_editor.next->connect("item_selected", this, "_blend_editor_next_changed");

View file

@ -1371,7 +1371,7 @@ AnimationTreeEditor::AnimationTreeEditor() {
p->add_separator();
p->add_item(TTR("Clear"),MENU_GRAPH_CLEAR);
p->connect("item_pressed", this,"_add_menu_item");
p->connect("id_pressed", this,"_add_menu_item");
play_button = memnew(Button);
play_button->set_pos(Point2(25,0));
@ -1407,10 +1407,10 @@ AnimationTreeEditor::AnimationTreeEditor() {
master_anim_popup = memnew( PopupMenu );
add_child(master_anim_popup);
master_anim_popup->connect("item_pressed",this,"_master_anim_menu_item");
master_anim_popup->connect("id_pressed",this,"_master_anim_menu_item");
node_popup->connect("item_pressed", this,"_node_menu_item");
node_popup->connect("id_pressed", this,"_node_menu_item");
updating_edit=false;

View file

@ -3436,7 +3436,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
edit_menu = memnew( MenuButton );
edit_menu->set_text(TTR("Edit"));
hb->add_child(edit_menu);
edit_menu->get_popup()->connect("item_pressed", this,"_popup_callback");
edit_menu->get_popup()->connect("id_pressed", this,"_popup_callback");
PopupMenu *p;
p = edit_menu->get_popup();
@ -3461,7 +3461,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
skeleton_menu->add_separator();
skeleton_menu->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_set_ik_chain", TTR("Make IK Chain")), SKELETON_SET_IK_CHAIN);
skeleton_menu->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_clear_ik_chain", TTR("Clear IK Chain")), SKELETON_CLEAR_IK_CHAIN);
skeleton_menu->connect("item_pressed", this,"_popup_callback");
skeleton_menu->connect("id_pressed", this,"_popup_callback");
/*
@ -3473,7 +3473,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
view_menu = memnew( MenuButton );
view_menu->set_text(TTR("View"));
hb->add_child(view_menu);
view_menu->get_popup()->connect("item_pressed", this,"_popup_callback");
view_menu->get_popup()->connect("id_pressed", this,"_popup_callback");
p = view_menu->get_popup();
@ -3488,7 +3488,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
anchor_menu = memnew( MenuButton );
anchor_menu->set_text(TTR("Anchor"));
hb->add_child(anchor_menu);
anchor_menu->get_popup()->connect("item_pressed", this,"_popup_callback");
anchor_menu->get_popup()->connect("id_pressed", this,"_popup_callback");
anchor_menu->hide();
//p = anchor_menu->get_popup();
@ -3534,7 +3534,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
animation_menu = memnew( MenuButton );
animation_menu->set_text(TTR("Animation"));
animation_hb->add_child(animation_menu);
animation_menu->get_popup()->connect("item_pressed", this,"_popup_callback");
animation_menu->get_popup()->connect("id_pressed", this,"_popup_callback");
p = animation_menu->get_popup();
@ -3571,7 +3571,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
selection_menu = memnew( PopupMenu );
add_child(selection_menu);
selection_menu->set_custom_minimum_size(Vector2(100, 0));
selection_menu->connect("item_pressed", this, "_selection_result_pressed");
selection_menu->connect("id_pressed", this, "_selection_result_pressed");
selection_menu->connect("popup_hide", this, "_selection_menu_hide");
key_pos=true;

View file

@ -432,7 +432,7 @@ CollisionPolygon2DEditor::CollisionPolygon2DEditor(EditorNode *p_editor) {
options->set_area_as_parent_rect();
options->set_text("Polygon");
//options->get_popup()->add_item("Parse BBCode",PARSE_BBCODE);
options->get_popup()->connect("item_pressed", this,"_menu_option");
options->get_popup()->connect("id_pressed", this,"_menu_option");
#endif
mode = MODE_EDIT;

View file

@ -561,7 +561,7 @@ CollisionPolygonEditor::CollisionPolygonEditor(EditorNode *p_editor) {
options->set_area_as_parent_rect();
options->set_text("Polygon");
//options->get_popup()->add_item("Parse BBCode",PARSE_BBCODE);
options->get_popup()->connect("item_pressed", this,"_menu_option");
options->get_popup()->connect("id_pressed", this,"_menu_option");
#endif
mode = MODE_EDIT;

View file

@ -310,7 +310,7 @@ MeshLibraryEditor::MeshLibraryEditor(EditorNode *p_editor) {
options->get_popup()->add_item(TTR("Import from Scene"),MENU_OPTION_IMPORT_FROM_SCENE);
options->get_popup()->add_item(TTR("Update from Scene"),MENU_OPTION_UPDATE_FROM_SCENE);
options->get_popup()->set_item_disabled(options->get_popup()->get_item_index(MENU_OPTION_UPDATE_FROM_SCENE),true);
options->get_popup()->connect("item_pressed", this,"_menu_cbk");
options->get_popup()->connect("id_pressed", this,"_menu_cbk");
menu=options;
editor=p_editor;
cd = memnew(ConfirmationDialog);

View file

@ -468,7 +468,7 @@ LightOccluder2DEditor::LightOccluder2DEditor(EditorNode *p_editor) {
options->set_area_as_parent_rect();
options->set_text("Polygon");
//options->get_popup()->add_item("Parse BBCode",PARSE_BBCODE);
options->get_popup()->connect("item_pressed", this,"_menu_option");
options->get_popup()->connect("id_pressed", this,"_menu_option");
#endif
mode = MODE_EDIT;

View file

@ -241,7 +241,7 @@ MeshInstanceEditor::MeshInstanceEditor() {
options->get_popup()->add_separator();
options->get_popup()->add_item(TTR("Create Outline Mesh.."),MENU_OPTION_CREATE_OUTLINE_MESH);
options->get_popup()->connect("item_pressed", this,"_menu_option");
options->get_popup()->connect("id_pressed", this,"_menu_option");
outline_dialog = memnew( ConfirmationDialog );
outline_dialog->set_title(TTR("Create Outline Mesh"));

View file

@ -333,7 +333,7 @@ MultiMeshEditor::MultiMeshEditor() {
options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("MultiMeshInstance","EditorIcons"));
options->get_popup()->add_item(TTR("Populate Surface"));
options->get_popup()->connect("item_pressed", this,"_menu_option");
options->get_popup()->connect("id_pressed", this,"_menu_option");
populate_dialog = memnew( ConfirmationDialog );
populate_dialog->set_title(TTR("Populate MultiMesh"));

View file

@ -515,7 +515,7 @@ NavigationPolygonEditor::NavigationPolygonEditor(EditorNode *p_editor) {
options->set_area_as_parent_rect();
options->set_text("Polygon");
//options->get_popup()->add_item("Parse BBCode",PARSE_BBCODE);
options->get_popup()->connect("item_pressed", this,"_menu_option");
options->get_popup()->connect("id_pressed", this,"_menu_option");
#endif
mode = MODE_EDIT;

View file

@ -144,7 +144,7 @@ void Particles2DEditorPlugin::_notification(int p_what) {
if (p_what==NOTIFICATION_ENTER_TREE) {
menu->get_popup()->connect("item_pressed",this,"_menu_callback");
menu->get_popup()->connect("id_pressed",this,"_menu_callback");
menu->set_icon(menu->get_popup()->get_icon("Particles2D","EditorIcons"));
file->connect("file_selected",this,"_file_selected");
}

View file

@ -356,7 +356,7 @@ ParticlesEditor::ParticlesEditor() {
options->get_popup()->add_item(TTR("Create Emitter From Node"),MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE);
options->get_popup()->add_item(TTR("Clear Emitter"),MENU_OPTION_CLEAR_EMISSION_VOLUME);
options->get_popup()->connect("item_pressed", this,"_menu_option");
options->get_popup()->connect("id_pressed", this,"_menu_option");
emission_dialog = memnew( ConfirmationDialog );
emission_dialog->set_title(TTR("Create Emitter"));

View file

@ -624,7 +624,7 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) {
options->set_area_as_parent_rect();
options->set_text("Polygon");
//options->get_popup()->add_item("Parse BBCode",PARSE_BBCODE);
options->get_popup()->connect("item_pressed", this,"_menu_option");
options->get_popup()->connect("id_pressed", this,"_menu_option");
#endif
base_hb = memnew( HBoxContainer );

View file

@ -840,7 +840,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) {
options->set_area_as_parent_rect();
options->set_text("Polygon");
//options->get_popup()->add_item("Parse BBCode",PARSE_BBCODE);
options->get_popup()->connect("item_pressed", this,"_menu_option");
options->get_popup()->connect("id_pressed", this,"_menu_option");
#endif
mode = MODE_EDIT;
@ -885,7 +885,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) {
uv_menu->get_popup()->add_item(TTR("UV->Polygon"),UVEDIT_UV_TO_POLYGON);
uv_menu->get_popup()->add_separator();
uv_menu->get_popup()->add_item(TTR("Clear UV"),UVEDIT_UV_CLEAR);
uv_menu->get_popup()->connect("item_pressed",this,"_menu_option");
uv_menu->get_popup()->connect("id_pressed",this,"_menu_option");
uv_mode_hb->add_child( memnew( VSeparator ));

View file

@ -110,7 +110,7 @@ RichTextEditor::RichTextEditor() {
options->get_popup()->add_item(TTR("Parse BBCode"),PARSE_BBCODE);
options->get_popup()->add_item(TTR("Clear"),CLEAR);
options->get_popup()->connect("item_pressed", this,"_menu_option");
options->get_popup()->connect("id_pressed", this,"_menu_option");
file_dialog = memnew( EditorFileDialog );
add_child(file_dialog);
file_dialog->add_filter("*.txt");

View file

@ -2128,7 +2128,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_docs", TTR("Close Docs")), CLOSE_DOCS);
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_file", TTR("Close"), KEY_MASK_CMD | KEY_W), FILE_CLOSE);
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_all", TTR("Close All")), CLOSE_ALL);
file_menu->get_popup()->connect("item_pressed", this,"_menu_option");
file_menu->get_popup()->connect("id_pressed", this,"_menu_option");
@ -2137,7 +2137,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
script_search_menu->set_text(TTR("Search"));
script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find", TTR("Find.."), KEY_MASK_CMD|KEY_F), HELP_SEARCH_FIND);
script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_next", TTR("Find Next"), KEY_F3), HELP_SEARCH_FIND_NEXT);
script_search_menu->get_popup()->connect("item_pressed", this,"_menu_option");
script_search_menu->get_popup()->connect("id_pressed", this,"_menu_option");
script_search_menu->hide();
@ -2153,7 +2153,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
debug_menu->get_popup()->add_separator();
//debug_menu->get_popup()->add_check_item("Show Debugger",DEBUG_SHOW);
debug_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("debugger/keep_debugger_open", TTR("Keep Debugger Open")), DEBUG_SHOW_KEEP_OPEN);
debug_menu->get_popup()->connect("item_pressed", this,"_menu_option");
debug_menu->get_popup()->connect("id_pressed", this,"_menu_option");
debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_NEXT), true);
debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_STEP), true );
@ -2170,7 +2170,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
window_menu->get_popup()->add_item(TTR("Move Left"),WINDOW_MOVE_LEFT,KEY_MASK_CMD|KEY_LEFT);
window_menu->get_popup()->add_item(TTR("Move Right"),WINDOW_MOVE_RIGHT,KEY_MASK_CMD|KEY_RIGHT);
window_menu->get_popup()->add_separator();
window_menu->get_popup()->connect("item_pressed", this,"_menu_option");
window_menu->get_popup()->connect("id_pressed", this,"_menu_option");
#endif

View file

@ -1273,7 +1273,7 @@ ScriptTextEditor::ScriptTextEditor() {
context_menu = memnew(PopupMenu);
add_child(context_menu);
context_menu->connect("item_pressed", this, "_edit_option");
context_menu->connect("id_pressed", this, "_edit_option");
color_panel = memnew(PopupPanel);
add_child(color_panel);
@ -1309,7 +1309,7 @@ ScriptTextEditor::ScriptTextEditor() {
#endif
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/trim_trailing_whitespace"), EDIT_TRIM_TRAILING_WHITESAPCE);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/auto_indent"), EDIT_AUTO_INDENT);
edit_menu->get_popup()->connect("item_pressed", this,"_edit_option");
edit_menu->get_popup()->connect("id_pressed", this,"_edit_option");
edit_menu->get_popup()->add_separator();
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_breakpoint"), DEBUG_TOGGLE_BREAKPOINT);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/remove_all_breakpoints"), DEBUG_REMOVE_ALL_BREAKPOINTS);
@ -1329,7 +1329,7 @@ ScriptTextEditor::ScriptTextEditor() {
search_menu->get_popup()->add_separator();
search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/contextual_help"), HELP_CONTEXTUAL);
search_menu->get_popup()->connect("item_pressed", this,"_edit_option");
search_menu->get_popup()->connect("id_pressed", this,"_edit_option");
edit_hb->add_child(edit_menu);

View file

@ -469,7 +469,7 @@ ShaderEditor::ShaderEditor() {
edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/paste", TTR("Paste"), KEY_MASK_CMD|KEY_V), EDIT_PASTE);
edit_menu->get_popup()->add_separator();
edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/select_all", TTR("Select All"), KEY_MASK_CMD|KEY_A), EDIT_SELECT_ALL);
edit_menu->get_popup()->connect("item_pressed", this,"_menu_option");
edit_menu->get_popup()->connect("id_pressed", this,"_menu_option");
search_menu = memnew( MenuButton );
@ -483,7 +483,7 @@ ShaderEditor::ShaderEditor() {
search_menu->get_popup()->add_separator();
// search_menu->get_popup()->add_item("Locate Symbol..",SEARCH_LOCATE_SYMBOL,KEY_MASK_CMD|KEY_K);
search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/goto_line", TTR("Goto Line.."), KEY_MASK_CMD|KEY_L), SEARCH_GOTO_LINE);
search_menu->get_popup()->connect("item_pressed", this,"_menu_option");
search_menu->get_popup()->connect("id_pressed", this,"_menu_option");
goto_line_dialog = memnew(GotoLineDialog);

View file

@ -2807,7 +2807,7 @@ void ShaderGraphEditor::_notification(int p_what) {
if (addsep)
popup->add_separator();
}
popup->connect("item_pressed",this,"_add_node");
popup->connect("id_pressed",this,"_add_node");
}

View file

@ -2423,7 +2423,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/focus_origin"), VIEW_CENTER_TO_ORIGIN);
view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/focus_selection"), VIEW_CENTER_TO_SELECTION);
view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/align_selection_with_view"), VIEW_ALIGN_SELECTION_WITH_VIEW);
view_menu->get_popup()->connect("item_pressed",this,"_menu_option");
view_menu->get_popup()->connect("id_pressed",this,"_menu_option");
preview_camera = memnew( Button );
preview_camera->set_toggle_mode(true);
@ -2440,7 +2440,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
selection_menu = memnew( PopupMenu );
add_child(selection_menu);
selection_menu->set_custom_minimum_size(Vector2(100, 0));
selection_menu->connect("item_pressed", this, "_selection_result_pressed");
selection_menu->connect("id_pressed", this, "_selection_result_pressed");
selection_menu->connect("popup_hide", this, "_selection_menu_hide");
if (p_index==0) {
@ -3907,7 +3907,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
p->add_separator();
p->add_shortcut(ED_SHORTCUT("spatial_editor/transform_dialog", TTR("Transform Dialog..")), MENU_TRANSFORM_DIALOG);
p->connect("item_pressed", this,"_menu_item_pressed");
p->connect("id_pressed", this,"_menu_item_pressed");
view_menu = memnew( MenuButton );
view_menu->set_text(TTR("View"));
@ -3945,7 +3945,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
p->set_item_checked( p->get_item_index(MENU_VIEW_GRID), true );
p->connect("item_pressed", this,"_menu_item_pressed");
p->connect("id_pressed", this,"_menu_item_pressed");
/* REST OF MENU */

View file

@ -818,7 +818,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor)
for (int i = 0; i < 4; i++)
p->set_item_as_checkable(i,true);
p->set_item_checked(0,true);
p->connect("item_pressed", this, "_set_snap_mode");
p->connect("id_pressed", this, "_set_snap_mode");
hb_grid = memnew( HBoxContainer );
hb_tools->add_child(hb_grid);
hb_grid->add_child( memnew( VSeparator ));

View file

@ -679,7 +679,7 @@ ThemeEditor::ThemeEditor() {
add_child(theme_menu);
theme_menu->set_pos(Vector2(3,3)*EDSCALE);
theme_menu->get_popup()->connect("item_pressed", this,"_theme_menu_cbk");
theme_menu->get_popup()->connect("id_pressed", this,"_theme_menu_cbk");
HBoxContainer *main_hb = memnew( HBoxContainer );
@ -898,7 +898,7 @@ ThemeEditor::ThemeEditor() {
type_menu->set_text("..");
add_del_dialog->add_child(type_menu);
type_menu->get_popup()->connect("item_pressed", this,"_type_menu_cbk");
type_menu->get_popup()->connect("id_pressed", this,"_type_menu_cbk");
l = memnew( Label );
l->set_pos( Point2(200,5)*EDSCALE );
@ -918,7 +918,7 @@ ThemeEditor::ThemeEditor() {
add_del_dialog->add_child(name_menu);
name_menu->get_popup()->connect("about_to_show", this,"_name_menu_about_to_show");
name_menu->get_popup()->connect("item_pressed", this,"_name_menu_cbk");
name_menu->get_popup()->connect("id_pressed", this,"_name_menu_cbk");
type_select_label= memnew( Label );
type_select_label->set_pos( Point2(400,5)*EDSCALE );

View file

@ -1489,7 +1489,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) {
p->add_shortcut(ED_SHORTCUT("tile_map_editor/duplicate_selection", TTR("Duplicate Selection"), KEY_MASK_CMD+KEY_D), OPTION_DUPLICATE);
p->add_shortcut(ED_GET_SHORTCUT("tile_map_editor/erase_selection"), OPTION_ERASE_SELECTION);
p->connect("item_pressed", this, "_menu_option");
p->connect("id_pressed", this, "_menu_option");
toolbar->add_child(options);

View file

@ -240,7 +240,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
options->get_popup()->add_separator();
options->get_popup()->add_item(TTR("Create from Scene"),MENU_OPTION_CREATE_FROM_SCENE);
options->get_popup()->add_item(TTR("Merge from Scene"),MENU_OPTION_MERGE_FROM_SCENE);
options->get_popup()->connect("item_pressed", this,"_menu_cbk");
options->get_popup()->connect("id_pressed", this,"_menu_cbk");
editor=p_editor;
cd = memnew(ConfirmationDialog);
add_child(cd);

View file

@ -1351,7 +1351,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
}
popup_platform->get_popup()->connect("item_pressed",this,"_copy_to_platform");
popup_platform->get_popup()->connect("id_pressed",this,"_copy_to_platform");
get_ok()->set_text(TTR("Close"));
set_hide_on_ok(true);
@ -1399,7 +1399,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
input_editor->connect("button_pressed",this,"_action_button_pressed");
popup_add = memnew( PopupMenu );
add_child(popup_add);
popup_add->connect("item_pressed",this,"_add_item");
popup_add->connect("id_pressed",this,"_add_item");
press_a_key = memnew( ConfirmationDialog );
press_a_key->set_focus_mode(FOCUS_ALL);

View file

@ -2017,7 +2017,7 @@ CustomPropertyEditor::CustomPropertyEditor() {
type_button = memnew( MenuButton );
add_child(type_button);
type_button->hide();
type_button->get_popup()->connect("item_pressed", this,"_type_create_selected");
type_button->get_popup()->connect("id_pressed", this,"_type_create_selected");
scene_tree = memnew( SceneTreeDialog );
@ -2039,7 +2039,7 @@ CustomPropertyEditor::CustomPropertyEditor() {
menu = memnew(PopupMenu);
add_child(menu);
menu->connect("item_pressed",this,"_menu_option");
menu->connect("id_pressed",this,"_menu_option");
evaluator = NULL;

View file

@ -366,7 +366,7 @@ ResourcesDock::ResourcesDock(EditorNode *p_editor) {
mb->set_tooltip(TTR("Save Resource"));
mb->get_popup()->add_item(TTR("Save Resource"),TOOL_SAVE);
mb->get_popup()->add_item(TTR("Save Resource As.."),TOOL_SAVE_AS);
mb->get_popup()->connect("item_pressed",this,"_tool_selected" );
mb->get_popup()->connect("id_pressed",this,"_tool_selected" );
hbc->add_child( mb );
button_save=mb;
@ -377,7 +377,7 @@ ResourcesDock::ResourcesDock(EditorNode *p_editor) {
mb->get_popup()->add_item(TTR("Make Local"),TOOL_MAKE_LOCAL);
mb->get_popup()->add_item(TTR("Copy"),TOOL_COPY);
mb->get_popup()->add_item(TTR("Paste"),TOOL_PASTE);
mb->get_popup()->connect("item_pressed",this,"_tool_selected" );
mb->get_popup()->connect("id_pressed",this,"_tool_selected" );
hbc->add_child( mb );
button_tools=mb;

View file

@ -2013,7 +2013,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec
menu = memnew( PopupMenu );
add_child(menu);
menu->connect("item_pressed",this,"_tool_selected");
menu->connect("id_pressed",this,"_tool_selected");
first_enter=true;
restore_script_editor_on_drag=false;

View file

@ -1210,14 +1210,14 @@ SceneTreeEditor::SceneTreeEditor(bool p_label,bool p_can_rename, bool p_can_open
instance_menu->add_item(TTR("Discard Instancing"),SCENE_MENU_CLEAR_INSTANCING);
instance_menu->add_separator();
instance_menu->add_item(TTR("Open in Editor"),SCENE_MENU_OPEN);
instance_menu->connect("item_pressed",this,"_subscene_option");
instance_menu->connect("id_pressed",this,"_subscene_option");
add_child(instance_menu);
inheritance_menu = memnew( PopupMenu );
inheritance_menu->add_item(TTR("Clear Inheritance"),SCENE_MENU_CLEAR_INHERITANCE);
inheritance_menu->add_separator();
inheritance_menu->add_item(TTR("Open in Editor"),SCENE_MENU_OPEN_INHERITED);
inheritance_menu->connect("item_pressed",this,"_subscene_option");
inheritance_menu->connect("id_pressed",this,"_subscene_option");
add_child(inheritance_menu);