Added new icons for file status. When untracked file is

added to index than it has added file icon.
This commit is contained in:
Tomasz Krasnyk
2010-11-29 00:10:17 +01:00
parent cb59e86a81
commit 33e21e2604
11 changed files with 58 additions and 11 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 419 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

+36 -4
View File
@@ -42,6 +42,13 @@
21231220128735E90046E5A1 /* submodule-empty.png in Resources */ = {isa = PBXBuildFile; fileRef = 2123121D128735E90046E5A1 /* submodule-empty.png */; };
2123138A128756ED0046E5A1 /* PBRemoteCommandFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 21231389128756ED0046E5A1 /* PBRemoteCommandFactory.m */; };
212313B5128759C00046E5A1 /* PBOpenDocumentCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 212313B4128759C00046E5A1 /* PBOpenDocumentCommand.m */; };
212A49A312A31292009DAFAD /* renamed_file.png in Resources */ = {isa = PBXBuildFile; fileRef = 212A49A212A31292009DAFAD /* renamed_file.png */; };
212A49A512A312B2009DAFAD /* unversioned_file.png in Resources */ = {isa = PBXBuildFile; fileRef = 212A49A412A312B2009DAFAD /* unversioned_file.png */; };
212A49A712A312BE009DAFAD /* added_file.png in Resources */ = {isa = PBXBuildFile; fileRef = 212A49A612A312BE009DAFAD /* added_file.png */; };
212A49AA12A31328009DAFAD /* conflicted_file.png in Resources */ = {isa = PBXBuildFile; fileRef = 212A49A812A31328009DAFAD /* conflicted_file.png */; };
212A49AB12A31328009DAFAD /* deleted_file.png in Resources */ = {isa = PBXBuildFile; fileRef = 212A49A912A31328009DAFAD /* deleted_file.png */; };
212A49AD12A31350009DAFAD /* ignored_file.png in Resources */ = {isa = PBXBuildFile; fileRef = 212A49AC12A31350009DAFAD /* ignored_file.png */; };
212A49AF12A3135C009DAFAD /* modified_file.png in Resources */ = {isa = PBXBuildFile; fileRef = 212A49AE12A3135C009DAFAD /* modified_file.png */; };
217FF0B912A1CB3300785A65 /* PBStashController.m in Sources */ = {isa = PBXBuildFile; fileRef = 217FF0B312A1CB3300785A65 /* PBStashController.m */; };
217FF0BA12A1CB3300785A65 /* PBSubmoduleController.m in Sources */ = {isa = PBXBuildFile; fileRef = 217FF0B512A1CB3300785A65 /* PBSubmoduleController.m */; };
217FF0BB12A1CB3300785A65 /* PBGitResetController.m in Sources */ = {isa = PBXBuildFile; fileRef = 217FF0B712A1CB3300785A65 /* PBGitResetController.m */; };
@@ -160,7 +167,6 @@
F56ADDD90ED19F9E002AC78F /* AddBranchTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = F56ADDD70ED19F9E002AC78F /* AddBranchTemplate.png */; };
F56ADDDA0ED19F9E002AC78F /* AddLabelTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = F56ADDD80ED19F9E002AC78F /* AddLabelTemplate.png */; };
F56CC7320E65E0E5004307B4 /* PBGraphCellInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = F56CC7310E65E0E5004307B4 /* PBGraphCellInfo.m */; };
F57240BB0E9678EA00D8EE66 /* deleted_file.png in Resources */ = {isa = PBXBuildFile; fileRef = F57240BA0E9678EA00D8EE66 /* deleted_file.png */; };
F574A2850EAE2EAC003F2CB1 /* PBRefController.m in Sources */ = {isa = PBXBuildFile; fileRef = F574A2840EAE2EAC003F2CB1 /* PBRefController.m */; };
F574A2910EAE2FF4003F2CB1 /* PBGitConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 93FCCBA80EA8AF450061B02B /* PBGitConfig.m */; };
F57CC3910E05DDF2000472E2 /* PBEasyPipe.m in Sources */ = {isa = PBXBuildFile; fileRef = F57CC3900E05DDF2000472E2 /* PBEasyPipe.m */; };
@@ -276,7 +282,6 @@
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
21025C1012947AB200D87200 /* sourceListAction.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sourceListAction.png; sourceTree = "<group>"; };
21025C1112947AB200D87200 /* sourceListActionOver.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sourceListActionOver.png; sourceTree = "<group>"; };
21025CA6129487C200D87200 /* defs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = defs.h; sourceTree = "<group>"; };
21230CAF1284B26A0046E5A1 /* PBGitMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitMenuItem.h; sourceTree = "<group>"; };
21230CB01284B26A0046E5A1 /* PBGitMenuItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitMenuItem.m; sourceTree = "<group>"; };
21230D331284C5080046E5A1 /* PBGitStash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitStash.h; sourceTree = "<group>"; };
@@ -306,6 +311,13 @@
21231389128756ED0046E5A1 /* PBRemoteCommandFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBRemoteCommandFactory.m; sourceTree = "<group>"; };
212313B3128759C00046E5A1 /* PBOpenDocumentCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBOpenDocumentCommand.h; sourceTree = "<group>"; };
212313B4128759C00046E5A1 /* PBOpenDocumentCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBOpenDocumentCommand.m; sourceTree = "<group>"; };
212A49A212A31292009DAFAD /* renamed_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = renamed_file.png; sourceTree = "<group>"; };
212A49A412A312B2009DAFAD /* unversioned_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = unversioned_file.png; sourceTree = "<group>"; };
212A49A612A312BE009DAFAD /* added_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = added_file.png; sourceTree = "<group>"; };
212A49A812A31328009DAFAD /* conflicted_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = conflicted_file.png; sourceTree = "<group>"; };
212A49A912A31328009DAFAD /* deleted_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = deleted_file.png; sourceTree = "<group>"; };
212A49AC12A31350009DAFAD /* ignored_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ignored_file.png; sourceTree = "<group>"; };
212A49AE12A3135C009DAFAD /* modified_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = modified_file.png; sourceTree = "<group>"; };
217FF0B312A1CB3300785A65 /* PBStashController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBStashController.m; sourceTree = SOURCE_ROOT; };
217FF0B412A1CB3300785A65 /* PBStashController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBStashController.h; sourceTree = SOURCE_ROOT; };
217FF0B512A1CB3300785A65 /* PBSubmoduleController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBSubmoduleController.m; sourceTree = "<group>"; };
@@ -689,7 +701,6 @@
21230ED41285ED760046E5A1 /* View */ = {
isa = PBXGroup;
children = (
21025CA6129487C200D87200 /* defs.h */,
21230ED71285EDAF0046E5A1 /* PBArgumentPicker.h */,
21230ED81285EDAF0046E5A1 /* PBArgumentPicker.m */,
21CF0B22129C7ED90065B37C /* TrackableOutlineView.h */,
@@ -714,6 +725,20 @@
path = Controller;
sourceTree = "<group>";
};
212A499412A3121D009DAFAD /* File Markers */ = {
isa = PBXGroup;
children = (
212A49A812A31328009DAFAD /* conflicted_file.png */,
212A49A912A31328009DAFAD /* deleted_file.png */,
212A49A612A312BE009DAFAD /* added_file.png */,
212A49A412A312B2009DAFAD /* unversioned_file.png */,
212A49A212A31292009DAFAD /* renamed_file.png */,
212A49AC12A31350009DAFAD /* ignored_file.png */,
212A49AE12A3135C009DAFAD /* modified_file.png */,
);
path = "File Markers";
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* GitTest */ = {
isa = PBXGroup;
children = (
@@ -741,6 +766,7 @@
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
212A499412A3121D009DAFAD /* File Markers */,
2123121B128735E90046E5A1 /* submodule-notmatching-index.png */,
2123121C128735E90046E5A1 /* submodule-matching-index.png */,
2123121D128735E90046E5A1 /* submodule-empty.png */,
@@ -1337,7 +1363,6 @@
F52BCE030E84208300AA3741 /* PBGitHistoryView.xib in Resources */,
F59116E60E843BB50072CCB1 /* PBGitCommitView.xib in Resources */,
F5E92A230E88569500056E75 /* new_file.png in Resources */,
F57240BB0E9678EA00D8EE66 /* deleted_file.png in Resources */,
F5E424110EA3E4D60046E362 /* PBDiffWindow.xib in Resources */,
F50A411F0EBB874C00208746 /* mainSplitterBar.tiff in Resources */,
F50A41200EBB874C00208746 /* mainSplitterDimple.tiff in Resources */,
@@ -1383,6 +1408,13 @@
21231220128735E90046E5A1 /* submodule-empty.png in Resources */,
21025C1212947AB200D87200 /* sourceListAction.png in Resources */,
21025C1312947AB200D87200 /* sourceListActionOver.png in Resources */,
212A49A312A31292009DAFAD /* renamed_file.png in Resources */,
212A49A512A312B2009DAFAD /* unversioned_file.png in Resources */,
212A49A712A312BE009DAFAD /* added_file.png in Resources */,
212A49AA12A31328009DAFAD /* conflicted_file.png in Resources */,
212A49AB12A31328009DAFAD /* deleted_file.png in Resources */,
212A49AD12A31350009DAFAD /* ignored_file.png in Resources */,
212A49AF12A3135C009DAFAD /* modified_file.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
+3 -1
View File
@@ -12,7 +12,8 @@
typedef enum {
NEW,
MODIFIED,
DELETED
DELETED,
ADDED
} PBChangedFileStatus;
@interface PBChangedFile : NSObject {
@@ -35,5 +36,6 @@ typedef enum {
- (NSImage *)icon;
- (NSString *)indexInfo;
+ (NSImage *) iconForStatus:(PBChangedFileStatus) aStatus;
- (id) initWithPath:(NSString *)p;
@end
+12 -5
View File
@@ -31,24 +31,31 @@
return [NSString stringWithFormat:@"%@ %@\t%@\0", self.commitBlobMode, self.commitBlobSHA, self.path];
}
- (NSImage *) icon
{
+ (NSImage *) iconForStatus:(PBChangedFileStatus) aStatus {
NSString *filename;
switch (status) {
switch (aStatus) {
case NEW:
filename = @"new_file";
filename = @"unversioned_file";
break;
case DELETED:
filename = @"deleted_file";
break;
case ADDED:
filename = @"added_file";
break;
default:
filename = @"empty_file";
filename = @"modified_file";
break;
}
NSString *p = [[NSBundle mainBundle] pathForResource:filename ofType:@"png"];
return [[NSImage alloc] initByReferencingFile: p];
}
- (NSImage *) icon
{
return [PBChangedFile iconForStatus:status];
}
+ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector
{
return NO;
+7 -1
View File
@@ -251,7 +251,13 @@
- (void)tableView:(NSTableView*)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)rowIndex
{
id controller = [tableView tag] == 0 ? unstagedFilesController : stagedFilesController;
[[tableColumn dataCell] setImage:[[[controller arrangedObjects] objectAtIndex:rowIndex] icon]];
PBChangedFile *changedFile = [[controller arrangedObjects] objectAtIndex:rowIndex];
PBChangedFileStatus status = [changedFile status];
NSImage *imageToSet = [changedFile icon];
if (controller == stagedFilesController && status == NEW) {
imageToSet = [PBChangedFile iconForStatus:ADDED];
}
[[tableColumn dataCell] setImage:imageToSet];
}
- (void) tableClicked:(NSTableView *) tableView