]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/preferences_widgets.cpp
move pointer to .rodata
[vlc] / modules / gui / qt4 / components / preferences_widgets.cpp
index 1fe3651a5f6acab93459b8fdf7125cd604bc522c..6c7422349f99af883cf116a1d5b7ced34f34177a 100644 (file)
@@ -199,6 +199,29 @@ void ConfigControl::doApply( intf_thread_t *p_intf )
     }
 }
 
+/*******************************************************
+ * Simple widgets
+ *******************************************************/
+InterfacePreviewWidget::InterfacePreviewWidget
+        ( QWidget *parent ) : QLabel( parent, 0 )
+{
+    setGeometry( 0, 0, 128, 100 );
+    setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+}
+
+void InterfacePreviewWidget::setPreview( int comboid )
+{
+    /* Need to move resources references as soon as qt4.cpp
+       local defines has been moved somewhere else
+    */
+    const char * pixmaps[] = { ":/prefsmenu/sample_classic",
+                               ":/prefsmenu/sample_complete",
+                               ":/prefsmenu/sample_minimal" };
+    setPixmap( QPixmap( pixmaps[ comboid ] ) );
+}
+
+
+
 /**************************************************************************
  * String-based controls
  *************************************************************************/
@@ -1014,7 +1037,7 @@ BoolConfigControl::BoolConfigControl( vlc_object_t *_p_this,
 BoolConfigControl::BoolConfigControl( vlc_object_t *_p_this,
                                       module_config_t *_p_item,
                                       QLabel *_label,
-                                      QCheckBox *_checkbox,
+                                      QAbstractButton *_checkbox,
                                       bool bycat ) :
                    VIntConfigControl( _p_this, _p_item )
 {
@@ -1025,14 +1048,13 @@ BoolConfigControl::BoolConfigControl( vlc_object_t *_p_this,
 
 void BoolConfigControl::finish()
 {
-    checkbox->setCheckState( p_item->value.i == true ? Qt::Checked
-                                                        : Qt::Unchecked );
+    checkbox->setChecked( p_item->value.i == true );
     checkbox->setToolTip( formatTooltip(qtr(p_item->psz_longtext)) );
 }
 
 int BoolConfigControl::getValue()
 {
-    return checkbox->checkState() == Qt::Checked ? true : false;
+    return checkbox->isChecked();
 }
 
 /**************************************************************************
@@ -1223,12 +1245,14 @@ void KeySelectorControl::finish()
         {
             QList<QTreeWidgetItem *> list =
                 table->findItems( qtr( p_item->psz_text ), Qt::MatchExactly );
-            if( list.count() > 1 )
+            if( list.count() >= 1 )
             {
                 list[0]->setText( 2, VLCKeyToString( p_item->value.i ) );
                 list[0]->setData( 2, Qt::UserRole,
                                   QVariant( p_item->value.i ) );
             }
+            if( list.count() >= 2 )
+                msg_Dbg( p_this, "This is probably wrong, %s", p_item->psz_text );
         }
     }
     module_config_free (p_config);