Commit 4cec2c76 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: add and deploy QuincyKit for crashlog reporting

This is for evaluation only. We might want to revert to our previous system for the release.
parent f66dacb3
This diff is collapsed.
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
7D3F6525188051F2005776C4 /* BWQuincyMain.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D3F6523188051F2005776C4 /* BWQuincyMain.xib */; };
7D8BB0B71830311300FAE9B7 /* DebugMessageVisualizer.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D8BB0B51830311300FAE9B7 /* DebugMessageVisualizer.xib */; }; 7D8BB0B71830311300FAE9B7 /* DebugMessageVisualizer.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D8BB0B51830311300FAE9B7 /* DebugMessageVisualizer.xib */; };
7D8BB0BA1830367200FAE9B7 /* PlaylistMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D8BB0B81830367200FAE9B7 /* PlaylistMenu.xib */; }; 7D8BB0BA1830367200FAE9B7 /* PlaylistMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D8BB0B81830367200FAE9B7 /* PlaylistMenu.xib */; };
7D8BB0C01830393300FAE9B7 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D8BB0BE1830393300FAE9B7 /* MainWindow.xib */; }; 7D8BB0C01830393300FAE9B7 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D8BB0BE1830393300FAE9B7 /* MainWindow.xib */; };
...@@ -469,6 +470,11 @@ ...@@ -469,6 +470,11 @@
5CCED71314C0D4A90057F8D1 /* ExtensionsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ExtensionsManager.m; path = ../../../modules/gui/macosx/ExtensionsManager.m; sourceTree = SOURCE_ROOT; }; 5CCED71314C0D4A90057F8D1 /* ExtensionsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ExtensionsManager.m; path = ../../../modules/gui/macosx/ExtensionsManager.m; sourceTree = SOURCE_ROOT; };
5CCED71414C0D4A90057F8D1 /* VLCUIWidgets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCUIWidgets.h; path = ../../../modules/gui/macosx/VLCUIWidgets.h; sourceTree = SOURCE_ROOT; }; 5CCED71414C0D4A90057F8D1 /* VLCUIWidgets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCUIWidgets.h; path = ../../../modules/gui/macosx/VLCUIWidgets.h; sourceTree = SOURCE_ROOT; };
5CCED71514C0D4A90057F8D1 /* VLCUIWidgets.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCUIWidgets.m; path = ../../../modules/gui/macosx/VLCUIWidgets.m; sourceTree = SOURCE_ROOT; }; 5CCED71514C0D4A90057F8D1 /* VLCUIWidgets.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCUIWidgets.m; path = ../../../modules/gui/macosx/VLCUIWidgets.m; sourceTree = SOURCE_ROOT; };
7D3F6524188051F2005776C4 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Resources/English.lproj/BWQuincyMain.xib; sourceTree = "<group>"; };
7D3F652618805297005776C4 /* BWQuincyManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = BWQuincyManager.h; path = ../../../modules/gui/macosx/BWQuincyManager.h; sourceTree = "<group>"; };
7D3F652718805297005776C4 /* BWQuincyManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = BWQuincyManager.m; path = ../../../modules/gui/macosx/BWQuincyManager.m; sourceTree = "<group>"; };
7D3F652818805297005776C4 /* BWQuincyUI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = BWQuincyUI.h; path = ../../../modules/gui/macosx/BWQuincyUI.h; sourceTree = "<group>"; };
7D3F652918805297005776C4 /* BWQuincyUI.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = BWQuincyUI.m; path = ../../../modules/gui/macosx/BWQuincyUI.m; sourceTree = "<group>"; };
7D7DC2CA182E86D9008C9E3E /* darwinvlc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = darwinvlc.c; path = ../../../bin/darwinvlc.c; sourceTree = "<group>"; }; 7D7DC2CA182E86D9008C9E3E /* darwinvlc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = darwinvlc.c; path = ../../../bin/darwinvlc.c; sourceTree = "<group>"; };
7D8BB0B318302AC000FAE9B7 /* DebugMessageVisualizer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DebugMessageVisualizer.h; path = ../../../modules/gui/macosx/DebugMessageVisualizer.h; sourceTree = "<group>"; }; 7D8BB0B318302AC000FAE9B7 /* DebugMessageVisualizer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DebugMessageVisualizer.h; path = ../../../modules/gui/macosx/DebugMessageVisualizer.h; sourceTree = "<group>"; };
7D8BB0B418302AC000FAE9B7 /* DebugMessageVisualizer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = DebugMessageVisualizer.m; path = ../../../modules/gui/macosx/DebugMessageVisualizer.m; sourceTree = "<group>"; }; 7D8BB0B418302AC000FAE9B7 /* DebugMessageVisualizer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = DebugMessageVisualizer.m; path = ../../../modules/gui/macosx/DebugMessageVisualizer.m; sourceTree = "<group>"; };
...@@ -1172,6 +1178,17 @@ ...@@ -1172,6 +1178,17 @@
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
7D3F652A1880529C005776C4 /* QuincyKit */ = {
isa = PBXGroup;
children = (
7D3F652618805297005776C4 /* BWQuincyManager.h */,
7D3F652718805297005776C4 /* BWQuincyManager.m */,
7D3F652818805297005776C4 /* BWQuincyUI.h */,
7D3F652918805297005776C4 /* BWQuincyUI.m */,
);
name = QuincyKit;
sourceTree = "<group>";
};
8E445F86047289E50059A3A7 /* fileicons */ = { 8E445F86047289E50059A3A7 /* fileicons */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -1511,6 +1528,7 @@ ...@@ -1511,6 +1528,7 @@
CC0CD0E513DE0FC600B0D90D /* Imported Code */ = { CC0CD0E513DE0FC600B0D90D /* Imported Code */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
7D3F652A1880529C005776C4 /* QuincyKit */,
CC6D8D9C0A878DED006F2BBE /* AppleRemote.h */, CC6D8D9C0A878DED006F2BBE /* AppleRemote.h */,
CC6D8D9D0A878DED006F2BBE /* AppleRemote.m */, CC6D8D9D0A878DED006F2BBE /* AppleRemote.m */,
CC0CD0E413DE0EB500B0D90D /* PXSourceList */, CC0CD0E413DE0EB500B0D90D /* PXSourceList */,
...@@ -1792,6 +1810,7 @@ ...@@ -1792,6 +1810,7 @@
7D8BB0B81830367200FAE9B7 /* PlaylistMenu.xib */, 7D8BB0B81830367200FAE9B7 /* PlaylistMenu.xib */,
7D8BB0BE1830393300FAE9B7 /* MainWindow.xib */, 7D8BB0BE1830393300FAE9B7 /* MainWindow.xib */,
7DE88F281831396A00CD9DA2 /* PlaylistAccessoryView.xib */, 7DE88F281831396A00CD9DA2 /* PlaylistAccessoryView.xib */,
7D3F6523188051F2005776C4 /* BWQuincyMain.xib */,
); );
name = xibs; name = xibs;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1854,6 +1873,7 @@ ...@@ -1854,6 +1873,7 @@
CC402EB90E00ABBB006A4BA4 /* vlc.scriptSuite in Resources */, CC402EB90E00ABBB006A4BA4 /* vlc.scriptSuite in Resources */,
CC402EBA0E00ABBB006A4BA4 /* vlc.scriptTerminology in Resources */, CC402EBA0E00ABBB006A4BA4 /* vlc.scriptTerminology in Resources */,
CC402EBB0E00ABBB006A4BA4 /* README.MacOSX.rtf in Resources */, CC402EBB0E00ABBB006A4BA4 /* README.MacOSX.rtf in Resources */,
7D3F6525188051F2005776C4 /* BWQuincyMain.xib in Resources */,
CC402F3C0E00ABBB006A4BA4 /* noart.png in Resources */, CC402F3C0E00ABBB006A4BA4 /* noart.png in Resources */,
CC04323D13B246DF00D7D52E /* effects-double-buttons_dark.png in Resources */, CC04323D13B246DF00D7D52E /* effects-double-buttons_dark.png in Resources */,
CC04323E13B246DF00D7D52E /* effects-double-buttons-blue_dark.png in Resources */, CC04323E13B246DF00D7D52E /* effects-double-buttons-blue_dark.png in Resources */,
...@@ -2277,6 +2297,14 @@ ...@@ -2277,6 +2297,14 @@
/* End PBXResourcesBuildPhase section */ /* End PBXResourcesBuildPhase section */
/* Begin PBXVariantGroup section */ /* Begin PBXVariantGroup section */
7D3F6523188051F2005776C4 /* BWQuincyMain.xib */ = {
isa = PBXVariantGroup;
children = (
7D3F6524188051F2005776C4 /* English */,
);
name = BWQuincyMain.xib;
sourceTree = "<group>";
};
7D8BB0B51830311300FAE9B7 /* DebugMessageVisualizer.xib */ = { 7D8BB0B51830311300FAE9B7 /* DebugMessageVisualizer.xib */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (
......
/*
* Author: Andreas Linde <mail@andreaslinde.de>
* Kent Sutherland
*
* Copyright (c) 2011 Andreas Linde & Kent Sutherland.
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#import <Cocoa/Cocoa.h>
typedef enum CrashAlertType {
CrashAlertTypeSend = 0,
CrashAlertTypeFeedback = 1,
} CrashAlertType;
typedef enum CrashReportStatus {
// This app version is set to discontinued, no new crash reports accepted by the server
CrashReportStatusFailureVersionDiscontinued = -30,
// XML: Sender ersion string contains not allowed characters, only alphanumberical including space and . are allowed
CrashReportStatusFailureXMLSenderVersionNotAllowed = -21,
// XML: Version string contains not allowed characters, only alphanumberical including space and . are allowed
CrashReportStatusFailureXMLVersionNotAllowed = -20,
// SQL for adding a symoblicate todo entry in the database failed
CrashReportStatusFailureSQLAddSymbolicateTodo = -18,
// SQL for adding crash log in the database failed
CrashReportStatusFailureSQLAddCrashlog = -17,
// SQL for adding a new version in the database failed
CrashReportStatusFailureSQLAddVersion = -16,
// SQL for checking if the version is already added in the database failed
CrashReportStatusFailureSQLCheckVersionExists = -15,
// SQL for creating a new pattern for this bug and set amount of occurrances to 1 in the database failed
CrashReportStatusFailureSQLAddPattern = -14,
// SQL for checking the status of the bugfix version in the database failed
CrashReportStatusFailureSQLCheckBugfixStatus = -13,
// SQL for updating the occurances of this pattern in the database failed
CrashReportStatusFailureSQLUpdatePatternOccurances = -12,
// SQL for getting all the known bug patterns for the current app version in the database failed
CrashReportStatusFailureSQLFindKnownPatterns = -11,
// SQL for finding the bundle identifier in the database failed
CrashReportStatusFailureSQLSearchAppName = -10,
// the post request didn't contain valid data
CrashReportStatusFailureInvalidPostData = -3,
// incoming data may not be added, because e.g. bundle identifier wasn't found
CrashReportStatusFailureInvalidIncomingData = -2,
// database cannot be accessed, check hostname, username, password and database name settings in config.php
CrashReportStatusFailureDatabaseNotAvailable = -1,
CrashReportStatusUnknown = 0,
CrashReportStatusAssigned = 1,
CrashReportStatusSubmitted = 2,
CrashReportStatusAvailable = 3,
} CrashReportStatus;
@class BWQuincyUI;
@protocol BWQuincyManagerDelegate <NSObject>
@required
// Invoked once the modal sheets are gone
- (void) showMainApplicationWindow;
@optional
// Return the description the crashreport should contain, empty by default. The string will automatically be wrapped into <[DATA[ ]]>, so make sure you don't do that in your string.
-(NSString *) crashReportDescription;
// Return the userid the crashreport should contain, empty by default
-(NSString *) crashReportUserID;
// Return the contact value (e.g. email) the crashreport should contain, empty by default
-(NSString *) crashReportContact;
@end
@interface BWQuincyManager : NSObject
#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
<NSXMLParserDelegate>
#endif
{
CrashReportStatus _serverResult;
NSInteger _statusCode;
NSMutableString *_contentOfProperty;
id<BWQuincyManagerDelegate> _delegate;
NSString *_submissionURL;
NSString *_companyName;
NSString *_appIdentifier;
BOOL _autoSubmitCrashReport;
NSString *_crashFile;
BWQuincyUI *_quincyUI;
}
- (NSString*) modelVersion;
+ (BWQuincyManager *)sharedQuincyManager;
// submission URL defines where to send the crash reports to (required)
@property (nonatomic, retain) NSString *submissionURL;
// defines the company name to be shown in the crash reporting dialog
@property (nonatomic, retain) NSString *companyName;
// delegate is required
@property (nonatomic, assign) id <BWQuincyManagerDelegate> delegate;
// if YES, the crash report will be submitted without asking the user
// if NO, the user will be asked if the crash report can be submitted (default)
@property (nonatomic, assign, getter=isAutoSubmitCrashReport) BOOL autoSubmitCrashReport;
///////////////////////////////////////////////////////////////////////////////////////////////////
// settings
// If you want to use HockeyApp instead of your own server, this is required
@property (nonatomic, retain) NSString *appIdentifier;
- (void) cancelReport;
- (void) sendReportCrash:(NSString*)crashContent
description:(NSString*)description;
- (NSString *) applicationName;
- (NSString *) applicationVersionString;
- (NSString *) applicationVersion;
@end
This diff is collapsed.
/*
* Author: Andreas Linde <mail@andreaslinde.de>
* Kent Sutherland
*
* Copyright (c) 2011 Andreas Linde & Kent Sutherland.
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#import <Cocoa/Cocoa.h>
@class BWQuincyManager;
@interface BWQuincyUI : NSWindowController {
IBOutlet NSTextField *descriptionTextField;
IBOutlet NSTextView *crashLogTextView;
IBOutlet NSTextField *noteText;
IBOutlet NSButton *showButton;
IBOutlet NSButton *hideButton;
IBOutlet NSButton *cancelButton;
IBOutlet NSButton *submitButton;
BWQuincyManager *_quincyManager;
NSString *_xml;
NSString *_crashFile;
NSString *_companyName;
NSString *_applicationName;
NSMutableString *_consoleContent;
NSString *_crashLogContent;
BOOL showComments;
BOOL showDetails;
}
- (id)initWithManager:(BWQuincyManager *)quincyManager crashFile:(NSString *)crashFile companyName:(NSString *)companyName applicationName:(NSString *)applicationName;
- (void) askCrashReportDetails;
- (IBAction) cancelReport:(id)sender;
- (IBAction) submitReport:(id)sender;
- (IBAction) showDetails:(id)sender;
- (IBAction) hideDetails:(id)sender;
- (IBAction) showComments:(id)sender;
- (BOOL)showComments;
- (void)setShowComments:(BOOL)value;
- (BOOL)showDetails;
- (void)setShowDetails:(BOOL)value;
@end
\ No newline at end of file
/*
* Author: Andreas Linde <mail@andreaslinde.de>
* Kent Sutherland
*
* Copyright (c) 2011 Andreas Linde & Kent Sutherland.
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#import "BWQuincyUI.h"
#import "BWQuincyManager.h"
#import <sys/sysctl.h>
#define CRASHREPORTSENDER_MAX_CONSOLE_SIZE 50000
@interface BWQuincyUI(private)
- (void) askCrashReportDetails;
- (void) endCrashReporter;
@end
const CGFloat kCommentsHeight = 105;
const CGFloat kDetailsHeight = 285;
@implementation BWQuincyUI
- (id)initWithManager:(BWQuincyManager *)quincyManager crashFile:(NSString *)crashFile companyName:(NSString *)companyName applicationName:(NSString *)applicationName {
self = [super initWithWindowNibName: @"BWQuincyMain"];
if ( self != nil) {
_xml = nil;
_quincyManager = quincyManager;
_crashFile = crashFile;
_companyName = companyName;
_applicationName = applicationName;
[self setShowComments: YES];
[self setShowDetails: NO];
NSRect windowFrame = [[self window] frame];
windowFrame.size = NSMakeSize(windowFrame.size.width, windowFrame.size.height - kDetailsHeight);
windowFrame.origin.y -= kDetailsHeight;
[[self window] setFrame: windowFrame
display: YES
animate: NO];
}
return self;
}
- (void)awakeFromNib
{
crashLogTextView.editable = NO;
crashLogTextView.selectable = NO;
crashLogTextView.automaticSpellingCorrectionEnabled = NO;
}
- (void) endCrashReporter {
[self close];
}
- (IBAction) showComments: (id) sender {
NSRect windowFrame = [[self window] frame];
if ([sender intValue]) {
[self setShowComments: NO];
windowFrame.size = NSMakeSize(windowFrame.size.width, windowFrame.size.height + kCommentsHeight);
windowFrame.origin.y -= kCommentsHeight;
[[self window] setFrame: windowFrame
display: YES
animate: YES];
[self setShowComments: YES];
} else {
[self setShowComments: NO];
windowFrame.size = NSMakeSize(windowFrame.size.width, windowFrame.size.height - kCommentsHeight);
windowFrame.origin.y += kCommentsHeight;
[[self window] setFrame: windowFrame
display: YES
animate: YES];
}
}
- (IBAction) showDetails:(id)sender {
NSRect windowFrame = [[self window] frame];
windowFrame.size = NSMakeSize(windowFrame.size.width, windowFrame.size.height + kDetailsHeight);
windowFrame.origin.y -= kDetailsHeight;
[[self window] setFrame: windowFrame
display: YES
animate: YES];
[self setShowDetails:YES];
}
- (IBAction) hideDetails:(id)sender {
NSRect windowFrame = [[self window] frame];
[self setShowDetails:NO];
windowFrame.size = NSMakeSize(windowFrame.size.width, windowFrame.size.height - kDetailsHeight);
windowFrame.origin.y += kDetailsHeight;
[[self window] setFrame: windowFrame
display: YES
animate: YES];
}
- (IBAction) cancelReport:(id)sender {
[self endCrashReporter];
[NSApp stopModal];
[_quincyManager cancelReport];
}
- (void) _sendReportAfterDelay {
NSString *notes = [NSString stringWithFormat:@"Comments:\n%@\n\nConsole:\n%@", [descriptionTextField stringValue], _consoleContent];
[_quincyManager sendReportCrash:_crashLogContent description:notes];
[_crashLogContent release];
_crashLogContent = nil;
}
- (IBAction) submitReport:(id)sender {
[submitButton setEnabled:NO];
[[self window] makeFirstResponder: nil];
[self performSelector:@selector(_sendReportAfterDelay) withObject:nil afterDelay:0.01];
[self endCrashReporter];
[NSApp stopModal];
}
- (void) askCrashReportDetails {
NSError *error;
[[self window] setTitle:[NSString stringWithFormat:NSLocalizedString(@"Problem Report for %@", @"Window title"), _applicationName]];
[[descriptionTextField cell] setPlaceholderString:NSLocalizedString(@"Please describe any steps needed to trigger the problem", @"User description placeholder")];
[noteText setStringValue:NSLocalizedString(@"No personal information will be sent with this report.", @"Note text")];
// get the crash log
NSString *crashLogs = [NSString stringWithContentsOfFile:_crashFile encoding:NSUTF8StringEncoding error:&error];
NSString *lastCrash = [[crashLogs componentsSeparatedByString: @"**********\n\n"] lastObject];
_crashLogContent = [lastCrash retain];
// get the console log
NSEnumerator *theEnum = [[[NSString stringWithContentsOfFile:@"/private/var/log/system.log" encoding:NSUTF8StringEncoding error:&error] componentsSeparatedByString: @"\n"] objectEnumerator];
NSString* currentObject;
NSMutableArray* applicationStrings = [NSMutableArray array];
NSString* searchString = [_applicationName stringByAppendingString:@"["];
while ( (currentObject = [theEnum nextObject]) ) {
if ([currentObject rangeOfString:searchString].location != NSNotFound)
[applicationStrings addObject: currentObject];
}
_consoleContent = [[NSMutableString alloc] initWithString:@""];
NSInteger i;
for(i = ((NSInteger)[applicationStrings count])-1; (i>=0 && i>((NSInteger)[applicationStrings count])-100); i--) {
[_consoleContent appendString:[applicationStrings objectAtIndex:i]];
[_consoleContent appendString:@"\n"];
}
// Now limit the content to CRASHREPORTSENDER_MAX_CONSOLE_SIZE (default: 50kByte)
if ([_consoleContent length] > CRASHREPORTSENDER_MAX_CONSOLE_SIZE) {
_consoleContent = (NSMutableString *)[_consoleContent substringWithRange:NSMakeRange([_consoleContent length]-CRASHREPORTSENDER_MAX_CONSOLE_SIZE-1, CRASHREPORTSENDER_MAX_CONSOLE_SIZE)];
}
[crashLogTextView setString:[NSString stringWithFormat:@"%@\n\n%@", _crashLogContent, _consoleContent]];
NSBeep();
[NSApp runModalForWindow:[self window]];
}
- (void)dealloc {
[_consoleContent release]; _consoleContent = nil;
_companyName = nil;
_quincyManager = nil;
[super dealloc];
}
- (BOOL)showComments {
return showComments;
}
- (void)setShowComments:(BOOL)value {
showComments = value;
}
- (BOOL)showDetails {
return showDetails;
}
- (void)setShowDetails:(BOOL)value {
showDetails = value;
}
#pragma mark NSTextField Delegate
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector {
BOOL commandHandled = NO;
if (commandSelector == @selector(insertNewline:)) {
[textView insertNewlineIgnoringFieldEditor:self];
commandHandled = YES;
}
return commandHandled;
}
@end
...@@ -85,5 +85,9 @@ SOURCES_macosx = \ ...@@ -85,5 +85,9 @@ SOURCES_macosx = \
VLCVoutWindowController.h \ VLCVoutWindowController.h \
DebugMessageVisualizer.m \ DebugMessageVisualizer.m \
DebugMessageVisualizer.h \ DebugMessageVisualizer.h \
BWQuincyManager.h \
BWQuincyManager.m \
BWQuincyUI.h \
BWQuincyUI.m \
iTunes.h \ iTunes.h \
$(NULL) $(NULL)
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
#import "TrackSynchronization.h" #import "TrackSynchronization.h"
#import "VLCVoutWindowController.h" #import "VLCVoutWindowController.h"
#import "ExtensionsManager.h" #import "ExtensionsManager.h"
#import "BWQuincyManager.h"
#import "VideoEffects.h" #import "VideoEffects.h"
#import "AudioEffects.h" #import "AudioEffects.h"
...@@ -762,6 +763,17 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -762,6 +763,17 @@ static VLCMain *_o_sharedMainInstance = nil;
if (!p_intf) if (!p_intf)
return; return;
NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] valueForKey: @"CFBundleVersion"];
NSRange endRande = [appVersion rangeOfString:@"-"];
if (endRande.location != NSNotFound)
appVersion = [appVersion substringToIndex:endRande.location];
BWQuincyManager *quincyManager = [BWQuincyManager sharedQuincyManager];
[quincyManager setApplicationVersion:appVersion];
[quincyManager setSubmissionURL:@"http://crash.videolan.org/crash_v200.php"];
[quincyManager setDelegate:self];
[quincyManager setCompanyName:@"VideoLAN"];
[self updateCurrentlyUsedHotkeys]; [self updateCurrentlyUsedHotkeys];
/* init media key support */ /* init media key support */
...@@ -780,8 +792,6 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -780,8 +792,6 @@ static VLCMain *_o_sharedMainInstance = nil;
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(computerWillSleep:) [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(computerWillSleep:)
name:NSWorkspaceWillSleepNotification object:nil]; name:NSWorkspaceWillSleepNotification object:nil];
[self performSelector:@selector(lookForCrashLog) withObject:nil afterDelay:1.5];
/* we will need this, so let's load it here so the interface appears to be more responsive */ /* we will need this, so let's load it here so the interface appears to be more responsive */
nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner: NSApp]; nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner: NSApp];
......
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