Aleš Erjavec avatar Aleš Erjavec committed 47e4c2f

Fixed cancel button enabled state updates.

Comments (0)

Files changed (1)

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)
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.