Commit 4e97bdad authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MediaLibrary: Creating a new Widget to display the media library.

parent 16d29cd5
......@@ -157,6 +157,7 @@ ELSE(NOT WITH_GUI)
Gui/import/ImportController.cpp
Gui/library/ListViewController.cpp
Gui/library/MediaCellView.cpp
Gui/library/MediaLibrary.cpp
Gui/library/MediaListView.cpp
Gui/library/StackViewController.cpp
Gui/library/StackViewNavController.cpp
......@@ -205,6 +206,7 @@ ELSE(NOT WITH_GUI)
Gui/import/TagWidget.h
Gui/library/ListViewController.h
Gui/library/MediaCellView.h
Gui/library/MediaLibrary.h
Gui/library/MediaListView.h
Gui/library/StackViewController.h
Gui/library/StackViewNavController.h
......@@ -252,6 +254,7 @@ ELSE(NOT WITH_GUI)
Gui/import/ui/ImportController.ui
Gui/library/StackViewNavController.ui
Gui/library/ui/MediaCellView.ui
Gui/library/ui/MediaLibrary.ui
Gui/library/ui/StackViewNavController.ui
Gui/ui/About.ui
Gui/ui/ClipProperty.ui
......
......@@ -4,7 +4,7 @@
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Ludovic Fauvet <etix@l0cal.com>
* Hugo Beauzee-Luyssen <beauze.h@gmail.com>
* Hugo Beauzée-Luyssen <beauze.h@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -46,7 +46,7 @@
/* Widgets */
#include "DockWidgetManager.h"
#include "ImportController.h"
#include "MediaListView.h"
#include "MediaLibrary.h"
#include "PreviewWidget.h"
#include "timeline/Timeline.h"
#include "timeline/TracksView.h"
......@@ -272,29 +272,20 @@ MainWindow::loadVlmcPreferences( const QString &subPart )
void
MainWindow::setupLibrary()
{
//GUI part :
QWidget *libraryWidget = new QWidget( this );
libraryWidget->setMinimumWidth( 280 );
QPushButton *button = new QPushButton( tr( "Import" ), this );
connect( button, SIGNAL( clicked() ), this, SLOT( on_actionImport_triggered() ) );
StackViewController *nav = new StackViewController( libraryWidget );
MediaListView *mediaView = new MediaListView( nav, Library::getInstance() );
nav->pushViewController( mediaView );
libraryWidget->layout()->addWidget( button );
m_importController = new ImportController();
const ClipRenderer* clipRenderer = qobject_cast<const ClipRenderer*>( m_clipPreview->getGenericRenderer() );
Q_ASSERT( clipRenderer != NULL );
DockWidgetManager::getInstance()->addDockedWidget( libraryWidget, QT_TRANSLATE_NOOP( "DockWidgetManager", "Media Library" ),
MediaLibrary *mediaLibrary = new MediaLibrary();
DockWidgetManager::getInstance()->addDockedWidget( mediaLibrary, QT_TRANSLATE_NOOP( "DockWidgetManager", "Media Library" ),
Qt::AllDockWidgetAreas,
QDockWidget::AllDockWidgetFeatures,
Qt::LeftDockWidgetArea );
connect( mediaView, SIGNAL( clipSelected( Clip* ) ),
connect( mediaLibrary, SIGNAL( clipSelected( Clip* ) ),
clipRenderer, SLOT( setClip( Clip* ) ) );
connect( mediaLibrary, SIGNAL( importRequired() ),
this, SLOT( on_actionImport_triggered() ) );
connect( Library::getInstance(), SIGNAL( clipRemoved( const QUuid& ) ),
clipRenderer, SLOT( clipUnloaded( const QUuid& ) ) );
}
......
/*****************************************************************************
* MediaLibrary.cpp: VLMC media library's ui
*****************************************************************************
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Hugo Beauzée-Luyssen <beauze.h@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "MediaLibrary.h"
#include "Library.h"
#include "MediaListView.h"
#include "StackViewController.h"
MediaLibrary::MediaLibrary(QWidget *parent) : QWidget(parent),
m_ui( new Ui::MediaLibrary() )
{
m_ui->setupUi( this );
StackViewController *nav = new StackViewController( m_ui->mediaListContainer );
MediaListView *mediaListView = new MediaListView( nav, Library::getInstance() );
nav->pushViewController( mediaListView );
connect( m_ui->importButton, SIGNAL( clicked() ),
this, SIGNAL( importRequired() ) );
connect( mediaListView, SIGNAL( clipSelected( Clip* ) ),
this, SIGNAL( clipSelected( Clip* ) ) );
}
/*****************************************************************************
* MediaLibrary.h: VLMC media library's ui
*****************************************************************************
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Hugo Beauzee-Luyssen <beauze.h@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef MEDIALIBRARY_H
#define MEDIALIBRARY_H
#include <QWidget>
#include "ui_MediaLibrary.h"
class Clip;
class MediaLibrary : public QWidget
{
Q_OBJECT
Q_DISABLE_COPY( MediaLibrary );
public:
explicit MediaLibrary( QWidget *parent = 0);
private:
Ui::MediaLibrary *m_ui;
signals:
void importRequired();
void clipSelected( Clip* );
};
#endif // MEDIALIBRARY_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MediaLibrary</class>
<widget class="QWidget" name="MediaLibrary">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>280</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QWidget" name="mediaListContainer" native="true"/>
</item>
<item>
<widget class="QPushButton" name="importButton">
<property name="text">
<string>Import</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment