Sha256: 8a4ebe1789050fa98262755b183b2c44e6eee6e49d41f3e3de21bb94714a35ea

Contents?: true

Size: 836 Bytes

Versions: 7

Compression:

Stored size: 836 Bytes

Contents

module Redcar
  class Project

    class FindRecentDialog < FilterListDialog
      def update_list(filter)
        recent = Project::Recent.storage['list']
        recent = recent.map {|path| path.gsub(/^#{Regexp.escape(Redcar.home_dir)}\/?/, "")}
        filter_and_rank_by(recent, filter)
      end

      def selected(path, ix)
        unless path[0..0] == "/" or path =~ /^[A-Z]:\//
          path = Redcar.home_dir + "/" + path
        end
        if File.exist?(File.expand_path(path))
          if File.directory?(path)
            Project::Manager.open_project_for_path(path)
            close
          elsif File.file?(File.expand_path(path))
            Project::Manager.open_file(path)
            close
          else
            Project::Recent.remove_path(path)
          end
        end
      end
    end
    
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
redcar-dev-0.13.3dev plugins/project/lib/project/find_recent_dialog.rb
redcar-dev-0.13.2dev plugins/project/lib/project/find_recent_dialog.rb
redcar-dev-0.13.1dev plugins/project/lib/project/find_recent_dialog.rb
redcar-0.12.1 plugins/project/lib/project/find_recent_dialog.rb
redcar-dev-0.13.0dev plugins/project/lib/project/find_recent_dialog.rb
redcar-0.12 plugins/project/lib/project/find_recent_dialog.rb
redcar-dev-0.12.27dev plugins/project/lib/project/find_recent_dialog.rb