]> git.sesse.net Git - vlc/commitdiff
Qt4 - Preferences, improve a bit the Hotkeys. Preparatory work to merge the Hotkeys...
authorJean-Baptiste Kempf <jb@videolan.org>
Mon, 5 Nov 2007 07:26:36 +0000 (07:26 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 5 Nov 2007 07:26:36 +0000 (07:26 +0000)
modules/gui/qt4/components/complete_preferences.cpp
modules/gui/qt4/components/preferences_widgets.cpp

index c2d7d47319f21b6206366c63230c3fc7f17028f0..421f6ea221a5857e5798c517d5587179fd9cd773 100644 (file)
@@ -457,13 +457,6 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
         if( !control )
             continue;
 
-        if( has_hotkey )
-        {
-            /* A hotkey widget takes 2 lines */
-            if( box ) i_boxline ++;
-            else i_line++;
-        }
-
         if( box ) i_boxline++;
         else i_line++;
         controls.append( control );
index 45f84c48d8fbdb01a0b334eca4308d7804511f70..cd29f43e13846db1c70de380cb3cd75b3d497e35 100644 (file)
@@ -390,7 +390,8 @@ void StringListConfigControl::actionRequested( int i_action )
     if( i_action < 0 || i_action >= p_item->i_action ) return;
 
     vlc_value_t val;
-    val.psz_string = qtu( (combo->itemData( combo->currentIndex() ).toString() ) );
+    val.psz_string = 
+        qtu( (combo->itemData( combo->currentIndex() ).toString() ) );
 
     p_item->ppf_action[i_action]( p_this, getName(), val, val, 0 );
 
@@ -975,11 +976,34 @@ KeySelectorControl::KeySelectorControl( vlc_object_t *_p_this,
                                 ConfigControl( _p_this, _p_item, _parent )
 
 {
+    QWidget *keyContainer = new QWidget;
+    QGridLayout *gLayout = new QGridLayout( keyContainer );
+    
     label = new QLabel( qtr("Select an action to change the associated hotkey") );
-    table = new QTreeWidget( 0 );
+    QLabel *searchLabel = new QLabel( qtr( "Search" ) );
+    
+    table = new QTreeWidget;
+    table->setColumnCount(2);
+    table->headerItem()->setText( 0, qtr( "Action" ) );
+    table->headerItem()->setText( 1, qtr( "Shortcut" ) );
+    
+    QLineEdit *shortcutValue = new QLineEdit;
+    shortcutValue->setReadOnly(true);
+    QLineEdit *actionSearch = new QLineEdit;
+    
+    QPushButton *clearButton = new QPushButton( qtr( "Clear" ) );
+    QPushButton *setButton = new QPushButton( qtr( "Set" ) );
     finish();
-
-    if( !l )
+    
+    gLayout->addWidget( label, 0, 0, 1, 4 );
+    gLayout->addWidget( searchLabel, 1, 0, 1, 2 );
+    gLayout->addWidget( actionSearch, 1, 2, 1, 2 ); 
+    gLayout->addWidget( table, 2, 0, 1, 4 );
+    gLayout->addWidget( clearButton, 3, 0, 1, 1 );
+    gLayout->addWidget( shortcutValue, 3, 1, 1, 2 ); 
+    gLayout->addWidget( setButton, 3, 3, 1, 1 );
+    
+    if( !l ) /* This shouldn't happen */
     {
         QVBoxLayout *layout = new QVBoxLayout();
         layout->addWidget( label, 0 ); layout->addWidget( table, 1 );
@@ -987,8 +1011,7 @@ KeySelectorControl::KeySelectorControl( vlc_object_t *_p_this,
     }
     else
     {
-        l->addWidget( label, line, 0, 1, 2 );
-        l->addWidget( table, line+1, 0, 1,2 );
+        l->addWidget( keyContainer, 0, 0, 1, 2 );
     }
 }