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/schemeinfo.py

    r11166 r11189  
    3737        layout.addRow(self.tr("Description"), self.desc_edit) 
    3838 
     39        self.__schemeIsUntitled = True 
     40 
    3941        self.setLayout(layout) 
    4042 
     
    4446        """ 
    4547        self.scheme = scheme 
    46         self.name_edit.setText(scheme.title or "") 
     48        if not scheme.title: 
     49            self.name_edit.setText(self.tr("untitled")) 
     50            self.__schemeIsUntitled = True 
     51        else: 
     52            self.name_edit.setText(scheme.title) 
     53            self.__schemeIsUntitled = False 
    4754        self.desc_edit.setPlainText(scheme.description or "") 
    4855 
     
    5259 
    5360        """ 
    54         name = unicode(self.name_edit.text()).strip() 
     61        if self.__schemeIsUntitled and \ 
     62            self.name_edit.text() == self.tr("untitled"): 
     63            # 'untitled' text was not changed 
     64            name = "" 
     65        else: 
     66            name = unicode(self.name_edit.text()).strip() 
     67 
    5568        description = unicode(self.desc_edit.toPlainText()).strip() 
    5669        self.scheme.title = name 
Note: See TracChangeset for help on using the changeset viewer.