GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Fork of Caged/gitnub
Description: A Gitk-like application written in RubyCocoa that looks like it belongs on a Mac. See the wiki for downloads and screenshots.
Homepage: http://alternateidea.com
Clone URL: git://github.com/dutscher/gitnub.git
Cleaned up the image and text cell so it's not insane
benstiglitz (author)
Wed Mar 12 15:45:28 -0700 2008
commit  88e9717531fef063bf68056e3a65bc62e206b4cf
tree    13defdac7ee1308bee0fb3e6676f271b220f0a23
parent  41487b0d312fba88728433a2c4ebd44457c05e74
...
12
13
14
15
 
16
17
18
...
43
44
45
46
 
47
48
49
50
51
...
12
13
14
 
15
16
17
18
...
43
44
45
 
46
47
 
48
49
50
0
@@ -12,7 +12,7 @@ require 'mime-types/lib/mime/types'
0
 require 'grit/lib/grit'
0
 require 'InfoWindowController'
0
 
0
-OSX.ns_import 'ImageTextCell'
0
+OSX.ns_import 'CommitSummaryCell'
0
 include OSX
0
 
0
 REPOSITORY_LOCATION = ENV['PWD'].nil? ? '' : ENV['PWD']
0
@@ -43,9 +43,8 @@ class ApplicationController < OSX::NSObject
0
     
0
     @window.delegate = self
0
     column = @commits_table.tableColumns[0]
0
- cell = ImageTextCell.alloc.init
0
+ cell = CommitSummaryCell.alloc.init
0
     column.dataCell = cell
0
- cell.dataDelegate = @commits_controller
0
     
0
     @main_view.setFrameSize(@main_canvas.frame.size)
0
     @main_canvas.addSubview(@main_view)
...
87
88
89
90
91
92
93
94
 
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
 
 
 
 
 
112
113
114
...
87
88
89
 
 
90
 
 
91
92
93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
95
96
97
98
99
100
101
0
@@ -87,28 +87,15 @@ class CommitsController < OSX::NSObject
0
     @commits ? @commits.size : 0
0
   end
0
   
0
- # There is something fishy with ImageTextCell and this method so
0
- # we set the commit object to be used in dataElementForCell and return nil
0
   def tableView_objectValueForTableColumn_row(table_view, table_column, row)
0
- @commit = @commits[row]
0
- return nil
0
+ @commits[row].message.gsub(/\n/, ' ').to_s
0
   end
0
   
0
- # ImageTextCell data methods
0
- def primaryTextForCell_data(cell, data)
0
- data.message.gsub(/\n/, ' ').to_s
0
- end
0
-
0
- def secondaryTextForCell_data(cell, data)
0
- %(by #{data.committer.name} on #{data.committed_date.strftime("%A, %b %d, %I:%M %p")})
0
- end
0
-
0
- def iconForCell_data(icon, data)
0
- @icons[data.committer.email]
0
- end
0
-
0
- def dataElementForCell(cell)
0
- @commit
0
+ objc_method :tableView_willDisplayCell_forTableColumn_row, 'v@:@@@i'
0
+ def tableView_willDisplayCell_forTableColumn_row(table_view, cell, table_column, row)
0
+ commit = @commits[row]
0
+ cell.subtitle = %(by #{commit.committer.name} on #{commit.committed_date.strftime("%A, %b %d, %I:%M %p")})
0
+ cell.gravatarImage = @icons[commit.committer.email]
0
   end
0
   
0
   def webView_didFinishLoadForFrame(view, frame)
...
8
9
10
11
12
13
14
15
...
28
29
30
 
 
31
32
33
...
50
51
52
53
54
55
56
57
...
73
74
75
 
 
76
77
78
...
99
100
101
 
 
102
103
104
...
157
158
159
160
161
162
163
164
...
202
203
204
205
 
206
207
208
...
297
298
299
300
 
301
302
303
...
8
9
10
 
 
11
12
13
...
26
27
28
29
30
31
32
33
...
50
51
52
 
 
53
54
55
...
71
72
73
74
75
76
77
78
...
99
100
101
102
103
104
105
106
...
159
160
161
 
 
162
163
164
...
202
203
204
 
205
206
207
208
...
297
298
299
 
300
301
302
303
0
@@ -8,8 +8,6 @@
0
 
0
 /* Begin PBXBuildFile section */
0
     285BB47C0D8306C60027980C /* mime-types in Resources */ = {isa = PBXBuildFile; fileRef = 285BB4690D8306C60027980C /* mime-types */; };
0
- 285BB5300D849C890027980C /* ImageTextCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 285BB52D0D849C890027980C /* ImageTextCell.h */; };
0
- 285BB5310D849C890027980C /* ImageTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 285BB52E0D849C890027980C /* ImageTextCell.m */; };
0
     285BB5320D849C890027980C /* TexturedWindow.rb in Resources */ = {isa = PBXBuildFile; fileRef = 285BB52F0D849C890027980C /* TexturedWindow.rb */; };
0
     285BB53D0D849DD20027980C /* added.png in Resources */ = {isa = PBXBuildFile; fileRef = 285BB5380D849DD20027980C /* added.png */; };
