def update_launch_icon_model(self, *args): self.icon_model.clear() for desktop_file in self.launcher_setting.get_value(): log.debug('Processing with "%s"...' % desktop_file) if desktop_file.startswith("/") and os.path.exists(desktop_file): path = desktop_file else: user_path = os.path.join(NewDesktopEntry.user_folder, desktop_file) system_path = os.path.join(NewDesktopEntry.system_folder, desktop_file) if os.path.exists(user_path): path = user_path elif os.path.exists(system_path): path = system_path else: log.debug("No desktop file avaialbe in for %s" % desktop_file) continue try: entry = NewDesktopEntry(path) except Exception, e: log_traceback(log) continue self.icon_model.append((path, icon.get_from_name(entry.getIcon(), size=32), entry.getName(), entry))
def update_launch_icon_model(self, *args): self.icon_model.clear() for desktop_file in self.launcher_setting.get_value(): log.debug('Processing with "%s"...' % desktop_file) if desktop_file.startswith('/') and os.path.exists(desktop_file): path = desktop_file else: if desktop_file.startswith('application://'): desktop_file = desktop_file.split('application://')[1] log.debug("Desktop file for quantal: %s" % desktop_file) user_path = os.path.join(NewDesktopEntry.user_folder, desktop_file) system_path = os.path.join(NewDesktopEntry.system_folder, desktop_file) if os.path.exists(user_path): path = user_path elif os.path.exists(system_path): path = system_path else: path = desktop_file try: entry = NewDesktopEntry(path) self.icon_model.append((path, icon.get_from_name(entry.getIcon(), size=32), entry.getName(), entry)) except Exception, e: log_traceback(log) self.icon_model.append((path, icon.get_from_name('plugin-unityshell', size=32), self.QUANTAL_SPECIFIC_ITEMS[path], None))
def update_launch_icon_model(self, *args): self.icon_model.clear() for desktop_file in self.launcher_setting.get_value(): log.debug('Processing with "%s"...' % desktop_file) if desktop_file.startswith('/') and os.path.exists(desktop_file): path = desktop_file else: user_path = os.path.join(NewDesktopEntry.user_folder, desktop_file) system_path = os.path.join(NewDesktopEntry.system_folder, desktop_file) if os.path.exists(user_path): path = user_path elif os.path.exists(system_path): path = system_path else: log.debug("No desktop file avaialbe in for %s" % desktop_file) continue try: entry = NewDesktopEntry(path) except Exception, e: log_traceback(log) continue self.icon_model.append((path,\ icon.get_from_name(entry.getIcon(), size=32),\ entry.getName(), entry))
def is_module_active(cls, k, v): try: if k not in ('TweakModule', 'Clip', 'JanitorPlugin', 'proxy') and \ hasattr(v, '__utmodule__'): if cls.is_supported_desktop(v.__desktop__) and \ cls.is_supported_distro(v.__distro__) and \ v.is_active(): return True return False except Exception, e: log_traceback(log) return False
def update_launch_icon_model(self, *args): self.icon_model.clear() for desktop_file in self.launcher_setting.get_value(): log.debug('Processing with "%s"...' % desktop_file) if desktop_file.startswith('/') and os.path.exists(desktop_file): path = desktop_file else: if os.path.exists('/usr/share/applications/%s' % desktop_file): path = '/usr/share/applications/%s' % desktop_file else: log.debug("No desktop file avaialbe in for %s" % desktop_file) continue try: entry = NewDesktopEntry(path) except Exception, e: log_traceback(log) continue self.icon_model.append((path,\ icon.get_from_name(entry.getIcon(), size=32),\ entry.getName(), entry))
def update_launch_icon_model(self, *args): self.icon_model.clear() for desktop_file in self.launcher_setting.get_value(): log.debug('Processing with "%s"...' % desktop_file) if desktop_file.startswith('/') and os.path.exists(desktop_file): path = desktop_file else: if desktop_file.startswith('application://'): desktop_file = desktop_file.split('application://')[1] log.debug("Desktop file for quantal: %s" % desktop_file) user_path = os.path.join(NewDesktopEntry.user_folder, desktop_file) system_path = os.path.join(NewDesktopEntry.system_folder, desktop_file) if os.path.exists(user_path): path = user_path elif os.path.exists(system_path): path = system_path else: path = desktop_file try: entry = NewDesktopEntry(path) self.icon_model.append( (path, icon.get_from_name(entry.getIcon(), size=32), entry.getName(), entry)) except Exception, e: log_traceback(log) if path in self.QUANTAL_SPECIFIC_ITEMS.keys(): self.icon_model.append( (path, icon.get_from_name('plugin-unityshell', size=32), self.QUANTAL_SPECIFIC_ITEMS[path], None))