public
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/Caged/gitnub.git
Search Repo:
Click here to lend your support to: gitnub and make a donation at www.pledgie.com !
commit  78657c76ea4d62e21a8ab24c2476ef8c4096597d
tree    b55469a753c5cc6707eb9d7c93fff7b19bc888da
parent  9bd00236cb18db48bd11016372916753b054d7cf
gitnub / ApplicationController.rb
100644 41 lines (34 sloc) 0.923 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#
# ApplicationController.rb
# GitNub
#
# Created by Justin Palmer on 3/1/08.
# Copyright (c) 2008 Active Reload, LLC. All rights reserved.
#
 
require 'rubygems'
require 'osx/cocoa'
require 'grit/lib/grit'
 
include OSX
OSX.ns_import 'ImageTextCell'
 
class ApplicationController < OSX::NSObject
  ib_outlet :commits_table
  ib_outlet :commits_controller
  ib_outlet :window
  ib_outlet :main_canvas
  ib_outlet :main_view
  
  def applicationDidFinishLaunching(sender)
    @window.makeKeyAndOrderFront(self)
  end
  
  def applicationShouldTerminateAfterLastWindowClosed(notification)
    return true
  end
  
  def awakeFromNib
    @window.delegate = self
    column = @commits_table.tableColumns[0]
    cell = ImageTextCell.alloc.init
    column.dataCell = cell
    cell.dataDelegate = @commits_controller
    
    @main_view.setFrameSize(@main_canvas.frame.size)
    @main_canvas.addSubview(@main_view)
  end
end