Changeset 11135:111e30422c5a in orange


Ignore:
Timestamp:
10/17/12 17:23:40 (18 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

When adding a new link schedule delayed signal processing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/scheme/widgetsscheme.py

    r11134 r11135  
     1import logging 
     2from functools import partial 
    13 
    2 import logging 
     4from PyQt4.QtCore import QTimer 
    35 
    46from .. import orngSignalManager 
     
    6466        self.signal_manager.addLink(source_widget, sink_widget, source_channel, 
    6567                                    sink_channel, enabled=link.enabled) 
    66         from functools import partial 
    67         self.signal_manager.processNewSignals() 
     68 
    6869        link.enabled_changed.connect( 
    6970            partial(self.signal_manager.setLinkEnabled, 
    7071                    source_widget, sink_widget) 
    7172        ) 
     73 
     74        QTimer.singleShot(0, self.signal_manager.processNewSignals) 
    7275 
    7376    def remove_link(self, link): 
     
    97100            _settingsFromSchema=node.properties 
    98101        ) 
    99         import pprint 
    100         log.debug("New %r instance properties:\n%s", node.title, 
    101                   pprint.pformat(node.properties)) 
    102102 
    103103        widget.__init__(None, self.signal_manager) 
Note: See TracChangeset for help on using the changeset viewer.