Commits

Aleš Erjavec  committed 47e4c2f

Fixed cancel button enabled state updates.

  • Participants
  • Parent commits 53aea11

Comments (0)

Files changed (1)

File Orange/OrangeWidgets/OWDatabasesUpdate.py

 
         self.state = -1
         self.setState(state)
-        
+
     def setState(self, state):
         """
         Set the current update state for the widget (AVAILABLE,
         CURRENT, OUTDATED or DEPRECTED).
 
         """
-        if self.state != state:
-            self.state = state
-            self._update()
- 
+        self.state = state
+        self._update()
+
     def _update(self):
         if self.state == AVAILABLE:
             self.checkButton.setChecked(False)
             opt_widget.setState(new_item.state)
 
             self.UpdateInfoLabel()
-            self.cancelButton.setEnabled(False)
 
     def SubmitRemoveTask(self, domain, filename):
         serverfiles.remove(domain, filename)
         OWBaseWidget.onDeleteWidget(self)
 
     def onDownloadFinished(self):
+        # on download completed/canceled/error
         assert QThread.currentThread() is self.thread()
         for task in list(self._tasks):
             future = task.future()
             # Clear/reset the overall progress
             self.progress.setRange(0, 0)
 
+            self.cancelButton.setEnabled(False)
+
     def onDownloadError(self, exc_info):
         sys.excepthook(*exc_info)