Commit 5c1af03d authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Splitting EffectInstanceWidget in two: One effect part, one instance part.

parent 136cf96c
......@@ -162,6 +162,7 @@ ELSE(NOT WITH_GUI)
Gui/effectsengine/EffectsList.cpp
Gui/effectsengine/EffectsListView.cpp
Gui/effectsengine/EffectStack.cpp
Gui/effectsengine/EffectWidget.cpp
Gui/export/RendererSettings.cpp
Gui/export/ShareOnInternet.cpp
Gui/import/ImportController.cpp
......@@ -230,6 +231,7 @@ ELSE(NOT WITH_GUI)
Gui/effectsengine/EffectsList.h
Gui/effectsengine/EffectsListView.h
Gui/effectsengine/EffectStack.h
Gui/effectsengine/EffectWidget.h
Gui/export/RendererSettings.h
Gui/export/ShareOnInternet.h
Gui/import/ImportController.h
......@@ -289,6 +291,7 @@ ELSE(NOT WITH_GUI)
Gui/effectsengine/ui/EffectsList.ui
Gui/effectsengine/ui/EffectInstanceWidget.ui
Gui/effectsengine/ui/EffectStack.ui
Gui/effectsengine/ui/EffectWidget.ui
Gui/export/RendererSettings.ui
Gui/export/ShareOnInternet.ui
Gui/import/ui/ImportController.ui
......
......@@ -47,13 +47,8 @@ EffectInstanceWidget::setEffectInstance( EffectInstance *instance )
{
clear();
m_effect = instance;
m_ui->nameValueLabel->setText( instance->effect()->name() );
m_ui->descValueLabel->setText( instance->effect()->description() );
m_ui->typeValueLabel->setText( nameFromType( instance->effect()->type() ) );
m_ui->authorValueLabel->setText( instance->effect()->author() );
QString version = QString::number( instance->effect()->getMajor() ) + '.' +
QString::number( instance->effect()->getMinor() );
m_ui->versionValueLabel->setText( version );
m_ui->effectWidget->setEffect( instance->effect() );
EffectInstance::ParamList::iterator it = instance->params().begin();
EffectInstance::ParamList::iterator ite = instance->params().end();
while ( it != ite )
......@@ -75,35 +70,13 @@ EffectInstanceWidget::setEffectInstance( EffectInstance *instance )
void
EffectInstanceWidget::clear()
{
m_ui->nameValueLabel->setText( "" );
m_ui->descValueLabel->setText( "" );
m_ui->typeValueLabel->setText( "" );
m_ui->authorValueLabel->setText( "" );
m_ui->versionValueLabel->setText( "" );
m_ui->effectWidget->clear();
qDeleteAll( m_settings );
m_settings.clear();
qDeleteAll( m_widgets );
m_widgets.clear();
}
QString
EffectInstanceWidget::nameFromType( Effect::Type type )
{
switch ( type )
{
case Effect::Filter:
return tr( "Filter" );
case Effect::Source:
return tr( "Source" );
case Effect::Mixer2:
return tr( "Mixer 2" );
case Effect::Mixer3:
return tr( "Mixer 3" );
default:
return tr( "Unknown type" );
}
}
ISettingsCategoryWidget*
EffectInstanceWidget::widgetFactory( EffectSettingValue *s )
{
......
......@@ -41,7 +41,6 @@ class EffectInstanceWidget : public QWidget
explicit EffectInstanceWidget( QWidget *parent = 0);
void setEffectInstance( EffectInstance* effectInstance );
private:
static QString nameFromType( Effect::Type type );
ISettingsCategoryWidget *widgetFactory( EffectSettingValue *s );
void clear();
private:
......
/*****************************************************************************
* EffectWidget.cpp: Display info about an effect.
*****************************************************************************
* 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 "EffectWidget.h"
#include "ui_EffectWidget.h"
EffectWidget::EffectWidget(QWidget *parent) :
QWidget( parent ),
m_ui( new Ui::EffectWidget )
{
m_ui->setupUi(this);
}
EffectWidget::~EffectWidget()
{
delete m_ui;
}
void
EffectWidget::setEffect( Effect *effect )
{
clear();
m_effect = effect;
m_ui->nameValueLabel->setText( m_effect->name() );
m_ui->descValueLabel->setText( m_effect->description() );
m_ui->typeValueLabel->setText( nameFromType( m_effect->type() ) );
m_ui->authorValueLabel->setText( m_effect->author() );
QString version = QString::number( m_effect->getMajor() ) + '.' +
QString::number( m_effect->getMinor() );
m_ui->versionValueLabel->setText( version );
}
void
EffectWidget::clear()
{
m_ui->nameValueLabel->setText( "" );
m_ui->descValueLabel->setText( "" );
m_ui->typeValueLabel->setText( "" );
m_ui->authorValueLabel->setText( "" );
m_ui->versionValueLabel->setText( "" );
}
QString
EffectWidget::nameFromType( Effect::Type type )
{
switch ( type )
{
case Effect::Filter:
return tr( "Filter" );
case Effect::Source:
return tr( "Source" );
case Effect::Mixer2:
return tr( "Mixer 2" );
case Effect::Mixer3:
return tr( "Mixer 3" );
default:
return tr( "Unknown type" );
}
}
/*****************************************************************************
* EffectWidget.h: Display info about an effect.
*****************************************************************************
* 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.
*****************************************************************************/
#ifndef EFFECTWIDGET_H
#define EFFECTWIDGET_H
#include <QWidget>
#include "Effect.h"
namespace Ui
{
class EffectWidget;
}
class EffectWidget : public QWidget
{
Q_OBJECT
public:
explicit EffectWidget( QWidget *parent = 0 );
~EffectWidget();
void setEffect( Effect* effect );
void clear();
private:
static QString nameFromType( Effect::Type type );
private:
Ui::EffectWidget *m_ui;
Effect *m_effect;
};
#endif // EFFECTWIDGET_H
......@@ -14,136 +14,11 @@
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="topMargin">
<number>4</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Overview</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="nameLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="nameValueLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="authorLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Author</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="ExtendedLabel" name="authorValueLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="typeLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Type</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="typeValueLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="versionLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Version</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="versionValueLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="descLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Description</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="1" colspan="3">
<widget class="QLabel" name="descValueLabel">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="EffectWidget" name="effectWidget" native="true"/>
</item>
<item>
<widget class="QScrollArea" name="scrollArea">
......@@ -156,7 +31,7 @@
<x>0</x>
<y>0</y>
<width>386</width>
<height>147</height>
<height>241</height>
</rect>
</property>
<property name="sizePolicy">
......@@ -208,9 +83,10 @@
</widget>
<customwidgets>
<customwidget>
<class>ExtendedLabel</class>
<extends>QLabel</extends>
<header>ExtendedLabel.h</header>
<class>EffectWidget</class>
<extends>QWidget</extends>
<header>EffectWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EffectWidget</class>
<widget class="QWidget" name="EffectWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>180</width>
<height>112</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Overview</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="nameLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="nameValueLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="authorLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Author</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="ExtendedLabel" name="authorValueLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="typeLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Type</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="typeValueLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="versionLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Version</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="versionValueLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="descLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Description</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="1" colspan="3">
<widget class="QLabel" name="descValueLabel">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ExtendedLabel</class>
<extends>QLabel</extends>
<header>ExtendedLabel.h</header>
</customwidget>
</customwidgets>
<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