Qt: implement previous button and make an introduction text to the sout...
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 5 Mar 2009 20:05:04 +0000 (21:05 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 5 Mar 2009 20:05:51 +0000 (21:05 +0100)
Good ideas to improve the layout and the text are MORE than needed.

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

index 545ab02..59c8ab5 100644 (file)
@@ -97,6 +97,11 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, QString inputMR
     /* UI stuff */
     ui.setupUi( this );
     ui.inputBox->setMRL( inputMRL );
+    ui.helpEdit->setPlainText( "This dialog will allow you to stream or convert "
+            "your media, locally, on your private network or on the "
+            "Internet.\n"
+            "You should start by checking that your input matches what you "
+            "want and go on with the \"Next\" button.\n" );
 
     changeUDPandRTPmess( false );
 
@@ -154,6 +159,8 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, QString inputMR
 
     BUTTONACT( ui.nextButton, next() );
     BUTTONACT( ui.nextButton2, next() );
+    BUTTONACT( ui.prevButton, prev() );
+    BUTTONACT( ui.prevButton2, prev() );
 }
 
 void SoutDialog::next()
@@ -161,6 +168,12 @@ void SoutDialog::next()
     ui.toolBox->setCurrentIndex( ui.toolBox->currentIndex() + 1 );
 }
 
