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
OpenGEODE
Commits
864c581d
Commit
864c581d
authored
Aug 23, 2016
by
Maxime Perrotin
Browse files
Populate data dictionary
parent
846f3117
Changes
3
Hide whitespace changes
Inline
Side-by-side
opengeode/Connectors.py
View file @
864c581d
...
...
@@ -83,7 +83,7 @@ class Connection(QGraphicsPathItem, object):
return
(
QPointF
(
endp
.
x
()
-
5
,
endp
.
y
()
-
5
),
QPointF
(
endp
.
x
()
+
5
,
endp
.
y
()
-
5
))
def
select
(
self
):
def
select
(
self
,
selected
=
True
):
''' Select a connection - for future use? '''
return
...
...
opengeode/TextInteraction.py
View file @
864c581d
...
...
@@ -401,7 +401,7 @@ class EditableText(QGraphicsTextItem, object):
try
:
self
.
parent
.
select
(
True
)
except
AttributeError
:
# Some parents may not be selectable
(e.g. Signalroute)
# Some parents may not be selectable
pass
# Update completer list of keywords
self
.
context
=
''
...
...
opengeode/opengeode.py
View file @
864c581d
...
...
@@ -2130,6 +2130,9 @@ class OG_MainWindow(QtGui.QMainWindow, object):
self
.
view
.
update_asn1_dock
.
connect
(
self
.
set_asn1_view
)
self
.
datadict
=
self
.
findChild
(
QtGui
.
QTreeWidget
,
'datadict'
)
self
.
datadict
.
setAlternatingRowColors
(
True
)
self
.
datadict
.
setColumnCount
(
2
)
self
.
datadict
.
itemClicked
.
connect
(
self
.
datadict_item_selected
)
QtGui
.
QTreeWidgetItem
(
self
.
datadict
,
[
"ASN.1 Data types"
])
QtGui
.
QTreeWidgetItem
(
self
.
datadict
,
[
"ASN.1 Constants"
])
...
...
@@ -2178,6 +2181,12 @@ class OG_MainWindow(QtGui.QMainWindow, object):
except
(
AttributeError
,
IOError
,
TypeError
)
as
err
:
LOG
.
debug
(
str
(
err
))
@
QtCore
.
Slot
(
QtGui
.
QTreeWidgetItem
,
int
)
def
datadict_item_selected
(
self
,
item
,
column
):
''' Slot called when user clicks on an item of the data dictionary '''
print
item
,
column
@
QtCore
.
Slot
(
ogAST
.
AST
)
def
set_asn1_view
(
self
,
ast
):
''' Display the ASN.1 types in the dedicated scene '''
...
...
@@ -2218,12 +2227,15 @@ class OG_MainWindow(QtGui.QMainWindow, object):
# Update the data dictionary
item
=
self
.
datadict
.
topLevelItem
(
0
)
item
.
takeChildren
()
# remove old children
for
each
in
ast
.
dataview
:
QtGui
.
QTreeWidgetItem
(
item
,
[
each
.
replace
(
'-'
,
'_'
)])
for
name
,
sort
in
ast
.
dataview
.
viewitems
():
basic
=
ogParser
.
find_basic_type
(
sort
.
type
).
kind
[:
-
4
].
upper
()
QtGui
.
QTreeWidgetItem
(
item
,
[
name
.
replace
(
'-'
,
'_'
),
basic
])
item
=
self
.
datadict
.
topLevelItem
(
1
)
item
.
takeChildren
()
for
each
in
ast
.
asn1_constants
:
QtGui
.
QTreeWidgetItem
(
item
,
[
each
.
replace
(
'-'
,
'_'
)])
for
name
,
sort
in
ast
.
asn1_constants
.
viewitems
():
QtGui
.
QTreeWidgetItem
(
item
,
[
name
.
replace
(
'-'
,
'_'
),
sort
.
type
.
ReferencedTypeName
])
self
.
datadict
.
resizeColumnToContents
(
0
)
...
...
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