diff --git a/Classes/CocoaShare/MGMController.h b/Classes/CocoaShare/MGMController.h index 9bdedca..6d44370 100644 --- a/Classes/CocoaShare/MGMController.h +++ b/Classes/CocoaShare/MGMController.h @@ -36,7 +36,11 @@ extern NSString * const MGMFFilter; @class MGMURLConnectionManager, MGMPreferences, MGMAbout, MGMMenuItem, MGMPathSubscriber; -@interface MGMController : NSObject { +@interface MGMController : NSObject +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060) + +#endif +{ NSTimer *autoreleaseDrain; MGMURLConnectionManager *connectionManager; diff --git a/Classes/CocoaShare/MGMController.m b/Classes/CocoaShare/MGMController.m index 401f020..e51f291 100644 --- a/Classes/CocoaShare/MGMController.m +++ b/Classes/CocoaShare/MGMController.m @@ -532,6 +532,7 @@ static MGMController *MGMSharedController; } } - (void)subscribedPathChanged:(NSString *)thePath { + NSLog(@"Changed: %@", thePath); if (filtersEnabled) { NSFileManager *manager = [NSFileManager defaultManager]; int uploadLimit = [[NSUserDefaults standardUserDefaults] integerForKey:MGMUploadLimit]; @@ -572,6 +573,19 @@ static MGMController *MGMSharedController; } else { NSLog(@"Unable to get metadata of %@", fullPath); } + + NSDictionary *extendedAttributes = nil; + if ([manager respondsToSelector:@selector(attributesOfItemAtPath:error:)]) { + extendedAttributes = [[manager attributesOfItemAtPath:fullPath error:nil] objectForKey:@"NSFileExtendedAttributes"]; + } else { + extendedAttributes = [[manager fileSystemAttributesAtPath:fullPath] objectForKey:@"NSFileExtendedAttributes"]; + } + for (int a=0; a<[[extendedAttributes allKeys] count]; a++) { + if ([[[extendedAttributes allKeys] objectAtIndex:a] isMatchedByRegex:filter]) + [self addPathToUploads:fullPath isAutomatic:YES]; + else if ([[extendedAttributes objectForKey:[[extendedAttributes allKeys] objectAtIndex:a]] isKindOfClass:[NSString class]] && [[extendedAttributes objectForKey:[[extendedAttributes allKeys] objectAtIndex:a]] isMatchedByRegex:filter]) + [self addPathToUploads:fullPath isAutomatic:YES]; + } } else { if ([file isMatchedByRegex:filter]) [self addPathToUploads:fullPath isAutomatic:YES]; diff --git a/Classes/CocoaShare/MGMPathSubscriber.h b/Classes/CocoaShare/MGMPathSubscriber.h index bfbde7f..f315f59 100644 --- a/Classes/CocoaShare/MGMPathSubscriber.h +++ b/Classes/CocoaShare/MGMPathSubscriber.h @@ -7,9 +7,21 @@ // #import +#include +#include extern NSString * const MGMPathSubscriptionChangedNotification; +typedef enum { + MGMFODelete = NOTE_DELETE, + MGMFOWrite = NOTE_WRITE, + MGMFOExtend = NOTE_EXTEND, + MGMFOAttribute = NOTE_ATTRIB, + MGMFOLink = NOTE_LINK, + MGMFORename = NOTE_RENAME, + MGMFORevoke = NOTE_REVOKE +} MGMPathSubscriptionFileOptions; + @protocol MGMPathSubscriberDelegate - (void)subscribedPathChanged:(NSString *)thePath; @end @@ -18,7 +30,11 @@ extern NSString * const MGMPathSubscriptionChangedNotification; id delegate; NSMutableDictionary *subscriptions; FNSubscriptionUPP subscriptionUPP; + CFRunLoopRef runLoop; NSMutableArray *notificationsSending; + + int queueDescriptor; + BOOL fileWatchLoop; } + (id)sharedPathSubscriber; @@ -26,6 +42,7 @@ extern NSString * const MGMPathSubscriptionChangedNotification; - (void)setDelegate:(id)theDelegate; - (void)addPath:(NSString *)thePath; +- (void)addPath:(NSString *)thePath fileOptions:(u_int)theOptions; - (void)removePath:(NSString *)thePath; - (void)removeAllPaths; diff --git a/Classes/CocoaShare/MGMPathSubscriber.m b/Classes/CocoaShare/MGMPathSubscriber.m index 1afe3db..494ba11 100644 --- a/Classes/CocoaShare/MGMPathSubscriber.m +++ b/Classes/CocoaShare/MGMPathSubscriber.m @@ -8,9 +8,61 @@ #import "MGMPathSubscriber.h" +@interface MGMPathSubscriberFile : NSObject { + NSString *path; + int fileDescriptor; + u_int options; +} +- (id)initWithPath:(NSString*)thePath options:(u_int)theOptions; +- (NSString *)path; +- (int)fileDescriptor; +- (u_int)options; +- (BOOL)reopen; +@end + +@implementation MGMPathSubscriberFile +- (id)initWithPath:(NSString*)thePath options:(u_int)theOptions { + if ((self = [super init])) { + path = [thePath copy]; + options = theOptions; + fileDescriptor = open([path fileSystemRepresentation], O_EVTONLY, 0); + if (fileDescriptor<0) { + [self release]; + self = nil; + } + } + return self; +} +- (void)dealloc { + [path release]; + if (fileDescriptor>=0) + close(fileDescriptor); + [super dealloc]; +} +- (NSString *)path { + return path; +} +- (int)fileDescriptor { + return fileDescriptor; +} +- (u_int)options { + return options; +} + +- (BOOL)reopen { + if (fileDescriptor>=0) + close(fileDescriptor); + fileDescriptor = open([path fileSystemRepresentation], O_EVTONLY, 0); + if (fileDescriptor<0) + return NO; + return YES; +} +@end + @interface MGMPathSubscriber (MGMPrivate) - (void)subscriptionChanged:(FNSubscriptionRef)theSubscription; - (void)subscriptionFSChanged:(ConstFSEventStreamRef)theSubscription; +- (void)subscriptionFileChanged:(MGMPathSubscriberFile *)theFile; - (void)sendNotificationForPath:(NSString *)thePath; @end @@ -26,11 +78,11 @@ void MGMPathSubscriptionChange(FNMessage theMessage, OptionBits theFlags, void * void MGMPathSubscriptionFSChange(ConstFSEventStreamRef streamRef, void *thePathSubscription, size_t numEvents, void *eventPaths, const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId eventIds[]) { for (size_t i=0; i=0) + close(queueDescriptor); + fileWatchLoop = NO; [self removeAllPaths]; DisposeFNSubscriptionUPP(subscriptionUPP); [subscriptions release]; @@ -78,41 +137,76 @@ void MGMPathSubscriptionFSChange(ConstFSEventStreamRef streamRef, void *thePathS } - (void)addPath:(NSString *)thePath { + [self addPath:thePath fileOptions:MGMFODelete | MGMFOWrite | MGMFOExtend | MGMFOAttribute | MGMFOLink | MGMFORename | MGMFORevoke]; +} +- (void)addPath:(NSString *)thePath fileOptions:(u_int)theOptions { NSValue *value = [subscriptions objectForKey:thePath]; if (value!=nil) return; - FSEventStreamContext context = {0, self, NULL, NULL, NULL}; - if ([self OSMajorVersion]==10 && [self OSMinorVersion]>=5) { - FSEventStreamRef stream = FSEventStreamCreate(NULL, &MGMPathSubscriptionFSChange, &context, (CFArrayRef)[NSArray arrayWithObject:thePath], kFSEventStreamEventIdSinceNow, 0.5, kFSEventStreamCreateFlagNone); - if (stream==NULL) { - NSLog(@"MGMPathSubscription: Unable to subscribe to %@", thePath); - return; + + BOOL directory = NO; + BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:thePath isDirectory:&directory]; + if (!exists) { + NSLog(@"MGMPathSubscription: Unable to subscribe to %@ as it does not exist", thePath); + return; + } + if (directory) { + if ([self OSMajorVersion]==10 && [self OSMinorVersion]>=5) { + FSEventStreamContext context = {0, self, NULL, NULL, NULL}; + FSEventStreamRef stream = FSEventStreamCreate(NULL, &MGMPathSubscriptionFSChange, &context, (CFArrayRef)[NSArray arrayWithObject:thePath], kFSEventStreamEventIdSinceNow, 0.5, kFSEventStreamCreateFlagNone); + if (stream==NULL) { + NSLog(@"MGMPathSubscription: Unable to subscribe to %@", thePath); + return; + } + FSEventStreamScheduleWithRunLoop(stream, runLoop, kCFRunLoopDefaultMode); + FSEventStreamStart(stream); + [subscriptions setObject:[NSValue valueWithPointer:stream] forKey:thePath]; + } else { + FNSubscriptionRef subscription = NULL; + OSStatus error = FNSubscribeByPath((UInt8 *)[thePath fileSystemRepresentation], subscriptionUPP, self, kFNNotifyInBackground, &subscription); + if (error!=noErr) { + NSLog(@"MGMPathSubscription: Unable to subscribe to %@ due to the error %ld", thePath, (long)error); + return; + } + [subscriptions setObject:[NSValue valueWithPointer:subscription] forKey:thePath]; } - FSEventStreamScheduleWithRunLoop(stream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); - FSEventStreamStart(stream); - [subscriptions setObject:[NSValue valueWithPointer:stream] forKey:thePath]; } else { - FNSubscriptionRef subscription = NULL; - OSStatus error = FNSubscribeByPath((UInt8 *)[thePath fileSystemRepresentation], subscriptionUPP, self, kFNNotifyInBackground, &subscription); - if (error!=noErr) { - NSLog(@"MGMPathSubscription: Unable to subscribe to %@ due to the error %ld", thePath, (long)error); - return; + MGMPathSubscriberFile *file = [[[MGMPathSubscriberFile alloc] initWithPath:thePath options:theOptions] autorelease]; + + if (file==nil) { + NSLog(@"MGMPathSubscription: Unable to subscribe to %@ due to an error", thePath); + return; + } + + struct timespec nullts = { 0, 0 }; + struct kevent event; + EV_SET(&event, [file fileDescriptor], EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_CLEAR, theOptions, 0, file); + + [subscriptions setObject:file forKey:thePath]; + kevent(queueDescriptor, &event, 1, NULL, 0, &nullts); + + if (!fileWatchLoop) { + fileWatchLoop = YES; + [NSThread detachNewThreadSelector:@selector(fileWatchThread) toTarget:self withObject:nil]; } - [subscriptions setObject:[NSValue valueWithPointer:subscription] forKey:thePath]; } } - (void)removePath:(NSString *)thePath { NSValue *value = [subscriptions objectForKey:thePath]; if (value!=nil) { - if ([self OSMajorVersion]==10 && [self OSMinorVersion]>=5) { - FSEventStreamRef stream = [value pointerValue]; - FSEventStreamStop(stream); - FSEventStreamUnscheduleFromRunLoop(stream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); - FSEventStreamInvalidate(stream); - FSEventStreamRelease(stream); - [subscriptions removeObjectForKey:thePath]; + if ([value isKindOfClass:[NSValue class]]) { + if ([self OSMajorVersion]==10 && [self OSMinorVersion]>=5) { + FSEventStreamRef stream = [value pointerValue]; + FSEventStreamStop(stream); + FSEventStreamUnscheduleFromRunLoop(stream, runLoop, kCFRunLoopDefaultMode); + FSEventStreamInvalidate(stream); + FSEventStreamRelease(stream); + [subscriptions removeObjectForKey:thePath]; + } else { + FNUnsubscribe([value pointerValue]); + [subscriptions removeObjectForKey:thePath]; + } } else { - FNUnsubscribe([value pointerValue]); [subscriptions removeObjectForKey:thePath]; } } @@ -120,7 +214,18 @@ void MGMPathSubscriptionFSChange(ConstFSEventStreamRef streamRef, void *thePathS - (void)removeAllPaths { NSArray *keys = [subscriptions allKeys]; for (int i=0; i<[keys count]; i++) { - FNUnsubscribe([[subscriptions objectForKey:[keys objectAtIndex:i]] pointerValue]); + NSValue *value = [subscriptions objectForKey:[keys objectAtIndex:i]]; + if ([value isKindOfClass:[NSValue class]]) { + if ([self OSMajorVersion]==10 && [self OSMinorVersion]>=5) { + FSEventStreamRef stream = [value pointerValue]; + FSEventStreamStop(stream); + FSEventStreamUnscheduleFromRunLoop(stream, runLoop, kCFRunLoopDefaultMode); + FSEventStreamInvalidate(stream); + FSEventStreamRelease(stream); + } else { + FNUnsubscribe([value pointerValue]); + } + } } [subscriptions removeAllObjects]; } @@ -149,9 +254,76 @@ void MGMPathSubscriptionFSChange(ConstFSEventStreamRef streamRef, void *thePathS } } } +- (void)subscriptionFileChanged:(MGMPathSubscriberFile *)theFile { + NSArray *keys = [subscriptions allKeysForObject:theFile]; + if ([keys count]>=1) { + NSString *path = [keys objectAtIndex:0]; + if (![notificationsSending containsObject:path]) { + [notificationsSending addObject:path]; + [self performSelector:@selector(sendNotificationForPath:) withObject:path afterDelay:0.5]; + } + } +} + - (void)sendNotificationForPath:(NSString *)thePath { [[NSNotificationCenter defaultCenter] postNotificationName:MGMSubscribedPathChangedNotification object:thePath]; if ([delegate respondsToSelector:@selector(subscribedPathChanged:)]) [delegate subscribedPathChanged:thePath]; [notificationsSending removeObject:thePath]; } + +- (void)fileWatchThread { + int status; + struct kevent event; + struct timespec timeout = {1, 0}; + int queueFD = queueDescriptor; + + while (fileWatchLoop) { + @try { + status = kevent(queueFD, NULL, 0, &event, 1, &timeout); + if (status>0) { + MGMPathSubscriberFile *file = [(id)event.udata retain]; + if (event.filter==EVFILT_VNODE && event.fflags && file!=nil) { + if ((event.fflags & NOTE_RENAME)==NOTE_RENAME) { + [self performSelectorOnMainThread:@selector(subscriptionFileChanged:) withObject:file waitUntilDone:NO]; + } + if ((event.fflags & NOTE_WRITE)==NOTE_WRITE) { + [self performSelectorOnMainThread:@selector(subscriptionFileChanged:) withObject:file waitUntilDone:NO]; + } + if ((event.fflags & NOTE_DELETE)==NOTE_DELETE) { + [self performSelectorOnMainThread:@selector(subscriptionFileChanged:) withObject:file waitUntilDone:NO]; + + if ([file reopen]) { + struct timespec nullts = { 0, 0 }; + struct kevent event; + EV_SET(&event, [file fileDescriptor], EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_CLEAR, [file options], 0, file); + + kevent(queueDescriptor, &event, 1, NULL, 0, &nullts); + } else { + [self removePath:[file path]]; + } + } + if ((event.fflags & NOTE_ATTRIB)==NOTE_ATTRIB) { + [self performSelectorOnMainThread:@selector(subscriptionFileChanged:) withObject:file waitUntilDone:NO]; + } + if ((event.fflags & NOTE_EXTEND)==NOTE_EXTEND) { + [self performSelectorOnMainThread:@selector(subscriptionFileChanged:) withObject:file waitUntilDone:NO]; + } + if ((event.fflags & NOTE_LINK)==NOTE_LINK) { + [self performSelectorOnMainThread:@selector(subscriptionFileChanged:) withObject:file waitUntilDone:NO]; + } + if ((event.fflags & NOTE_REVOKE)==NOTE_REVOKE) { + [self performSelectorOnMainThread:@selector(subscriptionFileChanged:) withObject:file waitUntilDone:NO]; + } + } + [file release]; + } + } @catch (NSException *exception) { + NSLog(@"MGMPathSubscription: Error in fileWatchThread: %@", exception); + } + } + + if (close(queueFD)==-1) + NSLog(@"MGMPathSubscription: fileWatchThread couldn't close queue descriptor %d", errno); + queueDescriptor = -1; +} @end \ No newline at end of file diff --git a/Classes/CocoaShare/Preferences/MGMEventsPane.h b/Classes/CocoaShare/Preferences/MGMEventsPane.h index 02afb1b..8f8c64c 100644 --- a/Classes/CocoaShare/Preferences/MGMEventsPane.h +++ b/Classes/CocoaShare/Preferences/MGMEventsPane.h @@ -9,7 +9,11 @@ #import #import -@interface MGMEventsPane : MGMPreferencesPane { +@interface MGMEventsPane : MGMPreferencesPane +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060) + +#endif +{ IBOutlet NSView *view; IBOutlet NSPopUpButton *eventPopUp; IBOutlet NSPopUpButton *soundPopUp; diff --git a/Classes/TinyGrab/MGMTinyGrabPlugIn.h b/Classes/TinyGrab/MGMTinyGrabPlugIn.h new file mode 100644 index 0000000..20ff6ca --- /dev/null +++ b/Classes/TinyGrab/MGMTinyGrabPlugIn.h @@ -0,0 +1,24 @@ +// +// MGMTinyGrabPlugIn.h +// CocoaShare +// +// Created by James on 1/31/11. +// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/ +// + +#import + +@interface MGMTinyGrabPlugIn : NSObject { + IBOutlet NSView *view; + IBOutlet NSTextField *emailField; + IBOutlet NSTextField *passwordField; + IBOutlet NSTextField *typeField; + IBOutlet NSButton *loginButton; +} +- (void)releaseView; + +- (void)lockLogin; +- (void)unlockLogin; +- (void)login:(id)sender; +- (IBAction)registerAccount:(id)sender; +@end \ No newline at end of file diff --git a/Classes/TinyGrab/MGMTinyGrabPlugIn.m b/Classes/TinyGrab/MGMTinyGrabPlugIn.m new file mode 100644 index 0000000..5bc4318 --- /dev/null +++ b/Classes/TinyGrab/MGMTinyGrabPlugIn.m @@ -0,0 +1,213 @@ +// +// MGMTinyGrabPlugIn.m +// CocoaShare +// +// Created by James on 1/31/11. +// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/ +// + +#import "MGMTinyGrabPlugIn.h" +#import "MGMController.h" +#import "MGMAddons.h" +#import + +NSString * const MGMTinyGrabPostMethod = @"POST"; +NSString * const MGMTinyGrabURLForm = @"application/x-www-form-urlencoded"; +NSString * const MGMTinyGrabContentType = @"content-type"; + +NSString * const MGMTinyGrabAPI = @"http://tinygrab.com/api/v3.php?m=%@"; +NSString * const MGMTinyGrabAPIVerify = @"user/verify"; +NSString * const MGMTinyGrabAPIUpload = @"grab/upload"; + +NSString * const MGMTinyGrabAPIRError = @"X-Error-Text"; +NSString * const MGMTinyGrabAPIRErrorCode = @"X-Error-Code"; +NSString * const MGMTinyGrabAPIREmail = @"X-User-Email"; +NSString * const MGMTinyGrabAPIRJoinDate = @"X-User-Joindate"; +NSString * const MGMTinyGrabAPIRName = @"X-User-Name"; +NSString * const MGMTinyGrabAPIRPaid = @"X-User-Paid"; + +NSString * const MGMTinyGrabAPIRDate = @"X-Grab-Date"; +NSString * const MGMTinyGrabAPIRID = @"X-Grab-Id"; +NSString * const MGMTinyGrabAPIRURL = @"X-Grab-Url"; + +NSString * const MGMTinyGrabEmail = @"MGMTinyGrabEmail"; +NSString * const MGMTinyGrabType = @"MGMTinyGrabType"; + +const BOOL MGMTinyGrabResponseInvisible = YES; + +@implementation MGMTinyGrabPlugIn +- (void)dealloc { + [self releaseView]; + [super dealloc]; +} + +- (BOOL)isAccountPlugIn { + return YES; +} +- (NSString *)plugInName { + return @"TinyGrab"; +} +- (NSView *)plugInView { + if (view==nil) { + if (![NSBundle loadNibNamed:@"TinyGrabAccountPane" owner:self]) { + NSLog(@"Unable to load TinyGrab Account Pane"); + } else { + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + NSString *email = [defaults objectForKey:MGMTinyGrabEmail]; + if (email!=nil) + [emailField setStringValue:email]; + NSString *password = [[MGMController sharedController] password]; + if (password!=nil) + [passwordField setStringValue:password]; + NSString *type = [defaults objectForKey:MGMTinyGrabType]; + if (type!=nil) + [typeField setStringValue:[[type capitalizedString] localizedFor:self]]; + } + } + return view; +} +- (void)releaseView { + [view release]; + view = nil; + emailField = nil; + passwordField = nil; + loginButton = nil; +} + +- (NSArray *)allowedExtensions { + return [NSArray arrayWithObjects:@"png", @"jpg", nil]; +} + +- (void)setCurrentPlugIn:(BOOL)isCurrent { + if (!isCurrent) { + [[[MGMController sharedController] connectionManager] cancelAll]; + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + [defaults removeObjectForKey:MGMTinyGrabEmail]; + } +} + +- (void)lockLogin { + [emailField setEnabled:NO]; + [passwordField setEnabled:NO]; + [loginButton setEnabled:NO]; + [loginButton setTitle:[@"Logging In" localizedFor:self]]; +} +- (void)unlockLogin { + [emailField setEnabled:YES]; + [passwordField setEnabled:YES]; + [loginButton setEnabled:YES]; + [loginButton setTitle:[@"Login" localizedFor:self]]; +} + +- (IBAction)login:(id)sender { + if ([[emailField stringValue] isEqual:@""]) { + NSAlert *alert = [[NSAlert new] autorelease]; + [alert setMessageText:[@"Email Required" localizedFor:self]]; + [alert setInformativeText:[@"Please enter your email." localizedFor:self]]; + [alert runModal]; + } else { + [[MGMController sharedController] setPassword:[passwordField stringValue]]; + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + [defaults setObject:[emailField stringValue] forKey:MGMTinyGrabEmail]; + [typeField setStringValue:[@"Unknown" localizedFor:self]]; + [self lockLogin]; + + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:MGMTinyGrabAPI, MGMTinyGrabAPIVerify]]]; + [request setHTTPMethod:MGMTinyGrabPostMethod]; + [request setValue:MGMTinyGrabURLForm forHTTPHeaderField:MGMTinyGrabContentType]; + [request setHTTPBody:[[NSString stringWithFormat:@"email=%@&passwordhash=%@", [[defaults objectForKey:MGMTinyGrabEmail] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding], [[[MGMController sharedController] password] MD5]] dataUsingEncoding:NSUTF8StringEncoding]]; + MGMURLBasicHandler *handler = [MGMURLBasicHandler handlerWithRequest:request delegate:self]; + [handler setFailWithError:@selector(check:didFailWithError:)]; + [handler setFinish:@selector(checkDidFinish:)]; + [handler setInvisible:MGMTinyGrabResponseInvisible]; + [[[MGMController sharedController] connectionManager] addHandler:handler]; + } +} +- (IBAction)registerAccount:(id)sender { + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://tinygrab.com/register"]]; +} +- (void)check:(MGMURLBasicHandler *)theHandler didFailWithError:(NSError *)theError { + NSLog(@"HTTP Error: %@", theError); + NSAlert *alert = [[NSAlert new] autorelease]; + [alert setMessageText:[@"Account Error" localizedFor:self]]; + [alert setInformativeText:[theError localizedDescription]]; + [alert runModal]; + [self unlockLogin]; +} +- (void)checkDidFinish:(MGMURLBasicHandler *)theHandler { + NSDictionary *headers = [[theHandler response] allHeaderFields]; + if ([headers objectForKey:MGMTinyGrabAPIRError]!=nil) { + NSAlert *alert = [[NSAlert new] autorelease]; + [alert setMessageText:[@"Account Error" localizedFor:self]]; + [alert setInformativeText:[headers objectForKey:MGMTinyGrabAPIRError]]; + [alert runModal]; + [self unlockLogin]; + } else { + NSString *type = [headers objectForKey:MGMTinyGrabAPIRPaid]; + if (type==nil || [type isEqual:@"free"]) { + NSAlert *alert = [[NSAlert new] autorelease]; + [alert setMessageText:[@"Account Error" localizedFor:self]]; + [alert setInformativeText:[@"Only paid users are allowed to use TinyGrab in CocoaShare, sorry." localizedFor:self]]; + [alert runModal]; + [self unlockLogin]; + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + [defaults removeObjectForKey:MGMTinyGrabEmail]; + } else { + [typeField setStringValue:[[type capitalizedString] localizedFor:self]]; + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + [defaults setObject:type forKey:MGMTinyGrabType]; + NSAlert *alert = [[NSAlert new] autorelease]; + [alert setMessageText:[@"Login Successful" localizedFor:self]]; + [alert setInformativeText:[@"You have sucessfully logged into your account." localizedFor:self]]; + [alert runModal]; + [self unlockLogin]; + } + } +} + +- (void)sendFileAtPath:(NSString *)thePath withName:(NSString *)theName { + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + if ([defaults objectForKey:MGMTinyGrabEmail]==nil || [defaults objectForKey:MGMTinyGrabType]==nil) { + NSError *error = [NSError errorWithDomain:[[NSBundle bundleForClass:[self class]] bundleIdentifier] code:5 userInfo:[NSDictionary dictionaryWithObject:[@"Account is not logged in." localizedFor:self] forKey:NSLocalizedDescriptionKey]]; + [[MGMController sharedController] upload:thePath receivedError:error]; + return; + } + + srandomdev(); + NSString *boundary = [NSString stringWithFormat:@"----Boundary+%d", random()%100000]; + + NSMutableURLRequest *postRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:MGMTinyGrabAPI, MGMTinyGrabAPIUpload]] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:120.0]; + [postRequest setHTTPMethod:MGMTinyGrabPostMethod]; + [postRequest setValue:[NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary, nil] forHTTPHeaderField:@"Content-Type"]; + + NSMutableDictionary *data = [NSMutableDictionary dictionary]; + [data setObject:[defaults objectForKey:MGMTinyGrabEmail] forKey:@"email"]; + [data setObject:[[[MGMController sharedController] password] MD5] forKey:@"passwordhash"]; + [data setObject:[NSDictionary dictionaryWithObjectsAndKeys:thePath, MGMMPFPath, theName, MGMMPFName, nil] forKey:@"upload"]; + [postRequest setHTTPBody:[data buildMultiPartBodyWithBoundary:boundary]]; + MGMURLBasicHandler *handler = [MGMURLBasicHandler handlerWithRequest:postRequest delegate:self]; + [handler setFailWithError:@selector(upload:didFailWithError:)]; + [handler setFinish:@selector(uploadDidFinish:)]; + [handler setInvisible:MGMTinyGrabResponseInvisible]; + [handler setObject:thePath]; + [[[MGMController sharedController] connectionManager] addHandler:handler]; +} +- (void)upload:(MGMURLBasicHandler *)theHandler didFailWithError:(NSError *)theError { + [[MGMController sharedController] upload:[theHandler object] receivedError:theError]; +} +- (void)uploadDidFinish:(MGMURLBasicHandler *)theHandler { + NSDictionary *headers = [[theHandler response] allHeaderFields]; + if ([headers objectForKey:MGMTinyGrabAPIRError]!=nil) { + NSError *error = [NSError errorWithDomain:[[NSBundle bundleForClass:[self class]] bundleIdentifier] code:[[headers objectForKey:MGMTinyGrabAPIRErrorCode] intValue] userInfo:[NSDictionary dictionaryWithObject:[headers objectForKey:MGMTinyGrabAPIRError] forKey:NSLocalizedDescriptionKey]]; + [[MGMController sharedController] upload:[theHandler object] receivedError:error]; + } else { + if ([headers objectForKey:MGMTinyGrabAPIRURL]!=nil) { + [[MGMController sharedController] uploadFinished:[theHandler object] url:[NSURL URLWithString:[headers objectForKey:MGMTinyGrabAPIRURL]]]; + } else { + NSError *error = [NSError errorWithDomain:[[NSBundle bundleForClass:[self class]] bundleIdentifier] code:4 userInfo:[NSDictionary dictionaryWithObject:[@"Unable to receive url." localizedFor:self] forKey:NSLocalizedDescriptionKey]]; + [[MGMController sharedController] upload:[theHandler object] receivedError:error]; + } + } +} + +@end \ No newline at end of file diff --git a/Classes/TinyGrab/prefix.pch b/Classes/TinyGrab/prefix.pch new file mode 100644 index 0000000..267d1c6 --- /dev/null +++ b/Classes/TinyGrab/prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'CocoaShare' target in the 'CocoaShare' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/CocoaShare.xcodeproj/project.pbxproj b/CocoaShare.xcodeproj/project.pbxproj index 047876f..a886ec0 100644 --- a/CocoaShare.xcodeproj/project.pbxproj +++ b/CocoaShare.xcodeproj/project.pbxproj @@ -103,9 +103,14 @@ 2A52DF5812E3D041000FC8CD /* menuiconselected.png in Resources */ = {isa = PBXBuildFile; fileRef = 2A52DF5712E3D041000FC8CD /* menuiconselected.png */; }; 2A52DF7312E3D436000FC8CD /* MGMMenuItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A52DF7212E3D436000FC8CD /* MGMMenuItem.m */; }; 2A55259D12F05BA700F97FE6 /* MGMFTPPlugIn.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A0C8CB412EF854D00A75AB7 /* MGMFTPPlugIn.m */; }; - 2A5531CA1306C9EF00095E2A /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A5531C91306C9EE00095E2A /* Carbon.framework */; }; 2A5C1B0812F2FB5D005153FA /* MGMWebDavPlugIn.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A5C1B0712F2FB5D005153FA /* MGMWebDavPlugIn.m */; }; 2A5C1B4912F32EE3005153FA /* WebDav.bundle in PlugIns */ = {isa = PBXBuildFile; fileRef = 2A5C1AF312F2FA6F005153FA /* WebDav.bundle */; }; + 2ACA5CD8160E76C700F294C2 /* MGMTinyGrabPlugIn.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ACA5CD7160E76C700F294C2 /* MGMTinyGrabPlugIn.m */; }; + 2ACA5CF1160E782700F294C2 /* TinyGrabAccountPane.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2ACA5CEB160E782700F294C2 /* TinyGrabAccountPane.xib */; }; + 2ACA5CF3160E782700F294C2 /* tinygrab.png in Resources */ = {isa = PBXBuildFile; fileRef = 2ACA5CF0160E782700F294C2 /* tinygrab.png */; }; + 2ACA5CF4160E795600F294C2 /* MGMUsers.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2AEAB3F112E2A57400552BAA /* MGMUsers.framework */; }; + 2ACA5CF6160E796B00F294C2 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ACA5CF5160E796B00F294C2 /* Carbon.framework */; }; + 2ACA5CF9160E79A000F294C2 /* TinyGrab.bundle in PlugIns */ = {isa = PBXBuildFile; fileRef = 2ACA5CC7160E763A00F294C2 /* TinyGrab.bundle */; }; 2AEAB3F312E2A57400552BAA /* GeckoReporter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2AEAB3EF12E2A57400552BAA /* GeckoReporter.framework */; }; 2AEAB3F412E2A57400552BAA /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2AEAB3F012E2A57400552BAA /* Growl.framework */; }; 2AEAB3F512E2A57500552BAA /* MGMUsers.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2AEAB3F112E2A57400552BAA /* MGMUsers.framework */; }; @@ -131,7 +136,6 @@ 2AEAB53712E2B68300552BAA /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 2AEAB53612E2B68300552BAA /* dsa_pub.pem */; }; 2AEF115912F527B900F495BE /* About.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF115812F527B900F495BE /* About.rtf */; }; 2AEF118612F52A7D00F495BE /* CocoaShareIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF118512F52A7D00F495BE /* CocoaShareIcon.png */; }; - 2AEF169812F7894100F495BE /* TinyGrab.bundle in PlugIns */ = {isa = PBXBuildFile; fileRef = 2AEF168B12F7893500F495BE /* TinyGrab.bundle */; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; /* End PBXBuildFile section */ @@ -185,6 +189,13 @@ remoteGlobalIDString = 2A5C1AF212F2FA6F005153FA; remoteInfo = WebDav; }; + 2ACA5CF7160E799400F294C2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 2ACA5CC6160E763A00F294C2; + remoteInfo = TinyGrab; + }; 2AD9EFB212FEE51500FD7560 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; @@ -207,8 +218,8 @@ 2A2F995412F094F10069B37E /* SFTP.bundle in PlugIns */, 2A5C1B4912F32EE3005153FA /* WebDav.bundle in PlugIns */, 2A0501F812F49D4E000F74EA /* MobileMe.bundle in PlugIns */, + 2ACA5CF9160E79A000F294C2 /* TinyGrab.bundle in PlugIns */, 2A0503CC12F4D464000F74EA /* twitpic.bundle in PlugIns */, - 2AEF169812F7894100F495BE /* TinyGrab.bundle in PlugIns */, ); name = PlugIns; runOnlyForDeploymentPostprocessing = 0; @@ -410,13 +421,23 @@ 2A52DF5712E3D041000FC8CD /* menuiconselected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menuiconselected.png; sourceTree = ""; }; 2A52DF7112E3D436000FC8CD /* MGMMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGMMenuItem.h; sourceTree = ""; }; 2A52DF7212E3D436000FC8CD /* MGMMenuItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGMMenuItem.m; sourceTree = ""; }; - 2A5531C91306C9EE00095E2A /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = ../../../System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; 2A5C1AF312F2FA6F005153FA /* WebDav.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WebDav.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; 2A5C1AFE12F2FAF3005153FA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 2A5C1B0012F2FB04005153FA /* prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = prefix.pch; path = Classes/WebDav/prefix.pch; sourceTree = ""; }; 2A5C1B0312F2FB3F005153FA /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/WebDavAccountPane.xib; sourceTree = ""; }; 2A5C1B0612F2FB5D005153FA /* MGMWebDavPlugIn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGMWebDavPlugIn.h; sourceTree = ""; }; 2A5C1B0712F2FB5D005153FA /* MGMWebDavPlugIn.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGMWebDavPlugIn.m; sourceTree = ""; }; + 2ACA5CC7160E763A00F294C2 /* TinyGrab.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TinyGrab.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; + 2ACA5CC8160E763A00F294C2 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; + 2ACA5CD5160E76B300F294C2 /* prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = prefix.pch; path = Classes/TinyGrab/prefix.pch; sourceTree = ""; }; + 2ACA5CD6160E76C700F294C2 /* MGMTinyGrabPlugIn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MGMTinyGrabPlugIn.h; path = TinyGrab/MGMTinyGrabPlugIn.h; sourceTree = ""; }; + 2ACA5CD7160E76C700F294C2 /* MGMTinyGrabPlugIn.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGMTinyGrabPlugIn.m; path = TinyGrab/MGMTinyGrabPlugIn.m; sourceTree = ""; }; + 2ACA5CEC160E782700F294C2 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/TinyGrabAccountPane.xib; sourceTree = ""; }; + 2ACA5CED160E782700F294C2 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 2ACA5CEE160E782700F294C2 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt_PT; path = pt_PT.lproj/TinyGrabAccountPane.xib; sourceTree = ""; }; + 2ACA5CEF160E782700F294C2 /* sv */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = sv; path = sv.lproj/TinyGrabAccountPane.xib; sourceTree = ""; }; + 2ACA5CF0160E782700F294C2 /* tinygrab.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tinygrab.png; sourceTree = ""; }; + 2ACA5CF5160E796B00F294C2 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; }; 2AEAB3EF12E2A57400552BAA /* GeckoReporter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GeckoReporter.framework; path = Frameworks/GeckoReporter.framework; sourceTree = ""; }; 2AEAB3F012E2A57400552BAA /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = Frameworks/Growl.framework; sourceTree = ""; }; 2AEAB3F112E2A57400552BAA /* MGMUsers.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MGMUsers.framework; path = Frameworks/MGMUsers.framework; sourceTree = ""; }; @@ -447,7 +468,6 @@ 2AEAB53612E2B68300552BAA /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dsa_pub.pem; sourceTree = ""; }; 2AEF115812F527B900F495BE /* About.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = About.rtf; sourceTree = SOURCE_ROOT; }; 2AEF118512F52A7D00F495BE /* CocoaShareIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CocoaShareIcon.png; sourceTree = SOURCE_ROOT; }; - 2AEF168B12F7893500F495BE /* TinyGrab.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = TinyGrab.bundle; sourceTree = ""; }; 8D1107320486CEB800E47090 /* CocoaShare.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CocoaShare.app; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -505,10 +525,19 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 2ACA5CC4160E763A00F294C2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 2ACA5CF4160E795600F294C2 /* MGMUsers.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 8D11072E0486CEB800E47090 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 2ACA5CF6160E796B00F294C2 /* Carbon.framework in Frameworks */, 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, 2AEAB3F312E2A57400552BAA /* GeckoReporter.framework in Frameworks */, 2AEAB3F412E2A57400552BAA /* Growl.framework in Frameworks */, @@ -516,7 +545,6 @@ 2AEAB3F612E2A57500552BAA /* Sparkle.framework in Frameworks */, 2A48833512E52EAA001618B5 /* libicucore.dylib in Frameworks */, 2A0504F312F4F024000F74EA /* QuartzCore.framework in Frameworks */, - 2A5531CA1306C9EF00095E2A /* Carbon.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -526,7 +554,7 @@ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { isa = PBXGroup; children = ( - 2A5531C91306C9EE00095E2A /* Carbon.framework */, + 2ACA5CF5160E796B00F294C2 /* Carbon.framework */, 2AEAB3EF12E2A57400552BAA /* GeckoReporter.framework */, 2AEAB3F012E2A57400552BAA /* Growl.framework */, 2AEAB3F112E2A57400552BAA /* MGMUsers.framework */, @@ -559,6 +587,7 @@ 2A5C1AF312F2FA6F005153FA /* WebDav.bundle */, 2A0501F112F49D08000F74EA /* MobileMe.bundle */, 2A0503C312F4D43B000F74EA /* twitpic.bundle */, + 2ACA5CC7160E763A00F294C2 /* TinyGrab.bundle */, ); name = Products; sourceTree = ""; @@ -570,7 +599,6 @@ 29B97315FDCFA39411CA2CEA /* Other Sources */, 2AEAB48112E2ADDF00552BAA /* Resources */, 29B97323FDCFA39411CA2CEA /* Frameworks */, - 2AEF160E12F786C700F495BE /* PlugIns */, 19C28FACFE9D520D11CA2CBB /* Products */, ); name = CocoaShare; @@ -586,6 +614,7 @@ 2A2F996212F095380069B37E /* SFTP */, 2A5C1B0212F2FB09005153FA /* WebDav */, 2A05020512F49DF4000F74EA /* MobileMe */, + 2ACA5CD4160E764B00F294C2 /* TinyGrab */, 2A0503D312F4D4B0000F74EA /* twitpic */, ); name = "Other Sources"; @@ -596,6 +625,7 @@ children = ( 2A48833312E52E9B001618B5 /* Linked Libraries */, 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, + 2ACA5CC8160E763A00F294C2 /* CoreFoundation.framework */, 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, ); name = Frameworks; @@ -942,6 +972,33 @@ name = WebDav; sourceTree = ""; }; + 2ACA5CC2160E75F000F294C2 /* TinyGrab */ = { + isa = PBXGroup; + children = ( + 2ACA5CD6160E76C700F294C2 /* MGMTinyGrabPlugIn.h */, + 2ACA5CD7160E76C700F294C2 /* MGMTinyGrabPlugIn.m */, + ); + name = TinyGrab; + sourceTree = ""; + }; + 2ACA5CD4160E764B00F294C2 /* TinyGrab */ = { + isa = PBXGroup; + children = ( + 2ACA5CD5160E76B300F294C2 /* prefix.pch */, + ); + name = TinyGrab; + sourceTree = ""; + }; + 2ACA5CEA160E782700F294C2 /* TinyGrab */ = { + isa = PBXGroup; + children = ( + 2ACA5CEB160E782700F294C2 /* TinyGrabAccountPane.xib */, + 2ACA5CED160E782700F294C2 /* Info.plist */, + 2ACA5CF0160E782700F294C2 /* tinygrab.png */, + ); + path = TinyGrab; + sourceTree = ""; + }; 2AEAB45B12E2ACEA00552BAA /* Classes */ = { isa = PBXGroup; children = ( @@ -952,6 +1009,7 @@ 2A2F996012F095320069B37E /* SFTP */, 2A5C1AFF12F2FB04005153FA /* WebDav */, 2A05020312F49DF0000F74EA /* MobileMe */, + 2ACA5CC2160E75F000F294C2 /* TinyGrab */, 2A0503D112F4D4AA000F74EA /* twitpic */, ); path = Classes; @@ -1007,6 +1065,7 @@ 2A2F996612F0955B0069B37E /* SFTP */, 2A5C1AFD12F2FAF3005153FA /* WebDav */, 2A05020112F49DDD000F74EA /* MobileMe */, + 2ACA5CEA160E782700F294C2 /* TinyGrab */, 2A0503CF12F4D49E000F74EA /* twitpic */, ); path = Resources; @@ -1048,14 +1107,6 @@ path = Preferences; sourceTree = ""; }; - 2AEF160E12F786C700F495BE /* PlugIns */ = { - isa = PBXGroup; - children = ( - 2AEF168B12F7893500F495BE /* TinyGrab.bundle */, - ); - path = PlugIns; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -1178,6 +1229,23 @@ productReference = 2A5C1AF312F2FA6F005153FA /* WebDav.bundle */; productType = "com.apple.product-type.bundle"; }; + 2ACA5CC6160E763A00F294C2 /* TinyGrab */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2ACA5CD1160E763A00F294C2 /* Build configuration list for PBXNativeTarget "TinyGrab" */; + buildPhases = ( + 2ACA5CC3160E763A00F294C2 /* Sources */, + 2ACA5CC4160E763A00F294C2 /* Frameworks */, + 2ACA5CC5160E763A00F294C2 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TinyGrab; + productName = TinyGrab; + productReference = 2ACA5CC7160E763A00F294C2 /* TinyGrab.bundle */; + productType = "com.apple.product-type.bundle"; + }; 8D1107260486CEB800E47090 /* CocoaShare */ = { isa = PBXNativeTarget; buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "CocoaShare" */; @@ -1198,6 +1266,7 @@ 2A2F994C12F094EA0069B37E /* PBXTargetDependency */, 2A5C1B4712F32EDF005153FA /* PBXTargetDependency */, 2A0501FA12F49D54000F74EA /* PBXTargetDependency */, + 2ACA5CF8160E799400F294C2 /* PBXTargetDependency */, 2A0503CA12F4D460000F74EA /* PBXTargetDependency */, ); name = CocoaShare; @@ -1224,6 +1293,7 @@ portuguese, pt_PT, sv, + en, ); mainGroup = 29B97314FDCFA39411CA2CEA /* CocoaShare */; projectDirPath = ""; @@ -1236,6 +1306,7 @@ 2A2F994412F094710069B37E /* SFTP */, 2A5C1AF212F2FA6F005153FA /* WebDav */, 2A0501F012F49D08000F74EA /* MobileMe */, + 2ACA5CC6160E763A00F294C2 /* TinyGrab */, 2A0503C212F4D43B000F74EA /* twitpic */, 2AD9EFAD12FEE1E000FD7560 /* Build Directory */, ); @@ -1301,6 +1372,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 2ACA5CC5160E763A00F294C2 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2ACA5CF1160E782700F294C2 /* TinyGrabAccountPane.xib in Resources */, + 2ACA5CF3160E782700F294C2 /* tinygrab.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 8D1107290486CEB800E47090 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -1434,6 +1514,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 2ACA5CC3160E763A00F294C2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2ACA5CD8160E76C700F294C2 /* MGMTinyGrabPlugIn.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 8D11072C0486CEB800E47090 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1500,6 +1588,11 @@ target = 2A5C1AF212F2FA6F005153FA /* WebDav */; targetProxy = 2A5C1B4612F32EDF005153FA /* PBXContainerItemProxy */; }; + 2ACA5CF8160E799400F294C2 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 2ACA5CC6160E763A00F294C2 /* TinyGrab */; + targetProxy = 2ACA5CF7160E799400F294C2 /* PBXContainerItemProxy */; + }; 2AD9EFB312FEE51500FD7560 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 2AD9EFAD12FEE1E000FD7560 /* Build Directory */; @@ -1599,6 +1692,16 @@ name = twitpicPostWindow.xib; sourceTree = ""; }; + 2ACA5CEB160E782700F294C2 /* TinyGrabAccountPane.xib */ = { + isa = PBXVariantGroup; + children = ( + 2ACA5CEC160E782700F294C2 /* English */, + 2ACA5CEE160E782700F294C2 /* pt_PT */, + 2ACA5CEF160E782700F294C2 /* sv */, + ); + name = TinyGrabAccountPane.xib; + sourceTree = ""; + }; 2AEAB48312E2ADDF00552BAA /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( @@ -2026,6 +2129,77 @@ }; name = Release; }; + 2ACA5CD2160E763A00F294C2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/Frameworks\"", + ); + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Classes/TinyGrab/prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_UNINITIALIZED_AUTOS = NO; + INFOPLIST_FILE = Resources/TinyGrab/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; + OTHER_LDFLAGS = ( + "-undefined", + suppress, + "-undefined", + dynamic_lookup, + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = bundle; + }; + name = Debug; + }; + 2ACA5CD3160E763A00F294C2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/Frameworks\"", + ); + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Classes/TinyGrab/prefix.pch; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_UNINITIALIZED_AUTOS = NO; + INFOPLIST_FILE = Resources/TinyGrab/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; + OTHER_LDFLAGS = ( + "-undefined", + suppress, + "-undefined", + dynamic_lookup, + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = bundle; + }; + name = Release; + }; 2AD9EFAF12FEE24000FD7560 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2098,7 +2272,7 @@ "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.5; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; - SDKROOT = macosx10.6; + SDKROOT = macosx10.5; VALID_ARCHS = "ppc i386 x86_64"; }; name = Debug; @@ -2118,7 +2292,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.4; "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.5; PREBINDING = NO; - SDKROOT = macosx10.6; + SDKROOT = macosx10.5; VALID_ARCHS = "ppc i386 x86_64"; }; name = Release; @@ -2189,6 +2363,14 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 2ACA5CD1160E763A00F294C2 /* Build configuration list for PBXNativeTarget "TinyGrab" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2ACA5CD2160E763A00F294C2 /* Debug */, + 2ACA5CD3160E763A00F294C2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; 2AD9EFAE12FEE24000FD7560 /* Build configuration list for PBXAggregateTarget "Build Directory" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Frameworks/MGMUsers.framework/Versions/A/Headers/MGMPreferences.h b/Frameworks/MGMUsers.framework/Versions/A/Headers/MGMPreferences.h index 4c7bd1f..f6ba5b1 100644 --- a/Frameworks/MGMUsers.framework/Versions/A/Headers/MGMPreferences.h +++ b/Frameworks/MGMUsers.framework/Versions/A/Headers/MGMPreferences.h @@ -10,7 +10,11 @@ @class MGMPreferencesPane; -@interface MGMPreferences : NSObject { +@interface MGMPreferences : NSObject +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060) + +#endif +{ @private NSWindow *preferencesWindow; NSMutableArray *preferencesPanes; diff --git a/Frameworks/MGMUsers.framework/Versions/A/Resources/MGMTaskView.nib b/Frameworks/MGMUsers.framework/Versions/A/Resources/MGMTaskView.nib new file mode 100644 index 0000000..ef2ccee Binary files /dev/null and b/Frameworks/MGMUsers.framework/Versions/A/Resources/MGMTaskView.nib differ diff --git a/Frameworks/MGMUsers.framework/Versions/A/Resources/MGMTasksWindow.nib b/Frameworks/MGMUsers.framework/Versions/A/Resources/MGMTasksWindow.nib new file mode 100644 index 0000000..c2c6ac5 Binary files /dev/null and b/Frameworks/MGMUsers.framework/Versions/A/Resources/MGMTasksWindow.nib differ diff --git a/Frameworks/MGMUsers.framework/Versions/A/Resources/TaskRestart.png b/Frameworks/MGMUsers.framework/Versions/A/Resources/TaskRestart.png new file mode 100644 index 0000000..f3063a0 Binary files /dev/null and b/Frameworks/MGMUsers.framework/Versions/A/Resources/TaskRestart.png differ diff --git a/Frameworks/MGMUsers.framework/Versions/A/Resources/TaskRestartPressed.png b/Frameworks/MGMUsers.framework/Versions/A/Resources/TaskRestartPressed.png new file mode 100644 index 0000000..c686b41 Binary files /dev/null and b/Frameworks/MGMUsers.framework/Versions/A/Resources/TaskRestartPressed.png differ diff --git a/Frameworks/MGMUsers.framework/Versions/A/Resources/TaskReveal.png b/Frameworks/MGMUsers.framework/Versions/A/Resources/TaskReveal.png new file mode 100644 index 0000000..9c3e824 Binary files /dev/null and b/Frameworks/MGMUsers.framework/Versions/A/Resources/TaskReveal.png differ diff --git a/Frameworks/MGMUsers.framework/Versions/A/Resources/TaskRevealPressed.png b/Frameworks/MGMUsers.framework/Versions/A/Resources/TaskRevealPressed.png new file mode 100644 index 0000000..762cb80 Binary files /dev/null and b/Frameworks/MGMUsers.framework/Versions/A/Resources/TaskRevealPressed.png differ diff --git a/Frameworks/MGMUsers.framework/Versions/A/Resources/TaskStop.png b/Frameworks/MGMUsers.framework/Versions/A/Resources/TaskStop.png new file mode 100644 index 0000000..30a1cec Binary files /dev/null and b/Frameworks/MGMUsers.framework/Versions/A/Resources/TaskStop.png differ diff --git a/Frameworks/MGMUsers.framework/Versions/A/Resources/TaskStopPressed.png b/Frameworks/MGMUsers.framework/Versions/A/Resources/TaskStopPressed.png new file mode 100644 index 0000000..5982e27 Binary files /dev/null and b/Frameworks/MGMUsers.framework/Versions/A/Resources/TaskStopPressed.png differ diff --git a/PlugIns/TinyGrab.bundle/Contents/MacOS/TinyGrab b/PlugIns/TinyGrab.bundle/Contents/MacOS/TinyGrab deleted file mode 100755 index 5bec974..0000000 Binary files a/PlugIns/TinyGrab.bundle/Contents/MacOS/TinyGrab and /dev/null differ diff --git a/PlugIns/TinyGrab.bundle/Contents/Resources/English.lproj/TinyGrabAccountPane.nib b/PlugIns/TinyGrab.bundle/Contents/Resources/English.lproj/TinyGrabAccountPane.nib deleted file mode 100644 index 28737d7..0000000 Binary files a/PlugIns/TinyGrab.bundle/Contents/Resources/English.lproj/TinyGrabAccountPane.nib and /dev/null differ diff --git a/PlugIns/TinyGrab.bundle/Contents/Resources/pt_PT.lproj/TinyGrabAccountPane.nib b/PlugIns/TinyGrab.bundle/Contents/Resources/pt_PT.lproj/TinyGrabAccountPane.nib deleted file mode 100644 index 1a7e7b0..0000000 Binary files a/PlugIns/TinyGrab.bundle/Contents/Resources/pt_PT.lproj/TinyGrabAccountPane.nib and /dev/null differ diff --git a/PlugIns/TinyGrab.bundle/Contents/Resources/sv.lproj/TinyGrabAccountPane.nib b/PlugIns/TinyGrab.bundle/Contents/Resources/sv.lproj/TinyGrabAccountPane.nib deleted file mode 100644 index c1f3849..0000000 Binary files a/PlugIns/TinyGrab.bundle/Contents/Resources/sv.lproj/TinyGrabAccountPane.nib and /dev/null differ diff --git a/Resources/TinyGrab/English.lproj/TinyGrabAccountPane.xib b/Resources/TinyGrab/English.lproj/TinyGrabAccountPane.xib new file mode 100644 index 0000000..ec3badc --- /dev/null +++ b/Resources/TinyGrab/English.lproj/TinyGrabAccountPane.xib @@ -0,0 +1,718 @@ + + + + 1050 + 10J567 + 823 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 823 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + MGMTinyGrabPlugIn + + + FirstResponder + + + NSApplication + + + + 268 + + YES + + + 256 + + YES + + YES + 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 + + + {{220, 3}, {100, 100}} + + YES + + 130560 + 33554432 + + NSImage + tinygrab + + 0 + 0 + 0 + YES + + YES + + + + 268 + {{14, 12}, {92, 32}} + + YES + + 67239424 + 134217728 + Register + + LucidaGrande + 13 + 1044 + + + -2038284033 + 129 + + + 200 + 25 + + + + + 268 + {{87, 78}, {123, 17}} + + YES + + 68288064 + 272630784 + Unknown + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2ODY1AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 268 + {{17, 78}, {68, 17}} + + YES + + 68288064 + 71304192 + Type: + + + + + + + + + 268 + {{106, 12}, {107, 32}} + + YES + + 67239424 + 134217728 + Login + + + -2038284033 + 129 + + DQ + 200 + 25 + + + + + 268 + {{90, 101}, {222, 22}} + + YES + + 343014976 + 272630784 + + + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + + + YES + NSAllRomanInputSourcesLocaleIdentifier + + + + + + 268 + {{90, 126}, {222, 22}} + + YES + + -1804468671 + 272630784 + + + + YES + + + + + + + 268 + {{17, 103}, {68, 17}} + + YES + + 68288064 + 71304192 + Password: + + + + + + + + + 268 + {{17, 128}, {68, 17}} + + YES + + 68288064 + 71304192 + Email: + + + + + + + + {332, 168} + + NSView + + + + + YES + + + nextKeyView + + + + 12 + + + + emailField + + + + 13 + + + + passwordField + + + + 14 + + + + view + + + + 15 + + + + loginButton + + + + 16 + + + + login: + + + + 17 + + + + registerAccount: + + + + 24 + + + + typeField + + + + 25 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + + + + + + + + + + + 2 + + + YES + + + + + + 3 + + + YES + + + + + + 4 + + + YES + + + + + + 5 + + + YES + + + + + + 6 + + + YES + + + + + + 7 + + + + + 8 + + + + + 9 + + + + + 10 + + + + + 11 + + + + + 18 + + + YES + + + + + + 19 + + + + + 20 + + + YES + + + + + + 21 + + + + + 22 + + + YES + + + + + + 23 + + + + + 26 + + + YES + + + + + + 27 + + + + + + + YES + + YES + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 1.WindowOrigin + 1.editorWindowContentRectSynchronizationRect + 10.IBPluginDependency + 11.IBPluginDependency + 18.IBPluginDependency + 18.IBViewBoundsToFrameTransform + 19.IBPluginDependency + 2.IBPluginDependency + 2.IBViewBoundsToFrameTransform + 20.IBPluginDependency + 20.IBViewBoundsToFrameTransform + 21.IBPluginDependency + 22.IBPluginDependency + 22.IBViewBoundsToFrameTransform + 23.IBPluginDependency + 26.IBViewBoundsToFrameTransform + 3.IBPluginDependency + 3.IBViewBoundsToFrameTransform + 4.IBPluginDependency + 4.IBViewBoundsToFrameTransform + 5.IBPluginDependency + 5.IBViewBoundsToFrameTransform + 6.IBPluginDependency + 6.IBViewBoundsToFrameTransform + 7.IBPluginDependency + 8.IBPluginDependency + 9.IBPluginDependency + + + YES + {{322, 588}, {332, 168}} + com.apple.InterfaceBuilder.CocoaPlugin + {628, 654} + {{217, 442}, {480, 272}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBiAAAwnwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBiAAAwuIAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCrgAAwnwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABC7gAAwigAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + AUMDAABDMAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBiAAAwrAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCtAAAwugAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCtAAAwrYAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCtgAAwigAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 27 + + + + YES + + MGMTinyGrabPlugIn + NSObject + + YES + + YES + login: + registerAccount: + + + YES + id + id + + + + YES + + YES + login: + registerAccount: + + + YES + + login: + id + + + registerAccount: + id + + + + + YES + + YES + emailField + loginButton + passwordField + typeField + view + + + YES + NSTextField + NSButton + NSTextField + NSTextField + NSView + + + + YES + + YES + emailField + loginButton + passwordField + typeField + view + + + YES + + emailField + NSTextField + + + loginButton + NSButton + + + passwordField + NSTextField + + + typeField + NSTextField + + + view + NSView + + + + + IBProjectSource + Classes/MGMTinyGrabPlugIn.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../../TinyGrabPlugIn.xcodeproj + 3 + + tinygrab + {100, 100} + + + diff --git a/PlugIns/TinyGrab.bundle/Contents/Info.plist b/Resources/TinyGrab/Info.plist similarity index 58% rename from PlugIns/TinyGrab.bundle/Contents/Info.plist rename to Resources/TinyGrab/Info.plist index a60301a..8625f2a 100644 --- a/PlugIns/TinyGrab.bundle/Contents/Info.plist +++ b/Resources/TinyGrab/Info.plist @@ -2,14 +2,12 @@ - BuildMachineOSBuild - 10J567 CFBundleDevelopmentRegion English CFBundleExecutable - TinyGrab + ${EXECUTABLE_NAME} CFBundleIdentifier - com.TinyGrab.TinyGrab + com.TinyGrab.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType @@ -20,20 +18,6 @@ ???? CFBundleVersion 0.1 - DTCompiler - 4.2 - DTPlatformBuild - 4A278b - DTPlatformVersion - GM - DTSDKBuild - 4A278b - DTSDKName - macosx10.6 - DTXcode - 0400 - DTXcodeBuild - 4A278b NSPrincipalClass MGMTinyGrabPlugIn diff --git a/Resources/TinyGrab/pt_PT.lproj/TinyGrabAccountPane.xib b/Resources/TinyGrab/pt_PT.lproj/TinyGrabAccountPane.xib new file mode 100644 index 0000000..304f50c --- /dev/null +++ b/Resources/TinyGrab/pt_PT.lproj/TinyGrabAccountPane.xib @@ -0,0 +1,718 @@ + + + + 1050 + 10J567 + 823 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 823 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + MGMTinyGrabPlugIn + + + FirstResponder + + + NSApplication + + + + 268 + + YES + + + 256 + + YES + + YES + 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 + + + {{220, 12}, {100, 100}} + + YES + + 130560 + 33554432 + + NSImage + tinygrab + + 0 + 0 + 0 + YES + + YES + + + + 268 + {{14, 12}, {92, 32}} + + YES + + 67239424 + 134217728 + Registar + + LucidaGrande + 13 + 1044 + + + -2038284033 + 129 + + + 200 + 25 + + + + + 268 + {{87, 87}, {123, 17}} + + YES + + 68288064 + 272630784 + Desconhecido + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2ODY1AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 268 + {{17, 87}, {68, 17}} + + YES + + 68288064 + 71304192 + Tipo: + + + + + + + + + 268 + {{106, 12}, {138, 32}} + + YES + + 67239424 + 134217728 + Iniciar Sessão + + + -2038284033 + 129 + + DQ + 200 + 25 + + + + + 268 + {{90, 110}, {222, 22}} + + YES + + 343014976 + 272630784 + + + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + + + YES + NSAllRomanInputSourcesLocaleIdentifier + + + + + + 268 + {{90, 135}, {222, 22}} + + YES + + -1804468671 + 272630784 + + + + YES + + + + + + + 268 + {{17, 112}, {68, 17}} + + YES + + 68288064 + 71304192 + Password: + + + + + + + + + 268 + {{17, 137}, {68, 17}} + + YES + + 68288064 + 71304192 + Email: + + + + + + + + {332, 177} + + NSView + + + + + YES + + + nextKeyView + + + + 12 + + + + emailField + + + + 13 + + + + passwordField + + + + 14 + + + + view + + + + 15 + + + + loginButton + + + + 16 + + + + login: + + + + 17 + + + + registerAccount: + + + + 24 + + + + typeField + + + + 25 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + + + + + + + + + + + 2 + + + YES + + + + + + 3 + + + YES + + + + + + 4 + + + YES + + + + + + 5 + + + YES + + + + + + 6 + + + YES + + + + + + 7 + + + + + 8 + + + + + 9 + + + + + 10 + + + + + 11 + + + + + 18 + + + YES + + + + + + 19 + + + + + 20 + + + YES + + + + + + 21 + + + + + 22 + + + YES + + + + + + 23 + + + + + 26 + + + YES + + + + + + 27 + + + + + + + YES + + YES + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 1.WindowOrigin + 1.editorWindowContentRectSynchronizationRect + 10.IBPluginDependency + 11.IBPluginDependency + 18.IBPluginDependency + 18.IBViewBoundsToFrameTransform + 19.IBPluginDependency + 2.IBPluginDependency + 2.IBViewBoundsToFrameTransform + 20.IBPluginDependency + 20.IBViewBoundsToFrameTransform + 21.IBPluginDependency + 22.IBPluginDependency + 22.IBViewBoundsToFrameTransform + 23.IBPluginDependency + 26.IBViewBoundsToFrameTransform + 3.IBPluginDependency + 3.IBViewBoundsToFrameTransform + 4.IBPluginDependency + 4.IBViewBoundsToFrameTransform + 5.IBPluginDependency + 5.IBViewBoundsToFrameTransform + 6.IBPluginDependency + 6.IBViewBoundsToFrameTransform + 7.IBPluginDependency + 8.IBPluginDependency + 9.IBPluginDependency + + + YES + {{322, 579}, {332, 177}} + com.apple.InterfaceBuilder.CocoaPlugin + {628, 654} + {{217, 442}, {480, 272}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBiAAAwnwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBiAAAwuIAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCrgAAwnwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABC7gAAwigAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + AUMDAABDMAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBiAAAwrAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCtAAAwugAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCtAAAwrYAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCtgAAwigAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 27 + + + + YES + + MGMTinyGrabPlugIn + NSObject + + YES + + YES + login: + registerAccount: + + + YES + id + id + + + + YES + + YES + login: + registerAccount: + + + YES + + login: + id + + + registerAccount: + id + + + + + YES + + YES + emailField + loginButton + passwordField + typeField + view + + + YES + NSTextField + NSButton + NSTextField + NSTextField + NSView + + + + YES + + YES + emailField + loginButton + passwordField + typeField + view + + + YES + + emailField + NSTextField + + + loginButton + NSButton + + + passwordField + NSTextField + + + typeField + NSTextField + + + view + NSView + + + + + IBProjectSource + Classes/MGMTinyGrabPlugIn.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../../TinyGrabPlugIn.xcodeproj + 3 + + tinygrab + {100, 100} + + + diff --git a/Resources/TinyGrab/sv.lproj/TinyGrabAccountPane.xib b/Resources/TinyGrab/sv.lproj/TinyGrabAccountPane.xib new file mode 100644 index 0000000..95060e0 --- /dev/null +++ b/Resources/TinyGrab/sv.lproj/TinyGrabAccountPane.xib @@ -0,0 +1,719 @@ + + + + 1050 + 10J567 + 1294 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1294 + + + YES + NSTextFieldCell + NSCustomView + NSCustomObject + NSButton + NSSecureTextField + NSTextField + NSSecureTextFieldCell + NSImageView + NSImageCell + NSButtonCell + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + + + YES + + MGMTinyGrabPlugIn + + + FirstResponder + + + NSApplication + + + + 268 + + YES + + + 256 + + YES + + YES + 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 + + + {{220, 3}, {100, 100}} + + + + YES + + 130560 + 33554432 + + NSImage + tinygrab + + 0 + 0 + 0 + YES + + YES + + + + 268 + {{14, 12}, {104, 32}} + + + + YES + + 67239424 + 134217728 + Registrera + + LucidaGrande + 13 + 1044 + + + -2038284033 + 129 + + + 200 + 25 + + + + + 268 + {{87, 78}, {123, 17}} + + + + YES + + 68288064 + 272630784 + Okänd + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2ODY1AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 268 + {{17, 78}, {68, 17}} + + + + YES + + 68288064 + 71304192 + Typ: + + + + + + + + + 268 + {{118, 12}, {108, 32}} + + + + YES + + 67239424 + 134217728 + Inloggning + + + -2038284033 + 129 + + DQ + 200 + 25 + + + + + 268 + {{90, 101}, {222, 22}} + + + + YES + + 343014976 + 272630784 + + + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + + + YES + NSAllRomanInputSourcesLocaleIdentifier + + + + + + 268 + {{90, 126}, {222, 22}} + + + + YES + + -1804468671 + 272630784 + + + + YES + + + + + + + 268 + {{17, 103}, {68, 17}} + + + + YES + + 68288064 + 71304192 + Lösenord: + + + + + + + + + 268 + {{17, 128}, {68, 17}} + + + + YES + + 68288064 + 71304192 + Epost: + + + + + + + + {332, 168} + + + + NSView + + + + + YES + + + nextKeyView + + + + 12 + + + + emailField + + + + 13 + + + + passwordField + + + + 14 + + + + view + + + + 15 + + + + loginButton + + + + 16 + + + + login: + + + + 17 + + + + registerAccount: + + + + 24 + + + + typeField + + + + 25 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + + + + + + + + + + + 2 + + + YES + + + + + + 3 + + + YES + + + + + + 4 + + + YES + + + + + + 5 + + + YES + + + + + + 6 + + + YES + + + + + + 7 + + + + + 8 + + + + + 9 + + + + + 10 + + + + + 11 + + + + + 18 + + + YES + + + + + + 19 + + + + + 20 + + + YES + + + + + + 21 + + + + + 22 + + + YES + + + + + + 23 + + + + + 26 + + + YES + + + + + + 27 + + + + + + + YES + + YES + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 1.WindowOrigin + 1.editorWindowContentRectSynchronizationRect + 10.IBPluginDependency + 11.IBPluginDependency + 18.IBPluginDependency + 18.IBViewBoundsToFrameTransform + 19.IBPluginDependency + 2.IBPluginDependency + 2.IBViewBoundsToFrameTransform + 20.IBPluginDependency + 20.IBViewBoundsToFrameTransform + 21.IBPluginDependency + 22.IBPluginDependency + 22.IBViewBoundsToFrameTransform + 23.IBPluginDependency + 26.IBViewBoundsToFrameTransform + 3.IBPluginDependency + 3.IBViewBoundsToFrameTransform + 4.IBPluginDependency + 4.IBViewBoundsToFrameTransform + 5.IBPluginDependency + 5.IBViewBoundsToFrameTransform + 6.IBPluginDependency + 6.IBViewBoundsToFrameTransform + 7.IBPluginDependency + 8.IBPluginDependency + 9.IBPluginDependency + + + YES + {{322, 588}, {332, 168}} + com.apple.InterfaceBuilder.CocoaPlugin + {628, 654} + {{217, 442}, {480, 272}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBiAAAwnwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBiAAAwuIAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCrgAAwnwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABC7gAAwigAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + AUMDAABDMAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBiAAAwrAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCtAAAwugAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCtAAAwrYAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCtgAAwigAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + + + + YES + + + + + 27 + + + + YES + + MGMTinyGrabPlugIn + NSObject + + registerAccount: + id + + + registerAccount: + + registerAccount: + id + + + + YES + + YES + emailField + loginButton + passwordField + typeField + view + + + YES + NSTextField + NSButton + NSTextField + NSTextField + NSView + + + + YES + + YES + emailField + loginButton + passwordField + typeField + view + + + YES + + emailField + NSTextField + + + loginButton + NSButton + + + passwordField + NSTextField + + + typeField + NSTextField + + + view + NSView + + + + + IBProjectSource + ./Classes/MGMTinyGrabPlugIn.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + tinygrab + {100, 100} + + + diff --git a/PlugIns/TinyGrab.bundle/Contents/Resources/tinygrab.png b/Resources/TinyGrab/tinygrab.png similarity index 100% rename from PlugIns/TinyGrab.bundle/Contents/Resources/tinygrab.png rename to Resources/TinyGrab/tinygrab.png diff --git a/index.php b/index.php index fd1969e..f7ddb8a 100644 --- a/index.php +++ b/index.php @@ -8,7 +8,7 @@ // $_CS = array(); -$_CS['version'] = "0.1"; +$_CS['version'] = "0.2"; $_CS['time'] = time(); // You are expected to understand a little PHP to use this file. @@ -36,7 +36,7 @@ exit(); // End of MD5 code. */ -$_CS['domain'] = $_SERVER['SERVER_NAME']; +$_CS['domain'] = $_SERVER['HTTP_HOST']; $_CS['port'] = $_SERVER['SERVER_PORT']; $_CS['ssl'] = ($_SERVER['HTTPS']=="on");