Commit 5b411d4a authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix toolbar refresh and completion list update

parent e761b97c
......@@ -265,11 +265,12 @@ class SignalList(EditableText):
class Signalroute(Connection):
''' Subclass of Connection used to draw channels between processes '''
in_sig = out_sig = None
completion_list = set()
def __init__(self, process):
''' Set generic parameters from Connection class '''
super(Signalroute, self).__init__(process, process)
self.parser = ogParser
self.completion_list = []
self.blackbold = ()
self.redbold = ()
self.label_in = SignalList(parent=self)
......
......@@ -395,12 +395,14 @@ def _channel(symbol, recursive=True, **kwargs):
''' Signalroute at block level '''
result = Indent()
result.append('SIGNALROUTE c')
Indent.indent += 1
if symbol.out_sig:
result.append('FROM {} TO ENV WITH {};'.format(unicode(symbol.process),
symbol.out_sig))
if symbol.in_sig:
result.append('FROM ENV TO {} WITH {};'.format(unicode(symbol.process),
symbol.in_sig))
Indent.indent -= 1
return result
......@@ -1216,6 +1216,7 @@ class SDL_View(QtGui.QGraphicsView, object):
'''
# First propagate the click (then scene will receive it first):
super(SDL_View, self).mousePressEvent(evt)
self.toolbar.update_menu(self.scene())
self.mouse_pos = evt.pos()
if evt.button() == Qt.MidButton:
self.mode = 'moveScreen'
......
......@@ -816,13 +816,15 @@ class TextSymbol(HorizontalSymbol):
CONTEXT.variables.update(ast.variables)
CONTEXT.timers = list(set(CONTEXT.timers + ast.timers))
except AttributeError:
# context ma not have variables/timers (eg if context = block)
# context may not have variables/timers (eg if context = block)
pass
CONTEXT.procedures = list(set(CONTEXT.procedures + ast.procedures))
try:
CONTEXT.fpar.extend(ast.fpar)
except AttributeError:
pass
# Update completion list of Signalroutes
Signalroute.completion_list |= set(sig['name'] for sig in ast.signals)
@property
def completion_list(self):
......@@ -1079,7 +1081,6 @@ class Procedure(Process):
def update_completion_list(self, **kwargs):
''' When text was entered, update completion list of ProcedureCall '''
#ProcedureCall.completion_list |= {unicode(self.text)}
for each in CONTEXT.procedures:
if unicode(self.text).lower() == each.inputString:
break
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment