901
901
raise errors.ModifyInternalError(message)
902
902
sender_name = yield self._get_sender_name(sender)
903
title = _("Searching for mime type handlers")
903
title = _("Searching for suitable software to open files")
904
904
mime_types = set(mime_types_list)
905
905
mime_names = [gio.content_type_get_description(mt) for mt in mime_types]
907
message = gettext.ngettext("%s requires to install additional "
908
"software which can open files of "
910
"%s requires to install additional "
911
"software which can open files of "
912
"the following mime types:\n%s",
913
len(mime_types)) % (sender_name,
914
", ".join(mime_names))
907
#TRANSLATORS: %s is an application
908
message = gettext.ngettext("%s requires to install software to "
909
"open files of the following file type:",
910
"%s requires to install software to "
911
"open files of the following file "
913
len(mime_types)) % sender_name
916
message = gettext.ngettext("You have to install additional "
917
"software to open files of the "
919
"You have to install additional "
920
"software to open files of the "
921
"following mime types:\n%s",
922
len(mime_types)) % (sender_name,
923
", ".join(mime_names))
915
message = gettext.ngettext("Software to open files of the "
916
"following file type is required "
917
"but is not installed:",
918
"Software to open files of the "
919
"following file types is required "
920
"but is not installed:",
922
mime_types_desc = [gio.content_type_get_description(mime_type) \
923
for mime_type in mime_types]
924
message += self._get_bullet_list(mime_types_desc)
924
925
progress = ProgressDialog(title, message, parent)
925
926
progress.show_all()
926
927
while gtk.events_pending():
954
for mime_type in desktop_entry.getMimeTypes():
955
supported_mime_types = set(desktop_entry.getMimeTypes())
956
for mime_type in supported_mime_types:
955
957
if not mime_type in mime_types:
958
959
package_map.setdefault(pkg_name, [[], set(), 0])
959
960
#FIXME: Don't add desktop entries twice
965
966
if package_map[pkg_name][2] < popcon:
966
967
package_map[pkg_name][2] = popcon
967
968
unsatisfied.discard(mime_type)
970
not supported_mime_types.issuperset(mime_types):
969
973
progress.destroy()
971
details=_("Mime types")
974
if mixed or unsatisfied:
975
details = _("Supported file types")
974
title = _("Install mime type handler?")
978
title = _("Install software to open files?")
976
#TRANSLATORS: list separator
977
unsatisfied_str = _(", ").join(unsatisfied)
980
unsatisfied_desc = [gio.content_type_get_description(mime_type) \
981
for mime_type in unsatisfied]
982
unsatisfied_str = self._get_bullet_list(unsatisfied_desc)
978
983
message += "\n\n"
979
message += gettext.ngettext("%s isn't supported.",
980
"Unsupported mime types: %s",
984
#TRANSLATORS: %s is either a single file type or a bullet list of
986
message += gettext.ngettext("%s is not supported.",
987
"Unsupported file types: %s",
981
988
len(unsatisfied)) % unsatisfied_str
982
989
confirm = ConfirmInstallDialog(title, message, parent=parent,
984
991
selectable=len(package_map) > 1,
985
package_type=_("Handler"))
992
package_type=_("Application"))
986
993
for pkg, (entries, provides, score) in package_map.iteritems():
987
994
if len(provides) == len(mime_types):
988
995
details = _("All")