summaryrefslogtreecommitdiff
path: root/editor/connections_dialog.h
diff options
context:
space:
mode:
authorEoin O'Neill <eoinoneill1991@gmail.com>2018-04-27 17:08:34 -0700
committerEoin O'Neill <eoinoneill1991@gmail.com>2018-04-29 17:16:05 -0700
commit62a858d4c95b1ece71ff0cec28d7f47bce73ee42 (patch)
tree4b912c194ee9b0f60316860b128044e786546e1c /editor/connections_dialog.h
parentdc7ed4b547c464923a622dc58312c0f9df77177a (diff)
Basic context menu added to connections docker w/ code cleanup.
Diffstat (limited to 'editor/connections_dialog.h')
-rw-r--r--editor/connections_dialog.h30
1 files changed, 26 insertions, 4 deletions
diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h
index 5e26e00f67..ca0e404740 100644
--- a/editor/connections_dialog.h
+++ b/editor/connections_dialog.h
@@ -28,6 +28,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+/**
+@author Juan Linietsky <reduzio@gmail.com>
+*/
+
#ifndef CONNECTIONS_DIALOG_H
#define CONNECTIONS_DIALOG_H
@@ -42,10 +46,7 @@
#include "scene/gui/tree.h"
#include "undo_redo.h"
-/**
-@author Juan Linietsky <reduzio@gmail.com>
-*/
-
+class PopupMenu;
class ConnectDialogBinds;
class ConnectDialog : public ConfirmationDialog {
@@ -93,6 +94,15 @@ class ConnectionsDock : public VBoxContainer {
GDCLASS(ConnectionsDock, VBoxContainer);
+ enum SignalMenuOption {
+ CONNECT
+ };
+
+ enum SlotMenuOption {
+ EDIT,
+ DISCONNECT
+ };
+
Button *connect_button;
EditorNode *editor;
Node *node;
@@ -100,10 +110,17 @@ class ConnectionsDock : public VBoxContainer {
ConfirmationDialog *remove_confirm;
ConnectDialog *connect_dialog;
+ PopupMenu *signal_menu;
+ PopupMenu *slot_menu;
+
void _close();
void _connect();
+ void _disconnect( TreeItem *item );
void _something_selected();
void _something_activated();
+ void _handle_signal_option( int option );
+ void _handle_slot_option( int option );
+ void _rmb_pressed( Vector2 position );
UndoRedo *undo_redo;
protected:
@@ -111,6 +128,11 @@ protected:
void _notification(int p_what);
static void _bind_methods();
+private:
+ bool _is_item_signal( TreeItem *item );
+ void _open_connection_dialog( TreeItem *item );
+
+
public:
void set_undoredo(UndoRedo *p_undo_redo) { undo_redo = p_undo_redo; }