Changeset 11191:b6dc725dd639 in orange


Ignore:
Timestamp:
11/20/12 16:13:39 (17 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Simplify the link text if the two channel names are the same, use unicode arrow character.

Location:
Orange/OrangeCanvas
Files:
4 edited

Legend:

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

    r11184 r11191  
    294294 
    295295        if self.__sourceName or self.__sinkName: 
    296             text = "{0} --> {1}".format(self.__sourceName, self.__sinkName) 
     296            if self.__sourceName != self.__sinkName: 
     297                text = u"{0} \u2192 {1}".format(self.__sourceName, 
     298                                                self.__sinkName) 
     299            else: 
     300                # If the names are the same show only one. 
     301                # Is this right? If the sink has two input channels of the 
     302                # same type having the name on the link help elucidate 
     303                # the scheme. 
     304                text = self.__sourceName 
    297305        else: 
    298306            text = "" 
     307 
    299308        self.linkTextItem.setPlainText(text) 
    300309 
  • Orange/OrangeCanvas/canvas/scene.py

    r11182 r11191  
    763763    painter.end() 
    764764 
    765     return unicode(svg_buffer.buffer()) 
     765    buffer_str = str(svg_buffer.buffer()) 
     766    return unicode(buffer_str.decode("utf-8")) 
  • Orange/OrangeCanvas/preview/previewbrowser.py

    r11139 r11191  
    236236 
    237237        if svg: 
    238             self.__image.load(QByteArray(svg)) 
     238            self.__image.load(QByteArray(svg.encode("utf-8"))) 
  • Orange/OrangeCanvas/preview/previewmodel.py

    r11189 r11191  
    166166                prefix="thumbnail", suffix=".svg", delete=False 
    167167                ) as f: 
    168             f.write(thumbnail) 
     168            f.write(thumbnail.encode("utf-8")) 
    169169            f.flush() 
    170170            icon = QIcon(f.name) 
Note: See TracChangeset for help on using the changeset viewer.