Example #1
0
 def showHeaders(self):
     """Show in a dialg a form with the header items. This form allow edit/delete and add header items.
     When the dialog is closed, it updates the header items properly
     Raises
     ---------
     gipsyException
     Raise a gipsyException when gets some error accesing to the set
     """
     try:
         items=self.gSet.getHeaderItems()
     except gipsyException as g:
         QMessageBox.warning(self, "Read Header Set Failed", QString(g.msj))
         return
     self.ghd=gipsyHeadersDlg(items)
     self.ghd.load()
     self.connect(self.ghd, SIGNAL("headerKeyDeleted"),self.deleteHeaderKey)
     self.connect(self.ghd, SIGNAL("headerKeyChanged"),self.changeHeaderKey)
     self.connect(self.ghd, SIGNAL("headerKeyAdded"), self.addHeaderKey)
     self.ghd.exec_()
Example #2
0
 def changeHeaderKey(self, key, newval):
     key=str(key)
     newval=str(newval)
 
     try:
         log=self.gSet.updateHeaderKey(key,newval)
     except gipsyException as g:
         QMessageBox.warning(self, "Update Header Item Failed ", QString(g.msj))
         if hasattr(self, 'ghd'):
             self.ghd.done(0)
             try:
                 items=self.gSet.getHeaderItems()
             except gipsyException as g:
                 QMessageBox.warning(self, "Read Header Set Failed", QString(g.msj))
                 return
             self.ghd=gipsyHeadersDlg(items)
             self.ghd.load()
             self.connect(self.ghd, SIGNAL("headerKeyDeleted"),self.deleteHeaderKey)
             self.connect(self.ghd, SIGNAL("headerKeyChanged"),self.changeHeaderKey)
             self.connect(self.ghd, SIGNAL("headerKeyAdded"), self.addHeaderKey)
             self.ghd.exec_()
         return
     self.emit(SIGNAL("headersChanged"), log)