Changeset 3800

Show
Ignore:
Timestamp:
12/11/07 14:46:32 (1 year ago)
Author:
ed
Message:

Fixed a bug in which adding controls from the DE a second time fails to add the bizobj code.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ide/ClassDesigner.py

    r3748 r3800  
    16441644 
    16451645    def flushCodeEditor(self): 
     1646        """Forces the content of the editor to update the code repository.""" 
    16461647        self.EditorForm.updateText() 
     1648 
     1649 
     1650    def updateCodeEditor(self): 
     1651        """Forces the code repository to update the contents of the editor.""" 
     1652        self.EditorForm.refreshCode() 
    16471653 
    16481654 
  • trunk/ide/ClassDesignerEditor.py

    r3668 r3800  
    213213 
    214214 
    215     def edit(self, obj, mthd=None, nonEvent=None): 
     215    def refreshCode(self): 
     216        """When an external event modified an object's code, this will update the  
     217        code displayed in the editor. 
     218        """ 
     219        self.edit(self.ddObject.KeyValue, discardChanges=True) 
     220         
     221 
     222    def edit(self, obj, mthd=None, nonEvent=None, discardChanges=False): 
    216223        """Opens an editor for the specified object and method.""" 
    217224        if mthd is None: 
     
    223230        rep = self.CodeRepository 
    224231        ed = self.editor 
    225         self.updateText() 
     232        if not discardChanges: 
     233            self.updateText() 
    226234        objCode = rep.get(obj) 
    227235        mvPointer = False 
  • trunk/ide/ClassDesignerFormMixin.py

    r3760 r3800  
    798798            # Make sure that the pk is retrieved! 
    799799            flds.append(pk) 
    800         cd = self.Controller.getCodeForObject(self, create=True) 
     800        rep = self.Controller.getCodeDict() 
     801        cd = rep.get(self) 
    801802        if cd is None: 
    802803            cd = {} 
    803          
    804         ###### 
    805         ##TODO: handle this case.        
    806804        currCode = cd.get("createBizobjs", "") 
    807         # See if there is a bizobj defined for this table. 
    808         ###### 
    809805         
    810806        bizcode = self.getBizobjTemplate() 
     
    823819        currCode += code 
    824820        cd["createBizobjs"] = currCode 
     821        rep[self] = cd 
     822        self.Controller.updateCodeEditor() 
    825823 
    826824