Exemplo n.º 1
0
    def _format_state_icon(self, item, data):
        # This happens with lazy object lists. Sometimes it calls this function
        # without actually having the real object.
        if not isinstance(item, DeliveryView):
            return

        stock_id, tooltip = get_delivery_state_icon(item.delivery)
        if stock_id is not None:
            return render_icon(stock_id, Gtk.IconSize.MENU)
Exemplo n.º 2
0
    def _format_state_icon(self, item, data):
        # This happens with lazy object lists. Sometimes it calls this function
        # without actually having the real object.
        if not isinstance(item, WorkOrderView):
            return

        stock_id, tooltip = get_workorder_state_icon(item.work_order)
        if stock_id is not None:
            return render_icon(stock_id, 16)
Exemplo n.º 3
0
    def _format_state_icon(self, item, data):
        # This happens with lazy object lists. Sometimes it calls this function
        # without actually having the real object.
        if not isinstance(item, WorkOrderView):
            return

        stock_id, tooltip = get_workorder_state_icon(item.work_order)
        if stock_id is not None:
            return render_icon(stock_id, 16)
Exemplo n.º 4
0
    def after_prescription_date__changed(self, widget):
        date = widget.read()
        if not date:
            return

        age = localtoday() - date
        if age.days > LATE_PRESCRIPTION_DAYS:
            # This is not a validation error, just a warning for the user.
            icon = render_icon('dialog-warning', 16)
            widget.set_pixbuf(icon)
            widget.set_tooltip(_('Attention: prescription date is older than '
                                 'one year'))
        else:
            widget.set_pixbuf(None)
Exemplo n.º 5
0
    def after_prescription_date__changed(self, widget):
        date = widget.read()
        if not date:
            return

        age = localtoday() - date
        if age.days > LATE_PRESCRIPTION_DAYS:
            # This is not a validation error, just a warning for the user.
            icon = render_icon('dialog-warning', 16)
            widget.set_pixbuf(icon)
            widget.set_tooltip(_('Attention: prescription date is older than '
                                 'one year'))
        else:
            widget.set_pixbuf(None)
Exemplo n.º 6
0
 def _format_state_icon(self, item, data):
     stock_id, tooltip = get_workorder_state_icon(item.work_order)
     if stock_id is not None:
         return render_icon(stock_id, Gtk.IconSize.MENU)
Exemplo n.º 7
0
 def _format_state_icon(self, item, data):
     stock_id, tooltip = get_workorder_state_icon(item.work_order)
     if stock_id is not None:
         return render_icon(stock_id, Gtk.IconSize.MENU)