class Plugin::Activity::ModelSelector

Constants

ICON
MODEL
MODEL_KIND
TITLE

Public Class Methods

new(*rest) click to toggle source
Calls superclass method
# File core/plugin/activity/model_selector.rb, line 7
def initialize(*rest)
  super
  initialize_model
  initialize_column
  set_headers_visible(false)
  self.ssc(:row_activated, &self.class.open_block)
end

Public Instance Methods

set(models) click to toggle source
# File core/plugin/activity/model_selector.rb, line 15
def set(models)
  model.clear
  models.each do |record|
    iter = model.append
    if record.respond_to? :icon
      iter[ICON] = record.icon.load_pixbuf(width: 24, height: 24) do |loaded_icon|
        iter[ICON] = loaded_icon
      end
    end
    iter[MODEL_KIND] = record.class.spec[:name]
    iter[TITLE] = record.title
    iter[MODEL] = record
  end
end