def updateEntry(self):
        """Updates entry object with current content of dialog.
        In new entry mode (setEntry() not called, so self.entry=None), creates new entry object.
        In old entry mode (setEntry() called), updates and saves old entry object.
        """
        # form up new entry
        title = str(self.wtitle.text())
        comment = str(self.comment_doc.toPlainText())
        # process comment string -- eliminate single newlines, make double-newlines into separate paragraphs
        # exception are paragraphs that start with "#LOG:", these get special treatment and the single newlines are
        # left intact
        pars = []
        for paragraph in comment.split("\n\n"):
            if paragraph.startswith("LOG:"):
                pars.append(paragraph.replace("\n", "<BR>"))
            else:
                pars.append(paragraph.replace("\n", " "))
        comment = "\n".join(pars)
        # go through data products and decide what to do with each one
        busy = Purr.BusyIndicator()
        # get list of DPs
        dps, updated = self.wdplv.buildDPList()
        # emit signal for all newly-created DPs
        for dp in dps:
            if not dp.archived:
                self.emit(SIGNAL("creatingDataProduct"), dp.sourcepath)
        # update or return new entry
        if self.entry:
            self.entry.update(title=title, comment=comment, dps=dps)
            self.entry.save(refresh_index=updated)
            return self.entry
        else:
            return Purr.LogEntry(time.time(), title, comment, dps)