Commit 8ff59181 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt, logo filter should have a browse button for file selection.

Closes #4293
parent 3fe0475f
...@@ -36,11 +36,13 @@ ...@@ -36,11 +36,13 @@
#include <QSignalMapper> #include <QSignalMapper>
#include <QComboBox> #include <QComboBox>
#include <QTimer> #include <QTimer>
#include <QFileDialog>
#include "components/extended_panels.hpp" #include "components/extended_panels.hpp"
#include "dialogs/preferences.hpp" #include "dialogs/preferences.hpp"
#include "qt4.hpp" #include "qt4.hpp"
#include "input_manager.hpp" #include "input_manager.hpp"
#include "util/qt_dirs.hpp"
#include "../../audio_filter/equalizer_presets.h" #include "../../audio_filter/equalizer_presets.h"
#include <vlc_aout.h> #include <vlc_aout.h>
...@@ -204,6 +206,7 @@ ExtVideo::ExtVideo( intf_thread_t *_p_intf, QTabWidget *_parent ) : ...@@ -204,6 +206,7 @@ ExtVideo::ExtVideo( intf_thread_t *_p_intf, QTabWidget *_parent ) :
SETUP_VFILTER_OPTION( eraseMaskText, editingFinished() ) SETUP_VFILTER_OPTION( eraseMaskText, editingFinished() )
SETUP_VFILTER_OPTION( eraseYSpin, valueChanged( int ) ) SETUP_VFILTER_OPTION( eraseYSpin, valueChanged( int ) )
SETUP_VFILTER_OPTION( eraseXSpin, valueChanged( int ) ) SETUP_VFILTER_OPTION( eraseXSpin, valueChanged( int ) )
BUTTONACT( ui.eraseBrowseBtn, browseEraseFile() );
SETUP_VFILTER( marq ) SETUP_VFILTER( marq )
SETUP_VFILTER_OPTION( marqMarqueeText, textChanged( const QString& ) ) SETUP_VFILTER_OPTION( marqMarqueeText, textChanged( const QString& ) )
...@@ -214,6 +217,7 @@ ExtVideo::ExtVideo( intf_thread_t *_p_intf, QTabWidget *_parent ) : ...@@ -214,6 +217,7 @@ ExtVideo::ExtVideo( intf_thread_t *_p_intf, QTabWidget *_parent ) :
SETUP_VFILTER_OPTION( logoYSpin, valueChanged( int ) ) SETUP_VFILTER_OPTION( logoYSpin, valueChanged( int ) )
SETUP_VFILTER_OPTION( logoXSpin, valueChanged( int ) ) SETUP_VFILTER_OPTION( logoXSpin, valueChanged( int ) )
SETUP_VFILTER_OPTION( logoOpacitySlider, valueChanged( int ) ) SETUP_VFILTER_OPTION( logoOpacitySlider, valueChanged( int ) )
BUTTONACT( ui.logoBrowseBtn, browseLogo() );
SETUP_VFILTER( gradfun ) SETUP_VFILTER( gradfun )
SETUP_VFILTER_OPTION( gradfunRadiusSlider, valueChanged( int ) ) SETUP_VFILTER_OPTION( gradfunRadiusSlider, valueChanged( int ) )
...@@ -400,6 +404,20 @@ void ExtVideo::updateFilters() ...@@ -400,6 +404,20 @@ void ExtVideo::updateFilters()
: groupbox->isChecked() ); : groupbox->isChecked() );
} }
void ExtVideo::browseLogo()
{
QString file = QFileDialog::getOpenFileName( NULL, qtr( "Logo filenames" ),
p_intf->p_sys->filepath, "Images (*.png *.jpg);;All (*)" );
ui.logoFileText->setText( toNativeSeparators( file ) );
}
void ExtVideo::browseEraseFile()
{
QString file = QFileDialog::getOpenFileName( NULL, qtr( "Image mask" ),
p_intf->p_sys->filepath, "Images (*.png *.jpg);;All (*)" );
ui.eraseMaskText->setText( toNativeSeparators( file ) );
}
void ExtVideo::initComboBoxItems( QObject *widget ) void ExtVideo::initComboBoxItems( QObject *widget )
{ {
QComboBox *combobox = qobject_cast<QComboBox*>( widget ); QComboBox *combobox = qobject_cast<QComboBox*>( widget );
......
...@@ -62,6 +62,8 @@ private slots: ...@@ -62,6 +62,8 @@ private slots:
void updateFilters(); void updateFilters();
void updateFilterOptions(); void updateFilterOptions();
void cropChange(); void cropChange();
void browseLogo();
void browseEraseFile();
}; };
class ExtV4l2 : public QWidget class ExtV4l2 : public QWidget
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>542</width> <width>542</width>
<height>302</height> <height>284</height>
</rect> </rect>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
...@@ -1342,9 +1342,9 @@ ...@@ -1342,9 +1342,9 @@
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>
</property> </property>
<layout class="QGridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="2" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_21"> <widget class="QLabel" name="label_19">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>50</width> <width>50</width>
...@@ -1352,10 +1352,20 @@ ...@@ -1352,10 +1352,20 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string>Left</string> <string>Logo</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>logoXSpin</cstring> <cstring>logoFileText</cstring>
</property>
</widget>
</item>
<item row="0" column="1" colspan="3">
<widget class="QLineEdit" name="logoFileText"/>
</item>
<item row="0" column="4">
<widget class="QToolButton" name="logoBrowseBtn">
<property name="text">
<string>...</string>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -1375,8 +1385,18 @@ ...@@ -1375,8 +1385,18 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0"> <item row="1" column="1" colspan="2">
<widget class="QLabel" name="label_19"> <widget class="QSpinBox" name="logoYSpin"/>
</item>
<item row="1" column="3" colspan="2">
<widget class="QLabel" name="label_45">
<property name="text">
<string>pixels</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_21">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>50</width> <width>50</width>
...@@ -1384,39 +1404,46 @@ ...@@ -1384,39 +1404,46 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string>Logo</string> <string>Left</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>logoFileText</cstring> <cstring>logoXSpin</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2" colspan="2"> <item row="2" column="1" colspan="2">
<widget class="QLineEdit" name="logoFileText"/>
</item>
<item row="2" column="2">
<widget class="QSpinBox" name="logoXSpin"/> <widget class="QSpinBox" name="logoXSpin"/>
</item> </item>
<item row="1" column="2"> <item row="2" column="3" colspan="2">
<widget class="QSpinBox" name="logoYSpin"/> <widget class="QLabel" name="label_44">
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_45">
<property name="text"> <property name="text">
<string>pixels</string> <string>pixels</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="3"> <item row="3" column="0" colspan="2">
<widget class="QLabel" name="label_44"> <widget class="QLabel" name="label_22">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>pixels</string> <string>Transparency</string>
</property>
<property name="buddy">
<cstring>logoOpacitySlider</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0" colspan="4"> <item row="3" column="2" colspan="3">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1" colspan="2">
<widget class="QSlider" name="logoOpacitySlider"> <widget class="QSlider" name="logoOpacitySlider">
<property name="maximum"> <property name="maximum">
<number>255</number> <number>255</number>
...@@ -1432,7 +1459,7 @@ ...@@ -1432,7 +1459,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="4" column="2">
<widget class="QLabel" name="label_48"> <widget class="QLabel" name="label_48">
<property name="font"> <property name="font">
<font> <font>
...@@ -1450,7 +1477,7 @@ ...@@ -1450,7 +1477,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="2"> <item row="4" column="4">
<widget class="QLabel" name="label_49"> <widget class="QLabel" name="label_49">
<property name="font"> <property name="font">
<font> <font>
...@@ -1468,34 +1495,10 @@ ...@@ -1468,34 +1495,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0">
<widget class="QLabel" name="label_22">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Transparency</string>
</property>
<property name="buddy">
<cstring>logoOpacitySlider</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="2">
<widget class="QGroupBox" name="eraseEnable"> <widget class="QGroupBox" name="eraseEnable">
<property name="title"> <property name="title">
<string>Logo erase</string> <string>Logo erase</string>
...@@ -1507,7 +1510,7 @@ ...@@ -1507,7 +1510,7 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
<layout class="QGridLayout"> <layout class="QGridLayout">
<item row="1" column="0"> <item row="2" column="0">
<widget class="QLabel" name="label_16"> <widget class="QLabel" name="label_16">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
...@@ -1523,7 +1526,7 @@ ...@@ -1523,7 +1526,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="3" column="0">
<widget class="QLabel" name="label_17"> <widget class="QLabel" name="label_17">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
...@@ -1539,10 +1542,10 @@ ...@@ -1539,10 +1542,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="3" column="1">
<widget class="QSpinBox" name="eraseXSpin"/> <widget class="QSpinBox" name="eraseXSpin"/>
</item> </item>
<item row="1" column="1"> <item row="2" column="1">
<widget class="QSpinBox" name="eraseYSpin"/> <widget class="QSpinBox" name="eraseYSpin"/>
</item> </item>
<item row="0" column="1" colspan="2"> <item row="0" column="1" colspan="2">
...@@ -1564,21 +1567,21 @@ ...@@ -1564,21 +1567,21 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2"> <item row="2" column="2" colspan="2">
<widget class="QLabel" name="label_46"> <widget class="QLabel" name="label_46">
<property name="text"> <property name="text">
<string>pixels</string> <string>pixels</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="2"> <item row="3" column="2" colspan="2">
<widget class="QLabel" name="label_47"> <widget class="QLabel" name="label_47">
<property name="text"> <property name="text">
<string>pixels</string> <string>pixels</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0" colspan="3"> <item row="4" column="0" colspan="3">
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
...@@ -1594,6 +1597,13 @@ ...@@ -1594,6 +1597,13 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="0" column="3">
<widget class="QToolButton" name="eraseBrowseBtn">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
......
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