preferences.cpp 16.9 KB
Newer Older
zorglub's avatar
zorglub committed
1
/*****************************************************************************
zorglub's avatar
zorglub committed
2
 * preferences.cpp : "Normal preferences"
zorglub's avatar
zorglub committed
3
 ****************************************************************************
4
5
 * Copyright (C) 2006 the VideoLAN team
 * $Id$
zorglub's avatar
zorglub committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 *
 * Authors: Clément Stenac <zorglub@videolan.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

24
#include <QApplication>
zorglub's avatar
zorglub committed
25
26
27
28
29
30
31
32
33
34
#include <QLabel>
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QVariant>
#include <QString>
#include <QFont>
#include <QGroupBox>
#include <QScrollArea>
#include <QVBoxLayout>
#include <QHBoxLayout>
zorglub's avatar
zorglub committed
35
#include <QGridLayout>
36
#include <QHeaderView>
zorglub's avatar
zorglub committed
37
38
39
#include <QPalette>
#include <QColor>

zorglub's avatar
zorglub committed
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "components/preferences.hpp"
#include "components/preferences_widgets.hpp"
#include "qt4.hpp"

#include <vlc_config_cat.h>
#include <vlc_intf_strings.h>
#include <assert.h>

#include "pixmaps/audio.xpm"
#include "pixmaps/video.xpm"
#include "pixmaps/type_net.xpm"
#include "pixmaps/type_playlist.xpm"
#include "pixmaps/advanced.xpm"
#include "pixmaps/codec.xpm"
#include "pixmaps/intf.xpm"

zorglub's avatar
zorglub committed
56
57
58
59
60
61
62
63
64
65
#define ITEM_HEIGHT 25

/*********************************************************************
 * The Tree
 *********************************************************************/
PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
                            QTreeWidget( _parent ), p_intf( _p_intf )
{
    setColumnCount( 1 );
    setIconSize( QSize( ITEM_HEIGHT,ITEM_HEIGHT ) );
zorglub's avatar
zorglub committed
66
    setAlternatingRowColors( true );
67
    header()->hide();
zorglub's avatar
zorglub committed
68

zorglub's avatar
zorglub committed
69
70
71
72
73
74
75
76
77
78
79
#define BI( a,b) QIcon a##_icon = QIcon( QPixmap( b##_xpm ))
    BI( audio, audio );
    BI( video, video );
    BI( input, codec );
    BI( sout, type_net );
    BI( advanced, advanced );
    BI( playlist, type_playlist );
    BI( interface, intf );
#undef BI

    /* Build the tree for the main module */
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
80
    module_t *p_module = NULL;
zorglub's avatar
zorglub committed
81
82
83
    vlc_list_t *p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE,
                                        FIND_ANYWHERE );
    if( !p_list ) return;
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
84
    for( int i_index = 0; p_module == NULL; i_index++ )
zorglub's avatar
zorglub committed
85
    {
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
86
87
        assert (i_index < p_list->i_count);

zorglub's avatar
zorglub committed
88
        p_module = (module_t *)p_list->p_values[i_index].p_object;
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
89
90
        if( strcmp( p_module->psz_object_name, "main" ) )
            p_module = NULL;
zorglub's avatar
zorglub committed
91
    }
zorglub's avatar
zorglub committed
92
93
94

    PrefsItemData *data = NULL;
    QTreeWidgetItem *current_item = NULL;
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
95
    for (size_t i = 0; i < p_module->confsize; i++)
