167 |
169 |
168 def addWatchPoint(self, cond, special, properties): |
170 def addWatchPoint(self, cond, special, properties): |
169 """ |
171 """ |
170 Public method to add a new watch expression to the list. |
172 Public method to add a new watch expression to the list. |
171 |
173 |
172 @param cond expression of the watch expression (string) |
174 @param cond expression of the watch expression |
173 @param special special condition of the watch expression (string) |
175 @type str |
|
176 @param special special condition of the watch expression |
|
177 @type str |
174 @param properties properties of the watch expression |
178 @param properties properties of the watch expression |
175 (tuple of temporary flag (bool), enabled flag (bool), |
179 (tuple of temporary flag, enabled flag, ignore count) |
176 ignore count (integer)) |
180 @type tuple of (bool, bool, int) |
177 """ |
181 """ |
178 wp = [cond, special] + list(properties) |
182 wp = [cond, special] + list(properties) |
179 cnt = len(self.watchpoints) |
183 cnt = len(self.watchpoints) |
180 self.beginInsertRows(QModelIndex(), cnt, cnt) |
184 self.beginInsertRows(QModelIndex(), cnt, cnt) |
181 self.watchpoints.append(wp) |
185 self.watchpoints.append(wp) |
|
186 self.endInsertRows() |
|
187 |
|
188 def addWatchPoints(self, watchpoints): |
|
189 """ |
|
190 Public method to add multiple watch expressions to the list. |
|
191 |
|
192 @param watchpoints list of watch expressions with expression, special |
|
193 condition, temporary flag, enabled flag and ignore count each |
|
194 @type list of (str, str, bool, bool, int) |
|
195 """ |
|
196 cnt = len(self.watchpoints) |
|
197 self.beginInsertRows(QModelIndex(), cnt, cnt + len(watchpoints) - 1) |
|
198 self.watchpoints += watchpoints |
182 self.endInsertRows() |
199 self.endInsertRows() |
183 |
200 |
184 def setWatchPointByIndex(self, index, cond, special, properties): |
201 def setWatchPointByIndex(self, index, cond, special, properties): |
185 """ |
202 """ |
186 Public method to set the values of a watch expression given by index. |
203 Public method to set the values of a watch expression given by index. |
196 row = index.row() |
213 row = index.row() |
197 index1 = self.createIndex(row, 0, self.watchpoints[row]) |
214 index1 = self.createIndex(row, 0, self.watchpoints[row]) |
198 index2 = self.createIndex( |
215 index2 = self.createIndex( |
199 row, len(self.watchpoints[row]), self.watchpoints[row]) |
216 row, len(self.watchpoints[row]), self.watchpoints[row]) |
200 self.dataAboutToBeChanged.emit(index1, index2) |
217 self.dataAboutToBeChanged.emit(index1, index2) |
201 i = 0 |
218 self.watchpoints[row] = [cond, special] + list(properties) |
202 for value in [cond, special] + list(properties): |
|
203 self.watchpoints[row][i] = value |
|
204 i += 1 |
|
205 self.dataChanged.emit(index1, index2) |
219 self.dataChanged.emit(index1, index2) |
206 |
220 |
207 def setWatchPointEnabledByIndex(self, index, enabled): |
221 def setWatchPointEnabledByIndex(self, index, enabled): |
208 """ |
222 """ |
209 Public method to set the enabled state of a watch expression given by |
223 Public method to set the enabled state of a watch expression given by |
263 """ |
277 """ |
264 Public method to get the values of a watch expression given by index. |
278 Public method to get the values of a watch expression given by index. |
265 |
279 |
266 @param index index of the watch expression (QModelIndex) |
280 @param index index of the watch expression (QModelIndex) |
267 @return watch expression (list of six values (expression, |
281 @return watch expression (list of six values (expression, |
268 special condition, temporary flag, enabled flag, ignore count, |
282 special condition, temporary flag, enabled flag, ignore count)) |
269 index)) |
283 @rtype tuple of (str, str, bool, bool, int) |
270 """ |
284 """ |
271 if index.isValid(): |
285 if index.isValid(): |
272 return self.watchpoints[index.row()][:] # return a copy |
286 return self.watchpoints[index.row()][:] # return a copy |
273 else: |
287 else: |
274 return [] |
288 return [] |
275 |
289 |
|
290 def getAllWatchpoints(self): |
|
291 """ |
|
292 Public method to get the list of watchpoints. |
|
293 |
|
294 @return list of watchpoints |
|
295 @rtype list of list of [str, str, bool, bool, int] |
|
296 """ |
|
297 return copy.deepcopy(self.watchpoints) |
|
298 |
276 def getWatchPointIndex(self, cond, special=""): |
299 def getWatchPointIndex(self, cond, special=""): |
277 """ |
300 """ |
278 Public method to get the index of a watch expression given by |
301 Public method to get the index of a watch expression given by |
279 expression. |
302 expression. |
280 |
303 |