self.tv = gtk.TreeView(self.model)
self.tv.set_rules_hint(True)
self.tv.get_selection().set_mode(gtk.SELECTION_MULTIPLE)
+ self.tv.get_selection().connect("changed", self.selChanged)
self.__addColumns(self.tv)
sw.add(self.tv)
tv.append_column(col)
+ def selChanged(self, sel):
+ model, paths = sel.get_selected_rows()
- def addBtnClicked(self, btn):
-
- if not self.debugger.isActive():
- return
-
-
- bpspec = self.bpEntry.get_text()
- bpspec = bpspec.strip()
- rx = re.compile("^[\w\._\-]+:\d+(\s+if\s+\S+.*)?$")
-
- #Check if format is correct
- if not rx.search(bpspec):
- dialog = gtk.MessageDialog(None, \
- gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, \
- gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, \
- "Invalid format!")
- dialog.run()
- dialog.destroy()
- return
-
-
- ifsplit = string.split(bpspec, "if")
-
- if len(ifsplit)>1:
- cond = ifsplit[1].strip()
- else:
- cond = None
-
- pos = ifsplit[0].strip()
- [file,lineno] = string.split(pos, ":")
+ if len(paths) > 0:
+ path = paths[0]
+ iter = model.get_iter(path)
+ bpspec, = model.get(iter, 1)
+ self.bpEntry.set_text(bpspec)
- self.addBreakpoint(file, lineno, cond)
-
def addBreakpoint(self, file, lineno, cond=None):
self.model.set(iter, 1, "%s:%s if %s" % (str(file), str(lineno), str(cond)))
+ def addBtnClicked(self, btn):
+
+ if not self.debugger.isActive():
+ return
+
+
+ bpspec = self.bpEntry.get_text()
+ bpspec = bpspec.strip()
+ rx = re.compile("^[\w\._\-]+:\d+(\s+if\s+\S+.*)?$")
+
+ #Check if format is correct
+ if not rx.search(bpspec):
+ dialog = gtk.MessageDialog(None, \
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, \
+ gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, \
+ "Invalid format!")
+ dialog.run()
+ dialog.destroy()
+ return
+
+
+ ifsplit = string.split(bpspec, "if")
+
+ if len(ifsplit)>1:
+ cond = ifsplit[1].strip()
+ else:
+ cond = None
+
+ pos = ifsplit[0].strip()
+ [file,lineno] = string.split(pos, ":")
+
+ self.addBreakpoint(file, lineno, cond)
+
+
+
def delBtnClicked(self, btn):
selection = self.tv.get_selection()
model, paths = selection.get_selected_rows()
- for path in paths:
+ for path in reversed(paths):
iter = model.get_iter(path)
bpno, = self.model.get(iter, 0)
self.debugger.delBreakpoint(bpno)