zorglub's avatar
zorglub committed
96
    {
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
97
        module_config_t *p_item = p_module->p_config + i;
zorglub's avatar
zorglub committed
98
99
100
        char *psz_help;
        QIcon icon;
        switch( p_item->i_type )
zorglub's avatar
zorglub committed
101
        {
zorglub's avatar
zorglub committed
102
        case CONFIG_CATEGORY:
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
103
            if( p_item->value.i == -1 ) break;
zorglub's avatar
zorglub committed
104
105
            data = new PrefsItemData();
            data->name = QString( qfu( config_CategoryNameGet
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
106
107
                                           ( p_item->value.i ) ) );
            psz_help = config_CategoryHelpGet( p_item->value.i );
zorglub's avatar
zorglub committed
108
109
110
111
112
            if( psz_help )
                data->help = QString( qfu(psz_help) );
            else
                data->help.clear();
            data->i_type = TYPE_CATEGORY;
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
113
            data->i_object_id = p_item->value.i;
zorglub's avatar
zorglub committed
114

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
115
            switch( p_item->value.i )
zorglub's avatar
zorglub committed
116
117
            {
#define CI(a,b) case a: icon = b##_icon;break
zorglub's avatar
zorglub committed
118
119
120
121
122
123
124
            CI( CAT_AUDIO, audio );
            CI( CAT_VIDEO, video );
            CI( CAT_INPUT, input );
            CI( CAT_SOUT, sout );
            CI( CAT_ADVANCED, advanced );
            CI( CAT_PLAYLIST, playlist );
            CI( CAT_INTERFACE, interface );
zorglub's avatar
zorglub committed
125
#undef CI
zorglub's avatar
zorglub committed
126
            }
zorglub's avatar
zorglub committed
127

zorglub's avatar
zorglub committed
128
129
130
131
132
133
134
135
            current_item = new QTreeWidgetItem();
            current_item->setText( 0, data->name );
            current_item->setIcon( 0 , icon );
            current_item->setData( 0, Qt::UserRole,
                                   qVariantFromValue( data ) );
            addTopLevelItem( current_item );
            break;
        case CONFIG_SUBCATEGORY:
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
136
            if( p_item->value.i == -1 ) break;
zorglub's avatar
zorglub committed
137
            if( data &&
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
138
139
140
141
142
143
144
                ( p_item->value.i == SUBCAT_VIDEO_GENERAL ||
                  p_item->value.i == SUBCAT_ADVANCED_MISC ||
                  p_item->value.i == SUBCAT_INPUT_GENERAL ||
                  p_item->value.i == SUBCAT_INTERFACE_GENERAL ||
                  p_item->value.i == SUBCAT_SOUT_GENERAL||
                  p_item->value.i == SUBCAT_PLAYLIST_GENERAL||
                  p_item->value.i == SUBCAT_AUDIO_GENERAL ) )
zorglub's avatar
zorglub committed
145
146
147
            {
                // Data still contains the correct thing
                data->i_type = TYPE_CATSUBCAT;
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
148
                data->i_subcat_id = p_item->value.i;
149
                data->name = QString( qfu( config_CategoryNameGet(
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
150
151
                                            p_item->value.i )) );
                psz_help = config_CategoryHelpGet( p_item->value.i );
zorglub's avatar
zorglub committed
152
                if( psz_help )
153
                    data->help = QString( qfu(psz_help) );
zorglub's avatar
zorglub committed
154
155
                else
                    data->help.clear();
zorglub's avatar
zorglub committed
156
157
158
                current_item->setData( 0, Qt::UserRole,
                                       QVariant::fromValue( data ) );
                continue;
zorglub's avatar
zorglub committed
159
            }
zorglub's avatar
zorglub committed
160
161
            data = new PrefsItemData();
            data->name = QString( qfu( config_CategoryNameGet(
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
162
163
                                                        p_item->value.i)) );
            psz_help = config_CategoryHelpGet( p_item->value.i );
zorglub's avatar
zorglub committed
164
165
166
167
168
            if( psz_help )
                data->help = QString( qfu(psz_help) );
            else
                data->help.clear();
            data->i_type = TYPE_SUBCATEGORY;
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
169
            data->i_object_id = p_item->value.i;
zorglub's avatar
zorglub committed
170
171
172
173
174
175
176
177
178
179
180
181
182

            assert( current_item );

            /* TODO : Choose the image */
            QTreeWidgetItem *subcat_item = new QTreeWidgetItem();
            subcat_item->setText( 0, data->name );
            //item->setIcon( 0 , XXX );
            subcat_item->setData( 0, Qt::UserRole,
                                  qVariantFromValue(data) );
            subcat_item->setSizeHint( 0, QSize( -1, ITEM_HEIGHT ) );
            current_item->addChild( subcat_item );
            break;
        }
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
183
    }
