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
cd26d2b3
Commit
cd26d2b3
authored
Jan 04, 2015
by
Maxime Perrotin
Browse files
Test/improve undo feature
parent
091d4227
Changes
2
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/gui.py
View file @
cd26d2b3
...
...
@@ -354,7 +354,9 @@ def gui():
{
'dll'
:
Signal
(
unicode
,
type
,
type
)})
encoder_backend
.
send_via_dll
=
DLLHandler
()
encoder_backend
.
send_via_dll
.
dll
.
connect
(
sdl
.
send_tc
)
editor
.
msc
.
connect
(
sdl
.
add_to_msc
)
if
isinstance
(
editor
,
asn1Viewer
):
# Connect TM to MSC
editor
.
msc
.
connect
(
sdl
.
add_to_msc
)
else
:
editor
.
msc
.
connect
(
msc
.
addToMsc
)
...
...
asn1_value_editor/sdlHandler.py
View file @
cd26d2b3
...
...
@@ -324,14 +324,14 @@ class sdlHandler(QObject):
def
send_tc
(
self
,
name
,
tc_func_ptr
,
param
=
None
):
''' Send a TC - Used either locally (parameterless TCs) or via
a signal sent by the B-mapper-generated backends '''
if
name
in
self
.
timers
:
# self.buttons[name].setEnabled(False)
self
.
add_to_msc
(
'timeout'
,
name
)
elif
not
param
:
msg
=
'{tc}{arg}'
.
format
(
tc
=
name
,
arg
=
'({})'
.
format
(
param
.
GSER
())
if
param
else
''
)
self
.
add_to_msc
(
'out'
,
msg
)
with
undo
.
UndoMacro
(
self
.
undo_stack
,
'Send TC'
):
if
name
in
self
.
timers
:
self
.
add_to_msc
(
'timeout'
,
name
)
else
:
msg
=
'{tc}{arg}'
.
format
(
tc
=
name
,
arg
=
'({})'
.
format
(
param
.
GSER
())
if
param
else
''
)
self
.
add_to_msc
(
'out'
,
msg
)
undo_cmd
=
SendTC
(
self
,
tc_func_ptr
,
param
)
self
.
undo_stack
.
push
(
undo_cmd
)
self
.
check_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