diff --git a/Medianno.xcodeproj/project.pbxproj b/Medianno.xcodeproj/project.pbxproj index 66ac7d3..a7b576c 100644 --- a/Medianno.xcodeproj/project.pbxproj +++ b/Medianno.xcodeproj/project.pbxproj @@ -30,6 +30,7 @@ 95BCFA2E13F8A3AD000F650F /* MAShortenQTTime.mm in Sources */ = {isa = PBXBuildFile; fileRef = 95BCFA2D13F8A3AD000F650F /* MAShortenQTTime.mm */; }; 95C534E013F732A200A07932 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 95C534DE13F732A200A07932 /* Localizable.strings */; }; 95CA841113FC149B00AE5AC4 /* MATokenFieldCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = 95CA841013FC149B00AE5AC4 /* MATokenFieldCell.mm */; }; + 95E8C26713FD72D2004E9839 /* MAColorForURL.mm in Sources */ = {isa = PBXBuildFile; fileRef = 95E8C26613FD72D2004E9839 /* MAColorForURL.mm */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -69,6 +70,8 @@ 95C534DF13F732A200A07932 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; 95CA840F13FC149B00AE5AC4 /* MATokenFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MATokenFieldCell.h; sourceTree = ""; }; 95CA841013FC149B00AE5AC4 /* MATokenFieldCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MATokenFieldCell.mm; sourceTree = ""; }; + 95E8C26513FD72D2004E9839 /* MAColorForURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MAColorForURL.h; sourceTree = ""; }; + 95E8C26613FD72D2004E9839 /* MAColorForURL.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MAColorForURL.mm; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -180,6 +183,8 @@ 950BB78513F2D95500D8E669 /* MADocWindow.mm */, 95BCFA2C13F8A3AD000F650F /* MAShortenQTTime.h */, 95BCFA2D13F8A3AD000F650F /* MAShortenQTTime.mm */, + 95E8C26513FD72D2004E9839 /* MAColorForURL.h */, + 95E8C26613FD72D2004E9839 /* MAColorForURL.mm */, ); name = Classes; sourceTree = ""; @@ -265,6 +270,7 @@ 950BB7AD13F46ECF00D8E669 /* MAAppController.mm in Sources */, 95BCFA2E13F8A3AD000F650F /* MAShortenQTTime.mm in Sources */, 95CA841113FC149B00AE5AC4 /* MATokenFieldCell.mm in Sources */, + 95E8C26713FD72D2004E9839 /* MAColorForURL.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Medianno/MAColorForURL.h b/Medianno/MAColorForURL.h new file mode 100644 index 0000000..059a5bc --- /dev/null +++ b/Medianno/MAColorForURL.h @@ -0,0 +1,13 @@ +// +// MAColorForURL.h +// Medianno +// +// Created by Matthias Neeracher on 8/18/11. +// Copyright 2011 Matthias Neeracher. All rights reserved. +// + + + +@interface MAColorForURL : NSValueTransformer + +@end diff --git a/Medianno/MAColorForURL.mm b/Medianno/MAColorForURL.mm new file mode 100644 index 0000000..bb8fbf2 --- /dev/null +++ b/Medianno/MAColorForURL.mm @@ -0,0 +1,31 @@ +// +// MAColorForURL.mm +// Medianno +// +// Created by Matthias Neeracher on 8/18/11. +// Copyright 2011 Matthias Neeracher. All rights reserved. +// + +#import "MAColorForURL.h" + +@implementation MAColorForURL + ++ (Class)transformedValueClass +{ + return [NSColor class]; +} + ++ (BOOL)allowsReverseTransformation +{ + return NO; +} + +- (id)transformedValue:(id)value +{ + if ([[NSFileManager defaultManager] fileExistsAtPath:value]) + return [NSColor blackColor]; + else + return [NSColor redColor]; +} + +@end diff --git a/Medianno/en.lproj/MADocument.xib b/Medianno/en.lproj/MADocument.xib index 5b6c9a3..7b1131d 100644 --- a/Medianno/en.lproj/MADocument.xib +++ b/Medianno/en.lproj/MADocument.xib @@ -1314,6 +1314,26 @@ 100243 + + + textColor: arrangedObjects.media + + + + + + textColor: arrangedObjects.media + textColor + arrangedObjects.media + + NSValueTransformerName + MAColorForURL + + 2 + + + 100246 + @@ -1860,7 +1880,7 @@ - 100243 + 100246 @@ -1876,6 +1896,7 @@ addMediaFiles: exportMedia: exportText: + importText: mediaSkipBackward: mediaSkipForward: toggleMediaPlay: @@ -1889,6 +1910,7 @@ id id id + id @@ -1899,6 +1921,7 @@ addMediaFiles: exportMedia: exportText: + importText: mediaSkipBackward: mediaSkipForward: toggleMediaPlay: @@ -1921,6 +1944,10 @@ exportText: id + + importText: + id + mediaSkipBackward: id