zorglub's avatar
zorglub committed
184
185
186
187
188
189
190
191
192
193
194
195
196
197

    /* Build the tree of plugins */
    for( int i_index = 0; i_index < p_list->i_count; i_index++ )
    {
        int i_subcategory = -1, i_category = -1, i_options = 0;
        p_module = (module_t *)p_list->p_values[i_index].p_object;

        // Main module excluded
        if( !strcmp( p_module->psz_object_name, "main" ) ) continue;

        /* Exclude empty plugins (submodules don't have config options, they
         * are stored in the parent module) */
        if( p_module->b_submodule ) continue;

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
198
199
200
        for (size_t i = 0; i < p_module->confsize; i++)
        {
            module_config_t *p_item = p_module->p_config + i;
zorglub's avatar
zorglub committed
201
202

            if( p_item->i_type == CONFIG_CATEGORY )
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
203
                i_category = p_item->value.i;
zorglub's avatar
zorglub committed
204
            else if( p_item->i_type == CONFIG_SUBCATEGORY )
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
205
                i_subcategory = p_item->value.i;
zorglub's avatar
zorglub committed
206
207
208
209
210
            if( p_item->i_type & CONFIG_ITEM )
                i_options++;

            if( i_options > 0 && i_category >= 0 && i_subcategory >= 0 )
                break;
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
211
        }
zorglub's avatar
zorglub committed
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256

        if( !i_options ) continue; // Nothing to display

        // Locate the category item;
        QTreeWidgetItem *subcat_item = NULL;
        bool b_found = false;
        for( int i_cat_index = 0 ; i_cat_index < topLevelItemCount();
                                   i_cat_index++ )
        {
            QTreeWidgetItem *cat_item = topLevelItem( i_cat_index );
            PrefsItemData *data = cat_item->data( 0, Qt::UserRole ).
                                             value<PrefsItemData *>();
            if( data->i_object_id == i_category )
            {
                for( int i_sc_index = 0; i_sc_index < cat_item->childCount();
                         i_sc_index++ )
                {
                    subcat_item = cat_item->child( i_sc_index );
                    PrefsItemData *sc_data = subcat_item->data(0, Qt::UserRole).
                                                value<PrefsItemData *>();
                    if( sc_data && sc_data->i_object_id == i_subcategory )
                    {
                        b_found = true;
                        break;
                    }
                }
                if( !b_found )
                {
                    subcat_item = cat_item;
                    b_found = true;
                }
                break;
            }
        }
        if( !b_found ) continue;

        PrefsItemData *module_data = new PrefsItemData();
        module_data->b_submodule = p_module->b_submodule;
        module_data->i_type = TYPE_MODULE;
        module_data->i_object_id = p_module->b_submodule ?
                         ((module_t *)p_module->p_parent)->i_object_id :
                         p_module->i_object_id;
        module_data->help.clear();
        // TODO image
        QTreeWidgetItem *module_item = new QTreeWidgetItem();
zorglub's avatar
zorglub committed
257
258
        module_item->setText( 0, qfu( p_module->psz_shortname ?
                      p_module->psz_shortname : p_module->psz_object_name) );
zorglub's avatar
zorglub committed
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
        //item->setIcon( 0 , XXX );
        module_item->setData( 0, Qt::UserRole,
                              QVariant::fromValue( module_data) );
        module_item->setSizeHint( 0, QSize( -1, ITEM_HEIGHT ) );
        subcat_item->addChild( module_item );
    }

    /* We got everything, just sort a bit */
    sortItems( 0, Qt::AscendingOrder );

    vlc_list_release( p_list );
}

PrefsTree::~PrefsTree() {}

zorglub's avatar
zorglub committed
274
void PrefsTree::applyAll()
zorglub's avatar
zorglub committed
275
{
zorglub's avatar
zorglub committed
276
    doAll( false );
zorglub's avatar
zorglub committed
277
278
}

zorglub's avatar
zorglub committed
279
void PrefsTree::cleanAll()
zorglub's avatar
zorglub committed
280
{
zorglub's avatar
zorglub committed
281
    doAll( true );
zorglub's avatar
zorglub committed
282
283
}

zorglub's avatar
zorglub committed
284
void PrefsTree::doAll( bool doclean )
zorglub's avatar
zorglub committed
285
286
287
288
289
{
    for( int i_cat_index = 0 ; i_cat_index < topLevelItemCount();
             i_cat_index++ )
    {
        QTreeWidgetItem *cat_item = topLevelItem( i_cat_index );
zorglub's avatar
zorglub committed
290
        for( int i_sc_index = 0; i_sc_index < cat_item->childCount();
zorglub's avatar
zorglub committed
291
292
293
                 i_sc_index++ )
        {
            QTreeWidgetItem *sc_item = cat_item->child( i_sc_index );
zorglub's avatar
zorglub committed
294
            for( int i_module = 0 ; i_module < sc_item->childCount();
zorglub's avatar
zorglub committed
295
296
                     i_module++ )
            {
zorglub's avatar
zorglub committed
297
298
                PrefsItemData *data = sc_item->child( i_module )->
                               data( 0, Qt::UserRole).value<PrefsItemData *>();
zorglub's avatar
zorglub committed
299
                if( data->panel && doclean )
zorglub's avatar
zorglub committed
300
301
302
303
                {
                    delete data->panel;
                    data->panel = NULL;
                }
zorglub's avatar
zorglub committed
304
                else if( data->panel )
zorglub's avatar
zorglub committed
305
                    data->panel->apply();
zorglub's avatar
zorglub committed
306
            }
zorglub's avatar
zorglub committed
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
            PrefsItemData *data = sc_item->data( 0, Qt::UserRole).
                                            value<PrefsItemData *>();
            if( data->panel && doclean )
            {
                delete data->panel;
                data->panel = NULL;
            }
            else if( data->panel )
                data->panel->apply();
        }
        PrefsItemData *data = cat_item->data( 0, Qt::UserRole).
                                            value<PrefsItemData *>();
        if( data->panel && doclean )
        {
            delete data->panel;
            data->panel = NULL;
zorglub's avatar
zorglub committed
323
        }
zorglub's avatar
zorglub committed
324
325
        else if( data->panel )
            data->panel->apply();
zorglub's avatar
zorglub committed
326
327
328
329
330
331
332
333
334
335
    }
}

