Changeset 1848:8870b3c7cf34 in orange-bioinformatics for _bioinformatics/widgets/OWSelectGenes.py


Ignore:
Timestamp:
10/01/13 14:14:59 (7 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Remove already entered names from the completion model.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _bioinformatics/widgets/OWSelectGenes.py

    r1847 r1848  
    4747        self.variables = VariableListModel() 
    4848        # All gene names from the input (in self.geneIndex column) 
    49         self.geneNames = set([]) 
     49        self.geneNames = [] 
    5050        # Output changed flag 
    5151        self._changedFlag = False 
     
    7171        completer.setCaseSensitivity(Qt.CaseInsensitive) 
    7272        completer.popup().setAlternatingRowColors(True) 
     73        completer.setModel(QStringListModel([], self)) 
     74 
    7375        self.entryField.setCompleter(completer) 
    7476 
     
    151153 
    152154        self.geneNames = names 
    153         self._completerModel = QStringListModel(names) 
    154         self.entryField.completer().setModel(self._completerModel) 
     155        self.entryField.completer().model().setStringList(sorted(set(names))) 
    155156        self.hightlighter.setNames(names) 
    156157 
     
    163164        selection = set(names).intersection(self.geneNames) 
    164165        curr_selection = set(self.selection).intersection(self.geneNames) 
     166 
    165167        if selection != curr_selection: 
    166168            self.selection = names 
    167169            self.invalidateOutput() 
     170 
     171            names = set(self.geneNames) - set(names) 
     172            self.entryField.completer().model().setStringList(sorted(names)) 
    168173 
    169174 
Note: See TracChangeset for help on using the changeset viewer.