-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open attachment dialog fixes #83
Conversation
src/MessageList/AttachmentBar.vala
Outdated
@@ -69,8 +69,8 @@ public class Mail.AttachmentBar : Gtk.FlowBox { | |||
} | |||
|
|||
private void show_attachment (Camel.MimePart attachment_part) { | |||
var dialog = new Mail.AttachmentDialog (attachment_part); | |||
dialog.transient_for = get_toplevel () as Gtk.Window; | |||
var dialog = new Mail.OpenAttachmentDialog ((Gtk.Window) get_toplevel (), attachment_part); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the as
keyword is important, if it's not a Gtk.Window we don't want to use it.
don't forget to change the file name in po/POTFILES |
} | ||
|
||
private async void show_file_anyway () { | ||
try { | ||
GLib.FileIOStream iostream; | ||
var file = File.new_tmp ("XXXXXX-%s".printf (mime_part.get_filename ()), out iostream); | ||
yield mime_part.content.decode_to_output_stream (iostream.output_stream, GLib.Priority.DEFAULT, null); | ||
yield GLib.AppInfo.launch_default_for_uri_async (file.get_uri (), null, null); | ||
yield GLib.AppInfo.launch_default_for_uri_async (file.get_uri (), new AppLaunchContext (), null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The binding here is misleading, it's nullable so If you want to avoid the compilation warning, better do (GLib.AppLaunchContext) null
Reference: https://developer.gnome.org/gio/stable/GAppInfo.html#g-app-info-launch-default-for-uri-async
Dialogs
as in other elementary apps