Commit cb04cd6cdac023798ed05e08a23e2aab72b0da4b
1 parent
330f8139
Exists in
master
and in
68 other branches
FIX: Show project changed dialog when measure is added or removed (fix #225)
Showing
1 changed file
with
10 additions
and
1 deletions
Show diff stats
invesalius/data/measures.py
... | ... | @@ -9,6 +9,7 @@ import vtk |
9 | 9 | |
10 | 10 | import constants as const |
11 | 11 | import project as prj |
12 | +import session as ses | |
12 | 13 | |
13 | 14 | TYPE = {const.LINEAR: _(u"Linear"), |
14 | 15 | const.ANGULAR: _(u"Angular"), |
... | ... | @@ -61,6 +62,9 @@ class MeasurementManager(object): |
61 | 62 | else: |
62 | 63 | ps.Publisher().sendMessage('Update slice viewer') |
63 | 64 | |
65 | + session = ses.Session() | |
66 | + session.SaveProject() | |
67 | + | |
64 | 68 | def _add_point(self, pubsub_evt): |
65 | 69 | position = pubsub_evt.data[0] |
66 | 70 | type = pubsub_evt.data[1] # Linear or Angular |
... | ... | @@ -109,6 +113,9 @@ class MeasurementManager(object): |
109 | 113 | else: |
110 | 114 | ps.Publisher().sendMessage('Update slice viewer') |
111 | 115 | |
116 | + session = ses.Session() | |
117 | + session.ChangeProject() | |
118 | + | |
112 | 119 | self.current = (m, mr) |
113 | 120 | |
114 | 121 | mr = self.current[1] |
... | ... | @@ -146,7 +153,6 @@ class MeasurementManager(object): |
146 | 153 | self.measures[index][0].name = new_name |
147 | 154 | |
148 | 155 | def _remove_measurements(self, pubsub_evt): |
149 | - print "---- measures: _remove_measurements" | |
150 | 156 | indexes = pubsub_evt.data |
151 | 157 | print indexes |
152 | 158 | for index in indexes: |
... | ... | @@ -158,6 +164,9 @@ class MeasurementManager(object): |
158 | 164 | ps.Publisher().sendMessage('Update slice viewer') |
159 | 165 | ps.Publisher().sendMessage('Render volume viewer') |
160 | 166 | |
167 | + session = ses.Session() | |
168 | + session.ChangeProject() | |
169 | + | |
161 | 170 | def _set_visibility(self, pubsub_evt): |
162 | 171 | index, visibility = pubsub_evt.data |
163 | 172 | m, mr = self.measures[index] | ... | ... |