Commit a1771c41 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: added a dialogue to enter comments about the latest crash

parent 2058e59d
......@@ -2,19 +2,30 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>69 68 356 240 0 0 1280 778 </string>
<key>IBEditorPositions</key>
<dict>
<key>29</key>
<string>69 313 438 44 0 0 1280 778 </string>
<key>3568</key>
<string>476 534 328 85 0 0 1280 778 </string>
<key>915</key>
<string>69 313 187 285 0 0 1280 778 </string>
</dict>
<key>IBFramework Version</key>
<string>670</string>
<string>489.0</string>
<key>IBLastKnownRelativeProjectPath</key>
<string>../../vlc.xcodeproj</string>
<key>IBOldestOS</key>
<integer>4</integer>
<key>IBOpenObjects</key>
<array>
<integer>3568</integer>
<integer>2201</integer>
<integer>29</integer>
<integer>21</integer>
<integer>915</integer>
<integer>3568</integer>
<integer>3706</integer>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>9E17</string>
......
......@@ -162,6 +162,14 @@ struct intf_sys_t
NSLock * o_msg_lock; /* messages lock */
IBOutlet NSButton * o_msgs_btn_crashlog; /* messages open crashlog */
/* CrashReporter panel */
IBOutlet NSButton * o_crashrep_dontSend_btn;
IBOutlet NSButton * o_crashrep_send_btn;
IBOutlet NSTextView * o_crashrep_fld;
IBOutlet NSTextField * o_crashrep_title_txt;
IBOutlet NSTextField * o_crashrep_desc_txt;
IBOutlet NSWindow * o_crashrep_win;
/* main menu */
IBOutlet NSMenuItem * o_mi_about;
......@@ -385,6 +393,8 @@ struct intf_sys_t
- (IBAction)showMessagesPanel:(id)sender;
- (IBAction)showInformationPanel:(id)sender;
- (IBAction)crashReporterAction:(id)sender;
- (IBAction)togglePlaylist:(id)sender;
- (void)updateTogglePlaylistState;
......
......@@ -2112,8 +2112,9 @@ end:
[emails primaryIdentifier]]];
NSString *postBody;
postBody = [NSString stringWithFormat:@"CrashLog=%@&Comment=Nothing&Email=%@\r\n",
postBody = [NSString stringWithFormat:@"CrashLog=%@&Comment=%@&Email=%@\r\n",
[crashLog stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
[userComment stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
[email stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[req setHTTPBody:[postBody dataUsingEncoding:NSUTF8StringEncoding]];
......@@ -2124,7 +2125,7 @@ end:
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSRunInformationalAlertPanel(_NS("Crash Log successfully sent"),
NSRunInformationalAlertPanel(_NS("Crash report successfully sent"),
_NS("Thanks for your report!"),
_NS("OK"), nil, nil, nil);
[connection release];
......@@ -2195,26 +2196,22 @@ end:
- (void)lookForCrashLog
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
// This pref key doesn't exists? this VLC is an upgrade, and this crash log come from previous version
BOOL areCrashLogsTooOld = ![[NSUserDefaults standardUserDefaults] integerForKey:@"LatestCrashReportYear"];
NSString * latestLog = [self latestCrashLogPathPreviouslySeen:NO];
if( latestLog && !areCrashLogsTooOld )
[self performSelectorOnMainThread:@selector(notifyCrashLogToUser:) withObject:latestLog waitUntilDone:NO];
[pool release];
[NSApp runModalForWindow: o_crashrep_win];
[o_pool release];
}
- (void)notifyCrashLogToUser:(NSString *)crashLogPath
- (IBAction)crashReporterAction:(id)sender
{
int ret = NSRunInformationalAlertPanel(_NS("VLC crashed previously"),
_NS("VLC crashed previously. Do you want to send an email with details on the crash to VLC's development team?"),
_NS("Send"), _NS("Don't Send"), nil, nil);
if( ret == NSAlertDefaultReturn )
{
[self sendCrashLog:[NSString stringWithContentsOfFile:crashLogPath] withUserComment:_NS("<Explain here what you were doing when VLC crashed, with possibly a link to the failing video>")];
}
if( sender == o_crashrep_send_btn )
[self sendCrashLog:[NSString stringWithContentsOfFile: [self latestCrashLogPath]] withUserComment: [o_crashrep_fld string]];
[NSApp stopModal];
[o_crashrep_win orderOut: sender];
}
- (IBAction)openCrashLog:(id)sender
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment