dialogBox->setDirectory( qfu( p_intf->p_libvlc->psz_homedir ) );
/* We don't want to see a grip in the middle of the window, do we? */
dialogBox->setSizeGripEnabled( false );
+ dialogBox->setToolTip( qtr( "Select one or multiple files, or a folder" ));
+
+ /* Set Filters for file selection */
+ QString fileTypes = "";
+ ADD_FILTER_MEDIA( fileTypes );
+ ADD_FILTER_VIDEO( fileTypes );
+ ADD_FILTER_AUDIO( fileTypes );
+ ADD_FILTER_PLAYLIST( fileTypes );
+ ADD_FILTER_ALL( fileTypes );
+ fileTypes.replace(QString(";*"), QString(" *"));
+
+ dialogBox->setFilter( fileTypes );
// Add it to the layout
ui.gridLayout->addWidget( dialogBox, 0, 0, 1, 3 );
BUTTONACT( ui.subBrowseButton, browseFileSub() );
- BUTTONACT( ui.subCheckBox, updateMRL());
+ BUTTONACT( ui.subCheckBox, toggleSubtitleFrame());
CONNECT( ui.fileInput, editTextChanged(QString ), this, updateMRL());
CONNECT( ui.subInput, editTextChanged(QString ), this, updateMRL());
bool FileOpenPanel::eventFilter(QObject *object, QEvent *event)
{
- printf( "coin\n" );
if ( ( object == dialogBox ) && ( event->type() == QEvent::Hide ) )
{
event->ignore();
return QObject::eventFilter(object, event);
}
+void FileOpenPanel::toggleSubtitleFrame()
+{
+ if (ui.subFrame->isVisible())
+ {
+ ui.subFrame->hide();
+// setMinimumHeight(1);
+ resize( sizeHint());
+ }
+ else
+ {
+ ui.subFrame->show();
+ }
+
+ /* Update the MRL */
+ updateMRL();
+}
+
/**************************************************************************
* Disk open
**************************************************************************/
bool audio, bool video,
bool subs, bool pls)
{
- QString fileTypes;
+ QString fileTypes = "";
if( all ) {
- fileTypes = _("Media Files");
- fileTypes += " ( ";
- fileTypes += EXTENSIONS_MEDIA;
- fileTypes += ");;";
+ ADD_FILTER_MEDIA( fileTypes );
}
if( video ) {
- fileTypes += _("Video Files");
- fileTypes += " ( ";
- fileTypes += EXTENSIONS_VIDEO;
- fileTypes += ");;";
+ ADD_FILTER_VIDEO( fileTypes );
}
if( audio ) {
- fileTypes += _("Sound Files");
- fileTypes += " ( ";
- fileTypes += EXTENSIONS_AUDIO;
- fileTypes += ");;";
+ ADD_FILTER_AUDIO( fileTypes );
}
if( pls ) {
- fileTypes += _("PlayList Files");
- fileTypes += " ( ";
- fileTypes += EXTENSIONS_PLAYLIST;
- fileTypes += ");;";
+ ADD_FILTER_PLAYLIST( fileTypes );
}
- fileTypes += _("All Files");
- fileTypes += " (*.*)";
+ ADD_FILTER_ALL( fileTypes );
fileTypes.replace(QString(";*"), QString(" *"));
return QFileDialog::getOpenFileNames( NULL,
help.isNull() ?
#include <vlc/vlc.h>
#include <vlc_interface.h>
+#define ADD_FILTER_MEDIA( string ) \
+ string += _("Media Files"); \
+ string += " ( "; \
+ string += EXTENSIONS_MEDIA; \
+ string += ");;";
+#define ADD_FILTER_VIDEO( string ) \
+ string += _("Video Files"); \
+ string += " ( "; \
+ string += EXTENSIONS_VIDEO; \
+ string += ");;";
+#define ADD_FILTER_AUDIO( string ) \
+ string += _("Audio Files"); \
+ string += " ( "; \
+ string += EXTENSIONS_AUDIO; \
+ string += ");;";
+#define ADD_FILTER_PLAYLIST( string )\
+ string += _("Playlist Files"); \
+ string += " ( "; \
+ string += EXTENSIONS_PLAYLIST; \
+ string += ");;";
+#define ADD_FILTER_ALL( string ) \
+ string += _("All Files"); \
+ string += " (*.*)";
+
+
class QEvent;
class QSignalMapper;
class QVLCMenu;
<rect>
<x>0</x>
<y>0</y>
- <width>463</width>
+ <width>435</width>
<height>249</height>
</rect>
</property>
<property name="spacing" >
<number>6</number>
</property>
+ <item row="1" column="1" colspan="2" >
+ <widget class="QComboBox" name="fileInput" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable" >
+ <bool>true</bool>
+ </property>
+ <property name="maxVisibleItems" >
+ <number>7</number>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="fileLabel" >
+ <property name="maximumSize" >
+ <size>
+ <width>85</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text" >
+ <string>File Names:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" colspan="3" >
+ <widget class="QWidget" native="1" name="tempWidget" />
+ </item>
+ <item row="5" column="0" colspan="3" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>200</width>
+ <height>2</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>273</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="0" colspan="2" >
+ <widget class="QCheckBox" name="subCheckBox" >
+ <property name="text" >
+ <string>Use a subtitles file</string>
+ </property>
+ </widget>
+ </item>
<item row="4" column="0" colspan="3" >
<widget class="QFrame" name="subFrame" >
<property name="sizePolicy" >
</layout>
</widget>
</item>
- <item row="3" column="0" colspan="2" >
- <widget class="QCheckBox" name="subCheckBox" >
- <property name="text" >
- <string>Use a subtitles file</string>
- </property>
- </widget>
- </item>
- <item row="2" column="2" >
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType" >
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>273</width>
- <height>16</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="1" >
- <widget class="QLabel" name="fileLabel" >
- <property name="text" >
- <string>File / Directory Names;</string>
- </property>
- </widget>
- </item>
- <item row="1" column="2" >
- <widget class="QComboBox" name="fileInput" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="editable" >
- <bool>true</bool>
- </property>
- <property name="maxVisibleItems" >
- <number>7</number>
- </property>
- </widget>
- </item>
- <item row="5" column="1" colspan="2" >
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>200</width>
- <height>2</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="0" column="1" colspan="2" >
- <widget class="QWidget" native="1" name="tempWidget" />
- </item>
- <item row="1" column="0" >
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType" >
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>16</width>
- <height>26</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
</widget>
<layoutdefault spacing="0" margin="0" />