diff --git a/app/CocoaPods/Base.lproj/CPHomeWindowController.xib b/app/CocoaPods/Base.lproj/CPHomeWindowController.xib index 5947c573..62f0854b 100644 --- a/app/CocoaPods/Base.lproj/CPHomeWindowController.xib +++ b/app/CocoaPods/Base.lproj/CPHomeWindowController.xib @@ -24,7 +24,7 @@ - + @@ -135,6 +135,29 @@ + + + + + + + + + + + @@ -199,13 +222,17 @@ + + + + @@ -219,7 +246,11 @@ - + + + + + @@ -357,6 +388,8 @@ Command-Line Tools? + + diff --git a/app/CocoaPods/CPRecentDocumentsController.h b/app/CocoaPods/CPRecentDocumentsController.h index 00675610..9aeab445 100644 --- a/app/CocoaPods/CPRecentDocumentsController.h +++ b/app/CocoaPods/CPRecentDocumentsController.h @@ -13,7 +13,7 @@ /// Used to set the first responder once data has been loadded in @property (nonatomic, readwrite, weak) IBOutlet NSTableView *documentsTableView; - +@property (weak) IBOutlet NSButton *openDocumentButton; @end diff --git a/app/CocoaPods/CPRecentDocumentsController.m b/app/CocoaPods/CPRecentDocumentsController.m index d08b1739..37ee2f1f 100644 --- a/app/CocoaPods/CPRecentDocumentsController.m +++ b/app/CocoaPods/CPRecentDocumentsController.m @@ -23,12 +23,23 @@ @implementation CPRecentDocumentsController - (void)awakeFromNib { [super awakeFromNib]; + + NSMutableAttributedString *attrTitle = + [[NSMutableAttributedString alloc] initWithString:NSLocalizedString(@"MAIN_WINDOW_OPEN_DOCUMENT_BUTTON_TITLE", nil)]; + NSUInteger len = [attrTitle length]; + NSRange range = NSMakeRange(0, len); + [attrTitle addAttribute:NSForegroundColorAttributeName value:[NSColor colorWithRed:217.0/255.0 green:217.0/255.0 blue:217.0/255.0 alpha:1.0] range:range]; + [attrTitle addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:10.0] range:range]; + NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; + paragraphStyle.alignment = NSTextAlignmentCenter; + [attrTitle addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:range]; + [attrTitle fixAttributesInRange:range]; + [self.openDocumentButton setAttributedTitle:attrTitle]; + [attrTitle addAttribute:NSForegroundColorAttributeName value:[NSColor colorWithRed:192.0/255.0 green:192.0/255.0 blue:192.0/255.0 alpha:1.0] range:range]; + [self.openDocumentButton setAttributedAlternateTitle:attrTitle]; + [self setupRecentDocuments]; - - if (self.documentsTableView.numberOfRows > 0) { - NSIndexSet *indexes = [NSIndexSet indexSetWithIndex:0]; - [self.documentsTableView selectRowIndexes:indexes byExtendingSelection:NO]; - } + [self prepareData]; } - (void)setupRecentDocuments @@ -42,6 +53,19 @@ - (void)setupRecentDocuments self.recentDocuments = documents; } +- (void)prepareData +{ + if ([self.recentDocuments count] > 0) { + NSIndexSet *indexes = [NSIndexSet indexSetWithIndex:0]; + [self.documentsTableView selectRowIndexes:indexes byExtendingSelection:NO]; + self.documentsTableView.hidden = NO; + self.openDocumentButton.hidden = YES; + } else { + self.documentsTableView.hidden = YES; + self.openDocumentButton.hidden = NO; + } +} + - (CPHomeWindowDocumentEntry *)projectDetailsAtURL:(NSURL *)url { NSFileManager *fileManager = [NSFileManager defaultManager]; diff --git a/app/CocoaPods/Home Screen.xcassets/OpenDocument.imageset/Contents.json b/app/CocoaPods/Home Screen.xcassets/OpenDocument.imageset/Contents.json new file mode 100644 index 00000000..9cac8d98 --- /dev/null +++ b/app/CocoaPods/Home Screen.xcassets/OpenDocument.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "OpenDocument.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "OpenDocument@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/app/CocoaPods/Home Screen.xcassets/OpenDocument.imageset/OpenDocument.png b/app/CocoaPods/Home Screen.xcassets/OpenDocument.imageset/OpenDocument.png new file mode 100644 index 00000000..3b9c8bbb Binary files /dev/null and b/app/CocoaPods/Home Screen.xcassets/OpenDocument.imageset/OpenDocument.png differ diff --git a/app/CocoaPods/Home Screen.xcassets/OpenDocument.imageset/OpenDocument@2x.png b/app/CocoaPods/Home Screen.xcassets/OpenDocument.imageset/OpenDocument@2x.png new file mode 100644 index 00000000..745ee47c Binary files /dev/null and b/app/CocoaPods/Home Screen.xcassets/OpenDocument.imageset/OpenDocument@2x.png differ diff --git a/app/CocoaPods/Home Screen.xcassets/OpenDocumentSelected.imageset/Contents.json b/app/CocoaPods/Home Screen.xcassets/OpenDocumentSelected.imageset/Contents.json new file mode 100644 index 00000000..f1532ba7 --- /dev/null +++ b/app/CocoaPods/Home Screen.xcassets/OpenDocumentSelected.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "OpenDocumentSelected.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "OpenDocumentSelected@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/app/CocoaPods/Home Screen.xcassets/OpenDocumentSelected.imageset/OpenDocumentSelected.png b/app/CocoaPods/Home Screen.xcassets/OpenDocumentSelected.imageset/OpenDocumentSelected.png new file mode 100644 index 00000000..9ee55a5a Binary files /dev/null and b/app/CocoaPods/Home Screen.xcassets/OpenDocumentSelected.imageset/OpenDocumentSelected.png differ diff --git a/app/CocoaPods/Home Screen.xcassets/OpenDocumentSelected.imageset/OpenDocumentSelected@2x.png b/app/CocoaPods/Home Screen.xcassets/OpenDocumentSelected.imageset/OpenDocumentSelected@2x.png new file mode 100644 index 00000000..e35b029d Binary files /dev/null and b/app/CocoaPods/Home Screen.xcassets/OpenDocumentSelected.imageset/OpenDocumentSelected@2x.png differ diff --git a/app/CocoaPods/Supporting Files/Localizable.strings b/app/CocoaPods/Supporting Files/Localizable.strings index 1fd8959d..dd72c949 100644 --- a/app/CocoaPods/Supporting Files/Localizable.strings +++ b/app/CocoaPods/Supporting Files/Localizable.strings @@ -23,4 +23,5 @@ "MAIN_WINDOW_TITLE" = "Welcome to CocoaPods"; "MAIN_WINDOW_OPEN_GUIDES_BUTTON_TITLE" = "Open Guides"; "MAIN_WINDOW_OPEN_SEARCH_BUTTON_TITLE" = "Open Search"; -"MAIN_WINDOW_CHANGELOG_BUTTON_TITLE" = "What's New?"; \ No newline at end of file +"MAIN_WINDOW_CHANGELOG_BUTTON_TITLE" = "What's New?"; +"MAIN_WINDOW_OPEN_DOCUMENT_BUTTON_TITLE" = "Open an existing Podfile"; \ No newline at end of file