示例#1
0
/** 
 ****************************************************************************
 * @brief Adds a list of plugins to the plugin registry
 *
 * @param list of plugins
 * 
 ****************************************************************************
 */
void PluginManagerImpl::register_plugins(grt::ListRef<app_Plugin> plugins)
{
  grt::ListRef<app_Plugin> list= get_plugin_list();
  
  for (size_t c= plugins.count(), i= 0; i < c; i++)
    list.insert(plugins[i]);
}
  virtual void refresh_children() {
    Node *add_node = 0;

    focused = 0;

    if (!children.empty()) {
      add_node = children.front();
      children.erase(children.begin());
    }
    clear_children();

    if (add_node)
      children.push_back(add_node);

    for (size_t c = _list.count(), i = 0; i < c; i++) {
      db_DatabaseObjectRef object(_list[i]);

      SchemaObjectNode *node = _create_node(object);

      node->type = OverviewBE::OItem;
      node->label = object->name();
      node->small_icon = IconManager::get_instance()->get_icon_id(object->get_metaclass(), Icon16);
      node->large_icon = IconManager::get_instance()->get_icon_id(object->get_metaclass(), Icon48);

      children.push_back(node);
    }
    // sort items after add_node
    std::sort(children.begin() + (add_node ? 1 : 0), children.end(), CompNodeLabel);
  }
  virtual void refresh_children()
  {
    Node *add_item= 0;
    
    if (!children.empty())
    {
      add_item = children.front();
      children.erase(children.begin());
    }
    clear_children();
    if (add_item)
      children.push_back(add_item);

    for (size_t c= _list.count(), i= 0; i < c; i++)
    {
      PrivilegeObjectNode *node= new PrivilegeObjectNode(_list[i], 
                                                         boost::bind(&RoleListNode::refresh, this, _1, _2));
      
      node->type= OverviewBE::OItem;
      node->label= _list[i]->name();
      node->small_icon= IconManager::get_instance()->get_icon_id(_list[i]->get_metaclass(), Icon16);
      node->large_icon= IconManager::get_instance()->get_icon_id(_list[i]->get_metaclass(), Icon48);
      node->remove= boost::bind(_remove, _1, db_RoleRef::cast_from(_list[i]));

      children.push_back(node);
    }
  }