Ignore:
Timestamp:
04/20/12 11:24:44 (2 years ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
rebase_source:
e7b867a313fa64494220ed8f28596a17763f7c18
Message:

Changed the order by which widgets are removed from the schema in
'clear' method.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/orngDoc.py

    r10827 r10831  
    364364    def clear(self): 
    365365        self.canvasDlg.setCaption() 
    366         for widget in self.widgets[::-1]:    
    367             self.removeWidget(widget, saveTempDoc = False)   # remove widgets from last to first 
     366 
     367        # remove widgets in the reverse order as listed in signalManager 
     368        # (it keeps them ordered topologically)  
     369        widgets = sorted(self.widgets, 
     370                key=lambda w: self.signalManager.widgets.index(w.instance), 
     371                reverse=True) 
     372 
     373        for widget in widgets: 
     374            self.removeWidget(widget, saveTempDoc = False) 
    368375        self.canvas.update() 
    369376        self.schemaPath = self.canvasDlg.settings["saveSchemaDir"] 
Note: See TracChangeset for help on using the changeset viewer.