Skip to content

Commit

Permalink
add open project folder menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
tka committed Apr 15, 2012
1 parent cb4b5f1 commit 39fa0ff
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/ui/tray.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ def open_dir_handler
end
end
end
def open_project_handler
Swt::Widgets::Listener.impl do |method, evt|
Swt::Program.launch(@watching_dir)
end
end

def compass_project_config
file_name = Compass.detect_configuration_file(@watching_dir)
Expand Down Expand Up @@ -536,11 +541,18 @@ def watch(dir)


@watch_item.text="Stop watching " + dir

@open_project_item = add_menu_item( "Open Project Folder",
open_project_handler,
Swt::SWT::PUSH,
@menu,
@menu.indexOf(@watch_item) +1 )

@install_item = add_menu_item( "Install...",
install_project_handler,
Swt::SWT::CASCADE,
@menu,
@menu.indexOf(@watch_item) +1 )
@menu.indexOf(@open_project_item) +1 )

@install_item.menu = Swt::Widgets::Menu.new( @menu )
build_compass_framework_menuitem( @install_item.menu, install_project_handler )
Expand All @@ -556,7 +568,6 @@ def watch(dir)
Swt::SWT::PUSH,
@menu,
@menu.indexOf(@clean_item) +1 )

if @menu.items[ @menu.indexOf(@build_project_item)+1 ].getStyle != Swt::SWT::SEPARATOR
add_menu_separator(@menu, @menu.indexOf(@build_project_item) + 1 )
end
Expand Down

0 comments on commit 39fa0ff

Please sign in to comment.