예제 #1
0
파일: base.py 프로젝트: pbx/kupfer
    def get_icon(self):
        """
        Returns an icon in GIcon format

        Subclasses should implement: get_gicon and get_icon_name,
        if they make sense.
        The methods are tried in that order.
        """
        gicon = self.get_gicon()
        if gicon and icons.is_good(gicon):
            return gicon
        icon_name = self.get_icon_name()
        if icon_name and icons.get_good_name_for_icon_names((icon_name, )):
            return icons.get_gicon_for_names(icon_name)
        return icons.get_gicon_for_names(self.fallback_icon_name)
예제 #2
0
    def get_icon(self):
        """
		Returns an icon in GIcon format

		Subclasses should implement: get_gicon and get_icon_name,
		if they make sense.
		The methods are tried in that order.
		"""
        gicon = self.get_gicon()
        if gicon and icons.is_good(gicon):
            return gicon
        icon_name = self.get_icon_name()
        if icon_name and icons.get_good_name_for_icon_names((icon_name, )):
            return icons.get_gicon_for_names(icon_name)
        return icons.get_gicon_for_names(self.fallback_icon_name)
예제 #3
0
파일: base.py 프로젝트: chmouel/kupfer
	def get_icon(self):
		"""
		Returns an icon in GIcon format

		Subclasses should implement: get_gicon and get_icon_name,
		if they make sense.
		The methods are tried in that order.
		"""
		gicon = self.get_gicon()
		if gicon and icons.is_good(gicon):
			return gicon
		icon_name = self.get_icon_name()
		if icon_name and icons.get_good_name_for_icon_names((icon_name, )):
			return icons.get_gicon_for_names(icon_name)
		fallback_class = Action if isinstance(self, Action) else KupferObject
		return icons.get_gicon_for_names(fallback_class.get_icon_name(self))