preferences.cpp 19.6 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
24
 *
 * 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.
 *****************************************************************************/
#include "components/preferences.hpp"
#include "components/preferences_widgets.hpp"
25
#include "qt4.hpp"
zorglub's avatar
zorglub committed
26
#include <vlc_config_cat.h>
zorglub's avatar
zorglub committed
27
#include <vlc_intf_strings.h>
Konstantin Pavlov's avatar
Konstantin Pavlov committed
28
#include <assert.h>
zorglub's avatar
zorglub committed
29
30
31
32
33
34
35
36

#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"
37
#include <QApplication>
zorglub's avatar
zorglub committed
38
39
40
41
42
43
44
45
46
47
#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
48
#include <QGridLayout>
49
#include <QHeaderView>
zorglub's avatar
zorglub committed
50

zorglub's avatar
zorglub committed
51
52
53
#include <QPalette>
#include <QColor>

zorglub's avatar
zorglub committed
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#define ITEM_HEIGHT 25

/*********************************************************************
 * The Tree
 *********************************************************************/
PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
                            QTreeWidget( _parent ), p_intf( _p_intf )
{
    module_t *p_module;
    vlc_list_t *p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE,
                                        FIND_ANYWHERE );
    if( !p_list ) return;

    setColumnCount( 1 );
    setIconSize( QSize( ITEM_HEIGHT,ITEM_HEIGHT ) );
zorglub's avatar
zorglub committed
69
    setAlternatingRowColors( true );
70
    header()->hide();
zorglub's avatar
zorglub committed
71

72
73
    QFont myFont = QApplication::font(0);
    myFont.setPointSize( myFont.pointSize() + 3 ); myFont.setBold( true );
zorglub's avatar
zorglub committed
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106

