Skip to content
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

Merged
merged 6 commits into from
Jul 18, 2017
Merged

Conversation

danirabbit
Copy link
Member

  • Rename to resolve ambiguity with future FileDialog subclass
  • Move to Dialogs as in other elementary apps
  • Fix styling, sizing
  • Resolve terminal warnings about no transient parent, etc

@@ -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);
Copy link
Member

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.

@tintou
Copy link
Member

tintou commented Jul 18, 2017

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);
Copy link
Member

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

@tintou tintou merged commit 2bbca2b into rewrite Jul 18, 2017
@tintou tintou deleted the open-attachment-dialog-fixes branch July 18, 2017 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants