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,6 +9,7 @@ import vtk | ||
9 | 9 | ||
10 | import constants as const | 10 | import constants as const |
11 | import project as prj | 11 | import project as prj |
12 | +import session as ses | ||
12 | 13 | ||
13 | TYPE = {const.LINEAR: _(u"Linear"), | 14 | TYPE = {const.LINEAR: _(u"Linear"), |
14 | const.ANGULAR: _(u"Angular"), | 15 | const.ANGULAR: _(u"Angular"), |
@@ -61,6 +62,9 @@ class MeasurementManager(object): | @@ -61,6 +62,9 @@ class MeasurementManager(object): | ||
61 | else: | 62 | else: |
62 | ps.Publisher().sendMessage('Update slice viewer') | 63 | ps.Publisher().sendMessage('Update slice viewer') |
63 | 64 | ||
65 | + session = ses.Session() | ||
66 | + session.SaveProject() | ||
67 | + | ||
64 | def _add_point(self, pubsub_evt): | 68 | def _add_point(self, pubsub_evt): |
65 | position = pubsub_evt.data[0] | 69 | position = pubsub_evt.data[0] |
66 | type = pubsub_evt.data[1] # Linear or Angular | 70 | type = pubsub_evt.data[1] # Linear or Angular |
@@ -109,6 +113,9 @@ class MeasurementManager(object): | @@ -109,6 +113,9 @@ class MeasurementManager(object): | ||
109 | else: | 113 | else: |
110 | ps.Publisher().sendMessage('Update slice viewer') | 114 | ps.Publisher().sendMessage('Update slice viewer') |
111 | 115 | ||
116 | + session = ses.Session() | ||
117 | + session.ChangeProject() | ||
118 | + | ||
112 | self.current = (m, mr) | 119 | self.current = (m, mr) |
113 | 120 | ||
114 | mr = self.current[1] | 121 | mr = self.current[1] |
@@ -146,7 +153,6 @@ class MeasurementManager(object): | @@ -146,7 +153,6 @@ class MeasurementManager(object): | ||
146 | self.measures[index][0].name = new_name | 153 | self.measures[index][0].name = new_name |
147 | 154 | ||
148 | def _remove_measurements(self, pubsub_evt): | 155 | def _remove_measurements(self, pubsub_evt): |
149 | - print "---- measures: _remove_measurements" | ||
150 | indexes = pubsub_evt.data | 156 | indexes = pubsub_evt.data |
151 | print indexes | 157 | print indexes |
152 | for index in indexes: | 158 | for index in indexes: |
@@ -158,6 +164,9 @@ class MeasurementManager(object): | @@ -158,6 +164,9 @@ class MeasurementManager(object): | ||
158 | ps.Publisher().sendMessage('Update slice viewer') | 164 | ps.Publisher().sendMessage('Update slice viewer') |
159 | ps.Publisher().sendMessage('Render volume viewer') | 165 | ps.Publisher().sendMessage('Render volume viewer') |
160 | 166 | ||
167 | + session = ses.Session() | ||
168 | + session.ChangeProject() | ||
169 | + | ||
161 | def _set_visibility(self, pubsub_evt): | 170 | def _set_visibility(self, pubsub_evt): |
162 | index, visibility = pubsub_evt.data | 171 | index, visibility = pubsub_evt.data |
163 | m, mr = self.measures[index] | 172 | m, mr = self.measures[index] |