#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 */
    int i_index;
    for( i_index = 0; i_index < p_list->i_count; i_index++ )
    {
        p_module = (module_t *)p_list->p_values[i_index].p_object;
        if( !strcmp( p_module->psz_object_name, "main" ) )
             break;
    }
    if( i_index < p_list->i_count )
    {
        module_config_t *p_item = p_module->p_config;
        PrefsItemData *data = NULL;
        QTreeWidgetItem *current_item = NULL;
        if( p_item ) do
        {
            char *psz_help;
            QIcon icon;
            switch( p_item->i_type )
            {
            case CONFIG_CATEGORY:
                if( p_item->i_value == -1 ) break;
                data = new PrefsItemData();
107
108
                data->name = QString( qfu( config_CategoryNameGet
                                               ( p_item->i_value ) ) );
zorglub's avatar
zorglub committed
109
110
                psz_help = config_CategoryHelpGet( p_item->i_value );
                if( psz_help )
111
                    data->help = QString( qfu(psz_help) );
zorglub's avatar
zorglub committed
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
                else
                    data->help.clear();
                data->i_type = TYPE_CATEGORY;
                data->i_object_id = p_item->i_value;

                switch( p_item->i_value )
                {
#define CI(a,b) case a: icon = b##_icon;break
                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 );
#undef CI
                }

                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:
                if( p_item->i_value == -1 ) break;
                if( data &&
                    ( p_item->i_value == SUBCAT_VIDEO_GENERAL ||
                      p_item->i_value == SUBCAT_ADVANCED_MISC ||
                      p_item->i_value == SUBCAT_INPUT_GENERAL ||
                      p_item->i_value == SUBCAT_INTERFACE_GENERAL ||
                      p_item->i_value == SUBCAT_SOUT_GENERAL||
                      p_item->i_value == SUBCAT_PLAYLIST_GENERAL||
                      p_item->i_value == SUBCAT_AUDIO_GENERAL ) )
                {
                    // Data still contains the correct thing
                    data->i_type = TYPE_CATSUBCAT;
                    data->i_subcat_id = p_item->i_value;
151
152
                    data->name = QString( qfu( config_CategoryNameGet(
                                                p_item->i_value )) );
zorglub's avatar
zorglub committed
153
154
                    psz_help = config_CategoryHelpGet( p_item->i_value );
                    if( psz_help )
155
                        data->help = QString( qfu(psz_help) );
zorglub's avatar
zorglub committed
156
157
158
159
160
161
162
                    else
                        data->help.clear();
                    current_item->setData( 0, Qt::UserRole,
                                           QVariant::fromValue( data ) );
                    continue;
                }
                data = new PrefsItemData();
163
164
                data->name = QString( qfu( config_CategoryNameGet( 
                                                            p_item->i_value)) );
zorglub's avatar
zorglub committed
165
166
                psz_help = config_CategoryHelpGet( p_item->i_value );
                if( psz_help )
167
                    data->help = QString( qfu(psz_help) );
zorglub's avatar
zorglub committed
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
                else
                    data->help.clear();
                data->i_type = TYPE_SUBCATEGORY;
                data->i_object_id = p_item->i_value;

                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;
            }
        } while( p_item->i_type != CONFIG_HINT_END && p_item++ );
    }

    /* Build the tree of plugins */
    for( int i_index = 0; i_index < p_list->i_count; i_index++ )
    {
        module_config_t *p_item;
        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;

        p_item = p_module->p_config;
        if( !p_item ) continue;

        do {
            if( p_item->i_type == CONFIG_CATEGORY )
                i_category = p_item->i_value;
            else if( p_item->i_type == CONFIG_SUBCATEGORY )
                i_subcategory = p_item->i_value;
            if( p_item->i_type & CONFIG_ITEM )
                i_options++;

            if( i_options > 0 && i_category >= 0 && i_subcategory >= 0 )
                break;
        } while( p_item->i_type != CONFIG_HINT_END && p_item++ );

        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();
        module_item->setText( 0, p_module->psz_shortname ?
                      p_module->psz_shortname : p_module->psz_object_name );
        //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
278
void PrefsTree::applyAll()
zorglub's avatar
zorglub committed
279
{
zorglub's avatar
zorglub committed
280
    doAll( false );
zorglub's avatar
zorglub committed
281
282
}

zorglub's avatar
zorglub committed
283
void PrefsTree::cleanAll()
zorglub's avatar
zorglub committed
284
{
zorglub's avatar
zorglub committed
285
    doAll( true );
zorglub's avatar
zorglub committed
286
287
288
}

/// \todo When cleaning, we should remove the panel ?
zorglub's avatar
zorglub committed
289
void PrefsTree::doAll( bool doclean )
zorglub's avatar
zorglub committed
290
291
292
293
294
{
    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
295
        for( int i_sc_index = 0; i_sc_index < cat_item->childCount();
zorglub's avatar
zorglub committed
296
297
298
                 i_sc_index++ )
        {
            QTreeWidgetItem *sc_item = cat_item->child( i_sc_index );
zorglub's avatar
zorglub committed
299
            for( int i_module = 0 ; i_module < sc_item->childCount();
zorglub's avatar
zorglub committed
300
301
                     i_module++ )
            {
zorglub's avatar
zorglub committed
302
303
                PrefsItemData *data = sc_item->child( i_module )->
                               data( 0, Qt::UserRole).value<PrefsItemData *>();
zorglub's avatar
zorglub committed
304
                if( data->panel && doclean )
zorglub's avatar
zorglub committed
305
306
307
308
                {
                    delete data->panel;
                    data->panel = NULL;
                }
zorglub's avatar
zorglub committed
309
                else if( data->panel )
zorglub's avatar
zorglub committed
310
                    data->panel->apply();
zorglub's avatar
zorglub committed
311
            }
zorglub's avatar
zorglub committed
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
            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
328
        }
zorglub's avatar
zorglub committed
329
330
        else if( data->panel )
            data->panel->apply();
zorglub's avatar
zorglub committed
331
332
333
334
335
336
337
338
339
340
    }
}

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

PrefsPanel::PrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
341
                        PrefsItemData * data, bool currently_advanced ) :
