Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/AppChooser/Dialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,26 @@ public class AppChooser.Dialog : Gtk.Window {
AppInfo? info = app_id == "" ? null : new DesktopAppInfo (app_id + ".desktop");

var content_description = ContentType.get_description ("text/plain");
var content_icon = ContentType.get_icon ("text/plain");
Icon secondary_icon = new ThemedIcon ("document-open");
if (content_type != "") {
content_description = ContentType.get_description (content_type);
content_icon = ContentType.get_icon (content_type);
if (content_description.contains ("x-scheme-handler")) {
///TRANSLATORS: An http link
content_description = _("link");
}

var content_icon = ContentType.get_icon (content_type);
if (Gtk.IconTheme.get_for_display (Gdk.Display.get_default ()).has_gicon (content_icon)) {
secondary_icon = content_icon;
}
}

var primary_text = _("An application wants to open a %s").printf (content_description);
if (info != null) {
primary_text = _("“%s” wants to open a %s").printf (info.get_display_name (), content_description);
}

var secondary_text = _("Open file with…");
var secondary_text = _("Open with…");
if (filename != "") {
secondary_text = _("Open “%s” with…").printf (filename);
}
Expand All @@ -82,7 +90,7 @@ public class AppChooser.Dialog : Gtk.Window {
xalign = 0
};

var mime_icon = new Gtk.Image.from_gicon (content_icon) {
var mime_icon = new Gtk.Image.from_gicon (secondary_icon) {
pixel_size = 48
};

Expand Down