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

Preserve empty scheme title, display 'untitled' placeholders where appropriate.

File:
1 edited

Legend:

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

    r11188 r11189  
    245245 
    246246        # Main window title and title icon. 
    247         self.setWindowTitle(self.scheme_widget.scheme().title) 
     247        self.set_document_title(self.scheme_widget.scheme().title) 
    248248        self.scheme_widget.titleChanged.connect(self.set_document_title) 
    249249        self.scheme_widget.modificationChanged.connect(self.setWindowModified) 
     
    743743 
    744744    def set_document_title(self, title): 
     745        """Set the document title (and the main window title). If `title` 
     746        is an empty string a default 'untitled' placeholder will be used. 
     747 
     748        """ 
    745749        if self.__document_title != title: 
    746750            self.__document_title = title 
     751 
     752            if not title: 
     753                # TODO: should the default name be platform specific 
     754                title = self.tr("untitled") 
     755 
    747756            self.setWindowTitle(title + "[*]") 
    748757 
    749758    def document_title(self): 
     759        """Return the document title. 
     760        """ 
    750761        return self.__document_title 
    751762 
Note: See TracChangeset for help on using the changeset viewer.