Пример #1
0
K3b::VideoDVDRippingView::VideoDVDRippingView( QWidget* parent )
    : K3b::MediaContentsView( true,
                            K3b::Medium::ContentVideoDVD,
                            K3b::Device::MEDIA_DVD_ALL,
                            K3b::Device::STATE_INCOMPLETE|K3b::Device::STATE_COMPLETE,
                            parent ),
      d( new Private )
{
    // toolbox
    // ----------------------------------------------------------------------------------
    d->toolBox = new KToolBar( mainWidget() );

    KUrlLabel* showFilesLabel = new KUrlLabel( d->toolBox );
    showFilesLabel->setContentsMargins( style()->pixelMetric( QStyle::PM_LayoutLeftMargin ), 0,
                                        style()->pixelMetric( QStyle::PM_LayoutRightMargin ), 0 );
    showFilesLabel->setText( i18n("Show files") );
    showFilesLabel->setWhatsThis( i18n("Shows plain Video DVD vob files from the DVD "
                                       "(including decryption) for further processing with another application") );
    connect( showFilesLabel, SIGNAL(leftClickedUrl()), this, SLOT(slotShowFiles()) );

    d->labelLength = new QLabel( d->toolBox );
    d->labelLength->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
    d->labelLength->setContentsMargins( style()->pixelMetric( QStyle::PM_LayoutLeftMargin ), 0,
                                        style()->pixelMetric( QStyle::PM_LayoutRightMargin ), 0 );

    d->delegate = new VideoDVDTitleDelegate( this );
    d->model = new VideoDVDTitleModel( this );

    // the title view
    // ----------------------------------------------------------------------------------
    d->view = new QTreeView( mainWidget() );
    d->view->setItemDelegate( d->delegate );
    d->view->setSelectionMode( QAbstractItemView::ExtendedSelection );
    d->view->setModel( d->model );
    d->view->setRootIsDecorated( false );
    d->view->header()->setResizeMode( QHeaderView::ResizeToContents );
    d->view->setContextMenuPolicy( Qt::CustomContextMenu );
    d->view->installEventFilter( this );
    connect( d->view, SIGNAL(customContextMenuRequested(QPoint)),
             this, SLOT(slotContextMenu(QPoint)) );

    // general layout
    // ----------------------------------------------------------------------------------
    QVBoxLayout* mainGrid = new QVBoxLayout( mainWidget() );
    mainGrid->addWidget( d->toolBox );
    mainGrid->addWidget( d->view );
    mainGrid->setContentsMargins( 0, 0, 0, 0 );
    mainGrid->setSpacing( 0 );

    setLeftPixmap( K3b::Theme::MEDIA_LEFT );
    setRightPixmap( K3b::Theme::MEDIA_VIDEO );

    initActions();

    d->toolBox->addAction( actionCollection()->action("start_rip") );
    d->toolBox->addSeparator();
    d->toolBox->addWidget( showFilesLabel );
    d->toolBox->addAction( new KToolBarSpacerAction( d->toolBox ) );
    d->toolBox->addWidget( d->labelLength );
}
Пример #2
0
K3bVideoDVDRippingView::K3bVideoDVDRippingView( QWidget* parent, const char * name )
  : K3bMediaContentsView( true,
			  K3bMedium::CONTENT_VIDEO_DVD,
			  K3bDevice::MEDIA_DVD_ALL,
			  K3bDevice::STATE_INCOMPLETE|K3bDevice::STATE_COMPLETE,
			  parent, name )
{
  QGridLayout* mainGrid = new QGridLayout( mainWidget() );

  // toolbox
  // ----------------------------------------------------------------------------------
  QHBoxLayout* toolBoxLayout = new QHBoxLayout( 0, 0, 0, "toolBoxLayout" );
  m_toolBox = new K3bToolBox( mainWidget() );
  toolBoxLayout->addWidget( m_toolBox );
  QSpacerItem* spacer = new QSpacerItem( 10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum );
  toolBoxLayout->addItem( spacer );
  m_labelLength = new QLabel( mainWidget() );
  m_labelLength->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
  toolBoxLayout->addWidget( m_labelLength );


  // the title view
  // ----------------------------------------------------------------------------------
  m_titleView = new K3bVideoDVDRippingTitleListView( mainWidget() );

  connect( m_titleView, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)),
	   this, SLOT(slotContextMenu(KListView*, QListViewItem*, const QPoint&)) );

  // general layout
  // ----------------------------------------------------------------------------------
  mainGrid->addLayout( toolBoxLayout, 0, 0 );
  mainGrid->addWidget( m_titleView, 1, 0 );


  initActions();

  m_toolBox->addButton( actionCollection()->action("start_rip"), true );

  setLeftPixmap( K3bTheme::MEDIA_LEFT );
  setRightPixmap( K3bTheme::MEDIA_VIDEO );
}