def get_pixbuf(self, icon_name): icon_filename = os.path.join(get_icon_dir(), icon_name) if os.path.exists(icon_filename): try: return pixbuf_new_from_file(icon_filename) except Exception as e: log("pixbuf_new_from_file(%s) failed: %s", icon_filename, e) return None
def set_dock_icon(self): filename = self.get_icon_filename() if not filename: log.warn("Warning: cannot set dock icon, file not found!") return log("OSXTray.set_dock_icon() loading icon from %s", filename) pixbuf = pixbuf_new_from_file(filename) self.macapp.set_dock_icon_pixbuf(pixbuf)
def get_pixbuf(self, icon_name): try: if not icon_name: log("get_pixbuf(%s)=None", icon_name) return None icon_filename = get_icon_filename(icon_name) log("get_pixbuf(%s) icon_filename=%s", icon_name, icon_filename) if icon_filename: return pixbuf_new_from_file(icon_filename) except: log.error("get_pixbuf(%s)", icon_name, exc_info=True) return None
def get_pixbuf(self, icon_name): from xpra.platform.paths import get_icon_filename from xpra.gtk_common.gtk_util import pixbuf_new_from_file try: if not icon_name: traylog("get_pixbuf(%s)=None", icon_name) return None icon_filename = get_icon_filename(icon_name) traylog("get_pixbuf(%s) icon_filename=%s", icon_name, icon_filename) if icon_filename: return pixbuf_new_from_file(icon_filename) except: traylog.error("get_pixbuf(%s)", icon_name, exc_info=True) return None
def get_image(self, icon_name, size=None): try: if not icon_name: return None icon_filename = get_icon_filename(icon_name) if not icon_filename: return None pixbuf = pixbuf_new_from_file(icon_filename) if not pixbuf: return None return scaled_image(pixbuf, size) except Exception: log.error("get_image(%s, %s)", icon_name, size, exc_info=True) return None
def get_icon(self, icon_name): icon_filename = os.path.join(get_icon_dir(), icon_name) if os.path.exists(icon_filename): return pixbuf_new_from_file(icon_filename) return None
def get_icon(self, icon_name): from xpra.platform.paths import get_icon_dir icon_filename = os.path.join(get_icon_dir(), icon_name) if os.path.exists(icon_filename): return pixbuf_new_from_file(icon_filename) return None
def do_set_icon_from_file(self, filename): if not self.macapp: return pixbuf = pixbuf_new_from_file(filename) self.macapp.set_dock_icon_pixbuf(pixbuf) self.icon_timestamp = monotonic_time()