From 33e21e2604b586a677bc39c361bb83b3f4342e25 Mon Sep 17 00:00:00 2001 From: Tomasz Krasnyk Date: Mon, 29 Nov 2010 00:10:17 +0100 Subject: [PATCH] Added new icons for file status. When untracked file is added to index than it has added file icon. --- File Markers/added_file.png | Bin 0 -> 397 bytes File Markers/conflicted_file.png | Bin 0 -> 387 bytes File Markers/deleted_file.png | Bin 0 -> 397 bytes File Markers/ignored_file.png | Bin 0 -> 286 bytes File Markers/modified_file.png | Bin 0 -> 425 bytes File Markers/renamed_file.png | Bin 0 -> 419 bytes File Markers/unversioned_file.png | Bin 0 -> 392 bytes GitX.xcodeproj/project.pbxproj | 40 +++++++++++++++++++++++++++--- PBChangedFile.h | 4 ++- PBChangedFile.m | 17 +++++++++---- PBGitIndexController.m | 8 +++++- 11 files changed, 58 insertions(+), 11 deletions(-) create mode 100644 File Markers/added_file.png create mode 100644 File Markers/conflicted_file.png create mode 100644 File Markers/deleted_file.png create mode 100644 File Markers/ignored_file.png create mode 100644 File Markers/modified_file.png create mode 100644 File Markers/renamed_file.png create mode 100644 File Markers/unversioned_file.png diff --git a/File Markers/added_file.png b/File Markers/added_file.png new file mode 100644 index 0000000000000000000000000000000000000000..ad08fae2d588c89b504b272a82ec70f1c3090f6c GIT binary patch literal 397 zcmV;80doF{P)TgOz+DSRow${)4UoWa=LVd45x{gtCYw12Y2$!*3)_ za1CIq|Na5fib7@#XCJL&`1t(=P?H5%Aw<((ga(*mZWdt%89_aU8_y0i+<1PNK~>BO ztl=+`4J-&7{xT>@n1cnAY-Yj3k(XVR;q9lV41fRqMb_{KtU*WGjbY>YHim0Y4uAt7 z$h3w*L(-1n;QPhEp#2Bd0FH;g-F}j=p!^4>|A9^X2cv<3^8ep|hK`sMka*CNa7GHk rzfgC>4EP7e#!5bL8%RnT009O7Kf3u@m|5z_00000NkvXXu0mjfUt+71 literal 0 HcmV?d00001 diff --git a/File Markers/conflicted_file.png b/File Markers/conflicted_file.png new file mode 100644 index 0000000000000000000000000000000000000000..a633ecf4eb3bab52ca7a866e72d1cb2a2b2ede77 GIT binary patch literal 387 zcmV-}0et?6P))Um&954Jmj|X44lep?Y(G8}4Q*tA&&;P}rjN zHEh*t_#BUQEy_zkYP3+I)Z9mDuc`B7I>qzNmD>FU2$B!&lfp_dTA6dpon0P!d$*y! r!{I{j^Je7W%E6%mqW@lvF98MsCKm!pAR2cE00000NkvXXu0mjf>=&tq literal 0 HcmV?d00001 diff --git a/File Markers/ignored_file.png b/File Markers/ignored_file.png new file mode 100644 index 0000000000000000000000000000000000000000..c4813fb57ab11aabe39d8a9a714cdc918eb7e09e GIT binary patch literal 286 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWw1G2RvOILn>}fnPkX!Sb@jYcdB=YQ_{H^)&`r5(qCIv@mi&K z&nTY86M0&dBQxhDM@E|%XHSlOy|QxO;|it&%yrTFg-q{DW8W*XSiGMQbgJxr`KBF9 zrx@@!?@(+zDf8fngmUD*{M&9qvT`qutcrSl+U{B9vN=2jPg5f`5_%Rc_-?m4VNZ}o z^|R1zUsEK(nypupj~A-Ep0hhIbJns|NtWzv8GK%vK@abqW1ReZ ipSr`J-==mDhPfQk%Vg$ z1qD%wt(~L@)?(o=u(PqWvJ*kD*2>l+bQyD8I5fzk}B5*r<>&)!k*1C6d zv+T^9dGq!n=iDxUP5f;gM+|7cpWMVh^=CMjB2C$B3aj425*zzMWe(F@)we!@b?Qw{ z^Z`jAB3MHpV|Z`Ww=V9qMZbKcq5#Ct9&TW;II6+U{Ry!h zJnf%htUQ6C$pQ>_5DOiMtmn%H$1n3A7$4Du?&~KgF+P?9EcpWgI(|y4WeqluuF(7H z>Uj=ON`?nC*^tZ#t@B&-+TR$SiIs{BE=2=C)krd)jF90U_G*YL3n;D3bDXqGpd^W2 zZ^HHZL6En$w5|IzyOYqNSY7l=Boq`8#VAuxRGeB{RzURMU*lJR0RSPF0GM|8Dq{cu N002ovPDHLkV1nEGum%7C literal 0 HcmV?d00001 diff --git a/File Markers/unversioned_file.png b/File Markers/unversioned_file.png new file mode 100644 index 0000000000000000000000000000000000000000..62a936101d6d0851c965210a6093a08f2c532ebc GIT binary patch literal 392 zcmV;30eAk1P)+cwuLDvpcu9YNrR^4b1KL zGqV>NV@?1Z;BU`)WC=-@oYmF)EsQo68rniC7hudR?_zQNs2@9;8s5P84|0GQ?4TS- zYTCOJi;{bZA{(i5jZ;j|Z(34{;d2{bgGVpKLJ$W{8f+WUR25pKc)QzyvDFco$h*)F z2OovTJ!G9@R92d>)8MmvDF literal 0 HcmV?d00001 diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 5dfb9ea..dae5822 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -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 = ""; }; 21025C1012947AB200D87200 /* sourceListAction.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sourceListAction.png; sourceTree = ""; }; 21025C1112947AB200D87200 /* sourceListActionOver.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sourceListActionOver.png; sourceTree = ""; }; - 21025CA6129487C200D87200 /* defs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = defs.h; sourceTree = ""; }; 21230CAF1284B26A0046E5A1 /* PBGitMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitMenuItem.h; sourceTree = ""; }; 21230CB01284B26A0046E5A1 /* PBGitMenuItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitMenuItem.m; sourceTree = ""; }; 21230D331284C5080046E5A1 /* PBGitStash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitStash.h; sourceTree = ""; }; @@ -306,6 +311,13 @@ 21231389128756ED0046E5A1 /* PBRemoteCommandFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBRemoteCommandFactory.m; sourceTree = ""; }; 212313B3128759C00046E5A1 /* PBOpenDocumentCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBOpenDocumentCommand.h; sourceTree = ""; }; 212313B4128759C00046E5A1 /* PBOpenDocumentCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBOpenDocumentCommand.m; sourceTree = ""; }; + 212A49A212A31292009DAFAD /* renamed_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = renamed_file.png; sourceTree = ""; }; + 212A49A412A312B2009DAFAD /* unversioned_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = unversioned_file.png; sourceTree = ""; }; + 212A49A612A312BE009DAFAD /* added_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = added_file.png; sourceTree = ""; }; + 212A49A812A31328009DAFAD /* conflicted_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = conflicted_file.png; sourceTree = ""; }; + 212A49A912A31328009DAFAD /* deleted_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = deleted_file.png; sourceTree = ""; }; + 212A49AC12A31350009DAFAD /* ignored_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ignored_file.png; sourceTree = ""; }; + 212A49AE12A3135C009DAFAD /* modified_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = modified_file.png; sourceTree = ""; }; 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 = ""; }; @@ -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 = ""; }; + 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 = ""; + }; 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; }; diff --git a/PBChangedFile.h b/PBChangedFile.h index bffc110..ca3e160 100644 --- a/PBChangedFile.h +++ b/PBChangedFile.h @@ -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 diff --git a/PBChangedFile.m b/PBChangedFile.m index ac9b4d3..5a7492e 100644 --- a/PBChangedFile.m +++ b/PBChangedFile.m @@ -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; diff --git a/PBGitIndexController.m b/PBGitIndexController.m index 48d727c..02a5fce 100644 --- a/PBGitIndexController.m +++ b/PBGitIndexController.m @@ -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