zorglub's avatar
zorglub committed
342
343
344
                        QWidget( _parent ), p_intf( _p_intf )
{
    module_config_t *p_item;
zorglub's avatar
zorglub committed
345
    module_t *p_module = NULL;
zorglub's avatar
zorglub committed
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
    vlc_list_t *p_list = NULL;
    global_layout = new QVBoxLayout();
    if( data->i_type == TYPE_CATEGORY )
    {
        /* TODO */
            return;
    }
    else if( data->i_type == TYPE_MODULE )
    {
        p_module = (module_t *) vlc_object_get( p_intf, data->i_object_id );
    }
    else
    {
        /* List the plugins */
        int i_index;
        vlc_bool_t b_found = VLC_FALSE;
        p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
        if( !p_list ) return;

        for( i_index = 0; i_index < p_list->i_count; i_index++ )
        {
            p_module = (module_t *)p_list->p_values[i_index].p_object;
            if( !strcmp( p_module->psz_object_name, "main" ) )
            {
                b_found = VLC_TRUE;
                break;
            }
        }
        if( !p_module && !b_found )
        {
            msg_Warn( p_intf, "unable to create preferences (main not found)");
            return;
        }
379
        if( p_module ) vlc_object_yield( p_module );
zorglub's avatar
zorglub committed
380
        vlc_list_release( p_list );
zorglub's avatar
zorglub committed
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
    }

    if( p_module->b_submodule )
        p_item = ((module_t *)p_module->p_parent)->p_config;
    else
        p_item = p_module->p_config;

    if( data->i_type == TYPE_SUBCATEGORY || data->i_type ==  TYPE_CATSUBCAT )
    {
        do
        {
            if( p_item->i_type == CONFIG_SUBCATEGORY &&
                            ( data->i_type == TYPE_SUBCATEGORY &&
                              p_item->i_value == data->i_object_id ) ||
                            ( data->i_type == TYPE_CATSUBCAT &&
                              p_item->i_value == data->i_subcat_id ) )
            {
                break;
            }
            if( p_item->i_type == CONFIG_HINT_END ) break;
        } while( p_item++ );
    }

    QString head;
    if( data->i_type == TYPE_SUBCATEGORY || data->i_type ==  TYPE_CATSUBCAT )
    {
        head = QString( data->name );
        p_item++; // Why that ?
    }
    else
411
412
    {
        head = QString( qfu(p_module->psz_longname) );
zorglub's avatar
zorglub committed
413
        if( p_module->psz_help )
414
415
416
417
418
        {
            head.append( "\n" );
            head.append( qfu( p_module->psz_help ) );
        }
    }
zorglub's avatar
zorglub committed
419

420
421
422
423
424
425
    QLabel *label = new QLabel( head );
    global_layout->addWidget( label );
    QFont myFont = QApplication::font(0);
    myFont.setPointSize( myFont.pointSize() + 3 ); myFont.setBold( true );

    label->setFont( myFont );
zorglub's avatar
zorglub committed
426
427
428
429
430
431
    QLabel *help = new QLabel( data->help, this );
    help->setWordWrap( true );

    global_layout->addWidget( help );

    QGroupBox *box = NULL;
zorglub's avatar
zorglub committed
432
    QGridLayout *boxlayout = NULL;
zorglub's avatar
zorglub committed
433
434

    QScrollArea *scroller= new QScrollArea;
435
    scroller->setFrameStyle( QFrame::NoFrame );
zorglub's avatar
zorglub committed
436
437
    QWidget *scrolled_area = new QWidget;

zorglub's avatar
zorglub committed
438
439
    QGridLayout *layout = new QGridLayout();
    int i_line = 0, i_boxline = 0;
zorglub's avatar
zorglub committed
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456

    if( p_item ) do
    {
        if( ( ( data->i_type == TYPE_SUBCATEGORY &&
                p_item->i_value != data->i_object_id ) ||
              ( data->i_type == TYPE_CATSUBCAT  &&
                p_item->i_value != data->i_subcat_id ) ) &&
            ( 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
457
458
                layout->addWidget( box, i_line, 0, 1, 2 );
                i_line++;
zorglub's avatar
zorglub committed
459
            }
460
            box = new QGroupBox( qfu(p_item->psz_text) );
zorglub's avatar
zorglub committed
461
462
463
464
465
466
467
468
469
470
471
472
            boxlayout = new QGridLayout();
        }
        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
473
474
475
476
477
        }
        if( !control )
        {
            continue;
        }
zorglub's avatar
zorglub committed
478
479
        if( box ) i_boxline++;
        else i_line++;
zorglub's avatar
zorglub committed
480
481
482
483
484
485
486
487
488
489
490
        controls.append( control );
    }
    while( !(p_item->i_type == CONFIG_HINT_END ||
           ( ( data->i_type == TYPE_SUBCATEGORY ||
               data->i_type == TYPE_CATSUBCAT ) &&
             ( p_item->i_type == CONFIG_CATEGORY ||
               p_item->i_type == CONFIG_SUBCATEGORY ) ) ) && p_item++ );

    if( box )
    {
        box->setLayout( boxlayout );
zorglub's avatar
zorglub committed
491
        layout->addWidget( box, i_line, 0, 1, 2 );
zorglub's avatar
zorglub committed
492
493
    }

