Changeset 11259:93eddd7eed11 in orange


Ignore:
Timestamp:
01/14/13 12:43:42 (15 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Set the channel names visiblity state from the settings.

Location:
Orange/OrangeCanvas
Files:
2 edited

Legend:

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

    r11257 r11259  
    589589            settings.value("quick-help/visible", True).toBool() 
    590590        ) 
     591 
     592        self.__update_from_settings() 
    591593 
    592594    def set_document_title(self, title): 
     
    14841486        self.scheme_widget.setQuickMenuTriggers(triggers) 
    14851487 
     1488        settings.endGroup() 
     1489        settings.beginGroup("schemeedit") 
     1490        show_channel_names = settings.value("show-channel-names", 
     1491                                            defaultValue=True) 
     1492        self.scheme_widget.setChannelNamesVisible(show_channel_names.toBool()) 
     1493 
    14861494 
    14871495def updated_flags(flags, mask, state): 
  • Orange/OrangeCanvas/document/schemeedit.py

    r11245 r11259  
    9595                                   SchemeEditWidget.DoubleClicked 
    9696        self.__emptyClickButtons = 0 
     97        self.__channelNamesVisible = True 
    9798        self.__possibleSelectionHandler = None 
    9899        self.__possibleMouseItemsMove = False 
     
    320321 
    321322        scene = CanvasScene() 
     323        scene.set_channel_names_visible(self.__channelNamesVisible) 
     324 
    322325        view = CanvasView(scene) 
    323326        view.setFrameStyle(CanvasView.NoFrame) 
     
    401404        return self.__quickMenuTriggers 
    402405 
     406    def setChannelNamesVisible(self, visible): 
     407        """Set channel names visibility state. When enabled the links 
     408        in the view will have a visible source/sink channel names 
     409        displayed over them. 
     410 
     411        """ 
     412        if self.__channelNamesVisible != visible: 
     413            self.__channelNamesVisible = visible 
     414            self.__scene.set_channel_names_visible(visible) 
     415 
     416    def channelNamesVisible(self): 
     417        """Return the channel name visibility state. 
     418        """ 
     419        return self.__channelNamesVisible 
     420 
    403421    def undoStack(self): 
    404422        """Return the undo stack. 
     
    409427        """Set the path associated with the current scheme. 
    410428 
    411     .. note:: Calling `setScheme` will invalidate the path (i.e. set it 
    412               to an empty string) 
     429        .. note:: Calling `setScheme` will invalidate the path (i.e. set it 
     430                  to an empty string) 
    413431 
    414432        """ 
     
    468486            self.__scene = CanvasScene() 
    469487            self.__view.setScene(self.__scene) 
     488            self.__scene.set_channel_names_visible(self.__channelNamesVisible) 
     489 
    470490            self.__scene.installEventFilter(self) 
    471491 
Note: See TracChangeset for help on using the changeset viewer.