]> git.sesse.net Git - vlc/commitdiff
Qt4 - Remove the enqueue button and regroup it under the play button, since it is...
authorJean-Baptiste Kempf <jb@videolan.org>
Sat, 31 Mar 2007 01:17:14 +0000 (01:17 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Sat, 31 Mar 2007 01:17:14 +0000 (01:17 +0000)
xtophe, is that what you wanted ?
Stream() does not do anything yet.

modules/gui/qt4/dialogs/open.cpp
modules/gui/qt4/dialogs/open.hpp
modules/gui/qt4/ui/open.ui

index 58bf84f513d22eca1aeb521ce5a9bb970f803708..58d890857e500dfba6f324c0688dddd17a5be303 100644 (file)
@@ -25,7 +25,7 @@
 #include <QGridLayout>
 #include <QFileDialog>
 #include <QRegExp>
-
+#include <QMenu>
 #include "dialogs/open.hpp"
 #include "components/open.hpp"
 
@@ -57,6 +57,13 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal ) :
 
     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 */
     CONNECT( ui.Tab, currentChanged(int), this, signalCurrent());
 
@@ -77,9 +84,8 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal ) :
     CONNECT( ui.slaveText, textChanged(QString), this, updateMRL());
     CONNECT( ui.cacheSpinBox, valueChanged(int), this, updateMRL());
 
-    BUTTONACT( ui.closeButton, play());
+    BUTTONACT( ui.playButton, play());
     BUTTONACT( ui.cancelButton, cancel());
-    BUTTONACT( ui.enqueueButton, enqueue());
     BUTTONACT( ui.advancedCheckBox , toggleAdvancedPanel() );
 
     /* Initialize caching */
@@ -165,6 +171,11 @@ void OpenDialog::playOrEnqueue( bool b_enqueue = false )
         accept();
 }
 
+void OpenDialog::stream()
+{
+//TODO. Policy not yet defined
+}
+
 void OpenDialog::toggleAdvancedPanel()
 {
     //FIXME does not work under Windows
index 26440e851b3f3a1cdeb107603052a37c3a0e09bb..fded8fb4405ecb565e790505963f5f82dbc81bef 100644 (file)
@@ -53,6 +53,7 @@ public:
     QString mainMRL;
 public slots:
     void play();
+    void stream();
 private:
     static OpenDialog *instance;
     input_thread_t *p_input;
index 40cbf327789a0310edd4323366501bf0b89e3d86..cb0d33dcc1d9543661df8d883613420eeb64731c 100644 (file)
        <property name="orientation" >
         <enum>Qt::Horizontal</enum>
        </property>
+       <property name="sizeType" >
+        <enum>QSizePolicy::Minimum</enum>
+       </property>
        <property name="sizeHint" >
         <size>
-         <width>241</width>
+         <width>240</width>
          <height>20</height>
         </size>
        </property>
       </spacer>
      </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" >
         <string>&amp;Cancel</string>
        </property>
       </widget>
      </item>
      <item>
-      <widget class="QPushButton" name="enqueueButton" >
-       <property name="text" >
-        <string>&amp;Enqueue</string>
+      <widget class="QToolButton" name="playButton" >
+       <property name="sizePolicy" >
+        <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>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="closeButton" >
        <property name="text" >
         <string>&amp;Play</string>
        </property>
-       <property name="default" >
-        <bool>true</bool>
+       <property name="popupMode" >
+        <enum>QToolButton::MenuButtonPopup</enum>
+       </property>
+       <property name="toolButtonStyle" >
+        <enum>Qt::ToolButtonTextOnly</enum>
        </property>
       </widget>
      </item>
   <tabstop>cacheSpinBox</tabstop>
   <tabstop>advancedLineInput</tabstop>
   <tabstop>Tab</tabstop>
-  <tabstop>closeButton</tabstop>
+  <tabstop>playButton</tabstop>
   <tabstop>cancelButton</tabstop>
  </tabstops>
  <resources/>