Index: /code/branches/mac_osx2/cmake/tools/TargetUtilities.cmake
===================================================================
--- /code/branches/mac_osx2/cmake/tools/TargetUtilities.cmake (revision 8355)
+++ /code/branches/mac_osx2/cmake/tools/TargetUtilities.cmake (revision 8356)
@@ -235,5 +235,5 @@
# Don't compile header files
FOREACH(_file ${_${_target_name}_files})
- IF(NOT _file MATCHES "\\.(c|cc|cpp|cxx|mm)$")
+ IF(NOT _file MATCHES "\\.(c|cc|cpp|cxx|m|mm)$")
SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES HEADER_FILE_ONLY TRUE)
ENDIF()
Index: /code/branches/mac_osx2/data/mac/Orxonox-Info.plist
===================================================================
--- /code/branches/mac_osx2/data/mac/Orxonox-Info.plist (revision 8355)
+++ /code/branches/mac_osx2/data/mac/Orxonox-Info.plist (revision 8356)
@@ -7,4 +7,6 @@
CFBundleExecutable
${EXECUTABLE_NAME}
+ CFBundleGetInfoString
+ Orxonox: The hottest space shooter ever to exist!
CFBundleIconFile
Icon.icns
@@ -15,20 +17,22 @@
CFBundleName
${PROJECT_NAME}
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ ${ORXONOX_VERSION}, ${ORXONOX_VERSION_NAME}
CFBundleVersion
${ORXONOX_VERSION}
- CFBundleShortVersionString
- ${ORXONOX_VERSION}, ${ORXONOX_VERSION_NAME}
- CFBundleGetInfoString
- Orxonox: The hottest space shooter ever to exist!
+ LSMinimumSystemVersion
+ 10.5
NSHumanReadableCopyright
GPL version 2 or higher, and CC-BY-SA
- CFBundlePackageType
- APPL
- LSMinimumSystemVersion
- 10.5
NSMainNibFile
MainMenu
NSPrincipalClass
NSApplication
+ CMSubmitURL
+
+ CMMaxReports
+ 100
Index: /code/branches/mac_osx2/src/CMakeLists.txt
===================================================================
--- /code/branches/mac_osx2/src/CMakeLists.txt (revision 8355)
+++ /code/branches/mac_osx2/src/CMakeLists.txt (revision 8356)
@@ -196,8 +196,10 @@
# Apple Mac OS X specific build settings
IF(APPLE)
- # On Apple we need to link to AppKit and Foundation frameworks
+ # On Apple we need to link to AppKit, Foundation frameworks
TARGET_LINK_LIBRARIES(orxonox-main
+ cmcrashreporter_orxonox
"-framework AppKit"
"-framework Foundation"
+ "-framework CoreFoundation"
)
Index: /code/branches/mac_osx2/src/Orxonox.cc
===================================================================
--- /code/branches/mac_osx2/src/Orxonox.cc (revision 8355)
+++ /code/branches/mac_osx2/src/Orxonox.cc (revision 8356)
@@ -75,5 +75,9 @@
strCmdLine = strCmdLine + argv[i] + ' ';
#endif
-
+
+ // Use these statements to make Orxonox go crashycrash
+ //int* crashInt = NULL;
+ //COUT(0) << *crashInt << std::endl;
+
return orxonox::main(strCmdLine);
}
Index: /code/branches/mac_osx2/src/OrxonoxMac.mm
===================================================================
--- /code/branches/mac_osx2/src/OrxonoxMac.mm (revision 8355)
+++ /code/branches/mac_osx2/src/OrxonoxMac.mm (revision 8356)
@@ -28,4 +28,5 @@
#import "OrxonoxMac.h"
+#import
static int argc_s = 0;
@@ -46,4 +47,7 @@
- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
+ // This call initializes the crash reporter, which sends crash reports to the developers
+ [CMCrashReporter check];
+
exit(main_mac(argc_s, argv_s));
}
Index: /code/branches/mac_osx2/src/external/CMakeLists.txt
===================================================================
--- /code/branches/mac_osx2/src/external/CMakeLists.txt (revision 8355)
+++ /code/branches/mac_osx2/src/external/CMakeLists.txt (revision 8356)
@@ -23,4 +23,5 @@
ADD_SUBDIRECTORY(bullet)
ADD_SUBDIRECTORY(cpptcl)
+ADD_SUBDIRECTORY(cmcrashreporter)
ADD_SUBDIRECTORY(enet)
ADD_SUBDIRECTORY(loki)
Index: /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporter.h
===================================================================
--- /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporter.h (revision 8356)
+++ /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporter.h (revision 8356)
@@ -0,0 +1,21 @@
+//
+// CMCrashReporter.h
+// CMCrashReporter-App
+//
+// Created by Jelle De Laender on 20/01/08.
+// Copyright 2008 CodingMammoth. All rights reserved.
+// Copyright 2010 CodingMammoth. Revision. All rights reserved.
+//
+// Current version: 1.1 (September 2010)
+//
+
+#import
+#import "CMCrashReporterGlobal.h"
+#import "CMCrashReporterWindow.h"
+
+@interface CMCrashReporter : NSObject {
+
+}
++ (void)check;
++ (NSArray *)getReports;
+@end
Index: /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporter.m
===================================================================
--- /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporter.m (revision 8356)
+++ /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporter.m (revision 8356)
@@ -0,0 +1,48 @@
+//
+// CMCrashReporter.m
+// CMCrashReporter-App
+//
+// Created by Jelle De Laender on 20/01/08.
+// Copyright 2008 CodingMammoth. All rights reserved.
+// Copyright 2010 CodingMammoth. Revision. All rights reserved.
+//
+
+#import "CMCrashReporter.h"
+
+@implementation CMCrashReporter
+
++(void)check
+{
+ NSUserDefaults *defaults = [[NSUserDefaultsController sharedUserDefaultsController] defaults];
+ if ([CMCrashReporterGlobal checkOnCrashes] && ![defaults boolForKey:@"CMCrashReporterIgnoreCrashes"]) {
+ NSArray *reports = [self getReports];
+ if ([reports count] > 0) {
+ [CMCrashReporterWindow runCrashReporterWithPaths:reports];
+ }
+ }
+}
+
++(NSArray *)getReports
+{
+ NSFileManager *fileManager = [NSFileManager defaultManager];
+
+ if ([CMCrashReporterGlobal isRunningLeopard]) {
+ // (Snow) Leopard format is AppName_Year_Month_Day
+ NSString *file;
+ NSString *path = [@"~/Library/Logs/CrashReporter/" stringByExpandingTildeInPath];
+ NSDirectoryEnumerator *dirEnum = [[NSFileManager defaultManager] enumeratorAtPath:path];
+
+ NSMutableArray *array = [NSMutableArray array];
+ while (file = [dirEnum nextObject])
+ if ([file hasPrefix:[CMCrashReporterGlobal appName]])
+ [array addObject:[[NSString stringWithFormat:@"~/Library/Logs/CrashReporter/%@",file] stringByExpandingTildeInPath]];
+
+ return array;
+ } else {
+ // Tiger Format is AppName.crash.log
+ NSString *path = [[NSString stringWithFormat:@"~/Library/Logs/CrashReporter/%@.crash.log",[CMCrashReporterGlobal appName]] stringByExpandingTildeInPath];
+ if ([fileManager fileExistsAtPath:path]) return [NSArray arrayWithObject:path];
+ else return nil;
+ }
+}
+@end
Index: /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporter.tmproj
===================================================================
--- /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporter.tmproj (revision 8356)
+++ /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporter.tmproj (revision 8356)
@@ -0,0 +1,70 @@
+
+
+
+
+ currentDocument
+ CMCrashReporterWindow.m
+ documents
+
+
+ filename
+ CMCrashReporter.h
+
+
+ filename
+ CMCrashReporter.m
+
+
+ filename
+ CMCrashReporterGlobal.h
+
+
+ filename
+ CMCrashReporterGlobal.m
+
+
+ filename
+ CMCrashReporterWindow.h
+
+
+ filename
+ CMCrashReporterWindow.m
+ lastUsed
+ 2011-02-23T16:27:21Z
+ selected
+
+
+
+ filename
+ read-me.txt
+
+
+ fileHierarchyDrawerWidth
+ 200
+ metaData
+
+ CMCrashReporterWindow.m
+
+ caret
+
+ column
+ 91
+ line
+ 91
+
+ firstVisibleColumn
+ 0
+ firstVisibleLine
+ 71
+
+
+ openDocuments
+
+ CMCrashReporterWindow.m
+
+ showFileHierarchyDrawer
+
+ windowFrame
+ {{204, 82}, {1227, 765}}
+
+
Index: /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporterGlobal.h
===================================================================
--- /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporterGlobal.h (revision 8356)
+++ /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporterGlobal.h (revision 8356)
@@ -0,0 +1,37 @@
+//
+// CMCrashReporterGlobal.h
+// CMCrashReporter-App
+//
+// Created by Jelle De Laender on 20/01/08.
+// Copyright 2008 CodingMammoth. All rights reserved.
+// Copyright 2010 CodingMammoth. Revision. All rights reserved.
+
+//
+
+#import
+
+
+@interface CMCrashReporterGlobal : NSObject
+{
+};
+
++ (NSString *)appName;
++ (NSString *)appUiName;
++ (NSString *)appVersion;
+
++ (BOOL)isRunningLeopard;
++ (BOOL)checkOnCrashes;
+
++ (NSString *)crashReportEmail;
++ (NSString *)crashReportURL;
++ (NSString *)osVersion;
+
++ (int)numberOfMaximumReports;
+
++ (void)setAppName:(NSString *)name;
++ (void)setAppUiName:(NSString *)name;
++ (void)setAppVersion:(NSString *)version;
++ (void)setCrashReportEmail:(NSString *)emailTo;
++ (void)setCrashReportURL:(NSString *)reportServerUrl;
+
+@end
Index: /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporterGlobal.m
===================================================================
--- /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporterGlobal.m (revision 8356)
+++ /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporterGlobal.m (revision 8356)
@@ -0,0 +1,145 @@
+//
+// CMCrashReporterGlobal.m
+// CMCrashReporter-App
+//
+// Created by Jelle De Laender on 20/01/08.
+// Copyright 2008 CodingMammoth. All rights reserved.
+// Copyright 2010 CodingMammoth. Revision. All rights reserved.
+//
+
+#import "CMCrashReporterGlobal.h"
+#import
+
+
+NSString* mAppName = nil;
+NSString* mAppUiName = nil;
+NSString* mAppVersion = nil;
+NSString* mCrashReportEmail = nil;
+NSString* mCrashReportEmailSubject = nil;
+NSString* mCrashReportURL = nil;
+
+
+@implementation CMCrashReporterGlobal
+
+
+- (void)dealloc {
+ if (mAppName != nil)
+ [mAppName release];
+ if (mAppUiName != nil)
+ [mAppUiName release];
+ if (mAppVersion != nil)
+ [mAppVersion release];
+ if (mCrashReportEmail != nil)
+ [mCrashReportEmail release];
+ if (mCrashReportEmailSubject != nil)
+ [mCrashReportEmailSubject release];
+ if (mCrashReportURL != nil)
+ [mCrashReportURL release];
+
+ [super dealloc];
+}
+
+
++ (NSString *)appName
+{
+ if (mAppName != NULL)
+ return mAppName;
+ else
+ return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"];
+}
+
++ (NSString *)appUiName
+{
+ if (mAppUiName != NULL)
+ return mAppUiName;
+ else
+ return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"];
+}
+
++ (NSString *)appVersion
+{
+ if (mAppVersion != NULL)
+ return mAppVersion;
+ else
+ return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
+}
+
++ (int)numberOfMaximumReports {
+ if (! [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CMMaxReports"]) return 0;
+
+ return [[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CMMaxReports"] intValue];
+}
+
++ (BOOL)isRunningLeopard
+{
+ SInt32 MacVersion;
+ Gestalt(gestaltSystemVersion, &MacVersion);
+ return MacVersion >= 4176;
+}
+
++ (BOOL)checkOnCrashes
+{
+ // Integration for later
+ return YES;
+}
+
++ (NSString *)crashReportURL
+{
+ NSString *value;
+ if (mCrashReportURL != NULL)
+ value = mCrashReportURL;
+ else
+ value = [[[NSBundle mainBundle] infoDictionary]
+ objectForKey:@"CMSubmitURL"];
+ if (!value) NSLog(@"Warning: No CMSubmitURL - key available for CMCrashReporter. Please add this key at your info.plist file.");
+ return value;
+}
+
++ (NSString *)crashReportEmail
+{
+ NSString *email;
+ if (mCrashReportURL != NULL)
+ email = mCrashReportEmail;
+ else
+ {
+ ABMultiValue *emails = [[[ABAddressBook sharedAddressBook] me] valueForProperty: kABEmailProperty];
+ email = (NSString *) [emails valueAtIndex: [emails indexForIdentifier: [emails primaryIdentifier]]];
+ }
+
+ return email;
+}
+
++ (NSString *)osVersion
+{
+ return [[NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"]
+ objectForKey:@"ProductVersion"];
+}
+
++ (void)setAppName:(NSString *)name
+{
+ mAppName = name;
+}
+
++ (void)setAppUiName:(NSString *)name
+{
+ mAppUiName = name;
+}
+
++ (void)setAppVersion:(NSString *)version
+{
+ mAppVersion = version;
+}
+
++ (void)setCrashReportEmail:(NSString *)emailTo
+{
+ mCrashReportEmail = emailTo;
+}
+
++ (void)setCrashReportURL:(NSString *)reportServerUrl
+{
+ mCrashReportURL = reportServerUrl;
+}
+
+
+@end
+
Index: /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporterWindow.h
===================================================================
--- /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporterWindow.h (revision 8356)
+++ /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporterWindow.h (revision 8356)
@@ -0,0 +1,45 @@
+//
+// CMCrashReporterWindow.h
+// CMCrashReporter-App
+//
+// Created by Jelle De Laender on 20/01/08.
+// Copyright 2008 CodingMammoth. All rights reserved.
+// Copyright 2010 CodingMammoth. Revision. All rights reserved.
+//
+
+#import
+#import "CMCrashReporterGlobal.h"
+
+
+@interface CMCrashReporterWindow : NSWindowController {
+ NSArray *paths;
+
+ IBOutlet id description;
+ IBOutlet id mailaddress;
+ IBOutlet id commentField;
+ IBOutlet id dontShowThis;
+ IBOutlet id includeRapport;
+ IBOutlet id application;
+ IBOutlet id version;
+}
+
++ (void)runCrashReporterWithPaths:(NSArray *)ar;
+
+- (id)init;
+
+- (NSArray *)paths;
+- (void)setPaths:(NSArray *)ar;
+
+- (void)windowDidLoad;
+- (void)windowWillClose:(NSNotification *)notification;
+
+- (BOOL)submitFile:(NSString *)file;
+- (IBAction)submitData:(id)sender;
+- (IBAction)dontReport:(id)sender;
+
+- (void)close;
+
+- (void)removeCrashLog:(NSString *)path;
+- (NSData*)generateFormData:(NSDictionary*)dict;
+
+@end
Index: /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporterWindow.m
===================================================================
--- /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporterWindow.m (revision 8356)
+++ /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporterWindow.m (revision 8356)
@@ -0,0 +1,195 @@
+//
+// CMCrashReporterWindow.m
+// CMCrashReporter-App
+//
+// Created by Jelle De Laender on 20/01/08.
+// Copyright 2008 CodingMammoth. All rights reserved.
+// Copyright 2010 CodingMammoth. Revision. All rights reserved.
+//
+
+#import "CMCrashReporterWindow.h"
+
+@implementation CMCrashReporterWindow
+
++ (void)runCrashReporterWithPaths:(NSArray *)ar
+{
+ CMCrashReporterWindow *windowController = [[self alloc] init];
+ [windowController setPaths:ar];
+ [[windowController window] makeKeyAndOrderFront:nil];
+}
+
+#pragma mark Default methods
+
+- (id)init
+{
+ self = [super initWithWindowNibName:NSStringFromClass([self class])];
+ if (self) {
+ // something to do?
+ }
+ return self;
+}
+
+- (NSArray *)paths {
+ return paths;
+}
+
+- (void)setPaths:(NSArray *)ar
+{
+ [paths release];
+ [ar retain];
+ paths = ar;
+}
+
+- (void)windowDidLoad
+{
+ [[self window] setTitle:[NSString stringWithFormat:@"%@ - %@ (%@) ",@"CrashReport", [CMCrashReporterGlobal appUiName],[CMCrashReporterGlobal appVersion]]];
+
+ NSString *email = [CMCrashReporterGlobal crashReportEmail];
+ if (email!=NULL)
+ [mailaddress setStringValue:email];
+}
+
+- (void)removeCrashLog:(NSString *)path
+{
+ NSError *error = nil;
+ [[NSFileManager defaultManager] removeItemAtPath:path error:&error];
+}
+
+- (void)updateIgnoreCrashes
+{
+ NSUserDefaults *defaults = [[NSUserDefaultsController sharedUserDefaultsController] defaults];
+ [defaults setBool:[dontShowThis state] forKey:@"CMCrashReporterIgnoreCrashes"];
+}
+
+- (IBAction)submitData:(id)sender
+{
+ sender; //unused
+
+ int i = 0;
+
+ BOOL failures = NO;
+
+ int max = MIN([CMCrashReporterGlobal numberOfMaximumReports],[paths count]);
+
+ if (max == 0) max = [paths count];
+
+ for (i = 0; i < max; i++) {
+ if ([self submitFile:[paths objectAtIndex:i]]) {
+ // report succeed
+ // File will be removed on close
+ } else
+ failures = YES;
+ }
+
+ NSAlert *alert = [[[NSAlert alloc] init] autorelease];
+ [alert addButtonWithTitle:@"OK"];
+ [alert setMessageText:[CMCrashReporterGlobal appName]];
+ [alert setAlertStyle:NSInformationalAlertStyle];
+
+ if (!failures)
+ [alert setInformativeText:[NSString stringWithFormat:@"Thanks for helping us improve %@",[CMCrashReporterGlobal appName]]];
+ else
+ [alert setInformativeText:[NSString stringWithFormat:@"%@ was unable to send the crashlog.",[CMCrashReporterGlobal appName]]];
+
+ [alert runModal];
+ [self close];
+}
+
+- (IBAction)dontReport:(id)sender
+{
+ sender; //unused
+ [self close];
+}
+
+- (void)close {
+ [self updateIgnoreCrashes];
+ [self windowWillClose:nil];
+ [[self window] performClose:nil];
+}
+
+- (void)windowWillClose:(NSNotification *)notification
+{
+ notification; //unused
+
+ /* Window need to close -- We remove all the reports -- */
+ unsigned int i = 0;
+ for (i = 0; i < [paths count]; i++) {
+ if ([[NSFileManager defaultManager] fileExistsAtPath:[paths objectAtIndex:i]])
+ [self removeCrashLog:[paths objectAtIndex:i]];
+ }
+}
+
+#pragma mark send
+
+-(BOOL)submitFile:(NSString *)file
+{
+ NSMutableDictionary* post_dict = [[NSMutableDictionary alloc] init];
+
+ [post_dict setValue:[NSString stringWithString:@"CMCrashReporter"] forKey:@"type"];
+ [post_dict setValue:[CMCrashReporterGlobal appName] forKey:@"application"];
+ [post_dict setValue:[CMCrashReporterGlobal version] forKey:@"appVersion"];
+ [post_dict setValue:[CMCrashReporterGlobal osVersion] forKey:@"osVersion"];
+ [post_dict setValue:[NSString stringWithString:[mailaddress stringValue]] forKey:@"mailaddress"];
+ [post_dict setValue:[NSString stringWithString:[[commentField textStorage] string]] forKey:@"comments"];
+ [post_dict setValue: [[[[NSDateFormatter alloc] initWithDateFormat:@"%H:%M:%S" allowNaturalLanguage:NO] autorelease] stringFromDate:[NSDate date]] forKey:@"time"];
+ [post_dict setValue: [[[[NSDateFormatter alloc] initWithDateFormat:@"%m/%d/%Y" allowNaturalLanguage:NO] autorelease] stringFromDate:[NSDate date]] forKey:@"date"];
+
+ if ([includeRapport state])
+ [post_dict setValue:[NSString stringWithContentsOfFile:file encoding:NSUTF8StringEncoding error:nil] forKey:@"rapport"];
+ else
+ [post_dict setValue:@"not included" forKey:@"rapport"];
+
+ NSData* regData = [self generateFormData:post_dict];
+ [post_dict release];
+
+ NSURL *url = [NSURL URLWithString:[CMCrashReporterGlobal crashReportURL]];
+ NSMutableURLRequest* post = [NSMutableURLRequest requestWithURL:url];
+ [post addValue: @"multipart/form-data; boundary=_insert_some_boundary_here_" forHTTPHeaderField: @"Content-Type"];
+ [post setHTTPMethod: @"POST"];
+ [post setHTTPBody:regData];
+
+ NSURLResponse* response;
+ NSError* error;
+ NSData* result = [NSURLConnection sendSynchronousRequest:post returningResponse:&response error:&error];
+ NSString *res = [[[NSString alloc] initWithData:result encoding:NSASCIIStringEncoding] autorelease];
+ NSString *compare = [res stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
+ return ([compare isEqualToString:@"ok"]);
+
+}
+
+#pragma mark Generate form data
+
+- (NSData*)generateFormData:(NSDictionary*)dict
+{
+ NSString* boundary = [NSString stringWithString:@"_insert_some_boundary_here_"];
+ NSArray* keys = [dict allKeys];
+ NSMutableData* result = [[NSMutableData alloc] initWithCapacity:100];
+
+ unsigned int i;
+ for (i = 0; i < [keys count]; i++)
+ {
+ id value = [dict valueForKey: [keys objectAtIndex: i]];
+ [result appendData:[[NSString stringWithFormat:@"--%@\n", boundary] dataUsingEncoding:NSASCIIStringEncoding]];
+ if ( ([value class] == [NSString class]) || ([@"tmp" isKindOfClass:[value class]]))
+ {
+ [result appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"\n\n", [keys objectAtIndex:i]] dataUsingEncoding:NSASCIIStringEncoding]];
+ [result appendData:[[NSString stringWithFormat:@"%@",value] dataUsingEncoding:NSASCIIStringEncoding]];
+ }
+ else if ([value class] == [NSURL class] && [value isFileURL])
+ {
+ [result appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"; filename=\"%@\"\n", [keys objectAtIndex:i], [[value path] lastPathComponent]] dataUsingEncoding:NSASCIIStringEncoding]];
+ [result appendData:[[NSString stringWithString:@"Content-Type: application/octet-stream\n\n"] dataUsingEncoding:NSASCIIStringEncoding]];
+ [result appendData:[NSData dataWithContentsOfFile:[value path]]];
+ }
+ else
+ {
+ NSLog(@"No string or NSURL!");
+ }
+
+ [result appendData:[[NSString stringWithString:@"\n"] dataUsingEncoding:NSASCIIStringEncoding]];
+ }
+ [result appendData:[[NSString stringWithFormat:@"--%@--\n", boundary] dataUsingEncoding:NSASCIIStringEncoding]];
+
+ return [result autorelease];
+}
+@end
Index: /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporterWindow.nib/designable.nib
===================================================================
--- /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporterWindow.nib/designable.nib (revision 8356)
+++ /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporterWindow.nib/designable.nib (revision 8356)
@@ -0,0 +1,903 @@
+
+
+
+ 1060
+ 10J869
+ 1305
+ 1038.35
+ 461.00
+
+
+ NSScroller
+ NSButton
+ NSScrollView
+ NSTextFieldCell
+ NSImageView
+ NSBox
+ NSImageCell
+ NSButtonCell
+ NSCustomObject
+ NSTextView
+ NSView
+ NSWindowTemplate
+ NSTextField
+
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+
+
+
+
+
+
+
+
+
+
+
+ description
+
+
+
+ 40
+
+
+
+ includeRapport
+
+
+
+ 43
+
+
+
+ dontReport:
+
+
+
+ 60
+
+
+
+ submitData:
+
+
+
+ 61
+
+
+
+ dontShowThis
+
+
+
+ 106
+
+
+
+ commentField
+
+
+
+ 153
+
+
+
+ window
+
+
+
+ 168
+
+
+
+ delegate
+
+
+
+ 182
+
+
+
+ mailaddress
+
+
+
+ 196
+
+
+
+
+
+ 0
+
+
+
+
+
+ -2
+
+
+ File's Owner
+
+
+ -1
+
+
+ First Responder
+
+
+ -3
+
+
+ Application
+
+
+ 1
+
+
+
+
+
+ Window (Window)
+
+
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+
+
+
+
+
+
+
+ 7
+
+
+
+
+
+
+
+ 9
+
+
+
+
+
+
+
+
+
+ 14
+
+
+
+
+ 10
+
+
+
+
+
+
+
+ 15
+
+
+
+
+
+
+
+ 19
+
+
+
+
+
+
+
+ 23
+
+
+
+
+
+
+
+ 25
+
+
+
+
+
+
+
+ 44
+
+
+
+
+
+
+
+ 123
+
+
+
+
+ 126
+
+
+
+
+
+
+
+ 134
+
+
+
+
+
+
+
+ 198
+
+
+
+
+ 199
+
+
+
+
+ 200
+
+
+
+
+ 201
+
+
+
+
+ 202
+
+
+
+
+ 203
+
+
+
+
+ 204
+
+
+
+
+ 205
+
+
+
+
+ 206
+
+
+
+
+ 207
+
+
+
+
+ 208
+
+
+
+
+ 209
+
+
+
+
+
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ {{342, 351}, {453, 394}}
+ com.apple.InterfaceBuilder.CocoaPlugin
+ {{342, 351}, {453, 394}}
+
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ P4AAAL+AAABAAAAAwuoAAA
+
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+
+
+
+
+
+ 209
+
+
+
+
+ CMCrashReporterWindow
+ NSWindowController
+
+ id
+ id
+
+
+
+ dontReport:
+ id
+
+
+ submitData:
+ id
+
+
+
+ id
+ id
+ id
+ id
+ id
+ id
+ id
+
+
+
+ application
+ id
+
+
+ commentField
+ id
+
+
+ description
+ id
+
+
+ dontShowThis
+ id
+
+
+ includeRapport
+ id
+
+
+ mailaddress
+ id
+
+
+ version
+ id
+
+
+
+ IBProjectSource
+ ./Classes/CMCrashReporterWindow.h
+
+
+
+
+ 0
+ IBCocoaFramework
+
+ com.apple.InterfaceBuilder.CocoaPlugin.macosx
+
+
+ YES
+ 3
+
+ NSApplicationIcon
+ {128, 128}
+
+
+
Index: /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporterWindow.xib
===================================================================
--- /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporterWindow.xib (revision 8356)
+++ /code/branches/mac_osx2/src/external/cmcrashreporter/CMCrashReporterWindow.xib (revision 8356)
@@ -0,0 +1,903 @@
+
+
+
+ 1060
+ 10J869
+ 1305
+ 1038.35
+ 461.00
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+ 1305
+
+
+ NSScroller
+ NSButton
+ NSScrollView
+ NSTextFieldCell
+ NSImageView
+ NSBox
+ NSImageCell
+ NSButtonCell
+ NSCustomObject
+ NSTextView
+ NSView
+ NSWindowTemplate
+ NSTextField
+
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+
+ PluginDependencyRecalculationVersion
+
+
+
+
+ CMCrashReporterWindow
+
+
+ FirstResponder
+
+
+ NSApplication
+
+
+ 7
+ 2
+ {{400, 212}, {453, 394}}
+ 536870912
+ Report a Crash
+ NSWindow
+
+
+
+ 256
+
+
+
+ 268
+ {{95, 310}, {316, 64}}
+
+
+
+ YES
+
+ 67239424
+ 272629760
+ Oops, it seems like this application quit unexpectedly last time. You can send us a report to help us improving this application.
+
+ LucidaGrande
+ 13
+ 1044
+
+
+
+ 6
+ System
+ controlColor
+
+ 3
+ MC42NjY2NjY2NjY3AA
+
+
+
+ 6
+ System
+ controlTextColor
+
+ 3
+ MAA
+
+
+
+
+
+
+ 268
+
+ Apple PDF pasteboard type
+ Apple PICT pasteboard type
+ Apple PNG pasteboard type
+ NSFilenamesPboardType
+ NeXT Encapsulated PostScript v1.2 pasteboard type
+ NeXT TIFF v4.0 pasteboard type
+
+ {{17, 313}, {64, 64}}
+
+
+
+ YES
+
+ 130560
+ 33554432
+
+ NSImage
+ NSApplicationIcon
+
+ 0
+ 0
+ 0
+ NO
+
+ YES
+
+
+
+ 256
+
+
+
+ 2304
+
+
+
+ 2322
+
+ Apple HTML pasteboard type
+ Apple PDF pasteboard type
+ Apple PICT pasteboard type
+ Apple PNG pasteboard type
+ Apple URL pasteboard type
+ CorePasteboardFlavorType 0x6D6F6F76
+ NSColor pasteboard type
+ NSFilenamesPboardType
+ NSStringPboardType
+ NeXT Encapsulated PostScript v1.2 pasteboard type
+ NeXT RTFD pasteboard type
+ NeXT Rich Text Format v1.0 pasteboard type
+ NeXT TIFF v4.0 pasteboard type
+ NeXT font pasteboard type
+ NeXT ruler pasteboard type
+ WebURLsWithTitlesPboardType
+ public.url
+
+ {396, 14}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 6
+
+
+
+ 396
+ 1
+
+
+ 11235
+ 0
+
+
+ 3
+ MQA
+
+
+
+ 6
+ System
+ selectedTextBackgroundColor
+
+
+
+ 6
+ System
+ selectedTextColor
+
+
+
+
+
+
+ 1
+ MCAwIDEAA
+
+
+
+
+
+ 6
+ {398, 1e+07}
+ {114, 0}
+
+
+
+ {{1, 1}, {396, 116}}
+
+
+
+
+
+
+ {4, -5}
+ 1
+
+ 4
+
+
+
+ 256
+ {{397, 1}, {15, 116}}
+
+
+
+
+ _doScroller:
+ 0.98305082321166992
+
+
+
+ -2147483392
+ {{-100, -100}, {87, 18}}
+
+
+
+ 1
+
+ _doScroller:
+ 1
+ 0.94565218687057495
+
+
+ {{20, 162}, {413, 118}}
+
+
+
+ 18
+
+
+
+
+
+
+ 256
+ {{18, 138}, {417, 18}}
+
+
+
+ YES
+
+ -2080244224
+ 0
+ Include anonymous crash report with technical information
+
+
+ 1211912703
+ 2
+
+ NSSwitch
+
+
+
+ 200
+ 25
+
+
+
+
+ 256
+ {{20, 288}, {413, 14}}
+
+
+
+ YES
+
+ 67239424
+ 272629760
+ Please specify what you did when the app crashed. (optional)
+
+ LucidaGrande
+ 11
+ 3100
+
+
+
+
+
+
+
+
+ 268
+ {{119, 57}, {314, 22}}
+
+
+
+ YES
+
+ -1804468671
+ 272630784
+
+
+
+ YES
+
+ 6
+ System
+ textBackgroundColor
+
+
+
+ 6
+ System
+ textColor
+
+
+
+
+
+
+ 268
+ {{343, 9}, {96, 32}}
+
+
+
+ YES
+
+ 67239424
+ 134217728
+ Report
+
+
+ -2038284033
+ 129
+
+
+ 200
+ 25
+
+
+
+
+ 268
+ {{247, 9}, {96, 32}}
+
+
+
+ YES
+
+ 67239424
+ 134217728
+ Ignore
+
+
+ -2038284033
+ 129
+
+ Gw
+ 200
+ 25
+
+
+
+
+ 256
+ {{18, 18}, {185, 18}}
+
+
+
+ YES
+
+ 67239424
+ 0
+ Don't show this anymore
+
+
+ 1211912703
+ 2
+
+
+
+ 200
+ 25
+
+
+
+
+ 268
+ {{20, 127}, {413, 5}}
+
+
+
+ {0, 0}
+
+ 67239424
+ 0
+ Box
+
+
+
+ 3
+ MCAwLjgwMDAwMDAxMTkAA
+
+
+ 3
+ 2
+ 0
+ NO
+
+
+
+ 268
+ {{17, 59}, {102, 17}}
+
+
+
+ YES
+
+ 67239488
+ 272630784
+ Email address:
+
+
+
+
+
+
+
+
+ 268
+ {{14, 87}, {422, 34}}
+
+
+
+ YES
+
+ 67239424
+ 272629760
+ Leave an email address if you would like us to get back to you.
+
+
+
+
+
+
+
+ {{7, 11}, {453, 394}}
+
+
+
+
+ {{0, 0}, {1280, 778}}
+ {1e+13, 1e+13}
+
+
+
+
+
+
+ description
+
+
+
+ 40
+
+
+
+ includeRapport
+
+
+
+ 43
+
+
+
+ dontReport:
+
+
+
+ 60
+
+
+
+ submitData:
+
+
+
+ 61
+
+
+
+ dontShowThis
+
+
+
+ 106
+
+
+
+ commentField
+
+
+
+ 153
+
+
+
+ window
+
+
+
+ 168
+
+
+
+ delegate
+
+
+
+ 182
+
+
+
+ mailaddress
+
+
+
+ 196
+
+
+
+
+
+ 0
+
+
+
+
+
+ -2
+
+
+ File's Owner
+
+
+ -1
+
+
+ First Responder
+
+
+ -3
+
+
+ Application
+
+
+ 1
+
+
+
+
+
+ Window (Window)
+
+
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+
+
+
+
+
+
+
+ 7
+
+
+
+
+
+
+
+ 9
+
+
+
+
+
+
+
+
+
+ 14
+
+
+
+
+ 10
+
+
+
+
+
+
+
+ 15
+
+
+
+
+
+
+
+ 19
+
+
+
+
+
+
+
+ 23
+
+
+
+
+
+
+
+ 25
+
+
+
+
+
+
+
+ 44
+
+
+
+
+
+
+
+ 123
+
+
+
+
+ 126
+
+
+
+
+
+
+
+ 134
+
+
+
+
+
+
+
+ 198
+
+
+
+
+ 199
+
+
+
+
+ 200
+
+
+
+
+ 201
+
+
+
+
+ 202
+
+
+
+
+ 203
+
+
+
+
+ 204
+
+
+
+
+ 205
+
+
+
+
+ 206
+
+
+
+
+ 207
+
+
+
+
+ 208
+
+
+
+
+ 209
+
+
+
+
+
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ {{342, 351}, {453, 394}}
+ com.apple.InterfaceBuilder.CocoaPlugin
+ {{342, 351}, {453, 394}}
+
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ P4AAAL+AAABAAAAAwuoAAA
+
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+
+
+
+
+
+ 209
+
+
+
+
+ CMCrashReporterWindow
+ NSWindowController
+
+ id
+ id
+
+
+
+ dontReport:
+ id
+
+
+ submitData:
+ id
+
+
+
+ id
+ id
+ id
+ id
+ id
+ id
+ id
+
+
+
+ application
+ id
+
+
+ commentField
+ id
+
+
+ description
+ id
+
+
+ dontShowThis
+ id
+
+
+ includeRapport
+ id
+
+
+ mailaddress
+ id
+
+
+ version
+ id
+
+
+
+ IBProjectSource
+ ./Classes/CMCrashReporterWindow.h
+
+
+
+
+ 0
+ IBCocoaFramework
+
+ com.apple.InterfaceBuilder.CocoaPlugin.macosx
+
+
+ YES
+ 3
+
+ NSApplicationIcon
+ {128, 128}
+
+
+
Index: /code/branches/mac_osx2/src/external/cmcrashreporter/CMakeLists.txt
===================================================================
--- /code/branches/mac_osx2/src/external/cmcrashreporter/CMakeLists.txt (revision 8356)
+++ /code/branches/mac_osx2/src/external/cmcrashreporter/CMakeLists.txt (revision 8356)
@@ -0,0 +1,70 @@
+ #
+ # ORXONOX - the hottest 3D action shooter ever to exist
+ # > www.orxonox.net <
+ #
+ # This program is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU General Public License
+ # as published by the Free Software Foundation; either version 2
+ # of the License, or (at your option) any later version.
+ #
+ # This program is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License along
+ # with this program; if not, write to the Free Software Foundation,
+ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ #
+IF(APPLE)
+
+SET_SOURCE_FILES(CCR_FILES
+ CMCrashReporter.m
+ CMCrashReporterGlobal.m
+ CMCrashReporterWindow.m
+)
+
+ORXONOX_ADD_LIBRARY(cmcrashreporter_orxonox
+ ORXONOX_EXTERNAL
+ LINK_LIBRARIES
+ "-framework CoreFoundation"
+ "-framework Cocoa"
+ "-framework AddressBook"
+ SOURCE_FILES
+ ${CCR_FILES}
+)
+
+IF(NOT CMAKE_CONFIGURATION_TYPES)
+ SET(_subdirs .)
+ SET(_default_subdir .)
+ELSE()
+ SET(_subdirs ${CMAKE_CONFIGURATION_TYPES})
+ SET(_default_subdir) # No default subdir
+ENDIF()
+
+FOREACH(_subdir ${_subdirs})
+ GET_FILENAME_COMPONENT(CURRENT_RUNTIME_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_subdir} ABSOLUTE)
+
+ # Convenience variables
+ # Note that this is just an empty bundle! The executable itself will
+ # be added at build time
+ SET(DEVBUNDLE_CURRENT_DIR "${CURRENT_RUNTIME_DIR}/${PROJECT_NAME}.app/Contents")
+ SET(DEVBUNDLE_CURRENT_BIN "${DEVBUNDLE_CURRENT_DIR}/MacOS")
+ SET(DEVBUNDLE_CURRENT_RESOURCES "${DEVBUNDLE_CURRENT_DIR}/Resources")
+ SET(DEVBUNDLE_DEFAULT_LANGFILE "English.lproj")
+ SET(DEVBUNDLE_NIB_FILE "CMCrashReporterWindow.nib")
+
+ # Create bundle folder structure
+ FILE(MAKE_DIRECTORY "${DEVBUNDLE_CURRENT_DIR}")
+ FILE(MAKE_DIRECTORY "${DEVBUNDLE_CURRENT_BIN}")
+ FILE(MAKE_DIRECTORY "${DEVBUNDLE_CURRENT_RESOURCES}")
+ FILE(MAKE_DIRECTORY "${DEVBUNDLE_CURRENT_RESOURCES}/${DEVBUNDLE_DEFAULT_LANGFILE}/${DEVBUNDLE_NIB_FILE}")
+
+ # Populate app with additional NIB file.
+ CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${DEVBUNDLE_NIB_FILE}/keyedobjects.nib" "${DEVBUNDLE_CURRENT_RESOURCES}/${DEVBUNDLE_DEFAULT_LANGFILE}/${DEVBUNDLE_NIB_FILE}/keyedobjects.nib" COPYONLY)
+ CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${DEVBUNDLE_NIB_FILE}/designable.nib" "${DEVBUNDLE_CURRENT_RESOURCES}/${DEVBUNDLE_DEFAULT_LANGFILE}/${DEVBUNDLE_NIB_FILE}/designable.nib" COPYONLY)
+
+
+ENDFOREACH(_subdir)
+
+ENDIF(APPLE)
Index: /code/branches/mac_osx2/src/external/cmcrashreporter/read-me.txt
===================================================================
--- /code/branches/mac_osx2/src/external/cmcrashreporter/read-me.txt (revision 8356)
+++ /code/branches/mac_osx2/src/external/cmcrashreporter/read-me.txt (revision 8356)
@@ -0,0 +1,64 @@
+ Read Me
+..:: -- -- -- -- -- -- -- -- -- -- ::..
+
+CMCrashReporter is a group of classes,
+special designed for Mac applications.
+
+CMCrashReporter collects crash-reports
+and send those to a server of the
+developer, in stead of Apple.
+
+CMCrashReporter is free and opensource.
+You can edit CMCrashReporter if wanted.
+If you find some bugs or have some feature requests,
+please email us at info@codingmammoth.com so we can
+update CMCrashReporter.
+
+ Credits
+..:: -- -- -- -- -- -- -- -- -- -- ::..
+
+CMCrashReporter is developed by
+Jelle De Laender - CodingMammoth.com
+
+Thanks to Pieter Omvlee (bohemiancoding.com)
+for the GUI-support.
+
+ Compability
+..:: -- -- -- -- -- -- -- -- -- -- ::..
+
+CMCrashReporter is compatible with
+Tiger, Leopard and Snow Leopard.
+
+Depending on your project, it's compatible for
+intel and PPC and GC (Garbage Collection).
+
+ Usage
+..:: -- -- -- -- -- -- -- -- -- -- ::..
+
+IMPORTANT: Link 'AddressBook.framework'
+(available on the Mac-computer self) to
+your project,
+since this CMCrashReporter is using this.
+
+1) Link the classes and the nib-file to your project.
+2) link the addressbook.framework to your project (available on Mac OS Library)
+3) At your main-class (preferable AppDelegate)
+ import CMCrashReporter.h and call [CMCrashReporter check].
+
+A good place to call this method is in -(void)applicationDidFinishLaunching: in your app delegate
+
+
+
+ App Settings (info.plist)
+..:: -- -- -- -- -- -- -- -- -- -- ::..
+
+CMSubmitURL - String: HTTP-Path to commit the logs to (as POST-Data)
+CMMaxReports (optional) - Int: max number of crashlogs to be sent
+
+ Settings (Preferences)
+..:: -- -- -- -- -- -- -- -- -- -- ::..
+It's possible to let your users have a choice to submit reports, or just ignore them.
+
+Create a NSCheckbox and link this to NSUserDefaults with 'CMCrashReporterIgnoreCrashes' as key.
+
+ CMCrashReporterIgnoreCrashes - BOOL: let the user ignore crashreports