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

Qt4 - Remove the enqueue button and regroup it under the play button, since it...

Qt4 - Remove the enqueue button and regroup it under the play button, since it is far less used. KEEP IT SIMPLE :D
xtophe, is that what you wanted ?
Stream() does not do anything yet.

parent 5021c9c9
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <QGridLayout> #include <QGridLayout>
#include <QFileDialog> #include <QFileDialog>
#include <QRegExp> #include <QRegExp>
#include <QMenu>
#include "dialogs/open.hpp" #include "dialogs/open.hpp"
#include "components/open.hpp" #include "components/open.hpp"
...@@ -57,6 +57,13 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal ) : ...@@ -57,6 +57,13 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal ) :
ui.advancedFrame->hide(); ui.advancedFrame->hide();
QMenu * openButtonMenu = new QMenu( "Open" );
openButtonMenu->addAction( qtr("&Enqueue"), this, SLOT( enqueue() ),
QKeySequence( "Alt+E") );
openButtonMenu->addAction( qtr("&Stream"), this, SLOT( stream() ) ,
QKeySequence( "Alt+T" ) );
ui.playButton->setMenu( openButtonMenu );
/* Force MRL update on tab change */ /* Force MRL update on tab change */
CONNECT( ui.Tab, currentChanged(int), this, signalCurrent()); CONNECT( ui.Tab, currentChanged(int), this, signalCurrent());
...@@ -77,9 +84,8 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal ) : ...@@ -77,9 +84,8 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal ) :
CONNECT( ui.slaveText, textChanged(QString), this, updateMRL()); CONNECT( ui.slaveText, textChanged(QString), this, updateMRL());
CONNECT( ui.cacheSpinBox, valueChanged(int), this, updateMRL()); CONNECT( ui.cacheSpinBox, valueChanged(int), this, updateMRL());
BUTTONACT( ui.closeButton, play()); BUTTONACT( ui.playButton, play());
BUTTONACT( ui.cancelButton, cancel()); BUTTONACT( ui.cancelButton, cancel());
BUTTONACT( ui.enqueueButton, enqueue());
BUTTONACT( ui.advancedCheckBox , toggleAdvancedPanel() ); BUTTONACT( ui.advancedCheckBox , toggleAdvancedPanel() );
/* Initialize caching */ /* Initialize caching */
...@@ -165,6 +171,11 @@ void OpenDialog::playOrEnqueue( bool b_enqueue = false ) ...@@ -165,6 +171,11 @@ void OpenDialog::playOrEnqueue( bool b_enqueue = false )
accept(); accept();
} }
void OpenDialog::stream()
{
//TODO. Policy not yet defined
}
void OpenDialog::toggleAdvancedPanel() void OpenDialog::toggleAdvancedPanel()
{ {
//FIXME does not work under Windows //FIXME does not work under Windows
......
...@@ -53,6 +53,7 @@ public: ...@@ -53,6 +53,7 @@ public:
QString mainMRL; QString mainMRL;
public slots: public slots:
void play(); void play();
void stream();
private: private:
static OpenDialog *instance; static OpenDialog *instance;
input_thread_t *p_input; input_thread_t *p_input;
......
...@@ -174,35 +174,56 @@ ...@@ -174,35 +174,56 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" > <property name="sizeHint" >
<size> <size>
<width>241</width> <width>240</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="cancelButton" > <widget class="QToolButton" name="cancelButton" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" > <property name="text" >
<string>&amp;Cancel</string> <string>&amp;Cancel</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="enqueueButton" > <widget class="QToolButton" name="playButton" >
<property name="text" > <property name="sizePolicy" >
<string>&amp;Enqueue</string> <sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>90</width>
<height>0</height>
</size>
</property> </property>
</widget>
</item>
<item>
<widget class="QPushButton" name="closeButton" >
<property name="text" > <property name="text" >
<string>&amp;Play</string> <string>&amp;Play</string>
</property> </property>
<property name="default" > <property name="popupMode" >
<bool>true</bool> <enum>QToolButton::MenuButtonPopup</enum>
</property>
<property name="toolButtonStyle" >
<enum>Qt::ToolButtonTextOnly</enum>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -214,7 +235,7 @@ ...@@ -214,7 +235,7 @@
<tabstop>cacheSpinBox</tabstop> <tabstop>cacheSpinBox</tabstop>
<tabstop>advancedLineInput</tabstop> <tabstop>advancedLineInput</tabstop>
<tabstop>Tab</tabstop> <tabstop>Tab</tabstop>
<tabstop>closeButton</tabstop> <tabstop>playButton</tabstop>
<tabstop>cancelButton</tabstop> <tabstop>cancelButton</tabstop>
</tabstops> </tabstops>
<resources/> <resources/>
......
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