Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
asn1-value-editor
Commits
6aaa3115
Commit
6aaa3115
authored
Dec 12, 2014
by
Maxime Perrotin
Browse files
Add signal to handle state change
parent
4f511f5d
Changes
2
Hide whitespace changes
Inline
Side-by-side
gui.py
View file @
6aaa3115
...
...
@@ -335,6 +335,11 @@ def gui():
encoder_backend
.
msc_callback
=
MSCHandler
()
encoder_backend
.
msc_callback
.
msc_box
.
connect
(
msc
.
addCondition
)
encoder_backend
.
tm_callback
.
got_tm
.
connect
(
editor
.
receivedTM
)
# Callback in the backend to update the state of the SDL diagram
SDLHandler
=
type
(
'SDLHandler'
,
(
QObject
,),
{
'change_state'
:
Signal
(
unicode
)})
encoder_backend
.
sdl_callback
=
SDLHandler
()
encoder_backend
.
sdl_callback
.
change_state
.
connect
(
sdl
.
change_state
)
encoder_backend
.
log
=
log
encoder_backend
.
statusbar
=
statusbar
...
...
sdlHandler.py
View file @
6aaa3115
...
...
@@ -69,3 +69,8 @@ class sdlHandler(object):
self
.
dock
.
show
()
else
:
self
.
dock
.
hide
()
@
Slot
(
unicode
)
def
change_state
(
self
,
new_state
):
''' Highlight the current state on the statechart diagram '''
print
'changed state to '
,
new_state
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment