Anonymous avatar Anonymous committed 66ad2c6

when quality or speed or not sensitive, show why in the tooltip message

Comments (0)

Files changed (1)

src/xpra/platform/client_extras_base.py

 
     def set_qualitymenu(self, *args):
         if self.quality:
-            self.quality.set_sensitive(not self.client.mmap_enabled and self.client.encoding in ("jpeg", "webp", "x264"))
+            can_use = not self.client.mmap_enabled and self.client.encoding in ("jpeg", "webp", "x264")
+            self.quality.set_sensitive(can_use)
+            if can_use:
+                self.quality.set_tooltip_text("Minimum picture quality")
+            else:
+                self.quality.set_tooltip_text("Not supported with %s encoding" % self.client.encoding)
+                
 
     def make_speedmenuitem(self):
         self.speed = self.menuitem("Speed", "speed.png", "Encoding latency vs size", None)
 
     def set_speedmenu(self, *args):
         if self.speed:
-            self.speed.set_sensitive(not self.client.mmap_enabled and self.client.encoding in ("x264", ) and self.client.change_speed)
+            can_use = not self.client.mmap_enabled and self.client.encoding=="x264" and self.client.change_speed
+            self.speed.set_sensitive(can_use)
+            if self.client.mmap_enabled:
+                self.speed.set_tooltip_text("Quality is always 100% with mmap")
+            elif not self.client.change_speed:
+                self.speed.set_tooltip_text("Server does not support changing speed")
+            elif self.client.encoding!="x264":
+                self.speed.set_tooltip_text("Not supported with %s encoding" % self.client.encoding)
+            else:
+                self.speed.set_tooltip_text("Encoding latency vs size")
 
 
     def spk_on(self, *args):
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.