Commit bb89e917 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: simplify previewWidgets creation.

Btw, you really shouldn't use C cast on QObjects
parent b0b8f87c
......@@ -200,8 +200,7 @@ void ConfigControl::doApply( intf_thread_t *p_intf )
/*******************************************************
* Simple widgets
*******************************************************/
InterfacePreviewWidget::InterfacePreviewWidget
( QWidget *parent ) : QLabel( parent, 0 )
InterfacePreviewWidget::InterfacePreviewWidget ( QWidget *parent ) : QLabel( parent )
{
setGeometry( 0, 0, 128, 100 );
setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
......
......@@ -64,6 +64,10 @@ class InterfacePreviewWidget : public QLabel
public:
InterfacePreviewWidget( QWidget * );
public slots:
/* 0: sample_classic, aka VLC 0.8.6
1: sample_complete, aka MPC
2: sample_minimal, aka WMP12 minimal
3: sample_skins */
void setPreview( int );
};
......
......@@ -542,15 +542,9 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
ui.native_zone->setEnabled( ui.qt4->isChecked() );
CONNECT( ui.qt4, toggled( bool ), ui.native_zone, setEnabled( bool ) );
InterfacePreviewWidget *preview = new InterfacePreviewWidget( this );
( (QGridLayout *) ui.LooknfeelBox->layout() )->
addWidget( preview, 1, 0, 1, 2 );
CONNECT( ui.displayModeBox, currentIndexChanged( int ),
preview, setPreview( int ) );
InterfacePreviewWidget *skinspreview = new InterfacePreviewWidget( this );
skinspreview->setPreview(3); /* skins_preview resource index */
( (QGridLayout *) ui.LooknfeelBox->layout() )->
addWidget( skinspreview, 7, 0, 1, 2 );
ui.mainPreview, setPreview( int ) );
ui.skinsPreview->setPreview( 3 ); /* skins_preview resource index */
CONFIG_GENERIC( "qt-display-mode", IntegerList, ui.displayLabel,
displayModeBox );
......
......@@ -61,6 +61,9 @@
<property name="text">
<string>Album art download policy:</string>
</property>
<property name="buddy">
<cstring>artFetcher</cstring>
</property>
</widget>
</item>
<item row="0" column="2" colspan="2">
......@@ -126,6 +129,9 @@
<property name="margin">
<number>5</number>
</property>
<property name="buddy">
<cstring>recentlyPlayedFilters</cstring>
</property>
</widget>
</item>
<item row="2" column="2" colspan="2">
......@@ -164,6 +170,9 @@
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>language</cstring>
</property>
</widget>
</item>
<item>
......@@ -392,6 +401,9 @@
<property name="text">
<string>Force window style:</string>
</property>
<property name="buddy">
<cstring>stylesCombo</cstring>
</property>
</widget>
</item>
</layout>
......@@ -410,11 +422,31 @@
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="InterfacePreviewWidget" name="mainPreview">
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="buddy">
<cstring>displayModeBox</cstring>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="InterfacePreviewWidget" name="skinsPreview"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>InterfacePreviewWidget</class>
<extends>QLabel</extends>
<header>components/preferences_widgets.hpp</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>OneInterfaceMode</tabstop>
<tabstop>artFetcher</tabstop>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment