Source

orange-bioinformatics / _bioinformatics / widgets / OWKEGGPathwayBrowser.py

Diff from to

_bioinformatics/widgets/OWKEGGPathwayBrowser.py

         self.has_new_reference_set = False
 
         self.setEnabled(False)
+        self.infoLabel.setText("Fetching organism definitions\n")
         QTimer.singleShot(100, self.UpdateOrganismComboBox)
 
     def UpdateOrganismComboBox(self):
             # TODO: Add option to specify additional organisms not
             # in the common list.
 
-            self.infoLabel.setText("Fetching organism definitions\n")
-
             keys = map(genome.org_code_to_entry_key, essential + common)
 
             self.progressBarInit()
             items = [desc for code, desc in codes]
 
             self.organismCodes = [code for code, desc in codes]
+            self.organismComboBox.clear()
             self.organismComboBox.addItems(items)
+            self.organismComboBox.setCurrentIndex(self.organismIndex)
         finally:
             self.setEnabled(True)
             self.infoLabel.setText("No data on input\n")
 
 if __name__ == "__main__":
     app = QApplication(sys.argv)
+    w = OWKEGGPathwayBrowser()
+    w.show()
+
     data = Orange.data.Table("brown-selected.tab")
-    w = OWKEGGPathwayBrowser()
-    w.UpdateOrganismComboBox()
-    w.show()
-    w.SetData(Orange.data.Table(data[:]))
-    QTimer.singleShot(10, w.handleNewSignals)
+
+    QTimer.singleShot(1000, lambda: w.SetData(data))
+    QTimer.singleShot(1500, w.handleNewSignals)
 
     app.exec_()
     w.saveSettings()