Changeset aeb66e2b217d2793117db9bc63e53b3e7f268bfe

Show
Ignore:
Timestamp:
19/03/07 20:42:25 (2 years ago)
Author:
Jean-Baptiste Kempf <jb@videolan.org>
git-committer:
Jean-Baptiste Kempf <jb@videolan.org> 1174333345 +0000
git-parent:

[0ac9553b533c730c57a195320ae8f56c157dd488]

git-author:
Jean-Baptiste Kempf <jb@videolan.org> 1174333345 +0000
Message:

Qt4 - Open. Use a Frame and not a QComboBox for subtitles. (lacks still some toggle function). Catch event to avoid bug of hidding of QFileDialog.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/qt4/components/open.cpp

    r93a51f2 raeb66e2  
    7272    listLabel[5]->setText( qtr( "Filter:" ) ); 
    7373 
     74    /* Hacks Continued Catch the close event */ 
     75    dialogBox->installEventFilter( this ); 
     76 
     77    // Hide the subtitles control by default. 
     78    ui.subFrame->hide(); 
     79 
     80 
    7481    BUTTONACT( ui.subBrowseButton, browseFileSub() ); 
    75  
    76     BUTTONACT( ui.subGroupBox, updateMRL()); 
     82    BUTTONACT( ui.subCheckBox, updateMRL()); 
     83 
    7784    CONNECT( ui.fileInput, editTextChanged(QString ), this, updateMRL()); 
    7885    CONNECT( ui.subInput, editTextChanged(QString ), this, updateMRL()); 
     
    110117    QString mrl = ui.fileInput->currentText(); 
    111118 
    112     if( ui.subGroupBox->isChecked() ) { 
     119    if( ui.subCheckBox->isChecked() ) { 
    113120        mrl.append( " :sub-file=" + ui.subInput->currentText() ); 
    114121        mrl.append( " :subsdec-align=" + ui.alignSubComboBox->currentText() ); 
     
    135142} 
    136143 
     144bool FileOpenPanel::eventFilter(QObject *object, QEvent *event) 
     145{ 
     146    printf( "coin\n" ); 
     147    if ( ( object == dialogBox ) && ( event->type() == QEvent::Hide ) ) 
     148    { 
     149         event->ignore(); 
     150         return true; 
     151    } 
     152    // standard event processing 
     153    else 
     154        return QObject::eventFilter(object, event); 
     155} 
    137156 
    138157/************************************************************************** 
  • modules/gui/qt4/components/open.hpp

    r93a51f2 raeb66e2  
    6969    QFileDialog *dialogBox; 
    7070    QLineEdit *lineFileEdit; 
     71    bool eventFilter(QObject *, QEvent *); 
    7172public slots: 
    7273    virtual void updateMRL(); 
     
    7475    void browseFile(); 
    7576    void browseFileSub(); 
     77 
    7678}; 
    7779 
  • modules/gui/qt4/dialogs/open.cpp

    r93a51f2 raeb66e2  
    162162void OpenDialog::toggleAdvancedPanel() 
    163163{ 
     164    //FIXME does not work under Windows 
    164165    if (ui.advancedFrame->isVisible()) { 
    165166        ui.advancedFrame->hide(); 
  • modules/gui/qt4/ui/open_file.ui

    r59713dc raeb66e2  
    77    <x>0</x> 
    88    <y>0</y> 
    9     <width>400</width> 
    10     <height>210</height> 
     9    <width>463</width> 
     10    <height>249</height> 
    1111   </rect> 
    1212  </property> 
     
    2929    <number>6</number> 
    3030   </property> 
    31    <item row="1" column="0" > 
    32     <spacer> 
    33      <property name="orientation" > 
    34       <enum>Qt::Horizontal</enum> 
    35      </property> 
    36      <property name="sizeType" > 
    37       <enum>QSizePolicy::Fixed</enum> 
    38      </property> 
    39      <property name="sizeHint" > 
    40       <size> 
    41        <width>3</width> 
    42        <height>20</height> 
    43       </size> 
    44      </property> 
    45     </spacer> 
    46    </item> 
    47    <item row="3" column="0" colspan="3" > 
    48     <widget class="QGroupBox" name="subGroupBox" > 
     31   <item row="4" column="0" colspan="3" > 
     32    <widget class="QFrame" name="subFrame" > 
    4933     <property name="sizePolicy" > 
    5034      <sizepolicy> 
     
    5539      </sizepolicy> 
    5640     </property> 
    57      <property name="title" > 
    58       <string>Use a subtitles file</string> 
    59      </property> 
    60      <property name="checkable" > 
    61       <bool>true</bool> 
    62      </property> 
    63      <property name="checked" > 
    64       <bool>false</bool> 
     41     <property name="frameShape" > 
     42      <enum>QFrame::StyledPanel</enum> 
    6543     </property> 
    6644     <layout class="QGridLayout" > 
    6745      <property name="margin" > 
     46       <number>9</number> 
     47      </property> 
     48      <property name="spacing" > 
    6849       <number>6</number> 
    6950      </property> 
    70       <property name="spacing" > 
    71        <number>5</number> 
    72       </property> 
    73       <item row="0" column="4" > 
    74        <widget class="QPushButton" name="subBrowseButton" > 
     51      <item row="1" column="7" > 
     52       <spacer> 
     53        <property name="orientation" > 
     54         <enum>Qt::Horizontal</enum> 
     55        </property> 
     56        <property name="sizeHint" > 
     57         <size> 
     58          <width>16</width> 
     59          <height>20</height> 
     60         </size> 
     61        </property> 
     62       </spacer> 
     63      </item> 
     64      <item row="1" column="0" > 
     65       <spacer> 
     66        <property name="orientation" > 
     67         <enum>Qt::Horizontal</enum> 
     68        </property> 
     69        <property name="sizeHint" > 
     70         <size> 
     71          <width>16</width> 
     72          <height>20</height> 
     73         </size> 
     74        </property> 
     75       </spacer> 
     76      </item> 
     77      <item row="1" column="5" colspan="2" > 
     78       <widget class="QComboBox" name="alignSubComboBox" > 
     79        <property name="minimumSize" > 
     80         <size> 
     81          <width>80</width> 
     82          <height>0</height> 
     83         </size> 
     84        </property> 
     85        <property name="currentIndex" > 
     86         <number>0</number> 
     87        </property> 
     88        <property name="insertPolicy" > 
     89         <enum>QComboBox::NoInsert</enum> 
     90        </property> 
     91        <property name="minimumContentsLength" > 
     92         <number>0</number> 
     93        </property> 
     94        <item> 
     95         <property name="text" > 
     96          <string>Left</string> 
     97         </property> 
     98        </item> 
     99        <item> 
     100         <property name="text" > 
     101          <string>Center</string> 
     102         </property> 
     103        </item> 
     104        <item> 
     105         <property name="text" > 
     106          <string>Right</string> 
     107         </property> 
     108        </item> 
     109       </widget> 
     110      </item> 
     111      <item row="1" column="4" > 
     112       <widget class="QLabel" name="alignSubLabel" > 
    75113        <property name="text" > 
    76          <string>Browse</string> 
    77         </property> 
    78        </widget> 
    79       </item> 
    80       <item row="0" column="0" colspan="4" > 
     114         <string>Alignment:</string> 
     115        </property> 
     116        <property name="buddy" > 
     117         <cstring>alignSubLabel</cstring> 
     118        </property> 
     119       </widget> 
     120      </item> 
     121      <item row="1" column="3" > 
     122       <spacer> 
     123        <property name="orientation" > 
     124         <enum>Qt::Horizontal</enum> 
     125        </property> 
     126        <property name="sizeHint" > 
     127         <size> 
     128          <width>71</width> 
     129          <height>26</height> 
     130         </size> 
     131        </property> 
     132       </spacer> 
     133      </item> 
     134      <item row="1" column="2" > 
     135       <widget class="QComboBox" name="sizeSubComboBox" > 
     136        <property name="minimumSize" > 
     137         <size> 
     138          <width>100</width> 
     139          <height>0</height> 
     140         </size> 
     141        </property> 
     142        <item> 
     143         <property name="text" > 
     144          <string>Very Small</string> 
     145         </property> 
     146        </item> 
     147        <item> 
     148         <property name="text" > 
     149          <string>Small</string> 
     150         </property> 
     151        </item> 
     152        <item> 
     153         <property name="text" > 
     154          <string>Normal</string> 
     155         </property> 
     156        </item> 
     157        <item> 
     158         <property name="text" > 
     159          <string>Big</string> 
     160         </property> 
     161        </item> 
     162        <item> 
     163         <property name="text" > 
     164          <string>Very Big</string> 
     165         </property> 
     166        </item> 
     167       </widget> 
     168      </item> 
     169      <item row="1" column="1" > 
     170       <widget class="QLabel" name="sizeSubLabel" > 
     171        <property name="text" > 
     172         <string>Size:</string> 
     173        </property> 
     174       </widget> 
     175      </item> 
     176      <item row="0" column="0" colspan="6" > 
    81177       <widget class="QComboBox" name="subInput" > 
    82178        <property name="sizePolicy" > 
     
    93189       </widget> 
    94190      </item> 
    95       <item row="1" column="1" > 
    96        <widget class="QComboBox" name="sizeSubComboBox" > 
    97         <property name="minimumSize" > 
    98          <size> 
    99           <width>100</width> 
    100           <height>0</height> 
    101          </size> 
    102         </property> 
    103         <item> 
    104          <property name="text" > 
    105           <string>Very Small</string> 
    106          </property> 
    107         </item> 
    108         <item> 
    109          <property name="text" > 
    110           <string>Small</string> 
    111          </property> 
    112         </item> 
    113         <item> 
    114          <property name="text" > 
    115           <string>Normal</string> 
    116          </property> 
    117         </item> 
    118         <item> 
    119          <property name="text" > 
    120           <string>Big</string> 
    121          </property> 
    122         </item> 
    123         <item> 
    124          <property name="text" > 
    125           <string>Very Big</string> 
    126          </property> 
    127         </item> 
    128        </widget> 
    129       </item> 
    130       <item row="1" column="2" > 
    131        <spacer> 
    132         <property name="orientation" > 
    133          <enum>Qt::Horizontal</enum> 
    134         </property> 
    135         <property name="sizeHint" > 
    136          <size> 
    137           <width>40</width> 
    138           <height>20</height> 
    139          </size> 
    140         </property> 
    141        </spacer> 
    142       </item> 
    143       <item row="1" column="4" > 
    144        <widget class="QComboBox" name="alignSubComboBox" > 
    145         <property name="minimumSize" > 
    146          <size> 
    147           <width>80</width> 
    148           <height>0</height> 
    149          </size> 
    150         </property> 
    151         <property name="currentIndex" > 
    152          <number>0</number> 
    153         </property> 
    154         <property name="insertPolicy" > 
    155          <enum>QComboBox::NoInsert</enum> 
    156         </property> 
    157         <property name="minimumContentsLength" > 
    158          <number>0</number> 
    159         </property> 
    160         <item> 
    161          <property name="text" > 
    162           <string>Left</string> 
    163          </property> 
    164         </item> 
    165         <item> 
    166          <property name="text" > 
    167           <string>Center</string> 
    168          </property> 
    169         </item> 
    170         <item> 
    171          <property name="text" > 
    172           <string>Right</string> 
    173          </property> 
    174         </item> 
    175        </widget> 
    176       </item> 
    177       <item row="1" column="0" > 
    178        <widget class="QLabel" name="sizeSubLabel" > 
     191      <item row="0" column="6" colspan="2" > 
     192       <widget class="QPushButton" name="subBrowseButton" > 
    179193        <property name="text" > 
    180          <string>Size:</string> 
    181         </property> 
    182        </widget> 
    183       </item> 
    184       <item row="1" column="3" > 
    185        <widget class="QLabel" name="alignSubLabel" > 
    186         <property name="text" > 
    187          <string>Alignment:</string> 
    188         </property> 
    189         <property name="buddy" > 
    190          <cstring>alignSubLabel</cstring> 
     194         <string>Browse</string> 
    191195        </property> 
    192196       </widget> 
     
    195199    </widget> 
    196200   </item> 
    197    <item row="0" column="1" colspan="2" > 
    198     <widget class="QWidget" native="1" name="tempWidget" /> 
     201   <item row="3" column="0" colspan="2" > 
     202    <widget class="QCheckBox" name="subCheckBox" > 
     203     <property name="text" > 
     204      <string>Use a subtitles file</string> 
     205     </property> 
     206    </widget> 
     207   </item> 
     208   <item row="2" column="2" > 
     209    <spacer> 
     210     <property name="orientation" > 
     211      <enum>Qt::Vertical</enum> 
     212     </property> 
     213     <property name="sizeType" > 
     214      <enum>QSizePolicy::Fixed</enum> 
     215     </property> 
     216     <property name="sizeHint" > 
     217      <size> 
     218       <width>273</width> 
     219       <height>16</height> 
     220      </size> 
     221     </property> 
     222    </spacer> 
     223   </item> 
     224   <item row="1" column="1" > 
     225    <widget class="QLabel" name="fileLabel" > 
     226     <property name="text" > 
     227      <string>File / Directory Names;</string> 
     228     </property> 
     229    </widget> 
    199230   </item> 
    200231   <item row="1" column="2" > 
     
    216247    </widget> 
    217248   </item> 
    218    <item row="1" column="1" > 
    219     <widget class="QLabel" name="fileLabel" > 
    220      <property name="text" > 
    221       <string>File / Directory Names;</string> 
    222      </property> 
    223     </widget> 
    224    </item> 
    225    <item row="2" column="2" > 
    226     <spacer> 
    227      <property name="orientation" > 
    228       <enum>Qt::Vertical</enum> 
    229      </property> 
    230      <property name="sizeType" > 
    231       <enum>QSizePolicy::Fixed</enum> 
    232      </property> 
    233      <property name="sizeHint" > 
    234       <size> 
    235        <width>273</width> 
    236        <height>16</height> 
    237       </size> 
    238      </property> 
    239     </spacer> 
    240    </item> 
    241    <item row="4" column="1" colspan="2" > 
     249   <item row="5" column="1" colspan="2" > 
    242250    <spacer> 
    243251     <property name="orientation" > 
     
    248256       <width>200</width> 
    249257       <height>2</height> 
     258      </size> 
     259     </property> 
     260    </spacer> 
     261   </item> 
     262   <item row="0" column="1" colspan="2" > 
     263    <widget class="QWidget" native="1" name="tempWidget" /> 
     264   </item> 
     265   <item row="1" column="0" > 
     266    <spacer> 
     267     <property name="orientation" > 
     268      <enum>Qt::Horizontal</enum> 
     269     </property> 
     270     <property name="sizeType" > 
     271      <enum>QSizePolicy::Fixed</enum> 
     272     </property> 
     273     <property name="sizeHint" > 
     274      <size> 
     275       <width>16</width> 
     276       <height>26</height> 
    250277      </size> 
    251278     </property>