commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 96/101: grc: gtk3: invalid connection all r


From: git
Subject: [Commit-gnuradio] [gnuradio] 96/101: grc: gtk3: invalid connection all red
Date: Thu, 16 Mar 2017 14:58:14 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch python3
in repository gnuradio.

commit e1eccf55ae78738d102e48bea4804a02fb41f12d
Author: Sebastian Koslowski <address@hidden>
Date:   Wed Jan 11 21:14:37 2017 +0100

    grc: gtk3: invalid connection all red
---
 grc/core/Messages.py         |  2 +-
 grc/gui/canvas/connection.py | 17 +++++++++--------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/grc/core/Messages.py b/grc/core/Messages.py
index c2d216e..f546c3b 100644
--- a/grc/core/Messages.py
+++ b/grc/core/Messages.py
@@ -126,7 +126,7 @@ def send_fail_save(file_path):
 
 
 def send_fail_connection(msg=''):
-    send('>>> Error: Cannot create connection.\n' + ('\t' + str(msg) if msg 
else ''))
+    send('>>> Error: Cannot create connection.\n' + ('\t{}\n'.format(msg) if 
msg else ''))
 
 
 def send_fail_load_preferences(prefs_file_path):
diff --git a/grc/gui/canvas/connection.py b/grc/gui/canvas/connection.py
index 1da63be..a58a026 100644
--- a/grc/gui/canvas/connection.py
+++ b/grc/gui/canvas/connection.py
@@ -50,7 +50,7 @@ class Connection(CoreConnection, Drawable):
 
         self._line = []
         self._line_width_factor = 1.0
-        self._color = self._color2 = self._arrow_color = None
+        self._color1 = self._color2 = None
 
         self._current_port_rotations = self._current_coordinates = None
 
@@ -99,15 +99,14 @@ class Connection(CoreConnection, Drawable):
 
         if source.domain == GR_MESSAGE_DOMAIN:
             self._line_width_factor = 1.0
-            self._color = None
+            self._color1 = None
             self._color2 = colors.CONNECTION_ENABLED_COLOR
         else:
             if source.domain != sink.domain:
                 self._line_width_factor = 2.0
-            self._color = get_domain_color(source.domain)
+            self._color1 = get_domain_color(source.domain)
             self._color2 = get_domain_color(sink.domain)
 
-        self._arrow_color = self._color2 if self.is_valid() else 
colors.CONNECTION_ERROR_COLOR
         self._arrow_rotation = -sink.rotation / 180 * pi
 
         if not self._bounding_points:
@@ -155,11 +154,13 @@ class Connection(CoreConnection, Drawable):
             self._make_path(cr)
             self._current_coordinates = new_coordinates
 
-        color1, color2, arrow_color = (
+        color1, color2 = (
             None if color is None else
             colors.HIGHLIGHT_COLOR if self.highlighted else
-            colors.CONNECTION_DISABLED_COLOR if not self.enabled else color
-            for color in (self._color, self._color2, self._arrow_color)
+            colors.CONNECTION_DISABLED_COLOR if not self.enabled else
+            colors.CONNECTION_ERROR_COLOR if not self.is_valid() else
+            color
+            for color in (self._color1, self._color2)
         )
 
         cr.translate(*self.coordinate)
@@ -183,7 +184,7 @@ class Connection(CoreConnection, Drawable):
             cr.new_path()
 
         cr.move_to(*arrow_pos)
-        cr.set_source_rgba(*arrow_color)
+        cr.set_source_rgba(*color2)
         cr.rotate(self._arrow_rotation)
         cr.rel_move_to(CONNECTOR_ARROW_HEIGHT, 0)
         cr.rel_line_to(-CONNECTOR_ARROW_HEIGHT, -CONNECTOR_ARROW_BASE/2)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]