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

Change button layout and behaviour in the open dialog. This avoid the Windows...

Change button layout and behaviour in the open dialog. This avoid the Windows issue and should close #1455
parent 6c27b748
...@@ -91,27 +91,14 @@ OpenDialog::OpenDialog( QWidget *parent, ...@@ -91,27 +91,14 @@ OpenDialog::OpenDialog( QWidget *parent,
ui.slaveBrowseButton->hide(); ui.slaveBrowseButton->hide();
/* Buttons Creation */ /* Buttons Creation */
QSizePolicy buttonSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum );
buttonSizePolicy.setHorizontalStretch( 0 );
buttonSizePolicy.setVerticalStretch( 0 );
/* Play Button */ /* Play Button */
playButton = new QToolButton; playButton = ui.playButton;
playButton->setText( qtr( "&Play" ) );
playButton->setSizePolicy( buttonSizePolicy );
playButton->setMinimumSize( QSize( 90, 0 ) );
playButton->setPopupMode( QToolButton::MenuButtonPopup );
playButton->setToolButtonStyle( Qt::ToolButtonTextOnly );
/* Cancel Button */ /* Cancel Button */
cancelButton = new QToolButton; cancelButton = new QPushButton( qtr( "&Cancel" ) );
cancelButton->setText( qtr( "&Cancel" ) );
cancelButton->setSizePolicy( buttonSizePolicy );
/* Select Button */ /* Select Button */
selectButton = new QToolButton; selectButton = new QPushButton( qtr( "Select" ) );
selectButton->setText( qtr( "Select" ) );
selectButton->setSizePolicy( buttonSizePolicy );
/* Menu for the Play button */ /* Menu for the Play button */
QMenu * openButtonMenu = new QMenu( "Open" ); QMenu * openButtonMenu = new QMenu( "Open" );
...@@ -124,10 +111,9 @@ OpenDialog::OpenDialog( QWidget *parent, ...@@ -124,10 +111,9 @@ OpenDialog::OpenDialog( QWidget *parent,
openButtonMenu->addAction( qtr( "&Convert" ), this, SLOT( transcode() ) , openButtonMenu->addAction( qtr( "&Convert" ), this, SLOT( transcode() ) ,
QKeySequence( "Alt+C" ) ); QKeySequence( "Alt+C" ) );
playButton->setMenu( openButtonMenu ); ui.menuButton->setMenu( openButtonMenu );
/* Add the three Buttons */ /* Add the three Buttons */
ui.buttonsBox->addButton( playButton, QDialogButtonBox::ActionRole );
ui.buttonsBox->addButton( selectButton, QDialogButtonBox::AcceptRole ); ui.buttonsBox->addButton( selectButton, QDialogButtonBox::AcceptRole );
ui.buttonsBox->addButton( cancelButton, QDialogButtonBox::RejectRole ); ui.buttonsBox->addButton( cancelButton, QDialogButtonBox::RejectRole );
...@@ -183,6 +169,7 @@ void OpenDialog::setMenuAction() ...@@ -183,6 +169,7 @@ void OpenDialog::setMenuAction()
{ {
playButton->hide(); playButton->hide();
selectButton->show(); selectButton->show();
selectButton->setDefault( true );
} }
else else
{ {
...@@ -202,6 +189,7 @@ void OpenDialog::setMenuAction() ...@@ -202,6 +189,7 @@ void OpenDialog::setMenuAction()
playButton->setText( qtr( "&Play" ) ); playButton->setText( qtr( "&Play" ) );
} }
playButton->show(); playButton->show();
playButton->setDefault( true );
selectButton->hide(); selectButton->hide();
} }
} }
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include "components/open_panels.hpp" #include "components/open_panels.hpp"
class QString; class QString;
class QToolButton;
class QTabWidget; class QTabWidget;
class OpenDialog : public QVLCDialog class OpenDialog : public QVLCDialog
...@@ -83,8 +82,8 @@ private: ...@@ -83,8 +82,8 @@ private:
int i_action_flag; int i_action_flag;
QStringList SeparateEntries( QString ); QStringList SeparateEntries( QString );
QToolButton *cancelButton, *selectButton; QPushButton *cancelButton, *selectButton;
QToolButton *playButton; QPushButton *playButton;
void finish( bool ); void finish( bool );
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>432</width> <width>518</width>
<height>285</height> <height>300</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy" > <property name="sizePolicy" >
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<string>Dialog</string> <string>Dialog</string>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<item row="0" column="0" colspan="2" > <item row="0" column="0" colspan="3" >
<widget class="QTabWidget" name="Tab" > <widget class="QTabWidget" name="Tab" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" > <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0" colspan="2" > <item row="1" column="0" colspan="3" >
<widget class="QCheckBox" name="advancedCheckBox" > <widget class="QCheckBox" name="advancedCheckBox" >
<property name="toolTip" > <property name="toolTip" >
<string>_("Show extended options")</string> <string>_("Show extended options")</string>
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0" colspan="2" > <item row="2" column="0" colspan="3" >
<widget class="QFrame" name="advancedFrame" > <widget class="QFrame" name="advancedFrame" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="Minimum" > <sizepolicy vsizetype="MinimumExpanding" hsizetype="Minimum" >
...@@ -58,73 +58,89 @@ ...@@ -58,73 +58,89 @@
<enum>QFrame::StyledPanel</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<item row="0" column="2" > <item row="0" column="0" >
<widget class="QLabel" name="label_3" > <widget class="QLabel" name="cacheLabel" >
<property name="text" > <property name="text" >
<string>_("Start Time")</string> <string>_("Caching")</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="3" colspan="2" > <item row="0" column="1" >
<widget class="QSpinBox" name="startTimeSpinBox" > <widget class="QSpinBox" name="cacheSpinBox" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" > <property name="toolTip" >
<string>_("Change the start time for the media")</string> <string>_("Change the caching for the media")</string>
</property> </property>
<property name="alignment" > <property name="alignment" >
<set>Qt::AlignRight</set> <set>Qt::AlignRight</set>
</property> </property>
<property name="suffix" > <property name="suffix" >
<string> s</string> <string> ms</string>
</property> </property>
<property name="maximum" > <property name="maximum" >
<number>999999</number> <number>999999</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0" > <item row="0" column="2" >
<widget class="QLabel" name="cacheLabel" > <spacer>
<property name="sizePolicy" > <property name="orientation" >
<sizepolicy vsizetype="Preferred" hsizetype="Fixed" > <enum>Qt::Horizontal</enum>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="sizeHint" >
<size>
<width>16</width>
<height>24</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3" >
<widget class="QLabel" name="label_3" >
<property name="text" > <property name="text" >
<string>_("Caching")</string> <string>_("Start Time")</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1" colspan="4" > <item row="0" column="4" colspan="2" >
<widget class="QLineEdit" name="advancedLineInput" > <widget class="QSpinBox" name="startTimeSpinBox" >
<property name="toolTip" > <property name="toolTip" >
<string>_("Complete MRL for VLC internal")</string> <string>_("Change the start time for the media")</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight</set>
</property>
<property name="suffix" >
<string> s</string>
</property>
<property name="maximum" >
<number>999999</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0" colspan="5" > <item row="0" column="6" >
<widget class="QCheckBox" name="slaveCheckbox" > <spacer>
<property name="text" > <property name="orientation" >
<string>_("Play another media synchronously (extra audio file, ...)")</string> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> <property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
<item row="4" column="1" colspan="4" > <item row="1" column="1" colspan="6" >
<widget class="Line" name="line" > <widget class="Line" name="line" >
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0" > <item row="2" column="0" colspan="7" >
<widget class="QLabel" name="advancedLabel" > <widget class="QCheckBox" name="slaveCheckbox" >
<property name="text" > <property name="text" >
<string>_("Customize")</string> <string>_("Play another media synchronously (extra audio file, ...)")</string>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -135,11 +151,11 @@ ...@@ -135,11 +151,11 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1" colspan="3" > <item row="3" column="1" colspan="4" >
<widget class="QLineEdit" name="slaveText" /> <widget class="QLineEdit" name="slaveText" />
</item> </item>
<item row="3" column="4" > <item row="3" column="5" colspan="2" >
<widget class="QToolButton" name="slaveBrowseButton" > <widget class="QPushButton" name="slaveBrowseButton" >
<property name="toolTip" > <property name="toolTip" >
<string>_("Select the file")</string> <string>_("Select the file")</string>
</property> </property>
...@@ -148,32 +164,24 @@ ...@@ -148,32 +164,24 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1" colspan="4" > <item row="4" column="1" colspan="6" >
<widget class="Line" name="line" > <widget class="Line" name="line" >
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1" > <item row="5" column="0" >
<widget class="QSpinBox" name="cacheSpinBox" > <widget class="QLabel" name="advancedLabel" >
<property name="sizePolicy" > <property name="text" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" > <string>_("Customize")</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
</widget>
</item>
<item row="5" column="1" colspan="6" >
<widget class="QLineEdit" name="advancedLineInput" >
<property name="toolTip" > <property name="toolTip" >
<string>_("Change the caching for the media")</string> <string>_("Complete MRL for VLC internal")</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight</set>
</property>
<property name="suffix" >
<string> ms</string>
</property>
<property name="maximum" >
<number>999999</number>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -186,18 +194,72 @@ ...@@ -186,18 +194,72 @@
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeType" > <property name="sizeType" >
<enum>QSizePolicy::Minimum</enum> <enum>QSizePolicy::MinimumExpanding</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" >
<size> <size>
<width>240</width> <width>151</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="3" column="1" > <item row="3" column="1" >
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="menuButton" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>20</width>
<height>16777215</height>
</size>
</property>
<property name="focusPolicy" >
<enum>Qt::ClickFocus</enum>
</property>
<property name="contextMenuPolicy" >
<enum>Qt::NoContextMenu</enum>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="playButton" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Play</string>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="2" >
<widget class="QDialogButtonBox" name="buttonsBox" > <widget class="QDialogButtonBox" name="buttonsBox" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Maximum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
......
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