Commit e123fc1e authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: try to make the advanced open dialog more usable for files (who the H......

Qt: try to make the advanced open dialog more usable for files (who the H... uses files nowadays ;) )
parent be7fb988
...@@ -135,6 +135,7 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -135,6 +135,7 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
/* Connects */ /* Connects */
BUTTONACT( ui.fileBrowseButton, browseFile() ); BUTTONACT( ui.fileBrowseButton, browseFile() );
BUTTONACT( ui.delFileButton, deleteFile() );
BUTTONACT( ui.subBrowseButton, browseFileSub() ); BUTTONACT( ui.subBrowseButton, browseFileSub() );
CONNECT( ui.subCheckBox, toggled( bool ), this, toggleSubtitleFrame( bool ) ); CONNECT( ui.subCheckBox, toggled( bool ), this, toggleSubtitleFrame( bool ) );
...@@ -161,6 +162,18 @@ void FileOpenPanel::browseFile() ...@@ -161,6 +162,18 @@ void FileOpenPanel::browseFile()
updateMRL(); updateMRL();
} }
void FileOpenPanel::deleteFile()
{
int i = ui.fileListWidg->currentRow();
if( i != -1 )
{
QListWidgetItem *temp = ui.fileListWidg->takeItem( i );
delete temp;
}
updateMRL();
}
/* Show a fileBrowser to select a subtitle */ /* Show a fileBrowser to select a subtitle */
void FileOpenPanel::browseFileSub() void FileOpenPanel::browseFileSub()
{ {
......
...@@ -110,6 +110,7 @@ public slots: ...@@ -110,6 +110,7 @@ public slots:
private slots: private slots:
void browseFileSub(); void browseFileSub();
void browseFile(); void browseFile();
void deleteFile();
void toggleSubtitleFrame( bool ); void toggleSubtitleFrame( bool );
}; };
......
<ui version="4.0" > <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<author>Jean-Baptiste Kempf</author> <author>Jean-Baptiste Kempf</author>
<class>OpenFile</class> <class>OpenFile</class>
<widget class="QWidget" name="OpenFile" > <widget class="QWidget" name="OpenFile">
<property name="geometry" > <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>571</width> <width>566</width>
<height>271</height> <height>344</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy vsizetype="Preferred" hsizetype="MinimumExpanding" > <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="windowTitle" > <property name="windowTitle">
<string>_("Open File")</string> <string>_(&quot;Open File&quot;)</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout" > <layout class="QGridLayout" name="gridLayout_3">
<item> <item row="0" column="0">
<widget class="QGroupBox" name="tempWidget" > <widget class="QGroupBox" name="tempWidget">
<property name="toolTip" > <property name="toolTip">
<string>_("Choose one or more media file to open")</string> <string>_(&quot;Choose one or more media file to open&quot;)</string>
</property> </property>
<property name="title" > <property name="title">
<string>_("Select one or more files")</string> <string>_(&quot;File Selection&quot;)</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout" > <layout class="QGridLayout" name="gridLayout">
<item rowspan="2" row="0" column="0" > <item row="0" column="0" colspan="3">
<widget class="QListWidget" name="fileListWidg" > <widget class="QLabel" name="label">
<property name="maximumSize" > <property name="text">
<string>_(&quot;You can select local files with the following list and buttons.&quot;)</string>
</property>
</widget>
</item>
<item row="1" column="0" rowspan="3" colspan="2">
<widget class="QListWidget" name="fileListWidg">
<property name="maximumSize">
<size> <size>
<width>16777215</width> <width>16777215</width>
<height>100</height> <height>100</height>
</size> </size>
</property> </property>
<property name="contextMenuPolicy" > <property name="contextMenuPolicy">
<enum>Qt::DefaultContextMenu</enum> <enum>Qt::DefaultContextMenu</enum>
</property> </property>
<property name="verticalScrollBarPolicy" > <property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum> <enum>Qt::ScrollBarAsNeeded</enum>
</property> </property>
<property name="horizontalScrollBarPolicy" > <property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum> <enum>Qt::ScrollBarAlwaysOff</enum>
</property> </property>
<property name="editTriggers" > <property name="editTriggers">
<set>QAbstractItemView::AllEditTriggers</set> <set>QAbstractItemView::AllEditTriggers</set>
</property> </property>
<property name="alternatingRowColors" > <property name="alternatingRowColors">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="selectionMode" >
<enum>QAbstractItemView::NoSelection</enum>
</property>
<property name="selectionBehavior" >
<enum>QAbstractItemView::SelectItems</enum>
</property>
</widget> </widget>
</item> </item>
<item row="0" column="1" > <item row="1" column="2">
<widget class="QPushButton" name="fileBrowseButton" > <widget class="QPushButton" name="fileBrowseButton">
<property name="minimumSize" > <property name="text">
<size> <string>_(&quot;Add...&quot;)</string>
<width>100</width>
<height>0</height>
</size>
</property> </property>
<property name="toolTip" > </widget>
<string>_("Select the subtitles file")</string> </item>
<item row="2" column="2">
<widget class="QPushButton" name="delFileButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="text" > <property name="text">
<string>_("Browse...")</string> <string>_(&quot;Delete&quot;)</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item row="1" column="0">
<widget class="QCheckBox" name="subCheckBox" > <widget class="QCheckBox" name="subCheckBox">
<property name="toolTip" > <property name="toolTip">
<string>_("Add a subtitles file")</string> <string>_(&quot;Add a subtitles file&quot;)</string>
</property> </property>
<property name="text" > <property name="text">
<string>_("Use a sub&amp;titles file")</string> <string>_(&quot;Use a sub&amp;titles file&quot;)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="2" column="0">
<widget class="QFrame" name="subFrame" > <widget class="QFrame" name="subFrame">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy vsizetype="Minimum" hsizetype="Preferred" > <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="frameShape" > <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2" > <layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0" > <item row="1" column="0">
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0" > <property name="sizeHint" stdset="0">
<size> <size>
<width>16</width> <width>16</width>
<height>20</height> <height>20</height>
...@@ -114,12 +120,12 @@ ...@@ -114,12 +120,12 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="1" column="3" > <item row="1" column="3">
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0" > <property name="sizeHint" stdset="0">
<size> <size>
<width>30</width> <width>30</width>
<height>26</height> <height>26</height>
...@@ -127,12 +133,12 @@ ...@@ -127,12 +133,12 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="1" column="7" > <item row="1" column="7">
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0" > <property name="sizeHint" stdset="0">
<size> <size>
<width>16</width> <width>16</width>
<height>20</height> <height>20</height>
...@@ -140,25 +146,25 @@ ...@@ -140,25 +146,25 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="1" column="1" > <item row="1" column="1">
<widget class="QLabel" name="sizeSubLabel" > <widget class="QLabel" name="sizeSubLabel">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy vsizetype="Preferred" hsizetype="Minimum" > <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text" > <property name="text">
<string>_("Size:")</string> <string>_(&quot;Size:&quot;)</string>
</property> </property>
<property name="buddy" > <property name="buddy">
<cstring>sizeSubComboBox</cstring> <cstring>sizeSubComboBox</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2" > <item row="1" column="2">
<widget class="QComboBox" name="sizeSubComboBox" > <widget class="QComboBox" name="sizeSubComboBox">
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>0</height> <height>0</height>
...@@ -166,25 +172,25 @@ ...@@ -166,25 +172,25 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="4" > <item row="1" column="4">
<widget class="QLabel" name="alignSubLabel" > <widget class="QLabel" name="alignSubLabel">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy vsizetype="Preferred" hsizetype="Minimum" > <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text" > <property name="text">
<string>_("Alignment:")</string> <string>_(&quot;Alignment:&quot;)</string>
</property> </property>
<property name="buddy" > <property name="buddy">
<cstring>alignSubComboBox</cstring> <cstring>alignSubComboBox</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="5" colspan="2" > <item row="1" column="5" colspan="2">
<widget class="QComboBox" name="alignSubComboBox" > <widget class="QComboBox" name="alignSubComboBox">
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>0</height> <height>0</height>
...@@ -192,37 +198,37 @@ ...@@ -192,37 +198,37 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0" colspan="6" > <item row="0" column="0" colspan="6">
<widget class="QLineEdit" name="subInput" /> <widget class="QLineEdit" name="subInput"/>
</item> </item>
<item row="0" column="6" colspan="2" > <item row="0" column="6" colspan="2">
<widget class="QPushButton" name="subBrowseButton" > <widget class="QPushButton" name="subBrowseButton">
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="toolTip" > <property name="toolTip">
<string>_("Select the subtitles file")</string> <string>_(&quot;Select the subtitles file&quot;)</string>
</property> </property>
<property name="text" > <property name="text">
<string>_("Browse...")</string> <string>_(&quot;Browse...&quot;)</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item row="3" column="0">
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType" > <property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum> <enum>QSizePolicy::MinimumExpanding</enum>
</property> </property>
<property name="sizeHint" stdset="0" > <property name="sizeHint" stdset="0">
<size> <size>
<width>273</width> <width>273</width>
<height>16</height> <height>16</height>
...@@ -235,6 +241,7 @@ ...@@ -235,6 +241,7 @@
<tabstops> <tabstops>
<tabstop>fileListWidg</tabstop> <tabstop>fileListWidg</tabstop>
<tabstop>fileBrowseButton</tabstop> <tabstop>fileBrowseButton</tabstop>
<tabstop>delFileButton</tabstop>
<tabstop>subCheckBox</tabstop> <tabstop>subCheckBox</tabstop>
<tabstop>subInput</tabstop> <tabstop>subInput</tabstop>
<tabstop>subBrowseButton</tabstop> <tabstop>subBrowseButton</tabstop>
......
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