Ignore:
Timestamp:
05/06/13 11:05:48 (12 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Finalise the WidgetsScheme on a 'Close' event.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/application/canvasmain.py

    r11469 r11487  
    944944        scheme_doc.setScheme(new_scheme) 
    945945 
    946         old_scheme.save_widget_settings() 
    947         old_scheme.close_all_open_widgets() 
    948         old_scheme.signal_manager.stop() 
     946        # Send a close event to the Scheme, it is responsible for 
     947        # closing/clearing all resources (widgets). 
     948        QApplication.sendEvent(old_scheme, QEvent(QEvent.Close)) 
     949 
    949950        old_scheme.deleteLater() 
    950951 
     
    14911492                return 
    14921493 
     1494        old_scheme = document.scheme() 
     1495 
    14931496        # Set an empty scheme to clear the document 
    14941497        document.setScheme(widgetsscheme.WidgetsScheme()) 
    14951498 
    1496         scheme = document.scheme() 
    1497         scheme.save_widget_settings() 
    1498         scheme.close_all_open_widgets() 
    1499         scheme.signal_manager.stop() 
    1500         scheme.deleteLater() 
     1499        QApplication.sendEvent(old_scheme, QEvent(QEvent.Close)) 
     1500 
     1501        old_scheme.deleteLater() 
    15011502 
    15021503        config.save_config() 
Note: See TracChangeset for help on using the changeset viewer.