diff --git a/QuickHub.xcodeproj/project.xcworkspace/xcshareddata/QuickHub.xccheckout b/QuickHub.xcodeproj/project.xcworkspace/xcshareddata/QuickHub.xccheckout new file mode 100644 index 0000000..50fa269 --- /dev/null +++ b/QuickHub.xcodeproj/project.xcworkspace/xcshareddata/QuickHub.xccheckout @@ -0,0 +1,41 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + 3DAAF321-F23F-418B-8878-D99A92673548 + IDESourceControlProjectName + QuickHub + IDESourceControlProjectOriginsDictionary + + 24BAD9B4CF1311EFC6A9026B58DA4C7681205F39 + https://github.com/chamerling/QuickHubApp + + IDESourceControlProjectPath + QuickHub.xcodeproj + IDESourceControlProjectRelativeInstallPathDictionary + + 24BAD9B4CF1311EFC6A9026B58DA4C7681205F39 + ../.. + + IDESourceControlProjectURL + https://github.com/chamerling/QuickHubApp + IDESourceControlProjectVersion + 111 + IDESourceControlProjectWCCIdentifier + 24BAD9B4CF1311EFC6A9026B58DA4C7681205F39 + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 24BAD9B4CF1311EFC6A9026B58DA4C7681205F39 + IDESourceControlWCCName + QuickHubApp + + + + diff --git a/QuickHubApp/AppController.m b/QuickHubApp/AppController.m index 3025ae6..118fd24 100644 --- a/QuickHubApp/AppController.m +++ b/QuickHubApp/AppController.m @@ -173,7 +173,7 @@ - (void) stopAll:(id)sender { } // Signal for the thread to be deleted - dispatch_semaphore_signal(runloopSemaphore); +// dispatch_semaphore_signal(runloopSemaphore); NSLog(@"Stopped!"); } diff --git a/QuickHubApp/MenuController.m b/QuickHubApp/MenuController.m index b27bfda..5c52cb3 100644 --- a/QuickHubApp/MenuController.m +++ b/QuickHubApp/MenuController.m @@ -30,7 +30,7 @@ #import "EventMenuItemController.h" #import "EventMenuItemView.h" -@interface MenuController (Private) +@interface MenuController (Private) - (NSMenu*) getIssuesMenu; - (NSMenu*) getOrgsMenu; - (NSMenu*) getReposMenu; @@ -79,19 +79,19 @@ - (id)init // register to notifications so that the menu can be updated when data is retrieved from github... - (void) awakeFromNib { //NSLog(@"Registering notifications listeners for the menu controller"); - + // register to internet connection changes so that we can update the first entry... - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(notifyInternet:) - name:NOTIFY_INTERNET_UP - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(notifyInternet:) - name:NOTIFY_INTERNET_DOWN - object:nil]; - - + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(notifyInternet:) + name:NOTIFY_INTERNET_UP + object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(notifyInternet:) + name:NOTIFY_INTERNET_DOWN + object:nil]; + + } - (void)cleanMenus:(id)sender { @@ -119,7 +119,7 @@ - (void)cleanMenus:(id)sender { menuItem = [statusMenu itemWithTitle:@"Pull Requests"]; menu = [menuItem submenu]; [self deleteOldEntriesFromMenu:menu fromItemTitle:@"deletelimit"]; - + // Delete users menuItem = [statusMenu itemWithTitle:@"Users"]; NSMenu *tmp = [menuItem submenu]; @@ -163,8 +163,12 @@ - (void) issuesFinished:(NSDictionary *)result { // process added and removed issues NSMutableSet* justGetIssues = [[NSMutableSet alloc] init]; - for (NSArray *issue in result) { - [justGetIssues addObject:[issue valueForKey:@"number"]]; + + for (id issue in result) { + + if ([issue isKindOfClass:[NSDictionary class]] && [[issue allKeys] containsObject:@"number"]) { + [justGetIssues addObject:[issue valueForKey:@"number"]]; + } } NSMutableSet* removedIssues = [NSMutableSet setWithSet:existingIssues]; @@ -175,8 +179,8 @@ - (void) issuesFinished:(NSDictionary *)result { if ([removedIssues count] > 1) { title = [NSString stringWithFormat:@"OMG, %d less issues", [removedIssues count]]; } - [[NSNotificationCenter defaultCenter] postNotificationName:GENERIC_NOTIFICATION - object:title + [[NSNotificationCenter defaultCenter] postNotificationName:GENERIC_NOTIFICATION + object:title userInfo:nil]; } @@ -185,16 +189,16 @@ - (void) issuesFinished:(NSDictionary *)result { if ([addedIssues count] > 0 && !firstIssueCall) { if ([addedIssues count] > 3) { - [[NSNotificationCenter defaultCenter] postNotificationName:GENERIC_NOTIFICATION - object:[NSString stringWithFormat:@"%d new issues...", [addedIssues count]] + [[NSNotificationCenter defaultCenter] postNotificationName:GENERIC_NOTIFICATION + object:[NSString stringWithFormat:@"%d new issues...", [addedIssues count]] userInfo:nil]; } else { for (NSString *key in addedIssues) { for (NSArray *issue in result) { if ([issue valueForKey:@"number"] == key) { NSString *title = [issue valueForKey:@"title"]; - [[NSNotificationCenter defaultCenter] postNotificationName:GITHUB_NOTIFICATION_ISSUE_ADDED - object:[NSString stringWithFormat:@"%@", title] userInfo:nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:GITHUB_NOTIFICATION_ISSUE_ADDED + object:[NSString stringWithFormat:@"%@", title] userInfo:nil]; } } } @@ -209,10 +213,14 @@ - (void) issuesFinished:(NSDictionary *)result { } // clear the existing Issues - existingIssues = [[NSMutableSet alloc]init]; + existingIssues = [[NSMutableSet alloc]init]; - for (NSDictionary *issue in result) { - [existingIssues addObject:[issue valueForKey:@"number"]]; + for (id issue in result) { + + if ([issue isKindOfClass:[NSDictionary class]] && [[issue allKeys] containsObject:@"number"]) { + [justGetIssues addObject:[issue valueForKey:@"number"]]; + [existingIssues addObject:[issue valueForKey:@"number"]]; + } if (clean) { [self addIssue:issue top:NO]; } @@ -233,7 +241,7 @@ - (void) gistFinished:(NSDictionary *)result { NSMenuItem *menuItem = [statusMenu itemWithTitle:@"Gists"]; NSMenu *menu = [menuItem submenu]; - + // process added and removed issues NSMutableSet* justGet = [[NSMutableSet alloc] init]; for (NSArray *issue in result) { @@ -249,9 +257,9 @@ - (void) gistFinished:(NSDictionary *)result { } else { title = [NSString stringWithString:@"RIP gist #"]; } - [[NSNotificationCenter defaultCenter] postNotificationName:GENERIC_NOTIFICATION - object:title - userInfo:nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:GENERIC_NOTIFICATION + object:title + userInfo:nil]; } NSMutableSet* added = [NSMutableSet setWithSet:justGet]; @@ -259,8 +267,8 @@ - (void) gistFinished:(NSDictionary *)result { if ([added count] > 0 && !firstGistCall) { if ([added count] > 3) { - [[NSNotificationCenter defaultCenter] postNotificationName:GENERIC_NOTIFICATION - object:[NSString stringWithFormat:@"%d new gists!", [added count]] + [[NSNotificationCenter defaultCenter] postNotificationName:GENERIC_NOTIFICATION + object:[NSString stringWithFormat:@"%d new gists!", [added count]] userInfo:nil]; } else { for (NSString *key in added) { @@ -273,8 +281,8 @@ - (void) gistFinished:(NSDictionary *)result { } else { title = [NSString stringWithFormat:@"gist %@ : %@", [issue valueForKey:@"id"], description]; } - [[NSNotificationCenter defaultCenter] postNotificationName:GITHUB_NOTIFICATION_GIST_ADDED - object:[NSString stringWithFormat:@"%@", title] userInfo:nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:GITHUB_NOTIFICATION_GIST_ADDED + object:[NSString stringWithFormat:@"%@", title] userInfo:nil]; } } } @@ -290,7 +298,7 @@ - (void) gistFinished:(NSDictionary *)result { } // clear the existing Issues - existingGists = [[NSMutableSet alloc]init]; + existingGists = [[NSMutableSet alloc]init]; for (NSDictionary *gist in result) { // cache for next time... @@ -344,7 +352,7 @@ - (void) organizationsFinished:(NSDictionary *)result { [organizationItem autorelease]; [menu addItem:organizationItem]; //[self addItem:organizationItem to:menu top:FALSE]; - + NSDictionary* repos = [entry valueForKey:@"repos"]; NSMenu* repositoriesMenu = [[NSMenu alloc] init]; @@ -385,7 +393,7 @@ - (void) organizationsFinished:(NSDictionary *)result { // HERE for (NSDictionary *repo in sorted) { NSMenuItem *organizationRepoItem = [[NSMenuItem alloc] initWithTitle:[repo valueForKey:@"name"] action:@selector(repoPressed:) keyEquivalent:@""]; - + [organizationRepoItem setRepresentedObject:[repo valueForKey:@"html_url"]]; NSNumber *priv = [repo valueForKey:@"private"]; @@ -416,14 +424,14 @@ - (void) organizationsFinished:(NSDictionary *)result { [popoverMenuItem setView:[details view]]; [popoverMenuItem autorelease]; - NSMenu *foomenu = [[NSMenu alloc] init]; + NSMenu *foomenu = [[NSMenu alloc] init]; [foomenu addItem:popoverMenuItem]; [organizationRepoItem setSubmenu:foomenu]; [repositoriesMenu addItem:organizationRepoItem]; } } - [organizationItem setSubmenu:repositoriesMenu]; + [organizationItem setSubmenu:repositoriesMenu]; } if (!result || [result count] == 0) { @@ -453,8 +461,8 @@ - (void) reposFinished:(NSDictionary *)result { [removed minusSet:justGet]; if ([removed count] > 0 && !firstRepositoryCall) { for (NSString *repo in removed) { - [[NSNotificationCenter defaultCenter] postNotificationName:GENERIC_NOTIFICATION - object:[NSString stringWithFormat:@"RIP repository '%@'", repo] userInfo:nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:GENERIC_NOTIFICATION + object:[NSString stringWithFormat:@"RIP repository '%@'", repo] userInfo:nil]; } } @@ -462,16 +470,16 @@ - (void) reposFinished:(NSDictionary *)result { [added minusSet:existingRepos]; if ([added count] > 0 && !firstRepositoryCall) { if ([added count] > 3) { - [[NSNotificationCenter defaultCenter] postNotificationName:GENERIC_NOTIFICATION - object:[NSString stringWithFormat:@"%d new repositories! Take coffee and code!", [added count]] + [[NSNotificationCenter defaultCenter] postNotificationName:GENERIC_NOTIFICATION + object:[NSString stringWithFormat:@"%d new repositories! Take coffee and code!", [added count]] userInfo:nil]; } else { for (NSString *key in added) { for (NSArray *issue in result) { if ([[issue valueForKey:@"name"] isEqual:key]) { NSString *title = [issue valueForKey:@"name"]; - [[NSNotificationCenter defaultCenter] postNotificationName:GENERIC_NOTIFICATION - object:[NSString stringWithFormat:@"New repository '%@'", title] userInfo:nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:GENERIC_NOTIFICATION + object:[NSString stringWithFormat:@"New repository '%@'", title] userInfo:nil]; } } } @@ -485,7 +493,7 @@ - (void) reposFinished:(NSDictionary *)result { } // clear the existing repos - existingRepos = [[NSMutableSet alloc]init]; + existingRepos = [[NSMutableSet alloc]init]; // create an array from the JKArray in order to be able to sort it... // to be removed and updated the day JSONKit is no more used @@ -500,7 +508,7 @@ - (void) reposFinished:(NSDictionary *)result { }]; for (NSDictionary *repo in sorted) { - [existingRepos addObject:[repo valueForKey:@"name"]]; + [existingRepos addObject:[repo valueForKey:@"name"]]; if (clean) { [self addRepo:repo top:NO]; } @@ -549,7 +557,7 @@ - (void)pullsFinished:(NSDictionary *)dictionary { [item autorelease]; [menu addItem:item]; //[self addItem:item to:menu top:FALSE]; - + // add submenus and item for each pull NSMenu* pullsMenu = [[NSMenu alloc] init]; for (NSArray *pull in pulls) { @@ -561,14 +569,14 @@ - (void)pullsFinished:(NSDictionary *)dictionary { [pullItem autorelease]; [pullsMenu addItem:pullItem]; //[self addItem:pullItem to:pullsMenu top:FALSE]; - + } [item setSubmenu:pullsMenu]; } if (!keys || [keys count] == 0) { // default menu item [self deleteOldEntriesFromMenu:menu fromItemTitle:@"deletelimit"]; - + NSMenuItem *defaultItem = [[NSMenuItem alloc] initWithTitle:@"No pull requests" action:nil keyEquivalent:@""]; [defaultItem autorelease]; [menu addItem:defaultItem]; @@ -612,7 +620,7 @@ - (void) followersFinished:(NSDictionary *)result { [defaultItem autorelease]; //[menu addItem:defaultItem]; [self addItem:defaultItem to:menu top:FALSE]; - } + } } - (void) followingsFinished:(NSDictionary *)result { @@ -623,7 +631,7 @@ - (void) followingsFinished:(NSDictionary *)result { NSMenuItem *followingsItem = [tmp itemWithTitle:@"Following"]; NSMenu *menu = [followingsItem submenu]; - + // always delete... // FIXME = just add or delete the diff [self deleteOldEntriesFromMenu:menu fromItemTitle:@"deletelimit"]; @@ -658,7 +666,7 @@ - (void) watchedReposFinished:(NSDictionary *)result { NSMenuItem *menuItem = [statusMenu itemWithTitle:@"Watching"]; NSMenu *menu = [menuItem submenu]; - + // always delete... // FIXME : just delete or add the diff [self deleteOldEntriesFromMenu:menu fromItemTitle:@"deletelimit"]; @@ -702,8 +710,8 @@ - (void) addIssue:(NSDictionary *)issue top:(BOOL)top { // get the repository name from the API url such as // 'https://api.github.com/repos/Jug-Montpellier/play-Jug/2' or 'https://api.github.com/repos/chamerling/JugApp/issues/1' - NSString *apiURL = [issue valueForKey:@"url"]; - NSString *repoName = [NSString stringWithString:[apiURL substringFromIndex:([[NSString stringWithString:@"https://api.github.com/repos/"] length])]]; + NSString *apiURL = [issue valueForKey:@"url"]; + NSString *repoName = [NSString stringWithString:[apiURL substringFromIndex:([[NSString stringWithString:@"https://api.github.com/repos/"] length])]]; if ([repoName rangeOfString:[NSString stringWithFormat:@"%@/", [[Preferences sharedInstance] login]]].length > 0) { repoName = [NSString stringWithString:[repoName substringFromIndex:([[NSString stringWithFormat:@"%@/", [[Preferences sharedInstance] login]] length])]]; repoName = [repoName substringToIndex:[repoName rangeOfString:@"/issues"].location]; @@ -724,7 +732,7 @@ - (void) addIssue:(NSDictionary *)issue top:(BOOL)top { } else { iconImage = [NSImage imageNamed:@"bullet_yellow.png"]; } - + [iconImage setSize:NSMakeSize(16,16)]; [issueItem setImage:iconImage]; [issueItem autorelease]; @@ -764,7 +772,7 @@ - (void) addGist:(NSDictionary *)gist top:(BOOL)top { - (void) addOrg:(NSDictionary *)org { //NSMenu *menu = [self getOrgsMenu]; - + } - (void) addRepo:(NSDictionary *)repo top:(BOOL)top{ @@ -806,12 +814,12 @@ - (void) addRepo:(NSDictionary *)repo top:(BOOL)top{ [popoverMenuItem setView:[details view]]; [popoverMenuItem autorelease]; - NSMenu *foomenu = [[NSMenu alloc] init]; + NSMenu *foomenu = [[NSMenu alloc] init]; [foomenu addItem:popoverMenuItem]; [organizationItem setSubmenu:foomenu]; [self addItem:organizationItem to:menu top:top]; - + } - (void) addOrgRepo:(NSString *)orgName withRepo:(NSDictionary *)repo top:(BOOL)top { @@ -819,7 +827,7 @@ - (void) addOrgRepo:(NSString *)orgName withRepo:(NSDictionary *)repo top:(BOOL) if (menu) { NSMenuItem *repoItem = [self createMenuItemForOrgRepo:repo]; [self addItem:repoItem to:menu top:top]; - + } else { //NSLog(@"Repo menu not found"); } @@ -836,17 +844,17 @@ - (void) addFollower:(NSDictionary *)user { // ID CARD /* - UserDetailsViewController *details = [[UserDetailsViewController alloc] initWithNibName:@"UserDetailsViewController" bundle:nil]; - [details setUserData:user]; - - NSMenuItem *popoverMenuItem = [[NSMenuItem alloc] init]; - [popoverMenuItem setView:[details view]]; - [popoverMenuItem autorelease]; - - NSMenu *foomenu = [[NSMenu alloc] init]; - [foomenu addItem:popoverMenuItem]; - [item setSubmenu:foomenu]; - */ + UserDetailsViewController *details = [[UserDetailsViewController alloc] initWithNibName:@"UserDetailsViewController" bundle:nil]; + [details setUserData:user]; + + NSMenuItem *popoverMenuItem = [[NSMenuItem alloc] init]; + [popoverMenuItem setView:[details view]]; + [popoverMenuItem autorelease]; + + NSMenu *foomenu = [[NSMenu alloc] init]; + [foomenu addItem:popoverMenuItem]; + [item setSubmenu:foomenu]; + */ [self addItem:item to:menu top:FALSE]; } @@ -863,18 +871,18 @@ - (void) addFollowing:(NSDictionary *)user { // ID CARD /* - UserDetailsViewController *details = [[UserDetailsViewController alloc] initWithNibName:@"UserDetailsViewController" bundle:nil]; - [details setUserData:user]; - - NSMenuItem *popoverMenuItem = [[NSMenuItem alloc] init]; - [popoverMenuItem setView:[details view]]; - [popoverMenuItem autorelease]; - - NSMenu *foomenu = [[NSMenu alloc] init]; - [foomenu addItem:popoverMenuItem]; - [item setSubmenu:foomenu]; + UserDetailsViewController *details = [[UserDetailsViewController alloc] initWithNibName:@"UserDetailsViewController" bundle:nil]; + [details setUserData:user]; + + NSMenuItem *popoverMenuItem = [[NSMenuItem alloc] init]; + [popoverMenuItem setView:[details view]]; + [popoverMenuItem autorelease]; + + NSMenu *foomenu = [[NSMenu alloc] init]; + [foomenu addItem:popoverMenuItem]; + [item setSubmenu:foomenu]; */ - + [self addItem:item to:menu top:FALSE]; } @@ -904,7 +912,7 @@ - (void) addWatched:(NSDictionary *)repo { [popoverMenuItem setView:[details view]]; [popoverMenuItem autorelease]; - NSMenu *foomenu = [[NSMenu alloc] init]; + NSMenu *foomenu = [[NSMenu alloc] init]; [foomenu addItem:popoverMenuItem]; [item setSubmenu:foomenu]; @@ -913,13 +921,13 @@ - (void) addWatched:(NSDictionary *)repo { - (void) addEvent:(NSDictionary *)event top:(BOOL)top { /*NSMenuItem *eventItem = [[NSMenuItem alloc] initWithTitle:[event valueForKey:@"message"] action:@selector(eventPressed:) keyEquivalent:@""]; + + [eventItem setRepresentedObject:[event valueForKey:@"url"]]; + [eventItem setEnabled:YES]; + [eventItem autorelease]; + */ - [eventItem setRepresentedObject:[event valueForKey:@"url"]]; - [eventItem setEnabled:YES]; - [eventItem autorelease]; - */ - NSMenuItem *eventItem = [[NSMenuItem alloc] initWithTitle:[event valueForKey:@"message"] action:@selector(eventPressed:) keyEquivalent:@""]; EventMenuItemController *controller = [[EventMenuItemController alloc] initWithNibName:@"EventMenuItemController" bundle:nil]; [controller setEvent:event]; @@ -932,25 +940,25 @@ - (void) addEvent:(NSDictionary *)event top:(BOOL)top { [eventItem setState:NSMixedState]; [eventItem autorelease]; - + NSInteger eventMenuSize = 20; if ([eventsMenu numberOfItems] >= eventMenuSize) { [eventsMenu removeItemAtIndex:eventMenuSize - 1]; } - - [self addItem:eventItem to:eventsMenu top:top]; + + [self addItem:eventItem to:eventsMenu top:top]; } - (void) addPull:(NSDictionary *)pull { //NSMenu *menu = [self getPullsMenu]; - + } # pragma mark - Actions on pressed menu items - (void) openPull:(id)sender { id selectedItem = [sender representedObject]; - [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@", selectedItem]]]; + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@", selectedItem]]]; } - (IBAction) repoPressed:(id) sender { @@ -971,7 +979,7 @@ - (IBAction) gistPressed:(id) sender { - (IBAction) pullPressed:(id)sender { id selectedItem = [sender representedObject]; - [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@", selectedItem]]]; + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@", selectedItem]]]; } - (IBAction) organizationPressed:(id) sender { @@ -981,17 +989,17 @@ - (IBAction) organizationPressed:(id) sender { - (void) followerPressed:(id) sender { id selectedItem = [sender representedObject]; - [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://github.com/%@", selectedItem]]]; + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://github.com/%@", selectedItem]]]; } - (void) followingPressed:(id) sender { id selectedItem = [sender representedObject]; - [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://github.com/%@", selectedItem]]]; + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://github.com/%@", selectedItem]]]; } - (void) eventPressed:(id) sender { id selectedItem = [sender representedObject]; - [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@", selectedItem]]]; + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@", selectedItem]]]; } - (IBAction)openFollowings:(id)sender { @@ -1003,7 +1011,7 @@ - (IBAction)openFollowers:(id)sender { } - (IBAction)openWatchedRepositories:(id)sender { - [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://github.com/%@/following", [preferences login]]]]; + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://github.com/%@/following", [preferences login]]]]; } #pragma mark - item stuff @@ -1032,9 +1040,9 @@ - (void) resetCache:(id)sender { firstIssueCall = YES; firstOrganizationCall = YES; firstRepositoryCall = YES; - existingRepos = [[NSMutableSet alloc]init]; - existingGists = [[NSMutableSet alloc]init]; - existingIssues = [[NSMutableSet alloc]init]; + existingRepos = [[NSMutableSet alloc]init]; + existingGists = [[NSMutableSet alloc]init]; + existingIssues = [[NSMutableSet alloc]init]; } #pragma mark - private @@ -1069,16 +1077,16 @@ - (NSMenuItem*) createMenuItemForOrgRepo:(NSDictionary*) repo { // ID Card /* - RepositoryDetailsViewController *details = [[RepositoryDetailsViewController alloc] initWithNibName:@"RepositoryDetailsViewController" bundle:nil]; - [details setRepositoryData:repo]; - - NSMenuItem *popoverMenuItem = [[NSMenuItem alloc] init]; - [popoverMenuItem setView:[details view]]; - [popoverMenuItem autorelease]; - - NSMenu *foomenu = [[NSMenu alloc] init]; - [foomenu addItem:popoverMenuItem]; - [organizationRepoItem setSubmenu:foomenu]; + RepositoryDetailsViewController *details = [[RepositoryDetailsViewController alloc] initWithNibName:@"RepositoryDetailsViewController" bundle:nil]; + [details setRepositoryData:repo]; + + NSMenuItem *popoverMenuItem = [[NSMenuItem alloc] init]; + [popoverMenuItem setView:[details view]]; + [popoverMenuItem autorelease]; + + NSMenu *foomenu = [[NSMenu alloc] init]; + [foomenu addItem:popoverMenuItem]; + [organizationRepoItem setSubmenu:foomenu]; */ return organizationRepoItem; @@ -1103,7 +1111,7 @@ - (NSMenu*) getReposOrgMenu:(NSString*) orgName { - (NSMenu*) getReposMenu { NSMenuItem *menuItem = [statusMenu itemWithTitle:@"Repositories"]; return [menuItem submenu]; - + } - (NSMenu*) getFollowingMenu { @@ -1166,7 +1174,7 @@ - (void) addItemOnMainUIThread:(NSMenuItem *)item to:(NSMenu*)menu at:(NSInteger NSString *string = [NSString stringWithFormat:@"%d", index]; NSLog(@"String %@", string); - + if (index && index >=0) { dict = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:item, menu, string, nil] forKeys:[NSArray arrayWithObjects:@"item", @"menu", "index", nil]]; } else { diff --git a/QuickHubApp/QHConstants.h b/QuickHubApp/QHConstants.h index c9fde1f..99fd9e5 100644 --- a/QuickHubApp/QHConstants.h +++ b/QuickHubApp/QHConstants.h @@ -31,7 +31,7 @@ #define APP_PREFIX @"org.chamerling.quickhubapp" #define appsite @"http://quickhubapp.com" -#define oauthsite @"http://quickhubapp.com/oauth.html" +#define oauthsite @"https://github.com/login/oauth/authorize?client_id=c5a8828037f5233363fb&scope=user,public_repo,,gist" #define revokeurl @"https://github.com/account/connections/" #define urlscheme @"quickhubapp"