Commits

Marko Toplak committed cc7732d

Database update widget: summary for filtered items.

Comments (0)

Files changed (1)

Orange/OrangeWidgets/OWDatabasesUpdate.py

             self.setEnabled(True)
 
     def UpdateInfoLabel(self):
-        local = [item for item, _, _ in self.updateItems
-                 if item.state != AVAILABLE]
-        onServer = [item for item, _, _ in self.updateItems]
+        local = [item for item, tree_item, _ in self.updateItems
+                 if item.state != AVAILABLE and not tree_item.isHidden() ]
+        size = sum(float(item.size) for item in local)
 
-        size = sum(float(special_tags(item).get("#uncompressed", item.size))
-                   for item in local)
+        onServer = [item for item, tree_item, _ in self.updateItems if not tree_item.isHidden()]
+        sizeOnServer = sum(float(item.size) for item in onServer)
 
-        sizeOnServer = sum(float(item.size) for item, _, _ in self.updateItems)
-
-        if self.showAll:
-
-            text = ("%i items, %s (data on server: %i items, %s)" %
-                    (len(local),
-                     sizeof_fmt(size),
-                     len(onServer),
-                     sizeof_fmt(sizeOnServer)))
-        else:
-            text = "%i items, %s" % (len(local), sizeof_fmt(size))
+        text = ("%i items, %s (on server: %i items, %s)" %
+                (len(local),
+                 sizeof_fmt(size),
+                 len(onServer),
+                 sizeof_fmt(sizeOnServer)))
 
         self.infoLabel.setText(text)
 
             hide = not all(UpdateItem_match(item, string)
                            for string in strings)
             tree_item.setHidden(hide)
+        self.UpdateInfoLabel()
 
     def SubmitDownloadTask(self, domain, filename):
         """
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.