+#pragma mark Crash Log
+- (void)mailCrashLog:(NSString *)crashLog withUserComment:(NSString *)userComment
+{
+ static char mail[] =
+ "From: vlcuser <vlcuser@videolan.org>\n"
+ "To: VideoLAN Crash Report <apple-bugreport@videolan.org>\n"
+ "Subject: %@\n"
+ "Content-Type: text/plain; charset=ISO-8859-1; format=flowed\n"
+ "Content-Transfer-Encoding: 7bit\n"
+ "\n"
+ "%@\n\n"
+ "User Comment:\n%@\n--------------\n"
+ "\n"
+ "Crash log:\n%@\n--------------\n"
+ "\n"
+ "\n";
+ NSString * mailPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"vlc_crash_mail.eml"];
+ NSString * mailContent = [NSString stringWithFormat:[NSString stringWithUTF8String:mail],
+ _NS("Crash Report (Type Ctrl-shift-D and hit send)"),
+ _NS("(Type Command-shift-D (Menu 'Message'>'Send Again' and hit send)"),
+ userComment, crashLog];
+ BOOL ret = [mailContent writeToFile:mailPath atomically:YES encoding:NSUTF8StringEncoding error:nil];
+ if( !ret )
+ {
+ NSRunAlertPanel(_NS("Error when generating crash report mail."), _NS("Can't prepare crash log mail"), _NS("OK"), nil, nil, nil );
+ return;
+ }
+
+ [[NSWorkspace sharedWorkspace] openFile:mailPath];
+}
+
+
+- (NSString *)latestCrashLogPathPreviouslySeen:(BOOL)previouslySeen