[Sugar-devel] [PATCH sugar] Add empty messages for empty devices and empty DOCUMENTS folders

Gonzalo Odiard gonzalo at laptop.org
Wed Sep 7 09:20:17 EDT 2011


Retested!
Please push.

Gonzalo

On Wed, Sep 7, 2011 at 3:07 AM, Simon Schampijer <simon at schampijer.de>wrote:

> On 09/06/2011 08:59 PM, Gonzalo Odiard wrote:
>
>> Tested and works ok.
>> IMHO, sending the constants had more sense when we only had two messages,
>> now should be more clear if we do:
>>
>>         if len(tree_model) == 0:
>>
>>              if self._is_query_empty():
>>> -                self._show_message(MESSAGE_**EMPTY_JOURNAL)
>>> +                if self._query['mountpoints'] == ['/']:
>>> +                    self._show_message(_('Your Journal is empty'))
>>> +                elif self._query['mountpoints'] == \
>>> +                        [model.get_documents_path()]:
>>> +                    self._show_message(_('Your documents folder is
>>> empty'))
>>> +                else:
>>> +                    self._show_message(_('The device is empty'))
>>>             else:
>>>                 self._show_message(_('No matching
>>> entries'),show_clear_query=**True)
>>>         else:
>>> @@ -385,6 +393,10 @@ class BaseListView(gtk.Bin):
>>>
>>>
>>>
>>    def _show_message(self, message, show_clear_query=False):
>>
>>   .....
>>
>>           if show_clear_query:
>>             button = gtk.Button(label=_('Clear search'))
>>             button.connect('clicked', self.__clear_button_clicked_**cb)
>>             button.props.image = Icon(icon_name='dialog-cancel'**,
>>                                       icon_size=gtk.ICON_SIZE_**BUTTON)
>>             canvas_button = hippo.CanvasWidget(widget=**button,
>>
>> xalign=hippo.ALIGNMENT_CENTER)
>>             box.append(canvas_button)
>>
>>
>> ... but is only me.
>> Regards,
>>
>> Gonzalo
>>
>
> Thanks Gonzalo for the feedback. Addressed your suggestion in the follow-up
> patch. Can you retest before I push?
>
> Regards,
>   Simon
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110907/c822b4f9/attachment.html>


More information about the Sugar-devel mailing list