Function to restore a DP from archived copy
        Asks for confirmation along the way if parent is not None
        (in which case it will be the parent widget for confirmation dialogs)

def restore_from_archive(self, parent=None):
        """Function to restore a DP from archived copy
        Asks for confirmation along the way if parent is not None
        (in which case it will be the parent widget for confirmation dialogs)
        """
        from PyQt4.Qt import QMessageBox
        exists = os.path.exists(self.sourcepath)
        if parent:
            msg = """<P>Do you really want to restore <tt>%s</tt> from
            this entry's copy of <tt>%s</tt>?</P>""" % (self.sourcepath, self.filename)
            exists = os.path.exists(self.sourcepath)
            if exists:
                msg += """<P>Current file exists, and will be overwritten.</P>"""
                if QMessageBox.warning(parent, "Restoring from archive", msg,
                                       QMessageBox.Yes, QMessageBox.No) != QMessageBox.Yes:
                    return False
            else:
                if QMessageBox.question(parent, "Restoring from archive", msg,
                                        QMessageBox.Yes, QMessageBox.No) != QMessageBox.Yes:
                    return False
        busy = Purr.BusyIndicator()
        # remove file if in the way
        if exists:
            if os.system("/bin/rm -fr '%s'" % self.sourcepath):
                busy = None
                if parent:
                    QMessageBox.warning(parent, "Error removing file", """<P>
            There was an error removing %s. Archived copy was not restored.
            The text console may have more information.</P>""" % self.sourcepath,
                                        QMessageBox.Ok, 0)
                return False
        # unpack archived file
        if self.fullpath.endswith('.tgz'):
            parent_dir = os.path.dirname(self.sourcepath.rstrip('/'))
            os.system("/bin/rm -fr %s" % self.sourcepath)
            if os.system("tar zxf '%s' -C '%s'" % (self.fullpath, parent_dir)):
                busy = None
                if parent:
                    QMessageBox.warning(parent, "Error unpacking file", """<P>
            There was an error unpacking the archived version to %s. The text console may have more information.</P>""" % self.sourcepath,
                                        QMessageBox.Ok, 0)
                return False
        # else simply copy over
        else:
            if os.system("/bin/cp -a '%s' '%s'" % (self.fullpath, self.sourcepath)):
                busy = None
                if parent:
                    QMessageBox.warning(parent, "Error copying file", """<P>
            There was an error copying the archived version to %s. The text console may have more information.</P>""" % self.sourcepath,
                                        QMessageBox.Ok, 0)
                return False
        busy = None
        if parent:
            QMessageBox.information(parent, "Restored file", """<P>Restored %s from this entry's
          archived copy.</P>""" % self.sourcepath,
                                    QMessageBox.Ok, 0)
        return True