+void SoutDialog::prev()
+{
+    ui.toolBox->setCurrentIndex( ui.toolBox->currentIndex() - 1 );
+}
+
+
 void SoutDialog::fileBrowse()
 {
     QString fileName = QFileDialog::getSaveFileName( this, qtr( "Save file..." ),
index 9cc9255..d5b391b 100644 (file)
@@ -148,6 +148,7 @@ private slots:
     void changeUDPandRTPmess( bool );
     void RTPtoggled( bool );
     void next();
+    void prev();
 };
 
 #endif
index fadac44..504936d 100644 (file)
@@ -7,8 +7,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>715</width>
-    <height>507</height>
+    <width>651</width>
+    <height>532</height>
    </rect>
   </property>
   <property name="windowTitle">
        <rect>
         <x>0</x>
         <y>0</y>
-        <width>697</width>
-        <height>381</height>
+        <width>633</width>
+        <height>414</height>
        </rect>
       </property>
       <attribute name="label">
        <string>_(&quot;Source&quot;)</string>
       </attribute>
-      <layout class="QGridLayout" name="gridLayout_4">
-       <item row="1" column="0">
+      <layout class="QGridLayout" name="gridLayout_3">
+       <item row="0" column="0" colspan="2">
+        <widget class="QPlainTextEdit" name="helpEdit">
+         <property name="enabled">
+          <bool>true</bool>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>16777215</width>
+           <height>150</height>
+          </size>
+         </property>
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>220</red>
+               <green>220</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>220</red>
+               <green>220</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="autoFillBackground">
+          <bool>false</bool>
+         </property>
+         <property name="readOnly">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="0" colspan="2">
+        <widget class="SoutInputBox" name="inputBox"/>
+       </item>
+       <item row="2" column="0" colspan="2">
         <spacer name="verticalSpacer">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
          <property name="sizeHint" stdset="0">
           <size>
            <width>581</width>
-           <height>321</height>
+           <height>10</height>
           </size>
          </property>
         </spacer>
        </item>
-       <item row="2" column="0">
+       <item row="3" column="0">
         <spacer name="horizontalSpacer">
          <property name="orientation">
           <enum>Qt::Horizontal</enum>
          </property>
         </spacer>
        </item>
-       <item row="2" column="1">
+       <item row="3" column="1">
         <widget class="QPushButton" name="nextButton">
          <property name="text">
           <string>_(&quot;Next&quot;)</string>
          </property>
         </widget>
        </item>
-       <item row="0" column="0" colspan="2">
-        <widget class="SoutInputBox" name="inputBox">
-         <property name="title">
-          <string>GroupBox</string>
-         </property>
-        </widget>
-       </item>
       </layout>
      </widget>
      <widget class="QWidget" name="page_3">
        <rect>
         <x>0</x>
         <y>0</y>
-        <width>653</width>
-        <height>367</height>
+        <width>649</width>
+        <height>399</height>
        </rect>
       </property>
       <attribute name="label">
        <string>_(&quot;Destination&quot;)</string>
       </attribute>
       <layout class="QGridLayout" name="gridLayout">
-       <item row="0" column="0" colspan="2">
+       <item row="0" column="0" colspan="3">
         <layout class="QGridLayout" name="_3">
          <item row="0" column="1" colspan="2">
           <widget class="QCheckBox" name="localOutput">
         </layout>
        </item>
        <item row="1" column="0">
+        <widget class="QPushButton" name="prevButton">
+         <property name="text">
+          <string>_(&quot;Previous&quot;)</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1">
         <spacer name="horizontalSpacer_2">
          <property name="orientation">
           <enum>Qt::Horizontal</enum>
          </property>
         </spacer>
        </item>
-       <item row="1" column="1">
+       <item row="1" column="2">
         <widget class="QPushButton" name="nextButton2">
          <property name="text">
           <string>_(&quot;Next&quot;)</string>
        <rect>
         <x>0</x>
         <y>0</y>
-        <width>604</width>
-        <height>310</height>
+        <width>633</width>
+        <height>414</height>
        </rect>
       </property>
       <attribute name="label">
        <string>_(&quot;Transcoding&quot;)</string>
       </attribute>
       <layout class="QGridLayout" name="gridLayout_2">
-       <item row="0" column="0">
+       <item row="0" column="0" colspan="2">
         <widget class="Line" name="line">
          <property name="orientation">
           <enum>Qt::Horizontal</enum>
          </property>
         </widget>
        </item>
-       <item row="1" column="0">
+       <item row="1" column="0" colspan="2">
         <widget class="VLCProfileSelector" name="profileSelect" native="true"/>
        </item>
-       <item row="2" column="0">
+       <item row="2" column="0" colspan="2">
         <widget class="Line" name="line_2">
          <property name="orientation">
           <enum>Qt::Horizontal</enum>
          </property>
         </widget>
        </item>
-       <item row="3" column="0">
+       <item row="3" column="0" colspan="2">
         <widget class="QGroupBox" name="groupBox_3">
          <property name="title">
           <string>_(&quot;Miscellaneous&quot;)</string>
          </property>
-         <layout class="QHBoxLayout" name="_5">
-          <item>
-           <layout class="QGridLayout" name="_6">
-            <item row="0" column="0">
-             <widget class="QCheckBox" name="sap">
-              <property name="text">
-               <string>_(&quot;SAP announce&quot;)</string>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="3">
-             <widget class="QLabel" name="sapGroupLabel">
-              <property name="text">
-               <string>_(&quot;Group name&quot;)</string>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="4">
-             <widget class="QLineEdit" name="sapGroup"/>
-            </item>
-            <item row="1" column="4">
-             <widget class="QSpinBox" name="ttl">
-              <property name="alignment">
-               <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-              </property>
-              <property name="minimum">
-               <number>1</number>
-              </property>
-              <property name="maximum">
-               <number>255</number>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="1" colspan="2">
-             <widget class="QLineEdit" name="sapName"/>
-            </item>
-            <item row="1" column="0" colspan="2">
-             <widget class="QCheckBox" name="soutAll">
-              <property name="text">
-               <string>_(&quot;Stream all elementary streams&quot;)</string>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="3">
-             <widget class="QLabel" name="ttlLabel">
-              <property name="text">
-               <string>_(&quot;Time-To-Live (TTL)&quot;)</string>
-              </property>
-             </widget>
-            </item>
-            <item row="2" column="0" colspan="2">
-             <widget class="QCheckBox" name="soutKeep">
-              <property name="text">
-               <string>_(&quot;Keep stream output open&quot;)</string>
-              </property>
-             </widget>
-            </item>
-           </layout>
+         <layout class="QGridLayout" name="gridLayout_4">
+          <item row="0" column="0" colspan="3">
+           <widget class="QCheckBox" name="soutAll">
+            <property name="text">
+             <string>_(&quot;Stream all elementary streams&quot;)</string>
+            </property>
+           </widget>
+          </item>
+          <item row="0" column="3" rowspan="2" colspan="2">
+           <widget class="QCheckBox" name="soutKeep">
+            <property name="text">
+             <string>_(&quot;Keep stream output open&quot;)</string>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="0" rowspan="2">
+           <widget class="QCheckBox" name="sap">
+            <property name="text">
+             <string>_(&quot;SAP announce&quot;)</string>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="1" rowspan="2" colspan="2">
+           <widget class="QLineEdit" name="sapName"/>
+          </item>
+          <item row="2" column="3">
+           <widget class="QLabel" name="sapGroupLabel">
+            <property name="text">
+             <string>_(&quot;Group name&quot;)</string>
+            </property>
+           </widget>
+          </item>
+          <item row="2" column="4">
+           <widget class="QLineEdit" name="sapGroup"/>
+          </item>
+          <item row="3" column="0" colspan="2">
+           <widget class="QLabel" name="ttlLabel">
+            <property name="text">
+             <string>_(&quot;Time-To-Live (TTL)&quot;)</string>
+            </property>
+           </widget>
+          </item>
+          <item row="3" column="2">
+           <widget class="QSpinBox" name="ttl">
+            <property name="alignment">
+             <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+            </property>
+            <property name="minimum">
+             <number>1</number>
+            </property>
+            <property name="maximum">
+             <number>255</number>
+            </property>
+           </widget>
           </item>
          </layout>
         </widget>
        </item>
-       <item row="4" column="0">
+       <item row="4" column="0" colspan="2">
         <widget class="QGroupBox" name="groupBox_4">
          <property name="title">
           <string>_(&quot;Generated stream output string&quot;)</string>
          </layout>
         </widget>
        </item>
+       <item row="5" column="0">
+        <widget class="QPushButton" name="prevButton2">
+         <property name="text">
+          <string>_(&quot;Previous&quot;)</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="1">
+        <spacer name="horizontalSpacer_3">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>507</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
       </layout>
      </widget>
     </widget>