Ejemplo n.º 1
0
void ControlPointWindow::on_navigatorTreeView_clicked(const QModelIndex& index)
{
    ControlPointNavigatorItem* navItem =
        static_cast<ControlPointNavigatorItem*>(index.internalPointer());

    if (navItem)
    {
        m_dataItemDisplay->setData(navItem);

        CdsContainerItem* containerItem = dynamic_cast<CdsContainerItem*>(navItem);
        if (containerItem && containerItem->container()->childIds().isEmpty())
        {
            ContentDirectoryItem* cdItem = 0;
            ControlPointNavigatorItem* tmpItem = containerItem->parent();
            for(;;)
            {
                cdItem = dynamic_cast<ContentDirectoryItem*>(tmpItem);
                if (cdItem)
                {
                    break;
                }
                else
                {
                    tmpItem = tmpItem->parent();
                }
            }
            cdItem->browser()->browse(HBrowseParams(
                containerItem->container()->id(), HBrowseParams::ObjectAndDirectChildren));
        }
    }
}
Ejemplo n.º 2
0
void ControlPointWindow::on_navigatorTreeView_clicked(QModelIndex index)
{
    isFocusOnTreeView = true;

    ControlPointNavigatorItem* navItem
            = static_cast<ControlPointNavigatorItem*>(index.internalPointer());

    //QMessageBox::information(this, tr("test"), tr("Type: %1").arg(navItem->type()));

    if (navItem->type() == ControlPointNavigatorItem::CdsContainer)
    {
        if (getCdsContainerDetail(navItem))
            updateDetailDisplay(navItem);
    }
    else
        updateDetailDisplay(navItem);
}
Ejemplo n.º 3
0
bool ControlPointWindow::getCdsContainerDetail(ControlPointNavigatorItem* navItem)
{
    ControlPointCdsContainerItem* cdsContainerItem =
            dynamic_cast<ControlPointCdsContainerItem*>(navItem);

    if (cdsContainerItem && cdsContainerItem->container()->childIds().isEmpty())
    {
        ControlPointNavigatorItem* curItem = cdsContainerItem->parent();
        ControlPointContentDirectoryItem* parItem = 0;

        do
        {
            parItem = dynamic_cast<ControlPointContentDirectoryItem*>(curItem);
            curItem = curItem->parent();
        }while (!parItem);

        parItem->browser()->browse(HBrowseParams(cdsContainerItem->container()->id(),
                                                 HBrowseParams::ObjectAndDirectChildren));
        return false;
    }
    return true;
}