0
     285BB53E0D849DD20027980C /* committer.png in Resources */ = {isa = PBXBuildFile; fileRef = 285BB5390D849DD20027980C /* committer.png */; };
0
@@ -28,6 +26,8 @@
0
     288CB41A0D8789DD0092B5CC /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 288CB4180D8789DD0092B5CC /* MainMenu.xib */; };
0
     288CB41D0D878A1C0092B5CC /* Info.xib in Resources */ = {isa = PBXBuildFile; fileRef = 288CB41C0D878A1C0092B5CC /* Info.xib */; };
0
     28DA55180D84C3A600D39FBF /* refresh.png in Resources */ = {isa = PBXBuildFile; fileRef = 28DA55170D84C3A600D39FBF /* refresh.png */; };
0
+ 4D922CA80D8889DB002A5539 /* CommitSummaryCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D922CA60D8889DB002A5539 /* CommitSummaryCell.h */; };
0
+ 4D922CA90D8889DB002A5539 /* CommitSummaryCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D922CA70D8889DB002A5539 /* CommitSummaryCell.m */; };
0
     4DDCA7070ACC9A6100E082CE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
0
     4DDCA7080ACC9A6100E082CE /* rb_main.rb in Resources */ = {isa = PBXBuildFile; fileRef = E8F5E25803AEB7C803A81C6F /* rb_main.rb */; };
0
     4DDCA70A0ACC9A6100E082CE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
0
@@ -50,8 +50,6 @@
0
     1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
0
     284B71470D7CDE340075DA6C /* nub.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = nub.xcodeproj; path = nub/nub.xcodeproj; sourceTree = "<group>"; };
0
     285BB4690D8306C60027980C /* mime-types */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "mime-types"; sourceTree = "<group>"; };
0
- 285BB52D0D849C890027980C /* ImageTextCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageTextCell.h; sourceTree = "<group>"; };
0
- 285BB52E0D849C890027980C /* ImageTextCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageTextCell.m; sourceTree = "<group>"; };
0
     285BB52F0D849C890027980C /* TexturedWindow.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = TexturedWindow.rb; sourceTree = "<group>"; };
0
     285BB5380D849DD20027980C /* added.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = added.png; sourceTree = "<group>"; };
0
     285BB5390D849DD20027980C /* committer.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = committer.png; sourceTree = "<group>"; };
0
@@ -73,6 +71,8 @@
0
     29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
0
     29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
0
     29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
0
+ 4D922CA60D8889DB002A5539 /* CommitSummaryCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommitSummaryCell.h; sourceTree = "<group>"; };
0
+ 4D922CA70D8889DB002A5539 /* CommitSummaryCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommitSummaryCell.m; sourceTree = "<group>"; };
0
     4DDCA7110ACC9A6100E082CE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; };
0
     4DDCA7120ACC9A6100E082CE /* GitNub.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GitNub.app; sourceTree = BUILT_PRODUCTS_DIR; };
0
     E8F5E24E03AEB6EC03A81C6F /* RubyCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RubyCocoa.framework; path = /Library/Frameworks/RubyCocoa.framework; sourceTree = "<absolute>"; };
0
@@ -99,6 +99,8 @@
0
         285BB5450D849EA60027980C /* ApplicationController.rb */,
0
         285BB5460D849EA60027980C /* CommitsController.rb */,
0
         285BB5470D849EA60027980C /* InfoWindowController.rb */,
0
+ 4D922CA60D8889DB002A5539 /* CommitSummaryCell.h */,
0
+ 4D922CA70D8889DB002A5539 /* CommitSummaryCell.m */,
0
       );
0
       name = Classes;
0
       sourceTree = "<group>";
0
@@ -157,8 +159,6 @@
0
     29B97315FDCFA39411CA2CEA /* Other Sources */ = {
0
       isa = PBXGroup;
0
       children = (
0
- 285BB52D0D849C890027980C /* ImageTextCell.h */,
0
- 285BB52E0D849C890027980C /* ImageTextCell.m */,
0
         285BB52F0D849C890027980C /* TexturedWindow.rb */,
0
         285BB4690D8306C60027980C /* mime-types */,
0
         288854540D7E352C00862D67 /* grit */,
0
@@ -202,7 +202,7 @@
0
       isa = PBXHeadersBuildPhase;
0
       buildActionMask = 2147483647;
0
       files = (
0
- 285BB5300D849C890027980C /* ImageTextCell.h in Headers */,
0
+ 4D922CA80D8889DB002A5539 /* CommitSummaryCell.h in Headers */,
0
       );
0
       runOnlyForDeploymentPostprocessing = 0;
0
     };
0
@@ -297,7 +297,7 @@
0
       buildActionMask = 2147483647;
0
       files = (
0
         4DDCA70A0ACC9A6100E082CE /* main.m in Sources */,
0
- 285BB5310D849C890027980C /* ImageTextCell.m in Sources */,
0
+ 4D922CA90D8889DB002A5539 /* CommitSummaryCell.m in Sources */,
0
       );
0
       runOnlyForDeploymentPostprocessing = 0;
0
     };

Comments

    No one has commented yet.