From ebe53a5cc3b698e50c7d26b3f4019c7c0b3faefa Mon Sep 17 00:00:00 2001
From: Martin Hanzik <martin@hanzik.com>
Date: Wed, 28 Mar 2018 21:08:12 +0200
Subject: [PATCH] Specify number of inputs in graphics boxes

---
 agui2/Graphics/DoubleGraphicsBox.h | 2 +-
 agui2/Graphics/GraphicsBox.cpp     | 2 +-
 agui2/Graphics/GraphicsBox.h       | 2 +-
 agui2/Graphics/InputGraphicsBox.h  | 2 +-
 agui2/Graphics/OutputGraphicsBox.h | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/agui2/Graphics/DoubleGraphicsBox.h b/agui2/Graphics/DoubleGraphicsBox.h
index 6a7f7d474e..6b119c9ba0 100644
--- a/agui2/Graphics/DoubleGraphicsBox.h
+++ b/agui2/Graphics/DoubleGraphicsBox.h
@@ -5,7 +5,7 @@ class DoubleGraphicsBox : public GraphicsBox
 {
     Q_OBJECT
 public:
-    DoubleGraphicsBox(QString text, qreal x = 0, qreal y = 0) : GraphicsBox( text, x, y ) {}
+    DoubleGraphicsBox(QString text, qreal x = 0, qreal y = 0) : GraphicsBox( text, x, y, 2 ) {}
     // Decide which end handles the top or bottom in connecting
     virtual ~DoubleGraphicsBox();
     virtual void addInput( GraphicsConnection* connection );
diff --git a/agui2/Graphics/GraphicsBox.cpp b/agui2/Graphics/GraphicsBox.cpp
index 7ed45f8d6b..ea7db09bb8 100644
--- a/agui2/Graphics/GraphicsBox.cpp
+++ b/agui2/Graphics/GraphicsBox.cpp
@@ -11,7 +11,7 @@
 #include <Graphics/GraphicsConnection.h>
 #include <Graphics/GraphicsScene.h>
 
-GraphicsBox::GraphicsBox(QString text, qreal x, qreal y)
+GraphicsBox::GraphicsBox(QString text, qreal x, qreal y, uint8_t inputs, uint8_t outputs)
     : m_text(std::move(text))
     , m_color(Qt::blue)
 {
diff --git a/agui2/Graphics/GraphicsBox.h b/agui2/Graphics/GraphicsBox.h
index 70e9bee4e5..4a31ad16f6 100644
--- a/agui2/Graphics/GraphicsBox.h
+++ b/agui2/Graphics/GraphicsBox.h
@@ -18,7 +18,7 @@ class GraphicsBox : public QGraphicsObject
 {
     Q_OBJECT
 public:
-    GraphicsBox(QString text, qreal x = 0, qreal y = 0);
+    explicit GraphicsBox(QString text, qreal x = 0, qreal y = 0, uint8_t inputs = 1, uint8_t outputs = 1);
     ~GraphicsBox() override;
 
     void paint(QPainter *painter, const QStyleOptionGraphicsItem *options, QWidget *widget) override;
diff --git a/agui2/Graphics/InputGraphicsBox.h b/agui2/Graphics/InputGraphicsBox.h
index 7bd3385cef..dcc18d4f87 100644
--- a/agui2/Graphics/InputGraphicsBox.h
+++ b/agui2/Graphics/InputGraphicsBox.h
@@ -8,7 +8,7 @@ class InputGraphicsBox : public GraphicsBox
 {
     Q_OBJECT
 public:
-    InputGraphicsBox(qreal x = 0, qreal y = 0): GraphicsBox("Input", x, y) {}
+    InputGraphicsBox(qreal x = 0, qreal y = 0): GraphicsBox("Input", x, y, 0, 1) {}
     virtual ~InputGraphicsBox() {}
     virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *options, QWidget *widget);
 private slots:
diff --git a/agui2/Graphics/OutputGraphicsBox.h b/agui2/Graphics/OutputGraphicsBox.h
index 5b8baaba47..32702208a9 100644
--- a/agui2/Graphics/OutputGraphicsBox.h
+++ b/agui2/Graphics/OutputGraphicsBox.h
@@ -9,7 +9,7 @@ class OutputGraphicsBox : public GraphicsBox
 {
     Q_OBJECT
 public:
-    OutputGraphicsBox( qreal x = 0, qreal y = 0 ): GraphicsBox( "Output", x, y ) {}
+    OutputGraphicsBox( qreal x = 0, qreal y = 0 ): GraphicsBox( "Output", x, y, 1, 0 ) {}
     virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
 private slots:
     void on_SetOutput();
-- 
GitLab