Skip to content

Commit

Permalink
doc icons
Browse files Browse the repository at this point in the history
  • Loading branch information
algesten committed Feb 4, 2012
1 parent ab2beae commit 569cf2c
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ViewDown.xcodeproj/project.pbxproj
Expand Up @@ -8,6 +8,7 @@

/* Begin PBXBuildFile section */
5B3174DB14DD6049000774E5 /* userstyles.css in Resources */ = {isa = PBXBuildFile; fileRef = 5B3174DA14DD6049000774E5 /* userstyles.css */; };
5B9DD87314DD8DF7001D1EF9 /* md.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5B9DD87214DD8DF7001D1EF9 /* md.icns */; };
5BD032A614DD7B1D00E1FB3B /* ViewDown.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5BD032A514DD7B1D00E1FB3B /* ViewDown.icns */; };
5BDC2FB514DAD1F300B7B22F /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BDC2FB414DAD1F300B7B22F /* Cocoa.framework */; };
5BDC2FBF14DAD1F300B7B22F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5BDC2FBD14DAD1F300B7B22F /* InfoPlist.strings */; };
Expand All @@ -20,6 +21,7 @@

/* Begin PBXFileReference section */
5B3174DA14DD6049000774E5 /* userstyles.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = userstyles.css; sourceTree = "<group>"; };
5B9DD87214DD8DF7001D1EF9 /* md.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = md.icns; sourceTree = "<group>"; };
5BD032A514DD7B1D00E1FB3B /* ViewDown.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = ViewDown.icns; sourceTree = "<group>"; };
5BDC2FB014DAD1F300B7B22F /* ViewDown.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ViewDown.app; sourceTree = BUILT_PRODUCTS_DIR; };
5BDC2FB414DAD1F300B7B22F /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -53,6 +55,7 @@
5BDC2FA514DAD1F200B7B22F = {
isa = PBXGroup;
children = (
5B9DD87214DD8DF7001D1EF9 /* md.icns */,
5BD032A514DD7B1D00E1FB3B /* ViewDown.icns */,
5BDC2FBA14DAD1F300B7B22F /* ViewDown */,
5BDC2FB314DAD1F300B7B22F /* Frameworks */,
Expand Down Expand Up @@ -167,6 +170,7 @@
5BDC2FCB14DAD1F300B7B22F /* MainMenu.xib in Resources */,
5B3174DB14DD6049000774E5 /* userstyles.css in Resources */,
5BD032A614DD7B1D00E1FB3B /* ViewDown.icns in Resources */,
5B9DD87314DD8DF7001D1EF9 /* md.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
7 changes: 7 additions & 0 deletions ViewDown/AppDelegate.h
Expand Up @@ -12,6 +12,10 @@
@interface AppDelegate : NSObject <NSApplicationDelegate, NSWindowDelegate>
{
@private

BOOL finishedStarting;
NSString *toLaunchWhenFinished;

NSFileManager* fm;
NSMutableArray* pathsToWatch;
NSNumber* lastEventId;
Expand All @@ -32,6 +36,8 @@
NSPoint savedScrollPosition;
BOOL scrollToLast;



}

@property (assign) IBOutlet NSWindow *window;
Expand All @@ -40,6 +46,7 @@

-(void)setCurrent:(NSURL*)url;

-(BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename;
-(void)openDocument:(id)sender;

- (void)initializeEventStream:(NSURL*)file;
Expand Down
19 changes: 19 additions & 0 deletions ViewDown/AppDelegate.m
Expand Up @@ -42,6 +42,9 @@ @implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{

// so we know
finishedStarting = YES;

// ensures we get no white top/bottom
web.drawsBackground = NO;

Expand Down Expand Up @@ -84,6 +87,12 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
CFUserNotificationDisplayAlert(0, kCFUserNotificationNoDefaultButtonFlag, NULL, NULL, NULL, CFSTR("Missing markdown"), CFSTR("The markdown script could not be found."), NULL, NULL, NULL, NULL);
}

if (toLaunchWhenFinished)
{
[self setCurrent:[NSURL fileURLWithPath:toLaunchWhenFinished]];
toLaunchWhenFinished = nil;
}

}

- (void)applicationWillTerminate:(NSNotification *)notification
Expand Down Expand Up @@ -138,6 +147,16 @@ -(void)setCurrent:(NSURL *)url

}

-(BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
{
if (finishedStarting) {
[self setCurrent:[NSURL fileURLWithPath:filename]];
} else {
toLaunchWhenFinished = filename;
}
return YES;
}

-(void)openDocument:(id)sender
{

Expand Down
23 changes: 23 additions & 0 deletions ViewDown/ViewDown-Info.plist
Expand Up @@ -4,6 +4,29 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>mkdn</string>
<string>markdown</string>
<string>mdown</string>
<string>markdn</string>
<string>md</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>md.icns</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>text/x-web-markdown</string>
</array>
<key>CFBundleTypeName</key>
<string>Markdown Document</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
Expand Down
Binary file added md.icns
Binary file not shown.

0 comments on commit 569cf2c

Please sign in to comment.