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 @@ ...@@ -2,19 +2,30 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <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> <key>IBFramework Version</key>
<string>670</string> <string>489.0</string>
<key>IBLastKnownRelativeProjectPath</key> <key>IBLastKnownRelativeProjectPath</key>
<string>../../vlc.xcodeproj</string> <string>../../vlc.xcodeproj</string>
<key>IBOldestOS</key> <key>IBOldestOS</key>
<integer>4</integer> <integer>4</integer>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>3568</integer>
<integer>2201</integer>
<integer>29</integer>
<integer>21</integer> <integer>21</integer>
<integer>915</integer> <integer>915</integer>
<integer>3568</integer>
<integer>3706</integer>
<integer>29</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>9E17</string> <string>9E17</string>
......
...@@ -161,6 +161,14 @@ struct intf_sys_t ...@@ -161,6 +161,14 @@ struct intf_sys_t
NSMutableArray * o_msg_arr; /* messages array */ NSMutableArray * o_msg_arr; /* messages array */
NSLock * o_msg_lock; /* messages lock */ NSLock * o_msg_lock; /* messages lock */
IBOutlet NSButton * o_msgs_btn_crashlog; /* messages open crashlog */ 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 */ /* main menu */
...@@ -385,6 +393,8 @@ struct intf_sys_t ...@@ -385,6 +393,8 @@ struct intf_sys_t
- (IBAction)showMessagesPanel:(id)sender; - (IBAction)showMessagesPanel:(id)sender;
- (IBAction)showInformationPanel:(id)sender; - (IBAction)showInformationPanel:(id)sender;
- (IBAction)crashReporterAction:(id)sender;
- (IBAction)togglePlaylist:(id)sender; - (IBAction)togglePlaylist:(id)sender;
- (void)updateTogglePlaylistState; - (void)updateTogglePlaylistState;
......
...@@ -2112,8 +2112,9 @@ end: ...@@ -2112,8 +2112,9 @@ end:
[emails primaryIdentifier]]]; [emails primaryIdentifier]]];
NSString *postBody; NSString *postBody;
postBody = [NSString stringWithFormat:@"CrashLog=%@&Comment=Nothing&Email=%@\r\n", postBody = [NSString stringWithFormat:@"CrashLog=%@&Comment=%@&Email=%@\r\n",
[crashLog stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], [crashLog stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
[userComment stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
[email stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; [email stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[req setHTTPBody:[postBody dataUsingEncoding:NSUTF8StringEncoding]]; [req setHTTPBody:[postBody dataUsingEncoding:NSUTF8StringEncoding]];
...@@ -2124,7 +2125,7 @@ end: ...@@ -2124,7 +2125,7 @@ end:
- (void)connectionDidFinishLoading:(NSURLConnection *)connection - (void)connectionDidFinishLoading:(NSURLConnection *)connection
{ {
NSRunInformationalAlertPanel(_NS("Crash Log successfully sent"), NSRunInformationalAlertPanel(_NS("Crash report successfully sent"),
_NS("Thanks for your report!"), _NS("Thanks for your report!"),
_NS("OK"), nil, nil, nil); _NS("OK"), nil, nil, nil);
[connection release]; [connection release];
...@@ -2195,26 +2196,22 @@ end: ...@@ -2195,26 +2196,22 @@ end:
- (void)lookForCrashLog - (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 // 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"]; BOOL areCrashLogsTooOld = ![[NSUserDefaults standardUserDefaults] integerForKey:@"LatestCrashReportYear"];
NSString * latestLog = [self latestCrashLogPathPreviouslySeen:NO]; NSString * latestLog = [self latestCrashLogPathPreviouslySeen:NO];
if( latestLog && !areCrashLogsTooOld ) if( latestLog && !areCrashLogsTooOld )
[self performSelectorOnMainThread:@selector(notifyCrashLogToUser:) withObject:latestLog waitUntilDone:NO]; [NSApp runModalForWindow: o_crashrep_win];
[o_pool release];
[pool release];
} }
- (void)notifyCrashLogToUser:(NSString *)crashLogPath - (IBAction)crashReporterAction:(id)sender
{ {
int ret = NSRunInformationalAlertPanel(_NS("VLC crashed previously"), if( sender == o_crashrep_send_btn )
_NS("VLC crashed previously. Do you want to send an email with details on the crash to VLC's development team?"), [self sendCrashLog:[NSString stringWithContentsOfFile: [self latestCrashLogPath]] withUserComment: [o_crashrep_fld string]];
_NS("Send"), _NS("Don't Send"), nil, nil);
if( ret == NSAlertDefaultReturn ) [NSApp stopModal];
{ [o_crashrep_win orderOut: sender];
[self sendCrashLog:[NSString stringWithContentsOfFile:crashLogPath] withUserComment:_NS("<Explain here what you were doing when VLC crashed, with possibly a link to the failing video>")];
}
} }
- (IBAction)openCrashLog:(id)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