Skip to content

Commit

Permalink
Open project in webistrano when clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
alexspeller committed Aug 16, 2011
1 parent 2b747ce commit 2ce9cc0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion controller/project_controller.rb
Expand Up @@ -70,7 +70,7 @@ def remove_loading(notification)

def add_host(notification)
notification.object.projects.each do |project|
item = status_menu.insertItemWithTitle_action_keyEquivalent_atIndex_(project.name.to_s, nil, "", 0)
item = status_menu.insertItemWithTitle_action_keyEquivalent_atIndex_(project.name.to_s, "project_clicked:", "", 0)
item.setTarget self
item.setRepresentedObject project
add_stages project
Expand Down Expand Up @@ -159,6 +159,11 @@ def stage_clicked(sender)
url = NSURL.URLWithString sender.representedObject.url
NSWorkspace.sharedWorkspace.openURL url
end

def project_clicked sender
url = NSURL.URLWithString sender.representedObject.url
NSWorkspace.sharedWorkspace.openURL url
end

def run_task(sender = nil)
taskName = @task_field.stringValue.to_s
Expand Down
4 changes: 4 additions & 0 deletions model/project.rb
Expand Up @@ -23,6 +23,10 @@ def fully_loaded?
def stages_url
"#{host.url}/projects/#{self.webistrano_id}/stages.xml"
end

def url
"#{host.url}/projects/#{webistrano_id}"
end

def fetch_stages doc
to_stages doc
Expand Down

0 comments on commit 2ce9cc0

Please sign in to comment.