]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/preferences_widgets.cpp
configuration: add config_AddIntf() config_RemoveIntf() and config_ExistIntf() to...
[vlc] / modules / gui / qt4 / components / preferences_widgets.cpp
index 5d2019411af21e0ba4eb04c793a77ec3e21f0c8b..46682f44c0c933adfed68ec03f511995d69727a8 100644 (file)
  * Todo:
  *  - Finish implementation (see WX)
  *  - Improvements over WX
- *      - Password field implementation (through "pwd" bool param
  *      - Validator for modulelist
  *  - Implement update stuff using a general Updated signal
  */
 
 #include "components/preferences_widgets.hpp"
 #include "util/customwidgets.hpp"
-#include "qt4.hpp"
 
 #include <vlc_keys.h>
 
@@ -74,7 +72,7 @@ ConfigControl *ConfigControl::createControl( vlc_object_t *p_this,
                                              QGridLayout *l, int &line )
 {
     ConfigControl *p_control = NULL;
-    if( p_item->psz_current ) return NULL;
+    if( p_item->psz_current || p_item->b_unsaveable ) return NULL;
 
     switch( p_item->i_type )
     {
@@ -421,6 +419,7 @@ ModuleConfigControl::ModuleConfigControl( vlc_object_t *_p_this,
         l->addWidget( combo, line, 1, Qt::AlignRight );
     }
 }
+
 ModuleConfigControl::ModuleConfigControl( vlc_object_t *_p_this,
                 module_config_t *_p_item, QLabel *_label, QComboBox *_combo,
                 bool bycat ) : VStringConfigControl( _p_this, _p_item )
@@ -514,16 +513,6 @@ ModuleListConfigControl::ModuleListConfigControl( vlc_object_t *_p_this,
 
     text->setToolTip( formatTooltip( qtr( p_item->psz_longtext) ) );
 }
-#if 0
-ModuleConfigControl::ModuleConfigControl( vlc_object_t *_p_this,
-        module_config_t *_p_item, QLabel *_label, QComboBox *_combo,
-        bool bycat ) : VStringConfigControl( _p_this, _p_item )
-{
-    combo = _combo;
-    label = _label;
-    finish( bycat );
-}
-#endif
 
 ModuleListConfigControl::~ModuleListConfigControl()
 {
@@ -640,6 +629,7 @@ void ModuleListConfigControl::onUpdate( int value )
             }
         }
     }
+    emit Updated();
 }
 
 /**************************************************************************
@@ -998,6 +988,8 @@ void KeySelectorControl::selectKey( QTreeWidgetItem *keyItem )
                 QTreeWidgetItem *it = table->topLevelItem(i);
                 module_config_t *p_item = static_cast<module_config_t*>
                               (it->data( 0, Qt::UserRole ).value<void*>());
+                if( p_keyItem != p_item && p_item->value.i == d->keyValue )
+                    p_item->value.i = 0;
                 it->setText( 1, VLCKeyToString( p_item->value.i ) );
             }
         }
@@ -1052,7 +1044,6 @@ void KeyInputDialog::checkForConflicts( int i_vlckey )
         if( p_current->value.i == i_vlckey && strcmp( p_current->psz_text,
                                                     keyToChange ) )
         {
-            p_current->value.i = 0;
             conflicts = true;
             break;
         }