Ignore:
Timestamp:
07/02/13 15:23:49 (10 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Refactored widget state messages handling.

Moved the resposibility for handling messages (OWBaseWidget.widgetStateChanged)
to WidgetsScheme.

Added support for messages in base SchemeNode class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/canvas/items/nodeitem.py

    r11525 r11614  
    2222from .utils import saturated, radial_gradient 
    2323 
     24from ...scheme.node import UserMessage 
    2425from ...registry import NAMED_COLORS 
    2526from ...resources import icon_loader 
     
    979980        """ 
    980981        pass 
     982 
     983    def setStateMessage(self, message): 
     984        """ 
     985        Set a state message to display over the item. 
     986 
     987        Parameters 
     988        ---------- 
     989        message : UserMessage 
     990            Message to display. `message.severity` is used to determine 
     991            the icon and `message.contents` is used as a tool tip. 
     992 
     993        """ 
     994        # TODO: Group messages by message_id not by severity 
     995        # and deprecate set[Error|Warning|Error]Message 
     996        if message.severity == UserMessage.Info: 
     997            self.setInfoMessage(message.contents) 
     998        elif message.severity == UserMessage.Warning: 
     999            self.setWarningMessage(message.contents) 
     1000        elif message.severity == UserMessage.Error: 
     1001            self.setErrorMessage(message.contents) 
    9811002 
    9821003    def setErrorMessage(self, message): 
Note: See TracChangeset for help on using the changeset viewer.