diff options
author | Poommetee Ketson <poommetee@protonmail.com> | 2017-12-12 22:57:17 +0700 |
---|---|---|
committer | Poommetee Ketson <poommetee@protonmail.com> | 2017-12-12 23:04:37 +0700 |
commit | 24df9f3707767f94a8b7842a24013aa3709b1805 (patch) | |
tree | 6afe7e0d6be6e1d886c2c40e929d9f50301f22f1 /editor/connections_dialog.cpp | |
parent | 55962ce28fec5f06016ed3f66f52e6e84b817dbe (diff) | |
download | redot-engine-24df9f3707767f94a8b7842a24013aa3709b1805.tar.gz |
Enhance undoredo action name, TTR, cleanup
Diffstat (limited to 'editor/connections_dialog.cpp')
-rw-r--r-- | editor/connections_dialog.cpp | 70 |
1 files changed, 1 insertions, 69 deletions
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index cd60455f4f..c095229374 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -88,12 +88,6 @@ public: void ConnectDialog::_notification(int p_what) { - if (p_what == NOTIFICATION_DRAW) { - - //RID ci = get_canvas_item(); - //get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size())); - } - if (p_what == NOTIFICATION_ENTER_TREE) { bind_editor->edit(cdbinds); } @@ -117,11 +111,6 @@ void ConnectDialog::_tree_node_selected() { dst_path->set_text(node->get_path_to(current)); } -void ConnectDialog::_dst_method_list_selected(int p_idx) { - - //dst_method->set_text( dst_method_list->get_popup()->get_item_text(p_idx)); -} - void ConnectDialog::edit(Node *p_node) { node = p_node; @@ -247,9 +236,7 @@ void ConnectDialog::set_dst_method(const StringName &p_method) { void ConnectDialog::_bind_methods() { - //ClassDB::bind_method("_ok",&ConnectDialog::_ok_pressed); ClassDB::bind_method("_cancel", &ConnectDialog::_cancel_pressed); - //ClassDB::bind_method("_dst_method_list_selected",&ConnectDialog::_dst_method_list_selected); ClassDB::bind_method("_tree_node_selected", &ConnectDialog::_tree_node_selected); ClassDB::bind_method("_add_bind", &ConnectDialog::_add_bind); @@ -355,18 +342,6 @@ ConnectDialog::ConnectDialog() { oneshot->set_text(TTR("Oneshot")); dstm_hb->add_child(oneshot); - /* - realtime = memnew( CheckButton ); - realtime->set_anchor( MARGIN_TOP, ANCHOR_END ); - realtime->set_anchor( MARGIN_BOTTOM, ANCHOR_END ); - realtime->set_anchor( MARGIN_RIGHT, ANCHOR_END ); - realtime->set_begin( Point2( 120, button_margin-10 ) ); - realtime->set_end( Point2( 80, margin ) ); - realtime->set_text("Realtime"); - add_child(realtime); -*/ - - //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); @@ -377,7 +352,6 @@ ConnectDialog::ConnectDialog() { add_child(error); error->get_ok()->set_text(TTR("Close")); get_ok()->set_text(TTR("Connect")); - //error->get_cancel()->set_text("Close"); } ConnectDialog::~ConnectDialog() { @@ -386,12 +360,6 @@ ConnectDialog::~ConnectDialog() { void ConnectionsDock::_notification(int p_what) { - if (p_what == NOTIFICATION_DRAW) { - - //RID ci = get_canvas_item(); - //get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size())); - } - if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { update_tree(); } @@ -478,7 +446,7 @@ void ConnectionsDock::_connect_pressed() { Connection c = item->get_metadata(0); ERR_FAIL_COND(c.source != node); //shouldn't happen but...bugcheck - undo_redo->create_action(TTR("Create Subscription")); + undo_redo->create_action(vformat(TTR("Disconnect '%s' from '%s'"), c.signal, c.method)); undo_redo->add_do_method(node, "disconnect", c.signal, c.target, c.method); undo_redo->add_undo_method(node, "connect", c.signal, c.target, c.method, Vector<Variant>(), c.flags); undo_redo->add_do_method(this, "update_tree"); @@ -491,42 +459,6 @@ void ConnectionsDock::_connect_pressed() { update_tree(); } } -/* -void ConnectionsDock::_remove() { - - if (!tree->get_selected()) - return; - - TreeItem *selected=tree->get_selected(); - if (!selected) - return; - - Dictionary meta=selected->get_metadata(0); - - remove_confirm->set_text(String()+"Remove Connection \""+meta["from_event"].operator String()+"\" ?"); - remove_confirm->popup_centered(Size2(340,80)); -} -*/ -/* -void ConnectionsDock::_remove_confirm() { - - if (!tree->get_selected()) - return; - TreeItem *selected=tree->get_selected(); - if (!selected) - return; - - Dictionary meta=selected->get_metadata(0); - - undo_redo->create_action("Remove Subscription"); - undo_redo->add_do_method(node,"unsubscribe_path_event",meta["from_event"].operator String(),meta["from_path"].operator NodePath(),meta["to_method"].operator String()); - undo_redo->add_undo_method(node,"subscribe_path_event_persist",meta["from_event"].operator String(),meta["from_path"].operator NodePath(),meta["to_method"].operator String(),Array(),false); - undo_redo->add_do_method(this,"update_tree"); - undo_redo->add_undo_method(this,"update_tree"); - undo_redo->commit_action(); - -} -*/ struct _ConnectionsDockMethodInfoSort { |