494
495
    vlc_object_release( p_module );

zorglub's avatar
zorglub committed
496
497
498
499
500
    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
501
502
    setLayout( global_layout );
#if 0
zorglub's avatar
zorglub committed
503
    some_hidden_text = new QLabel( qfu( I_HIDDEN_ADV ) );
zorglub's avatar
zorglub committed
504
    some_hidden_text->setWordWrap( true );
505
    setAdvanced( currently_advanced, true );
zorglub's avatar
zorglub committed
506
#endif
zorglub's avatar
zorglub committed
507
508
}

zorglub's avatar
zorglub committed
509
void PrefsPanel::apply()
zorglub's avatar
zorglub committed
510
511
512
513
514
{
    /* todo */
    QList<ConfigControl *>::Iterator i;
    for( i = controls.begin() ; i != controls.end() ; i++ )
    {
zorglub's avatar
zorglub committed
515
516
517
        ConfigControl *c = qobject_cast<ConfigControl *>(*i);
        fprintf( stderr, "Get a control %s\n", c->getName() );
        switch( c->getType() )
zorglub's avatar
zorglub committed
518
        {
zorglub's avatar
zorglub committed
519
520
521
522
523
524
525
526
527
        case 1:
            {
            VIntConfigControl *vicc = qobject_cast<VIntConfigControl *>(*i);
                fprintf( stderr, "Put %s = %i\n",  vicc->getName(),vicc->getValue() );
            config_PutInt( p_intf, vicc->getName(), vicc->getValue() );
            break;
            }
        case 2:
            {
zorglub's avatar
zorglub committed
528
            VFloatConfigControl *vfcc = qobject_cast<VFloatConfigControl *>(*i);
zorglub's avatar
zorglub committed
529
530
531
532
533
                fprintf( stderr, "Put %s = %f\n",  vfcc->getName(),vfcc->getValue() );
            config_PutFloat( p_intf, vfcc->getName(), vfcc->getValue() );
            break;
            }
        case 3:
zorglub's avatar
zorglub committed
534
            {
zorglub's avatar
zorglub committed
535
536
537
538
            VStringConfigControl *vscc =
                            qobject_cast<VStringConfigControl *>(*i);
                fprintf( stderr, "Put %s = %s\n",  vscc->getName(),vscc->getValue().toAscii().data() );
            config_PutPsz( p_intf, vscc->getName(),
zorglub's avatar
zorglub committed
539
540
541
542
543
544
                                       vscc->getValue().toAscii().data() );
            }
        }
    }
}

zorglub's avatar
zorglub committed
545
void PrefsPanel::clean()
zorglub's avatar
zorglub committed
546
{}
zorglub's avatar
zorglub committed
547
#if 0
548
void PrefsPanel::setAdvanced( bool adv, bool force )
zorglub's avatar
zorglub committed
549
550
{
    bool some_hidden = false;
551
    if( !force && adv == advanced ) return;
zorglub's avatar
zorglub committed
552
553
554
555
556
557
558

    advanced = adv;
    QList<ConfigControl *>::Iterator i;
    for( i = controls.begin() ; i != controls.end() ; i++ )
    {
        if( (*i)->isAdvanced() )
        {
zorglub's avatar
zorglub committed
559
560
561
562
563
564
565
            if( !advanced )
            {
                some_hidden = true;
                (*i)->hide();
            }
            else
                (*i)->show();
zorglub's avatar
zorglub committed
566
567
568
569
570
571
572
573
574
575
576
577
578
        }
    }
    if( some_hidden_text )
    {
        global_layout->removeWidget( some_hidden_text );
        some_hidden_text->hide();
    }
    if( some_hidden )
    {
        global_layout->addWidget( some_hidden_text );
        some_hidden_text->show();
    }
}
zorglub's avatar
zorglub committed
579
#endif