/*********************************************************************
 * The Panel
 *********************************************************************/
PrefsPanel::PrefsPanel( QWidget *_parent ) : QWidget( _parent )
{}

PrefsPanel::PrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
zorglub's avatar
zorglub committed
336
                        PrefsItemData * data ) :
zorglub's avatar
zorglub committed
337
338
                        QWidget( _parent ), p_intf( _p_intf )
{
zorglub's avatar
zorglub committed
339
    /* Find our module */
zorglub's avatar
zorglub committed
340
    module_t *p_module = NULL;
zorglub's avatar
zorglub committed
341
    if( data->i_type == TYPE_CATEGORY )
zorglub's avatar
zorglub committed
342
        return;
zorglub's avatar
zorglub committed
343
344
345
346
    else if( data->i_type == TYPE_MODULE )
        p_module = (module_t *) vlc_object_get( p_intf, data->i_object_id );
    else
    {
zorglub's avatar
zorglub committed
347
        p_module = config_FindModule( VLC_OBJECT(p_intf), "main" );
zorglub's avatar
zorglub committed
348
349
        assert( p_module );
        vlc_object_yield( p_module );
zorglub's avatar
zorglub committed
350
351
    }

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
352
353
354
355
356
357
    module_t *p_realmodule = p_module->b_submodule
            ? (module_t *)(p_module->p_parent)
            : p_module;

    module_config_t *p_item = p_realmodule->p_config;
    module_config_t *p_end = p_item + p_realmodule->confsize;
zorglub's avatar
zorglub committed
358
359
360

    if( data->i_type == TYPE_SUBCATEGORY || data->i_type ==  TYPE_CATSUBCAT )
    {
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
361
        while (p_item < p_end)
zorglub's avatar
zorglub committed
362
363
364
        {
            if( p_item->i_type == CONFIG_SUBCATEGORY &&
                            ( data->i_type == TYPE_SUBCATEGORY &&
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
365
                              p_item->value.i == data->i_object_id ) ||
zorglub's avatar
zorglub committed
366
                            ( data->i_type == TYPE_CATSUBCAT &&
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
367
                              p_item->value.i == data->i_subcat_id ) )
zorglub's avatar
zorglub committed
368
                break;
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
369
370
            p_item++;
        }
zorglub's avatar
zorglub committed
371
372
    }

zorglub's avatar
zorglub committed
373
    global_layout = new QVBoxLayout();
zorglub's avatar
zorglub committed
374
375
376
377
378
379
380
    QString head;
    if( data->i_type == TYPE_SUBCATEGORY || data->i_type ==  TYPE_CATSUBCAT )
    {
        head = QString( data->name );
        p_item++; // Why that ?
    }
    else
381
382
    {
        head = QString( qfu(p_module->psz_longname) );
zorglub's avatar
zorglub committed
383
        if( p_module->psz_help )
384
385
386
387
388
        {
            head.append( "\n" );
            head.append( qfu( p_module->psz_help ) );
        }
    }
zorglub's avatar
zorglub committed
389

390
391
    QLabel *label = new QLabel( head );
    global_layout->addWidget( label );
392
    QFont myFont = QApplication::font( static_cast<QWidget*>(0) );
393
394
395
    myFont.setPointSize( myFont.pointSize() + 3 ); myFont.setBold( true );

    label->setFont( myFont );
zorglub's avatar
zorglub committed
396
397
398
399
400
401
    QLabel *help = new QLabel( data->help, this );
    help->setWordWrap( true );

    global_layout->addWidget( help );

    QGroupBox *box = NULL;
zorglub's avatar
zorglub committed
402
    QGridLayout *boxlayout = NULL;
zorglub's avatar
zorglub committed
403
404

    QScrollArea *scroller= new QScrollArea;
405
    scroller->setFrameStyle( QFrame::NoFrame );
zorglub's avatar
zorglub committed
406
407
    QWidget *scrolled_area = new QWidget;

zorglub's avatar
zorglub committed
408
409
    QGridLayout *layout = new QGridLayout();
    int i_line = 0, i_boxline = 0;
410
    bool has_hotkey = false;
zorglub's avatar
zorglub committed
411
412
413
414

    if( p_item ) do
    {
        if( ( ( data->i_type == TYPE_SUBCATEGORY &&
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
415
                p_item->value.i != data->i_object_id ) ||
zorglub's avatar
zorglub committed
416
              ( data->i_type == TYPE_CATSUBCAT  &&
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
417
                p_item->value.i != data->i_subcat_id ) ) &&
zorglub's avatar
zorglub committed
418
419
420
421
422
423
424
425
426
427
            ( p_item->i_type == CONFIG_CATEGORY ||
              p_item->i_type == CONFIG_SUBCATEGORY ) )
            break;
        if( p_item->b_internal == VLC_TRUE ) continue;

        if( p_item->i_type == CONFIG_SECTION )
        {
            if( box )
            {
                box->setLayout( boxlayout );
zorglub's avatar
zorglub committed
428
429
                layout->addWidget( box, i_line, 0, 1, 2 );
                i_line++;
zorglub's avatar
zorglub committed
430
            }
431
            box = new QGroupBox( qfu(p_item->psz_text) );
zorglub's avatar
zorglub committed
432
433
            boxlayout = new QGridLayout();
        }
434
435
436
437
438
439
440
        /* Only one hotkey control */
        if( has_hotkey && p_item->i_type & CONFIG_ITEM && p_item->psz_name &&
                                         strstr( p_item->psz_name, "key-" ) )
            continue;
        if( p_item->i_type & CONFIG_ITEM && p_item->psz_name &&
                                            strstr( p_item->psz_name, "key-" ) )
            has_hotkey = true;
zorglub's avatar
zorglub committed
441

zorglub's avatar
zorglub committed
442
443
444
445
446
447
448
        ConfigControl *control;
        if( ! box )
            control = ConfigControl::createControl( VLC_OBJECT( p_intf ),
                                        p_item, NULL, layout, i_line );
        else
            control = ConfigControl::createControl( VLC_OBJECT( p_intf ),
                                    p_item, NULL, boxlayout, i_boxline );
zorglub's avatar
zorglub committed
449
450
        if( !control )
            continue;
zorglub's avatar
zorglub committed
451

452
453
454
455
456
457
458
        if( has_hotkey )
        {
            /* A hotkey widget takes 2 lines */
            if( box ) i_boxline ++;
            else i_line++;
        }

zorglub's avatar
zorglub committed
459
460
        if( box ) i_boxline++;
        else i_line++;
zorglub's avatar
zorglub committed
461
462
        controls.append( control );
    }
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
463
    while( !( ( data->i_type == TYPE_SUBCATEGORY ||
zorglub's avatar
zorglub committed
464
465
               data->i_type == TYPE_CATSUBCAT ) &&
             ( p_item->i_type == CONFIG_CATEGORY ||
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
466
467
               p_item->i_type == CONFIG_SUBCATEGORY ) )
        && ( ++p_item < p_end ) );
zorglub's avatar
zorglub committed
468
469
470
471

    if( box )
    {
        box->setLayout( boxlayout );
zorglub's avatar
zorglub committed
472
        layout->addWidget( box, i_line, 0, 1, 2 );
zorglub's avatar
zorglub committed
473
474
    }

475
476
    vlc_object_release( p_module );

zorglub's avatar
zorglub committed
477
478
479
480
481
    scrolled_area->setSizePolicy( QSizePolicy::Preferred,QSizePolicy::Fixed );
    scrolled_area->setLayout( layout );
    scroller->setWidget( scrolled_area );
    scroller->setWidgetResizable( true );
    global_layout->addWidget( scroller );
zorglub's avatar
zorglub committed
482
    setLayout( global_layout );
zorglub's avatar
zorglub committed
483
484
}

zorglub's avatar
zorglub committed
485
void PrefsPanel::apply()
zorglub's avatar
zorglub committed
486
487
488
489
{
    QList<ConfigControl *>::Iterator i;
    for( i = controls.begin() ; i != controls.end() ; i++ )
    {
zorglub's avatar
zorglub committed
490
        ConfigControl *c = qobject_cast<ConfigControl *>(*i);
zorglub's avatar
zorglub committed
491
        c->doApply( p_intf );
zorglub's avatar
zorglub committed
492
493
    }
}
zorglub's avatar
zorglub committed
494
void PrefsPanel::clean()
zorglub's avatar
zorglub committed
495
{}