Commit a37958d3 authored by Thomas Boquet's avatar Thomas Boquet
Browse files

handling double click in media library

parent e3dd088a
/*****************************************************************************
* ListViewController.h:
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Thomas Boquet <thomas.boquet@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 "ListViewController.h"
......@@ -6,11 +28,10 @@
ListViewController::ListViewController( StackViewController* nav ) : m_nav( nav )
{
m_title = new QString( "Media List 42" );
m_title = new QString( "Media List" );
m_scrollArea = new QScrollArea();
m_layout = new QVBoxLayout();
m_container = new QWidget();
m_layout = new QVBoxLayout();
m_container = new QWidget();
m_layout->setAlignment( Qt::AlignTop );
m_layout->setSpacing( 0 );
......
/*****************************************************************************
* ListViewController.h:
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Thomas Boquet <thomas.boquet@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 LISTVIEWCONTROLLER_H
#define LISTVIEWCONTROLLER_H
......@@ -19,12 +41,8 @@ public:
QWidget* view() const;
const QString& title() const;
void addCell( QWidget* cell );
private:
QString* m_title;
QScrollArea* m_scrollArea;
......
#include "MediaCellView.h"
#include "ui_MediaCellView.h"
#include "Library.h"
#include "ClipProperty.h"
MediaCellView::MediaCellView( const QUuid& uuid, QWidget *parent ) :
QWidget( parent ), m_ui( new Ui::MediaCellView ), m_uuid( uuid )
......@@ -45,3 +47,13 @@ const QUuid& MediaCellView::uuid() const
{
return m_uuid;
}
void MediaCellView::mouseDoubleClickEvent( QMouseEvent* event )
{
if ( event->buttons() | Qt::LeftButton == Qt::LeftButton )
{
ClipProperty* mp = new ClipProperty( Library::getInstance()->getClip( m_uuid ), this );
mp->setModal( true );
mp->show();
}
}
......@@ -3,6 +3,7 @@
#include <QWidget>
#include <QUuid>
#include <QMouseEvent>
namespace Ui
{
......@@ -28,6 +29,9 @@ protected:
private:
Ui::MediaCellView *m_ui;
const QUuid m_uuid;
protected:
void mouseDoubleClickEvent( QMouseEvent* );
};
#endif // MEDIACELLVIEW_H
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