Skip to content

Commit

Permalink
More cleanup on the backside view of the brief preview. Still need to…
Browse files Browse the repository at this point in the history
… implement author and description properties in the briefs data format, but support exists in the app once they're in place.
  • Loading branch information
capttaco committed Mar 29, 2010
1 parent 2412587 commit 48f310d
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 67 deletions.
Binary file modified Briefs.xcdatamodel/elements
Binary file not shown.
Binary file modified Briefs.xcdatamodel/layout
Binary file not shown.
10 changes: 6 additions & 4 deletions Briefs.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
D43CE959115FC77E00DA07D5 /* update-button.png in Resources */ = {isa = PBXBuildFile; fileRef = D43CE957115FC77E00DA07D5 /* update-button.png */; };
D43CEAB11160376500DA07D5 /* BFArrayBriefDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = D43CEAB01160376500DA07D5 /* BFArrayBriefDataSource.m */; };
D43CEB121160468F00DA07D5 /* howto.brieflist in Resources */ = {isa = PBXBuildFile; fileRef = D46414191069AB25001522F6 /* howto.brieflist */; };
D43CEC36116061CD00DA07D5 /* BriefRef.m in Sources */ = {isa = PBXBuildFile; fileRef = D43CEC35116061CD00DA07D5 /* BriefRef.m */; };
D463E8FF107310170075CCCE /* BFBriefcastViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D463E8FE107310170075CCCE /* BFBriefcastViewController.m */; };
D464117110606DDE001522F6 /* BFTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D464117010606DDE001522F6 /* BFTableViewController.m */; };
D46411931065CF8C001522F6 /* BFBriefCellController.m in Sources */ = {isa = PBXBuildFile; fileRef = D46411921065CF8C001522F6 /* BFBriefCellController.m */; };
Expand Down Expand Up @@ -213,6 +214,8 @@
D43CE957115FC77E00DA07D5 /* update-button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "update-button.png"; path = "images/buttons/update-button.png"; sourceTree = "<group>"; };
D43CEAAF1160376500DA07D5 /* BFArrayBriefDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BFArrayBriefDataSource.h; sourceTree = "<group>"; };
D43CEAB01160376500DA07D5 /* BFArrayBriefDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BFArrayBriefDataSource.m; sourceTree = "<group>"; };
D43CEC34116061CD00DA07D5 /* BriefRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BriefRef.h; sourceTree = "<group>"; };
D43CEC35116061CD00DA07D5 /* BriefRef.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BriefRef.m; sourceTree = "<group>"; };
D463E8FD107310170075CCCE /* BFBriefcastViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BFBriefcastViewController.h; sourceTree = "<group>"; };
D463E8FE107310170075CCCE /* BFBriefcastViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BFBriefcastViewController.m; sourceTree = "<group>"; wrapsLines = 0; };
D464116F10606DDE001522F6 /* BFTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BFTableViewController.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -283,8 +286,6 @@
D4A39835113C6EAA004971E9 /* Icon-small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-small.png"; path = "images/Icon-small.png"; sourceTree = "<group>"; };
D4AF1A331147312400D1B3B5 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
D4AF1B051147362200D1B3B5 /* Briefs.xcdatamodel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = wrapper.xcdatamodel; path = Briefs.xcdatamodel; sourceTree = "<group>"; };
D4AF1B141147431B00D1B3B5 /* BriefRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BriefRef.h; sourceTree = "<group>"; };
D4AF1B151147431B00D1B3B5 /* BriefRef.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BriefRef.m; sourceTree = "<group>"; };
D4AF1B30114808A300D1B3B5 /* BFBriefcast+CoreDataAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "BFBriefcast+CoreDataAdditions.h"; sourceTree = "<group>"; };
D4AF1B31114808A300D1B3B5 /* BFBriefcast+CoreDataAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "BFBriefcast+CoreDataAdditions.m"; sourceTree = "<group>"; };
D4AF1B4611480B3C00D1B3B5 /* BriefcastRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BriefcastRef.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -750,10 +751,10 @@
D4AF1B071147369A00D1B3B5 /* data */ = {
isa = PBXGroup;
children = (
D43CEC34116061CD00DA07D5 /* BriefRef.h */,
D43CEC35116061CD00DA07D5 /* BriefRef.m */,
D4AF1B4611480B3C00D1B3B5 /* BriefcastRef.h */,
D4AF1B4711480B3C00D1B3B5 /* BriefcastRef.m */,
D4AF1B141147431B00D1B3B5 /* BriefRef.h */,
D4AF1B151147431B00D1B3B5 /* BriefRef.m */,
);
name = data;
sourceTree = "<group>";
Expand Down Expand Up @@ -982,6 +983,7 @@
D43CE3A81154785500DA07D5 /* BFBriefInfoView.m in Sources */,
D43CE5331157055100DA07D5 /* BFPagedContainerView.m in Sources */,
D43CEAB11160376500DA07D5 /* BFArrayBriefDataSource.m in Sources */,
D43CEC36116061CD00DA07D5 /* BriefRef.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
6 changes: 4 additions & 2 deletions Classes/BFBriefInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ - (id)initWithDictionary:(NSDictionary *)dictionary atPath:(NSString *)path
numberOfScenes = (scenes != nil) ? [scenes count] : 0;

pathToBrieflist = path;
author = [dictionary objectForKey:@"author" orDefaultValue:@"None"];
desc = [dictionary objectForKey:@"desc" orDefaultValue:@"None"];
author = [dictionary objectForKey:@"author" orDefaultValue:@"None provided."];
desc = [dictionary objectForKey:@"desc" orDefaultValue:@"None provided."];

NSString *defaultTitle = [path stringByReplacingOccurrencesOfString:@".brieflist" withString:@""];

Expand All @@ -57,6 +57,8 @@ - (BriefRef *)insertIntoManagedContext:(NSManagedObjectContext *)context
[ref setTotalNumberOfScenes:[NSNumber numberWithInt:numberOfScenes]];

// TODO: add author, desc information
[ref setAuthor:author];
[ref setDesc:desc];

return ref;
}
Expand Down
16 changes: 15 additions & 1 deletion Classes/BFPreviewBriefViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,21 @@ - (void)prepareInfoView:(BriefRef *)ref
{
infoView.titleLabel.text = ref.title;
infoView.numberOfScenesLabel.text = [NSString stringWithFormat:@"%@", [ref totalNumberOfScenes]];
infoView.fromLabel.text = [[NSURL URLWithString:[ref fromURL]] host];
infoView.authorLabel.text = ref.author;

// adjust size of description box
// to account for multiple lines
CGSize adjustedSize = [ref.desc sizeWithFont:infoView.infoLabel.font constrainedToSize:CGSizeMake(116.0f, 50.0f)];
CGRect adjustedFrame = infoView.infoLabel.frame;
adjustedFrame.size = adjustedSize;
infoView.infoLabel.frame = adjustedFrame;
infoView.infoLabel.text = ref.desc;

// check if locally stored
if ([[ref fromURL] isEqual:kBFLocallyStoredBriefURLString]) {
infoView.fromLabel.text = @"Built-in";
}
else infoView.fromLabel.text = [[NSURL URLWithString:[ref fromURL]] host];

// format date
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
Expand Down
76 changes: 38 additions & 38 deletions Classes/BFPreviewBriefViewController.xib
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="1"/>
<integer value="5"/>
<integer value="58"/>
<integer value="4"/>
<integer value="1"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand Down Expand Up @@ -134,7 +134,7 @@
<bytes key="NSRGB">MC41NzYzMDcyOTY4IDAuNTkzNDY4Nzg1MyAwLjYwNzE2NTIxNzQAA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<object class="NSColor" key="IBUIShadowColor">
<object class="NSColor" key="IBUIShadowColor" id="703850549">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
</object>
Expand Down Expand Up @@ -189,6 +189,8 @@
<reference key="IBUIFont" ref="1036226713"/>
<bool key="IBUIShowsTouchWhenHighlighted">YES</bool>
<reference key="IBUIHighlightedTitleColor" ref="971094910"/>
<reference key="IBUINormalTitleColor" ref="703850549"/>
<reference key="IBUINormalTitleShadowColor" ref="703850549"/>
<object class="NSCustomResource" key="IBUINormalBackgroundImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">preview-play-bg.png</string>
Expand Down Expand Up @@ -303,10 +305,7 @@
<bytes key="NSRGB">MC4yOTcxMTQwNzQyIDAuMzMxNzU4NTg4NiAwLjQxODY1NDg1OTEAA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<object class="NSColor" key="IBUIShadowColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<reference key="IBUIShadowColor" ref="971094910"/>
<string key="IBUIShadowOffset">{0, 1}</string>
<int key="IBUIBaselineAdjustment">1</int>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
Expand All @@ -325,6 +324,31 @@
<bool key="IBUIAutoresizesSubviews">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
</object>
<object class="IBUILabel" id="668081038">
<reference key="NSNextResponder" ref="568653087"/>
<int key="NSvFlags">308</int>
<string key="NSFrame">{{67, 147}, {116, 45}}</string>
<reference key="NSSuperview" ref="568653087"/>
<reference key="IBUIBackgroundColor" ref="893395262"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">5</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="IBUIText">If I were to put three lines of text in here, it would look like...</string>
<object class="NSFont" key="IBUIFont" id="863577933">
<string key="NSName">Helvetica</string>
<double key="NSSize">12</double>
<int key="NSfFlags">16</int>
</object>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xNzg4MDUwODMgMC4xODAwNDg5ODczIDAuMTgyOTgwNjcxNQA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">0</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUINumberOfLines">0</int>
</object>
</object>
<string key="NSFrame">{{9, 4}, {192, 288}}</string>
<reference key="NSSuperview" ref="511513923"/>
Expand Down Expand Up @@ -495,38 +519,14 @@
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="IBUIText">Unknown</string>
<object class="NSFont" key="IBUIFont" id="863577933">
<string key="NSName">Helvetica</string>
<double key="NSSize">12</double>
<int key="NSfFlags">16</int>
</object>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xNzg4MDUwODMgMC4xODAwNDg5ODczIDAuMTgyOTgwNjcxNQA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="668081038">
<reference key="NSNextResponder" ref="511513923"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{76, 137}, {119, 74}}</string>
<reference key="NSSuperview" ref="511513923"/>
<reference key="IBUIBackgroundColor" ref="893395262"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="IBUIText">A typical three line description that can span, multiple lines</string>
<reference key="IBUIFont" ref="863577933"/>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xNzg4MDUwODMgMC4xODAwNDg5ODczIDAuMTgyOTgwNjcxNQA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">0</int>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUINumberOfLines">3</int>
</object>
<object class="IBUIView" id="576578248">
<reference key="NSNextResponder" ref="511513923"/>
Expand Down Expand Up @@ -872,7 +872,6 @@
<reference ref="1033104635"/>
<reference ref="24417363"/>
<reference ref="877781628"/>
<reference ref="668081038"/>
<reference ref="568653087"/>
</object>
<reference key="parent" ref="0"/>
Expand Down Expand Up @@ -996,17 +995,13 @@
<reference key="object" ref="49735026"/>
<reference key="parent" ref="97911693"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">48</int>
<reference key="object" ref="668081038"/>
<reference key="parent" ref="511513923"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">58</int>
<reference key="object" ref="568653087"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="576196310"/>
<reference ref="668081038"/>
</object>
<reference key="parent" ref="511513923"/>
</object>
Expand Down Expand Up @@ -1037,6 +1032,11 @@
<reference key="object" ref="309889177"/>
<reference key="parent" ref="576196310"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">48</int>
<reference key="object" ref="668081038"/>
<reference key="parent" ref="568653087"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
Expand Down
8 changes: 5 additions & 3 deletions Classes/BriefRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// BriefRef.h
// Briefs
//
// Created by Rob Rhyne on 3/10/10.
// Created by Rob Rhyne on 3/29/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//

Expand All @@ -14,13 +14,15 @@
{
}

@property (nonatomic, retain) NSString * fromURL;
@property (nonatomic, retain) NSDate * dateLastOpened;
@property (nonatomic, retain) NSString * author;
@property (nonatomic, retain) NSNumber * lastSceneOpened;
@property (nonatomic, retain) NSNumber * totalNumberOfScenes;
@property (nonatomic, retain) NSString * title;
@property (nonatomic, retain) NSString * desc;
@property (nonatomic, retain) NSDate * dateLastDownloaded;
@property (nonatomic, retain) NSString * fromURL;
@property (nonatomic, retain) NSString * filePath;
@property (nonatomic, retain) NSDate * dateLastOpened;
@property (nonatomic, retain) BriefcastRef * briefcast;

@end
Expand Down
8 changes: 5 additions & 3 deletions Classes/BriefRef.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// BriefRef.m
// Briefs
//
// Created by Rob Rhyne on 3/10/10.
// Created by Rob Rhyne on 3/29/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//

Expand All @@ -12,13 +12,15 @@

@implementation BriefRef

@dynamic fromURL;
@dynamic dateLastOpened;
@dynamic author;
@dynamic lastSceneOpened;
@dynamic totalNumberOfScenes;
@dynamic title;
@dynamic desc;
@dynamic dateLastDownloaded;
@dynamic fromURL;
@dynamic filePath;
@dynamic dateLastOpened;
@dynamic briefcast;

@end
17 changes: 1 addition & 16 deletions Classes/BriefsAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#import "BFSceneViewController.h"
#import "BFMainViewController.h"
#import "BFDataManager.h"
#import "BFPagedBrowseViewController.h"

@implementation BriefsAppDelegate

Expand Down Expand Up @@ -46,22 +47,6 @@ - (void)applicationWillTerminate:(UIApplication *)application
[[BFDataManager sharedBFDataManager] save];
}

//- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
//{
// if ([[url scheme] isEqualToString:@"brief"]) {
// NSLog(@"Received the following URL for a brief: %@", url);
//
//
//
// return YES;
// }
// else if ([[url scheme] isEqualToString:@"brieflist"]) {
// NSLog(@"Received the following URL for a briefcast: %@", url);
// return YES;
// }
// return NO;
//}

- (void)dealloc
{
[navigationController release];
Expand Down

0 comments on commit 48f310d

Please sign in to comment.