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

Rename MediaLibrary UI class to MediaLibraryView

This is more of a workaround to allow a new MediaLibrary class to exist,
however I hope that we will be able to split VLMC in two components in
the future; at which point this commit should probably be reverted or
adapted
parent 8162cfda
......@@ -187,7 +187,7 @@ vlmc_SOURCES += \
src/Gui/import/TagWidget.cpp \
src/Gui/library/ListViewController.cpp \
src/Gui/library/MediaCellView.cpp \
src/Gui/library/MediaLibrary.cpp \
src/Gui/library/MediaLibraryView.cpp \
src/Gui/library/MediaListView.cpp \
src/Gui/library/StackViewController.cpp \
src/Gui/library/StackViewNavController.cpp \
......@@ -256,7 +256,7 @@ vlmc_SOURCES += \
src/Gui/library/ListViewController.h \
src/Gui/library/StackViewController.h \
src/Gui/library/MediaListView.h \
src/Gui/library/MediaLibrary.h \
src/Gui/library/MediaLibraryView.h \
src/Gui/library/MediaCellView.h \
src/Gui/library/StackViewNavController.h \
src/Gui/library/ViewController.h \
......@@ -301,7 +301,7 @@ nodist_vlmc_SOURCES += \
src/Gui/settings/ColorWidget.moc.cpp \
src/Gui/import/ImportController.moc.cpp \
src/Gui/library/StackViewController.moc.cpp \
src/Gui/library/MediaLibrary.moc.cpp \
src/Gui/library/MediaLibraryView.moc.cpp \
src/Gui/wizard/firstlaunch/FirstLaunchPage.moc.cpp \
src/Gui/settings/Panel.moc.cpp \
src/Gui/preview/RenderWidget.moc.cpp \
......@@ -357,7 +357,7 @@ vlmc_UI = \
src/Gui/ui/ImportController.ui \
src/Gui/ui/TagWidget.ui \
src/Gui/ui/MediaCellView.ui \
src/Gui/ui/MediaLibrary.ui \
src/Gui/ui/MediaLibraryView.ui \
src/Gui/ui/StackViewNavController.ui \
src/Gui/ui/ClipMetadataDisplayer.ui \
src/Gui/ui/PreviewWidget.ui \
......
......@@ -56,7 +56,7 @@
/* Widgets */
#include "effectsengine/EffectsListView.h"
#include "import/ImportController.h"
#include "library/MediaLibrary.h"
#include "library/MediaLibraryView.h"
#include "widgets/NotificationZone.h"
#include "preview/PreviewWidget.h"
#include "timeline/Timeline.h"
......@@ -495,7 +495,7 @@ MainWindow::setupEffectsList()
void
MainWindow::setupLibrary()
{
m_mediaLibrary = new MediaLibrary;
m_mediaLibrary = new MediaLibraryView;
m_dockedLibrary = dockWidget( m_mediaLibrary, Qt::TopDockWidgetArea );
}
......
......@@ -37,7 +37,7 @@ class QUndoView;
class EffectsListView;
class ImportController;
class MediaLibrary;
class MediaLibraryView;
class PreviewWidget;
class Project;
class ProjectWizard;
......@@ -130,7 +130,7 @@ private:
SettingsDialog* m_projectPreferences;
ProjectWizard* m_wizard;
ImportController* m_importController;
MediaLibrary *m_mediaLibrary;
MediaLibraryView *m_mediaLibrary;
EffectsListView* m_effectsList;
QUndoView* m_undoView;
QDockWidget* m_dockedUndoView;
......
......@@ -24,7 +24,7 @@
# include "config.h"
#endif
#include "MediaLibrary.h"
#include "MediaLibraryView.h"
#include "Project/Project.h"
#include "Media/Clip.h"
......@@ -40,8 +40,8 @@
#include <QUrl>
#include <QMimeData>
MediaLibrary::MediaLibrary(QWidget *parent) : QWidget(parent),
m_ui( new Ui::MediaLibrary() )
MediaLibraryView::MediaLibraryView(QWidget *parent) : QWidget(parent),
m_ui( new Ui::MediaLibraryView() )
{
m_ui->setupUi( this );
setAcceptDrops( true );
......@@ -62,13 +62,13 @@ MediaLibrary::MediaLibrary(QWidget *parent) : QWidget(parent),
this, SLOT( filterTypeChanged() ) );
}
MediaLibrary::~MediaLibrary()
MediaLibraryView::~MediaLibraryView()
{
delete m_ui;
}
void
MediaLibrary::changeEvent( QEvent *e )
MediaLibraryView::changeEvent( QEvent *e )
{
QWidget::changeEvent( e );
switch ( e->type() )
......@@ -82,7 +82,7 @@ MediaLibrary::changeEvent( QEvent *e )
}
void
MediaLibrary::filterUpdated( const QString &filter )
MediaLibraryView::filterUpdated( const QString &filter )
{
const MediaListView::MediaList &medias = m_mediaListView->mediaList();
MediaListView::MediaList::const_iterator it = medias.begin();
......@@ -97,8 +97,8 @@ MediaLibrary::filterUpdated( const QString &filter )
}
}
MediaLibrary::Filter
MediaLibrary::currentFilter()
MediaLibraryView::Filter
MediaLibraryView::currentFilter()
{
switch ( m_ui->filterType->currentIndex() )
{
......@@ -112,7 +112,7 @@ MediaLibrary::currentFilter()
}
void
MediaLibrary::viewChanged( ViewController *view )
MediaLibraryView::viewChanged( ViewController *view )
{
MediaListView *mlv = qobject_cast<MediaListView*>( view );
......@@ -125,25 +125,25 @@ MediaLibrary::viewChanged( ViewController *view )
}
bool
MediaLibrary::filterByName( const Clip *clip, const QString &filter )
MediaLibraryView::filterByName( const Clip *clip, const QString &filter )
{
return ( clip->media()->fileName().contains( filter, Qt::CaseInsensitive ) );
}
bool
MediaLibrary::filterByTags( const Clip *clip, const QString &filter )
MediaLibraryView::filterByTags( const Clip *clip, const QString &filter )
{
return ( clip->matchMetaTag( filter ) );
}
void
MediaLibrary::filterTypeChanged()
MediaLibraryView::filterTypeChanged()
{
filterUpdated( m_ui->filterInput->text() );
}
void
MediaLibrary::dragEnterEvent( QDragEnterEvent *event )
MediaLibraryView::dragEnterEvent( QDragEnterEvent *event )
{
if ( event->mimeData()->hasFormat( "text/uri-list" ) )
{
......@@ -154,19 +154,19 @@ MediaLibrary::dragEnterEvent( QDragEnterEvent *event )
}
void
MediaLibrary::dragMoveEvent( QDragMoveEvent *event )
MediaLibraryView::dragMoveEvent( QDragMoveEvent *event )
{
event->acceptProposedAction();
}
void
MediaLibrary::dragLeaveEvent( QDragLeaveEvent *event )
MediaLibraryView::dragLeaveEvent( QDragLeaveEvent *event )
{
event->accept();
}
void
MediaLibrary::dropEvent( QDropEvent *event )
MediaLibraryView::dropEvent( QDropEvent *event )
{
const QList<QUrl> &fileList = event->mimeData()->urls();
......
......@@ -20,26 +20,27 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef MEDIALIBRARY_H
#define MEDIALIBRARY_H
#ifndef MEDIALIBRARYVIEW_H
#define MEDIALIBRARYVIEW_H
#include <QWidget>
#include "ui/MediaLibrary.h"
#include "ui/MediaLibraryView.h"
class Clip;
class MediaListView;
class MediaContainer;
class ViewController;
class MediaLibrary : public QWidget
class MediaLibraryView : public QWidget
{
Q_OBJECT
Q_DISABLE_COPY( MediaLibrary )
Q_DISABLE_COPY( MediaLibraryView )
public:
typedef bool (*Filter)( const Clip*, const QString& filter );
explicit MediaLibrary( QWidget *parent = 0);
virtual ~MediaLibrary();
explicit MediaLibraryView( QWidget *parent = 0);
virtual ~MediaLibraryView();
protected:
void dragEnterEvent( QDragEnterEvent *event );
......@@ -62,8 +63,8 @@ class MediaLibrary : public QWidget
static bool filterByTags( const Clip *clip, const QString &filter );
private:
Ui::MediaLibrary *m_ui;
MediaListView *m_mediaListView;
Ui::MediaLibraryView *m_ui;
MediaListView *m_mediaListView;
private slots:
void filterUpdated( const QString &filter );
......@@ -80,4 +81,4 @@ class MediaLibrary : public QWidget
void clipSelected( Clip* );
};
#endif // MEDIALIBRARY_H
#endif // MEDIALIBRARYVIEW_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MediaLibrary</class>
<widget class="QWidget" name="MediaLibrary">
<class>MediaLibraryView</class>
<widget class="QWidget" name="MediaLibraryView">
<property name="geometry">
<rect>
<x>0</x>
......
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