[Sugar-devel] [PATCH sugar] Add empty messages for empty devices and empty DOCUMENTS folders
Simon Schampijer
simon at schampijer.de
Wed Sep 7 02:07:07 EDT 2011
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
More information about the Sugar-devel
mailing list