Permalink
Browse files

Hookup branch menu [Paul Scott-Murphy]

  • Loading branch information...
1 parent 66e4e62 commit a1d6f9d106e2d04dc0c61671f690c46f4366ca6a @Caged committed Mar 21, 2008
Showing with 257 additions and 568 deletions.
  1. +6 −3 CommitsController.rb
  2. +251 −565 English.lproj/MainMenu.xib
@@ -21,14 +21,15 @@ def awakeFromNib
@current_commit_offset = 0
@offset = 50
@active_commit = nil
+ @branch = :master
@icons = Hash.new do |hash, email|
gravatar = NSURL.URLWithString("http://www.gravatar.com/avatar.php?gravatar_id=#{MD5.hexdigest(email)}&size=36")
hash[email] = NSImage.alloc.initWithContentsOfURL(gravatar)
end
if(fetch_git_repository)
setup_commit_detail_view
- fetch_commits_for :master, @offset
+ fetch_commits_for @branch, @offset
setup_branches_menu
setup_paging_control
@commits_table.reloadData
@@ -59,7 +60,7 @@ def page_commits(segment)
end
@current_commit_offset = 0 if @current_commit_offset == -(@offset)
- fetch_commits_for(:master, @offset, @current_commit_offset)
+ fetch_commits_for(@branch, @offset, @current_commit_offset)
@commits_table.reloadData
select_latest_commit
@@ -162,7 +163,8 @@ def update_main_document
def refresh
current_commit = active_commit && active_commit.id
- fetch_commits_for :master, @offset
+ @branch = @branch_select.titleOfSelectedItem
+ fetch_commits_for @branch, @offset
@commits_table.reloadData
@@ -197,6 +199,7 @@ def setup_branches_menu
@repo.branches.each do |branch|
@branch_select.addItemWithTitle(branch.name)
end
+ @branch_select.selectItemWithTitle(@branch)
end
def setup_paging_control
Oops, something went wrong.

0 comments on commit a1d6f9d

Please sign in to comment.