]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/simple_preferences.cpp
Add .mtv extension
[vlc] / modules / gui / qt4 / components / simple_preferences.cpp
1 /*****************************************************************************
2  * simple_preferences.cpp : "Simple preferences"
3  ****************************************************************************
4  * Copyright (C) 2006-2010 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *          Antoine Cellerier <dionoea@videolan.org>
9  *          Jean-Baptiste Kempf <jb@videolan.org>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24  *****************************************************************************/
25
26 #ifdef HAVE_CONFIG_H
27 # include "config.h"
28 #endif
29
30 #include "components/simple_preferences.hpp"
31 #include "components/preferences_widgets.hpp"
32 #include "dialogs/ml_configuration.hpp"
33
34 #include <vlc_config_cat.h>
35 #include <vlc_configuration.h>
36
37 #include <QString>
38 #include <QFont>
39 #include <QToolButton>
40 #include <QButtonGroup>
41 #include <QVBoxLayout>
42 #include <QScrollArea>
43
44 #include <QStyleFactory>
45 #include <QSettings>
46 #include <QtAlgorithms>
47 #include <QDir>
48
49 #define ICON_HEIGHT 64
50
51 #ifdef WIN32
52 # include <vlc_windows_interfaces.h>
53 #endif
54 #include <vlc_modules.h>
55
56 /*********************************************************************
57  * The List of categories
58  *********************************************************************/
59 SPrefsCatList::SPrefsCatList( intf_thread_t *_p_intf, QWidget *_parent, bool small ) :
60                                   QWidget( _parent ), p_intf( _p_intf )
61 {
62     QVBoxLayout *layout = new QVBoxLayout();
63
64     QButtonGroup *buttonGroup = new QButtonGroup( this );
65     buttonGroup->setExclusive ( true );
66     CONNECT( buttonGroup, buttonClicked ( int ),
67             this, switchPanel( int ) );
68
69     short icon_height = small ? ICON_HEIGHT /2 : ICON_HEIGHT;
70
71 #define ADD_CATEGORY( button, label, icon, numb )                           \
72     QToolButton * button = new QToolButton( this );                         \
73     button->setIcon( QIcon( ":/prefsmenu/" #icon ) );                       \
74     button->setText( label );                                               \
75     button->setToolTip( label + qtr("Preferences") );                       \
76     button->setToolButtonStyle( Qt::ToolButtonTextUnderIcon );              \
77     button->setIconSize( QSize( icon_height, icon_height ) );               \
78     button->resize( icon_height + 6 , icon_height + 6 );                    \
79     button->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding) ;  \
80     button->setAutoRaise( true );                                           \
81     button->setCheckable( true );                                           \
82     buttonGroup->addButton( button, numb );                                 \
83     layout->addWidget( button );
84
85     ADD_CATEGORY( SPrefsInterface, qtr("Interface"),
86                   cone_interface_64, 0 );
87     ADD_CATEGORY( SPrefsAudio, qtr("Audio"),
88                   cone_audio_64, 1 );
89     ADD_CATEGORY( SPrefsVideo, qtr("Video"),
90                   cone_video_64, 2 );
91     ADD_CATEGORY( SPrefsSubtitles, qtr("Subtitles && OSD"),
92                   cone_subtitles_64, 3 );
93     ADD_CATEGORY( SPrefsInputAndCodecs, qtr("Input && Codecs"),
94                   cone_input_64, 4 );
95     ADD_CATEGORY( SPrefsHotkeys, qtr("Hotkeys"),
96                   cone_hotkeys_64, 5 );
97
98 #undef ADD_CATEGORY
99
100     SPrefsInterface->setChecked( true );
101     layout->setMargin( 0 );
102     layout->setSpacing( 1 );
103
104     setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
105     setLayout( layout );
106
107 }
108
109 void SPrefsCatList::switchPanel( int i )
110 {
111     emit currentItemChanged( i );
112 }
113
114 /*********************************************************************
115  * The Panels
116  *********************************************************************/
117 SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
118                           int _number, bool small ) : QWidget( _parent ), p_intf( _p_intf )
119 {
120     module_config_t *p_config;
121     ConfigControl *control;
122     number = _number;
123
124 #define CONFIG_GENERIC( option, type, label, qcontrol )                   \
125             p_config =  config_FindConfig( VLC_OBJECT(p_intf), option );  \
126             if( p_config )                                                \
127             {                                                             \
128                 control =  new type ## ConfigControl( VLC_OBJECT(p_intf), \
129                            p_config, label, ui.qcontrol, false );         \
130                 controls.append( control );                               \
131             }                                                             \
132             else {                                                        \
133                 ui.qcontrol->setEnabled( false );                         \
134                 if( label ) label->setEnabled( false );                   \
135             }
136
137 #define CONFIG_BOOL( option, qcontrol )                           \
138             p_config =  config_FindConfig( VLC_OBJECT(p_intf), option );  \
139             if( p_config )                                                \
140             {                                                             \
141                 control =  new BoolConfigControl( VLC_OBJECT(p_intf),     \
142                            p_config, NULL, ui.qcontrol );          \
143                 controls.append( control );                               \
144             }                                                             \
145             else { ui.qcontrol->setEnabled( false ); }
146
147
148 #define CONFIG_GENERIC_NO_UI( option, type, label, qcontrol )             \
149             p_config =  config_FindConfig( VLC_OBJECT(p_intf), option );  \
150             if( p_config )                                                \
151             {                                                             \
152                 control =  new type ## ConfigControl( VLC_OBJECT(p_intf), \
153                            p_config, label, qcontrol, false );            \
154                 controls.append( control );                               \
155             }                                                             \
156             else {                                                        \
157                 QWidget *widget = label;                                  \
158                 qcontrol->setVisible( false );                            \
159                 if( widget ) widget->setEnabled( false );                 \
160             }
161
162
163 #define CONFIG_GENERIC_NO_BOOL( option, type, label, qcontrol )           \
164             p_config =  config_FindConfig( VLC_OBJECT(p_intf), option );  \
165             if( p_config )                                                \
166             {                                                             \
167                 control =  new type ## ConfigControl( VLC_OBJECT(p_intf), \
168                            p_config, label, ui.qcontrol );                \
169                 controls.append( control );                               \
170             }
171
172 #define CONFIG_GENERIC_FILE( option, type, label, qcontrol, qbutton )     \
173             p_config =  config_FindConfig( VLC_OBJECT(p_intf), option );  \
174             if( p_config )                                                \
175             {                                                             \
176                 control =  new type ## ConfigControl( VLC_OBJECT(p_intf), \
177                            p_config, label, qcontrol, qbutton );          \
178                 controls.append( control );                               \
179             }
180
181 #define START_SPREFS_CAT( name , label )    \
182         case SPrefs ## name:                \
183         {                                   \
184             Ui::SPrefs ## name ui;      \
185             ui.setupUi( panel );            \
186             panel_label->setText( label );
187
188 #define END_SPREFS_CAT      \
189             break;          \
190         }
191
192     QVBoxLayout *panel_layout = new QVBoxLayout();
193     QWidget *panel = new QWidget();
194     panel_layout->setMargin( 3 );
195
196     // Title Label
197     QLabel *panel_label = new QLabel;
198     QFont labelFont = QApplication::font();
199     labelFont.setPointSize( labelFont.pointSize() + 6 );
200     panel_label->setFont( labelFont );
201
202     // Title <hr>
203     QFrame *title_line = new QFrame;
204     title_line->setFrameShape(QFrame::HLine);
205     title_line->setFrameShadow(QFrame::Sunken);
206
207     QFont italicFont = QApplication::font();
208     italicFont.setItalic( true );
209
210     switch( number )
211     {
212         /******************************
213          * VIDEO Panel Implementation *
214          ******************************/
215         START_SPREFS_CAT( Video , qtr("Video Settings") );
216             CONFIG_BOOL( "video", enableVideo );
217
218             CONFIG_BOOL( "fullscreen", fullscreen );
219             CONFIG_BOOL( "overlay", overlay );
220             CONFIG_BOOL( "video-on-top", alwaysOnTop );
221             CONFIG_BOOL( "video-deco", windowDecorations );
222             CONFIG_GENERIC( "vout", Module, ui.voutLabel, outputModule );
223
224             CONFIG_BOOL( "video-wallpaper", wallpaperMode );
225 #ifdef WIN32
226             CONFIG_GENERIC( "directx-device", StringList, ui.dxDeviceLabel,
227                             dXdisplayDevice );
228             CONFIG_BOOL( "directx-hw-yuv", hwYUVBox );
229 #else
230             ui.directXBox->setVisible( false );
231             ui.hwYUVBox->setVisible( false );
232 #endif
233
234             CONFIG_GENERIC( "deinterlace", IntegerList, ui.deinterLabel, deinterlaceBox );
235             CONFIG_GENERIC( "deinterlace-mode", StringList, ui.deinterModeLabel, deinterlaceModeBox );
236             CONFIG_GENERIC( "aspect-ratio", String, ui.arLabel, arLine );
237
238             CONFIG_GENERIC_FILE( "snapshot-path", Directory, ui.dirLabel,
239                                  ui.snapshotsDirectory, ui.snapshotsDirectoryBrowse );
240             CONFIG_GENERIC( "snapshot-prefix", String, ui.prefixLabel, snapshotsPrefix );
241             CONFIG_BOOL( "snapshot-sequential",
242                             snapshotsSequentialNumbering );
243             CONFIG_GENERIC( "snapshot-format", StringList, ui.arLabel,
244                             snapshotsFormat );
245          END_SPREFS_CAT;
246
247         /******************************
248          * AUDIO Panel Implementation *
249          ******************************/
250         START_SPREFS_CAT( Audio, qtr("Audio Settings") );
251
252             CONFIG_BOOL( "audio", enableAudio );
253             ui.SPrefsAudio_zone->setEnabled( ui.enableAudio->isChecked() );
254             CONNECT( ui.enableAudio, toggled( bool ),
255                      ui.SPrefsAudio_zone, setEnabled( bool ) );
256
257 #define audioCommon( name ) \
258             QWidget * name ## Control = new QWidget( ui.outputAudioBox ); \
259             QHBoxLayout * name ## Layout = new QHBoxLayout( name ## Control); \
260             name ## Layout->setMargin( 0 ); \
261             name ## Layout->setSpacing( 0 ); \
262             QLabel * name ## Label = new QLabel( qtr( "Device:" ), name ## Control ); \
263             name ## Label->setMinimumSize(QSize(250, 0)); \
264             name ## Layout->addWidget( name ## Label ); \
265
266 #define audioControl( name) \
267             audioCommon( name ) \
268             QComboBox * name ## Device = new QComboBox( name ## Control ); \
269             name ## Layout->addWidget( name ## Device ); \
270             name ## Label->setBuddy( name ## Device ); \
271             name ## Device->setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Preferred  );\
272             outputAudioLayout->addWidget( name ## Control, outputAudioLayout->rowCount(), 0, 1, -1 );
273
274 #define audioControl2( name) \
275             audioCommon( name ) \
276             QLineEdit * name ## Device = new QLineEdit( name ## Control ); \
277             name ## Layout->addWidget( name ## Device ); \
278             name ## Label->setBuddy( name ## Device ); \
279             QPushButton * name ## Browse = new QPushButton( qtr( "Browse..." ), name ## Control); \
280             name ## Layout->addWidget( name ## Browse ); \
281             outputAudioLayout->addWidget( name ## Control, outputAudioLayout->rowCount(), 0, 1, -1 );
282
283             /* Build if necessary */
284             QGridLayout * outputAudioLayout = qobject_cast<QGridLayout *>(ui.outputAudioBox->layout());
285 #ifdef WIN32
286             audioControl( DirectX );
287             optionWidgets.append( DirectXControl );
288             CONFIG_GENERIC_NO_UI( "directx-audio-device-name", StringList,
289                     DirectXLabel, DirectXDevice );
290 #else
291             if( module_exists( "alsa" ) )
292             {
293                 audioControl( alsa );
294                 optionWidgets.append( alsaControl );
295                 CONFIG_GENERIC_NO_UI( "alsa-audio-device" , StringList, alsaLabel,
296                                 alsaDevice );
297             }
298             else
299                 optionWidgets.append( NULL );
300             if( module_exists( "oss" ) )
301             {
302                 audioControl2( OSS );
303                 optionWidgets.append( OSSControl );
304                 CONFIG_GENERIC_FILE( "oss-audio-device" , File, NULL, OSSDevice,
305                                  OSSBrowse );
306             }
307             else
308                 optionWidgets.append( NULL );
309 #endif
310
311 #undef audioControl2
312 #undef audioControl
313 #undef audioCommon
314
315             /* Audio Options */
316             ui.volumeValue->setMaximum( QT_VOLUME_MAX / QT_VOLUME_DEFAULT * 100 );
317             CONFIG_GENERIC_NO_BOOL( "qt-startvolume" , IntegerRangeSlider, NULL,
318                                      defaultVolume );
319             CONNECT( ui.defaultVolume, valueChanged( int ),
320                      this, updateAudioVolume( int ) );
321
322             CONFIG_BOOL( "qt-autosave-volume", keepVolumeRadio );
323             ui.defaultVolume_zone->setEnabled( ui.resetVolumeRadio->isChecked() );
324             CONNECT( ui.resetVolumeRadio, toggled( bool ),
325                      ui.defaultVolume_zone, setEnabled( bool ) );
326
327             CONFIG_GENERIC( "audio-language" , String , ui.langLabel,
328                             preferredAudioLanguage );
329
330             CONFIG_BOOL( "spdif", spdifBox );
331             CONFIG_GENERIC( "force-dolby-surround", IntegerList, ui.dolbyLabel,
332                             detectionDolby );
333
334             CONFIG_GENERIC_NO_BOOL( "norm-max-level" , Float, NULL,
335                                     volNormSpin );
336             CONFIG_GENERIC( "audio-replay-gain-mode", StringList, ui.replayLabel,
337                             replayCombo );
338             CONFIG_GENERIC( "audio-visual" , Module , ui.visuLabel,
339                             visualisation);
340             CONFIG_BOOL( "audio-time-stretch", autoscaleBox );
341
342             /* Audio Output Specifics */
343             CONFIG_GENERIC( "aout", Module, ui.outputLabel, outputModule );
344
345             CONNECT( ui.outputModule, currentIndexChanged( int ),
346                      this, updateAudioOptions( int ) );
347
348             /* File output exists on all platforms */
349             CONFIG_GENERIC_FILE( "audiofile-file", File, ui.fileLabel,
350                                  ui.fileName, ui.fileBrowseButton );
351
352             optionWidgets.append( ui.fileControl );
353             optionWidgets.append( ui.outputModule );
354             optionWidgets.append( ui.volNormBox );
355             /*Little mofification of ui.volumeValue to compile with Qt < 4.3 */
356             ui.volumeValue->setButtonSymbols(QAbstractSpinBox::NoButtons);
357             optionWidgets.append( ui.volumeValue );
358             optionWidgets.append( ui.headphoneEffect );
359             optionWidgets.append( ui.spdifBox );
360             updateAudioOptions( ui.outputModule->currentIndex() );
361
362             /* LastFM */
363             if( module_exists( "audioscrobbler" ) )
364             {
365                 CONFIG_GENERIC( "lastfm-username", String, ui.lastfm_user_label,
366                         lastfm_user_edit );
367                 CONFIG_GENERIC( "lastfm-password", String, ui.lastfm_pass_label,
368                         lastfm_pass_edit );
369
370                 if( config_ExistIntf( VLC_OBJECT( p_intf ), "audioscrobbler" ) )
371                     ui.lastfm->setChecked( true );
372                 else
373                     ui.lastfm->setChecked( false );
374
375                 ui.lastfm_zone->setVisible( ui.lastfm->isChecked() );
376
377                 CONNECT( ui.lastfm, toggled( bool ),
378                          ui.lastfm_zone, setVisible( bool ) );
379                 CONNECT( ui.lastfm, stateChanged( int ),
380                          this, lastfm_Changed( int ) );
381             }
382             else
383             {
384                 ui.lastfm->hide();
385                 ui.lastfm_zone->hide();
386             }
387
388             /* Normalizer */
389             CONNECT( ui.volNormBox, toggled( bool ), ui.volNormSpin,
390                      setEnabled( bool ) );
391
392             char* psz = config_GetPsz( p_intf, "audio-filter" );
393             qs_filter = qfu( psz ).split( ':', QString::SkipEmptyParts );
394             free( psz );
395
396             bool b_enabled = ( qs_filter.contains( "volnorm" ) );
397             ui.volNormBox->setChecked( b_enabled );
398             ui.volNormSpin->setEnabled( b_enabled );
399
400             b_enabled = ( qs_filter.contains( "headphone" ) );
401             ui.headphoneEffect->setChecked( b_enabled );
402
403             /* Volume Label */
404             updateAudioVolume( ui.defaultVolume->value() ); // First time init
405
406         END_SPREFS_CAT;
407
408         /* Input and Codecs Panel Implementation */
409         START_SPREFS_CAT( InputAndCodecs, qtr("Input & Codecs Settings") );
410
411             /* Disk Devices */
412             {
413                 ui.DVDDeviceComboBox->setToolTip(
414                     qtr( "If this property is blank, different values\n"
415                          "for DVD, VCD, and CDDA are set.\n"
416                          "You can define a unique one or configure them \n"
417                          "individually in the advanced preferences." ) );
418                 char *psz_dvddiscpath = config_GetPsz( p_intf, "dvd" );
419                 char *psz_vcddiscpath = config_GetPsz( p_intf, "vcd" );
420                 char *psz_cddadiscpath = config_GetPsz( p_intf, "cd-audio" );
421                 if( psz_dvddiscpath && psz_vcddiscpath && psz_cddadiscpath )
422                 if( !strcmp( psz_cddadiscpath, psz_dvddiscpath ) &&
423                     !strcmp( psz_dvddiscpath, psz_vcddiscpath ) )
424                 {
425                     ui.DVDDeviceComboBox->setEditText( qfu( psz_dvddiscpath ) );
426                 }
427                 free( psz_cddadiscpath );
428                 free( psz_dvddiscpath );
429                 free( psz_vcddiscpath );
430             }
431 #ifndef WIN32
432             QStringList DVDDeviceComboBoxStringList = QStringList();
433             DVDDeviceComboBoxStringList
434                     << "dvd*" << "scd*" << "sr*" << "sg*" << "cd*";
435             ui.DVDDeviceComboBox->addItems( QDir( "/dev/" )
436                     .entryList( DVDDeviceComboBoxStringList, QDir::System )
437                     .replaceInStrings( QRegExp("^"), "/dev/" )
438             );
439 #endif
440             CONFIG_GENERIC( "dvd", String, ui.DVDLabel,
441                             DVDDeviceComboBox->lineEdit() );
442             CONFIG_GENERIC_FILE( "input-record-path", Directory, ui.recordLabel,
443                                  ui.recordPath, ui.recordBrowse );
444
445             CONFIG_GENERIC( "http-proxy", String , ui.httpProxyLabel, proxy );
446             CONFIG_GENERIC_NO_BOOL( "postproc-q", Integer, ui.ppLabel,
447                                     PostProcLevel );
448             CONFIG_GENERIC( "avi-index", IntegerList, ui.aviLabel, AviRepair );
449
450             /* live555 module prefs */
451             CONFIG_BOOL( "rtsp-tcp",
452                                 live555TransportRTSP_TCPRadio );
453             if ( !module_exists( "live555" ) )
454             {
455                 ui.live555TransportRTSP_TCPRadio->hide();
456                 ui.live555TransportHTTPRadio->hide();
457                 ui.live555TransportLabel->hide();
458             }
459             CONFIG_BOOL( "ffmpeg-hw", hwAccelBox );
460 #ifdef WIN32
461             CONFIG_BOOL( "prefer-system-codecs", systemCodecBox );
462             HINSTANCE hdxva2_dll = LoadLibrary(TEXT("DXVA2.DLL") );
463             if( !hdxva2_dll )
464                 ui.hwAccelBox->setEnabled( false );
465             else
466                 FreeLibrary( hdxva2_dll );
467 #else
468             ui.systemCodecBox->hide();
469 #endif
470             optionWidgets.append( ui.DVDDeviceComboBox );
471             optionWidgets.append( ui.cachingCombo );
472             CONFIG_GENERIC( "ffmpeg-skiploopfilter", IntegerList, ui.filterLabel, loopFilterBox );
473             CONFIG_GENERIC( "sout-x264-tune", StringList, ui.x264Label, tuneBox );
474             CONFIG_GENERIC( "sout-x264-preset", StringList, ui.x264Label, presetBox );
475             CONFIG_GENERIC( "sout-x264-profile", StringList, ui.x264profileLabel, profileBox );
476             CONFIG_GENERIC( "sout-x264-level", String, ui.x264profileLabel, levelBox );
477
478             /* Caching */
479             /* Add the things to the ComboBox */
480             #define addToCachingBox( str, cachingNumber ) \
481                 ui.cachingCombo->addItem( qtr(str), QVariant( cachingNumber ) );
482             addToCachingBox( N_("Custom"), CachingCustom );
483             addToCachingBox( N_("Lowest latency"), CachingLowest );
484             addToCachingBox( N_("Low latency"), CachingLow );
485             addToCachingBox( N_("Normal"), CachingNormal );
486             addToCachingBox( N_("High latency"), CachingHigh );
487             addToCachingBox( N_("Higher latency"), CachingHigher );
488             #undef addToCachingBox
489
490 #define TestCaC( name ) \
491     b_cache_equal =  b_cache_equal && \
492      ( i_cache == config_GetInt( p_intf, name ) )
493
494 #define TestCaCi( name, int ) \
495     b_cache_equal = b_cache_equal &&  \
496     ( ( i_cache * int ) == config_GetInt( p_intf, name ) )
497             /* Select the accurate value of the ComboBox */
498             bool b_cache_equal = true;
499             int i_cache = config_GetInt( p_intf, "file-caching");
500
501             TestCaC( "udp-caching" );
502             if (module_exists ("dvdread"))
503                 TestCaC( "dvdread-caching" );
504             if (module_exists ("dvdnav"))
505                 TestCaC( "dvdnav-caching" );
506             TestCaC( "tcp-caching" );
507             TestCaC( "cdda-caching" );
508             TestCaC( "screen-caching" ); TestCaC( "vcd-caching" );
509             #ifdef WIN32
510             TestCaC( "dshow-caching" );
511             #else
512             if (module_exists ("access_jack"))
513                 TestCaC( "jack-input-caching" );
514             if (module_exists ("v4l2"))
515                 TestCaC( "v4l2-caching" );
516             if (module_exists ("pvr"))
517                 TestCaC( "pvr-caching" );
518             #endif
519             if (module_exists ("livedotcom"))
520                 TestCaCi( "rtsp-caching", 4 );
521             TestCaCi( "ftp-caching", 2 );
522             TestCaCi( "http-caching", 2 );
523             if (module_exists ("access_realrtsp"))
524                 TestCaCi( "realrtsp-caching", 10 );
525             TestCaCi( "mms-caching", 10 );
526             if( b_cache_equal == 1 )
527                 ui.cachingCombo->setCurrentIndex(
528                 ui.cachingCombo->findData( QVariant( i_cache ) ) );
529 #undef TestCaCi
530 #undef TestCaC
531
532         END_SPREFS_CAT;
533         /*******************
534          * Interface Panel *
535          *******************/
536         START_SPREFS_CAT( Interface, qtr("Interface Settings") );
537 //            ui.defaultLabel->setFont( italicFont );
538             ui.skinsLabel->setText(
539                     qtr( "This is VLC's skinnable interface. You can download other skins at" )
540                     + QString( " <a href=\"http://www.videolan.org/vlc/skins.php\">" )
541                     + qtr( "VLC skins website" )+ QString( "</a>." ) );
542             ui.skinsLabel->setFont( italicFont );
543
544 #if defined( WIN32 )
545             CONFIG_GENERIC( "language", StringList, ui.languageLabel, language );
546             BUTTONACT( ui.assoButton, assoDialog() );
547 #else
548             ui.languageBox->hide();
549             ui.assoButton->hide();
550             ui.assocLabel->hide();
551 #endif
552 #ifdef MEDIA_LIBRARY
553             BUTTONACT( ui.sqlMLbtn, configML() );
554 #endif
555
556             /* interface */
557             char *psz_intf = config_GetPsz( p_intf, "intf" );
558             if( psz_intf )
559             {
560                 if( strstr( psz_intf, "skin" ) )
561                     ui.skins->setChecked( true );
562             } else {
563                 /* defaults to qt */
564                 ui.qt4->setChecked( true );
565             }
566             free( psz_intf );
567
568             optionWidgets.append( ui.skins );
569             optionWidgets.append( ui.qt4 );
570 #if !defined(NDEBUG) || !defined( WIN32)
571             ui.stylesCombo->addItem( qtr("System's default") );
572             ui.stylesCombo->addItems( QStyleFactory::keys() );
573             ui.stylesCombo->setCurrentIndex( ui.stylesCombo->findText(
574                         getSettings()->value( "MainWindow/QtStyle", "" ).toString() ) );
575             ui.stylesCombo->insertSeparator( 1 );
576
577             CONNECT( ui.stylesCombo, currentIndexChanged( QString ), this, changeStyle( QString ) );
578             optionWidgets.append( ui.stylesCombo );
579 #else
580             ui.stylesCombo->hide();
581             optionWidgets.append( NULL );
582 #endif
583             radioGroup = new QButtonGroup(this);
584             radioGroup->addButton( ui.qt4, 0 );
585             radioGroup->addButton( ui.skins, 1 );
586             CONNECT( radioGroup, buttonClicked( int ),
587                      ui.styleStackedWidget, setCurrentIndex( int ) );
588             ui.styleStackedWidget->setCurrentIndex( radioGroup->checkedId() );
589
590             CONNECT( ui.minimalviewBox, toggled( bool ),
591                      ui.mainPreview, setNormalPreview( bool ) );
592             CONFIG_BOOL( "qt-minimal-view", minimalviewBox );
593             ui.mainPreview->setNormalPreview( ui.minimalviewBox->isChecked() );
594             ui.skinsPreview->setPreview( InterfacePreviewWidget::SKINS );
595
596             CONFIG_BOOL( "embedded-video", embedVideo );
597             CONFIG_BOOL( "qt-video-autoresize", resizingBox );
598             CONNECT( ui.embedVideo, toggled( bool ), ui.resizingBox, setEnabled( bool ) );
599             ui.resizingBox->setEnabled( ui.embedVideo->isChecked() );
600
601             CONFIG_BOOL( "qt-fs-controller", fsController );
602             CONFIG_BOOL( "qt-system-tray", systrayBox );
603             CONFIG_BOOL( "qt-notification", sysPop );
604             CONNECT( ui.systrayBox, toggled( bool ), ui.sysPop, setEnabled( bool ) );
605             ui.sysPop->setEnabled( ui.systrayBox->isChecked() );
606
607             CONFIG_BOOL( "qt-pause-minimized", pauseMinimizedBox );
608             CONFIG_BOOL( "playlist-tree", treePlaylist );
609             CONFIG_BOOL( "play-and-pause", playPauseBox );
610             CONFIG_GENERIC_FILE( "skins2-last", File, ui.skinFileLabel,
611                                  ui.fileSkin, ui.skinBrowse );
612
613             CONFIG_GENERIC( "album-art", IntegerList, ui.artFetchLabel,
614                                                       artFetcher );
615
616             /* UPDATE options */
617 #ifdef UPDATE_CHECK
618             CONFIG_BOOL( "qt-updates-notif", updatesBox );
619             CONFIG_GENERIC_NO_BOOL( "qt-updates-days", Integer, NULL,
620                     updatesDays );
621             ui.updatesDays->setEnabled( ui.updatesBox->isChecked() );
622             CONNECT( ui.updatesBox, toggled( bool ),
623                      ui.updatesDays, setEnabled( bool ) );
624 #else
625             ui.updateNotifierZone->hide();
626 #endif
627             /* ONE INSTANCE options */
628 #if defined( WIN32 ) || defined( HAVE_DBUS ) || defined(__APPLE__)
629             CONFIG_BOOL( "one-instance", OneInterfaceMode );
630             CONFIG_BOOL( "playlist-enqueue",
631                     EnqueueOneInterfaceMode );
632             ui.EnqueueOneInterfaceMode->setEnabled( ui.OneInterfaceMode->isChecked() );
633             CONNECT( ui.OneInterfaceMode, toggled( bool ),
634                      ui.EnqueueOneInterfaceMode, setEnabled( bool ) );
635 #else
636             ui.OneInterfaceBox->hide();
637 #endif
638             /* RECENTLY PLAYED options */
639             CONNECT( ui.saveRecentlyPlayed, toggled( bool ),
640                      ui.recentlyPlayedFilters, setEnabled( bool ) );
641             ui.recentlyPlayedFilters->setEnabled( false );
642             CONFIG_BOOL( "qt-recentplay", saveRecentlyPlayed );
643             CONFIG_GENERIC( "qt-recentplay-filter", String, ui.filterLabel,
644                     recentlyPlayedFilters );
645
646         END_SPREFS_CAT;
647
648         START_SPREFS_CAT( Subtitles,
649                             qtr("Subtitles & On Screen Display Settings") );
650             CONFIG_BOOL( "osd", OSDBox);
651             CONFIG_BOOL( "video-title-show", OSDTitleBox);
652             CONFIG_GENERIC( "video-title-position", IntegerList,
653                             ui.OSDTitlePosLabel, OSDTitlePos );
654
655             CONFIG_GENERIC( "subsdec-encoding", StringList, ui.encodLabel,
656                             encoding );
657             CONFIG_GENERIC( "sub-language", String, ui.subLangLabel,
658                             preferredLanguage );
659             CONFIG_GENERIC_NO_BOOL( "freetype-font", Font, ui.fontLabel, font );
660             CONFIG_GENERIC( "freetype-color", IntegerList, ui.fontColorLabel,
661                             fontColor );
662             CONFIG_GENERIC( "freetype-rel-fontsize", IntegerList,
663                             ui.fontSizeLabel, fontSize );
664             CONFIG_GENERIC( "freetype-effect", IntegerList, ui.fontEffectLabel,
665                             effect );
666             CONFIG_GENERIC_NO_BOOL( "sub-margin", Integer, ui.subsPosLabel, subsPosition );
667
668         END_SPREFS_CAT;
669
670         case SPrefsHotkeys:
671         {
672             p_config = config_FindConfig( VLC_OBJECT(p_intf), "key-play" );
673
674             QGridLayout *gLayout = new QGridLayout;
675             panel->setLayout( gLayout );
676             int line = 0;
677
678             panel_label->setText( qtr( "Configure Hotkeys" ) );
679             control = new KeySelectorControl( VLC_OBJECT(p_intf), p_config ,
680                                                 this, gLayout, line );
681             controls.append( control );
682
683             line++;
684
685             QFrame *sepline = new QFrame;
686             sepline->setFrameStyle(QFrame::HLine | QFrame::Sunken);
687             gLayout->addWidget( sepline, line, 0, 1, -1 );
688
689             line++;
690
691             p_config = config_FindConfig( VLC_OBJECT(p_intf), "hotkeys-mousewheel-mode" );
692             control = new IntegerListConfigControl( VLC_OBJECT(p_intf),
693                     p_config, this, false, gLayout, line );
694             controls.append( control );
695
696 #ifdef WIN32
697             line++;
698
699             p_config = config_FindConfig( VLC_OBJECT(p_intf), "qt-disable-volume-keys" );
700             control = new BoolConfigControl( VLC_OBJECT(p_intf), p_config, this, gLayout, line );
701             controls.append( control );
702 #endif
703
704             break;
705         }
706     }
707
708     panel_layout->addWidget( panel_label );
709     panel_layout->addWidget( title_line );
710
711     if( small )
712     {
713         QScrollArea *scroller= new QScrollArea;
714         scroller->setWidget( panel );
715         scroller->setWidgetResizable( true );
716         scroller->setFrameStyle( QFrame::NoFrame );
717         panel_layout->addWidget( scroller );
718     }
719     else
720     {
721         panel_layout->addWidget( panel );
722         if( number != SPrefsHotkeys ) panel_layout->addStretch( 2 );
723     }
724
725     setLayout( panel_layout );
726
727 #undef END_SPREFS_CAT
728 #undef START_SPREFS_CAT
729 #undef CONFIG_GENERIC_FILE
730 #undef CONFIG_GENERIC_NO_BOOL
731 #undef CONFIG_GENERIC_NO_UI
732 #undef CONFIG_GENERIC
733 #undef CONFIG_BOOL
734 }
735
736
737 void SPrefsPanel::updateAudioOptions( int number)
738 {
739     QString value = qobject_cast<QComboBox *>(optionWidgets[audioOutCoB])
740                                             ->itemData( number ).toString();
741 #ifdef WIN32
742     optionWidgets[directxW]->setVisible( ( value == "aout_directx" ) );
743 #else
744     /* optionWidgets[ossW] can be NULL */
745     if( optionWidgets[ossW] )
746         optionWidgets[ossW]->setVisible( ( value == "oss" ) );
747     /* optionWidgets[alsaW] can be NULL */
748     if( optionWidgets[alsaW] )
749         optionWidgets[alsaW]->setVisible( ( value == "alsa" ) );
750 #endif
751     optionWidgets[fileW]->setVisible( ( value == "aout_file" ) );
752     optionWidgets[spdifChB]->setVisible( ( value == "alsa" || value == "oss" || value == "auhal" ||
753                                            value == "aout_directx" || value == "waveout" ) );
754 }
755
756
757 SPrefsPanel::~SPrefsPanel()
758 {
759     qDeleteAll( controls ); controls.clear();
760 }
761
762 void SPrefsPanel::updateAudioVolume( int volume )
763 {
764     qobject_cast<QSpinBox *>(optionWidgets[volLW])
765         ->setValue( volume * 100 / QT_VOLUME_DEFAULT );
766 }
767
768
769 /* Function called from the main Preferences dialog on each SPrefs Panel */
770 void SPrefsPanel::apply()
771 {
772     /* Generic save for ever panel */
773     QList<ConfigControl *>::Iterator i;
774     for( i = controls.begin() ; i != controls.end() ; ++i )
775     {
776         ConfigControl *c = qobject_cast<ConfigControl *>(*i);
777         c->doApply();
778     }
779
780     switch( number )
781     {
782     case SPrefsInputAndCodecs:
783     {
784         /* Device default selection */
785         QByteArray devicepath =
786             qobject_cast<QComboBox *>(optionWidgets[inputLE])->currentText().toUtf8();
787         if( devicepath.size() > 0 )
788         {
789             config_PutPsz( p_intf, "dvd", devicepath );
790             config_PutPsz( p_intf, "vcd", devicepath );
791             config_PutPsz( p_intf, "cd-audio", devicepath );
792         }
793
794 #define CaCi( name, int ) config_PutInt( p_intf, name, int * i_comboValue )
795 #define CaC( name ) CaCi( name, 1 )
796         /* Caching */
797         QComboBox *cachingCombo = qobject_cast<QComboBox *>(optionWidgets[cachingCoB]);
798         int i_comboValue = cachingCombo->itemData( cachingCombo->currentIndex() ).toInt();
799         if( i_comboValue )
800         {
801             CaC( "udp-caching" );
802             if (module_exists ("dvdread" ))
803                 CaC( "dvdread-caching" );
804             if (module_exists ("dvdnav" ))
805                 CaC( "dvdnav-caching" );
806             CaC( "tcp-caching" ); CaC( "vcd-caching" );
807             CaC( "cdda-caching" ); CaC( "file-caching" );
808             CaC( "screen-caching" ); CaC( "bd-caching" );
809             CaCi( "rtsp-caching", 2 ); CaCi( "ftp-caching", 2 );
810             CaCi( "http-caching", 2 );
811             if (module_exists ("access_realrtsp" ))
812                 CaCi( "realrtsp-caching", 10 );
813             CaCi( "mms-caching", 10 );
814             #ifdef WIN32
815             CaC( "dshow-caching" );
816             #else
817             if (module_exists ( "access_jack" ))
818             CaC( "jack-input-caching" );
819             if (module_exists ( "v4l2" ))
820                 CaC( "v4l2-caching" );
821             if (module_exists ( "pvr" ))
822                 CaC( "pvr-caching" );
823             #endif
824             //CaCi( "dv-caching" ) too short...
825         }
826         break;
827 #undef CaC
828 #undef CaCi
829     }
830
831     /* Interfaces */
832     case SPrefsInterface:
833     {
834         if( qobject_cast<QRadioButton *>(optionWidgets[skinRB])->isChecked() )
835             config_PutPsz( p_intf, "intf", "skins2,any" );
836         else
837         //if( qobject_cast<QRadioButton *>(optionWidgets[qtRB])->isChecked() )
838             config_PutPsz( p_intf, "intf", "" );
839         if( qobject_cast<QComboBox *>(optionWidgets[styleCB]) )
840             getSettings()->setValue( "MainWindow/QtStyle",
841                 qobject_cast<QComboBox *>(optionWidgets[styleCB])->currentText() );
842
843         break;
844     }
845
846     case SPrefsAudio:
847     {
848         bool b_checked =
849             qobject_cast<QCheckBox *>(optionWidgets[normalizerChB])->isChecked();
850         if( b_checked && !qs_filter.contains( "volnorm" ) )
851             qs_filter.append( "volnorm" );
852         if( !b_checked && qs_filter.contains( "volnorm" ) )
853             qs_filter.removeAll( "volnorm" );
854
855         b_checked =
856             qobject_cast<QCheckBox *>(optionWidgets[headphoneB])->isChecked();
857
858         if( b_checked && !qs_filter.contains( "headphone" ) )
859             qs_filter.append( "headphone" );
860         if( !b_checked && qs_filter.contains( "headphone" ) )
861             qs_filter.removeAll( "headphone" );
862
863         config_PutPsz( p_intf, "audio-filter", qtu( qs_filter.join( ":" ) ) );
864         break;
865     }
866     }
867 }
868
869 void SPrefsPanel::clean()
870 {}
871
872 void SPrefsPanel::lastfm_Changed( int i_state )
873 {
874     if( i_state == Qt::Checked )
875         config_AddIntf( VLC_OBJECT( p_intf ), "audioscrobbler" );
876     else if( i_state == Qt::Unchecked )
877         config_RemoveIntf( VLC_OBJECT( p_intf ), "audioscrobbler" );
878 }
879
880 void SPrefsPanel::changeStyle( QString s_style )
881 {
882     QApplication::setStyle( s_style );
883
884     /* force refresh on all widgets */
885     QWidgetList widgets = QApplication::allWidgets();
886     QWidgetList::iterator it = widgets.begin();
887     while( it != widgets.end() ) {
888         (*it)->update();
889         ++it;
890     };
891 }
892
893 void SPrefsPanel::configML()
894 {
895 #ifdef MEDIA_LIBRARY
896     MLConfDialog *mld = new MLConfDialog( this, p_intf );
897     mld->exec();
898     delete mld;
899 #endif
900 }
901
902 #ifdef WIN32
903 #include <QDialogButtonBox>
904 #include "util/registry.hpp"
905 #include <string>
906
907 bool SPrefsPanel::addType( const char * psz_ext, QTreeWidgetItem* current,
908                            QTreeWidgetItem* parent, QVLCRegistry *qvReg )
909 {
910     bool b_temp;
911     const char* psz_VLC = "VLC";
912     current = new QTreeWidgetItem( parent, QStringList( psz_ext ) );
913
914     if( strstr( qvReg->ReadRegistryString( psz_ext, "", "" ), psz_VLC ) )
915     {
916         current->setCheckState( 0, Qt::Checked );
917         b_temp = false;
918     }
919     else
920     {
921         current->setCheckState( 0, Qt::Unchecked );
922         b_temp = true;
923     }
924     listAsso.append( current );
925     return b_temp;
926 }
927
928 void SPrefsPanel::assoDialog()
929 {
930     LPAPPASSOCREGUI p_appassoc;
931     CoInitialize( 0 );
932
933     if( S_OK == CoCreateInstance( &clsid_IApplication2,
934                 NULL, CLSCTX_INPROC_SERVER,
935                 &IID_IApplicationAssociationRegistrationUI,
936                 (void **)&p_appassoc) )
937     {
938         if(S_OK == p_appassoc->vt->LaunchAdvancedAssociationUI(p_appassoc, L"VLC" ) )
939         {
940             CoUninitialize();
941             return;
942         }
943     }
944
945     CoUninitialize();
946
947     QDialog *d = new QDialog( this );
948     QGridLayout *assoLayout = new QGridLayout( d );
949
950     QTreeWidget *filetypeList = new QTreeWidget;
951     assoLayout->addWidget( filetypeList, 0, 0, 1, 4 );
952     filetypeList->header()->hide();
953
954     QVLCRegistry * qvReg = new QVLCRegistry( HKEY_CLASSES_ROOT );
955
956     QTreeWidgetItem *audioType = new QTreeWidgetItem( QStringList( qtr( "Audio Files" ) ) );
957     QTreeWidgetItem *videoType = new QTreeWidgetItem( QStringList( qtr( "Video Files" ) ) );
958     QTreeWidgetItem *otherType = new QTreeWidgetItem( QStringList( qtr( "Playlist Files" ) ) );
959
960     filetypeList->addTopLevelItem( audioType );
961     filetypeList->addTopLevelItem( videoType );
962     filetypeList->addTopLevelItem( otherType );
963
964     audioType->setExpanded( true ); audioType->setCheckState( 0, Qt::Unchecked );
965     videoType->setExpanded( true ); videoType->setCheckState( 0, Qt::Unchecked );
966     otherType->setExpanded( true ); otherType->setCheckState( 0, Qt::Unchecked );
967
968     QTreeWidgetItem *currentItem = NULL;
969
970     int i_temp = 0;
971 #define aTa( name ) i_temp += addType( name, currentItem, audioType, qvReg )
972 #define aTv( name ) i_temp += addType( name, currentItem, videoType, qvReg )
973 #define aTo( name ) i_temp += addType( name, currentItem, otherType, qvReg )
974
975     aTa( ".a52" ); aTa( ".aac" ); aTa( ".ac3" ); aTa( ".dts" ); aTa( ".flac" );
976     aTa( ".m4a" ); aTa( ".m4p" ); aTa( ".mka" ); aTa( ".mod" ); aTa( ".mp1" );
977     aTa( ".mp2" ); aTa( ".mp3" ); aTa( ".oma" ); aTa( ".oga" ); aTa( ".spx" );
978     aTa( ".tta" ); aTa( ".wav" ); aTa( ".wma" ); aTa( ".xm" );
979     audioType->setCheckState( 0, ( i_temp > 0 ) ?
980                               ( ( i_temp == audioType->childCount() ) ?
981                                Qt::Checked : Qt::PartiallyChecked )
982                             : Qt::Unchecked );
983
984     i_temp = 0;
985     aTv( ".asf" ); aTv( ".avi" ); aTv( ".divx" ); aTv( ".dv" ); aTv( ".flv" );
986     aTv( ".gxf" ); aTv( ".m1v" ); aTv( ".m2v" ); aTv( ".m2ts" ); aTv( ".m4v" );
987     aTv( ".mkv" ); aTv( ".mov" ); aTv( ".mp2" ); aTv( ".mp4" ); aTv( ".mpeg" );
988     aTv( ".mpeg1" ); aTv( ".mpeg2" ); aTv( ".mpeg4" ); aTv( ".mpg" );
989     aTv( ".mts" ); aTv( ".mtv" ); aTv( ".mxf" );
990     aTv( ".ogg" ); aTv( ".ogm" ); aTv( ".ogx" ); aTv( ".ogv" );  aTv( ".ts" );
991     aTv( ".vob" ); aTv( ".vro" ); aTv( ".wmv" );
992     videoType->setCheckState( 0, ( i_temp > 0 ) ?
993                               ( ( i_temp == audioType->childCount() ) ?
994                                Qt::Checked : Qt::PartiallyChecked )
995                             : Qt::Unchecked );
996
997     i_temp = 0;
998     aTo( ".asx" ); aTo( ".b4s" ); aTo( ".ifo" ); aTo( ".m3u" ); aTo( ".pls" );
999     aTo( ".sdp" ); aTo( ".vlc" ); aTo( ".xspf" );
1000     otherType->setCheckState( 0, ( i_temp > 0 ) ?
1001                               ( ( i_temp == audioType->childCount() ) ?
1002                                Qt::Checked : Qt::PartiallyChecked )
1003                             : Qt::Unchecked );
1004
1005 #undef aTo
1006 #undef aTv
1007 #undef aTa
1008
1009     QDialogButtonBox *buttonBox = new QDialogButtonBox( d );
1010     QPushButton *closeButton = new QPushButton( qtr( "&Apply" ) );
1011     QPushButton *clearButton = new QPushButton( qtr( "&Cancel" ) );
1012     buttonBox->addButton( closeButton, QDialogButtonBox::AcceptRole );
1013     buttonBox->addButton( clearButton, QDialogButtonBox::ActionRole );
1014
1015     assoLayout->addWidget( buttonBox, 1, 2, 1, 2 );
1016
1017     CONNECT( closeButton, clicked(), this, saveAsso() );
1018     CONNECT( clearButton, clicked(), d, reject() );
1019     d->resize( 300, 400 );
1020     d->exec();
1021     delete d;
1022     delete qvReg;
1023     listAsso.clear();
1024 }
1025
1026 void addAsso( QVLCRegistry *qvReg, const char *psz_ext )
1027 {
1028     std::string s_path( "VLC" ); s_path += psz_ext;
1029     std::string s_path2 = s_path;
1030
1031     /* Save a backup if already assigned */
1032     char *psz_value = qvReg->ReadRegistryString( psz_ext, "", ""  );
1033
1034     if( !EMPTY_STR(psz_value) )
1035         qvReg->WriteRegistryString( psz_ext, "VLC.backup", psz_value );
1036     delete psz_value;
1037
1038     /* Put a "link" to VLC.EXT as default */
1039     qvReg->WriteRegistryString( psz_ext, "", s_path.c_str() );
1040
1041     /* Create the needed Key if they weren't done in the installer */
1042     if( !qvReg->RegistryKeyExists( s_path.c_str() ) )
1043     {
1044         qvReg->WriteRegistryString( psz_ext, "", s_path.c_str() );
1045         qvReg->WriteRegistryString( s_path.c_str(), "", "Media file" );
1046         qvReg->WriteRegistryString( s_path.append( "\\shell" ).c_str() , "", "Play" );
1047
1048         /* Get the installer path */
1049         QVLCRegistry *qvReg2 = new QVLCRegistry( HKEY_LOCAL_MACHINE );
1050         std::string str_temp; str_temp.assign(
1051             qvReg2->ReadRegistryString( "Software\\VideoLAN\\VLC", "", "" ) );
1052
1053         if( str_temp.size() )
1054         {
1055             qvReg->WriteRegistryString( s_path.append( "\\Play\\command" ).c_str(),
1056                 "", str_temp.append(" --started-from-file \"%1\"" ).c_str() );
1057
1058             qvReg->WriteRegistryString( s_path2.append( "\\DefaultIcon" ).c_str(),
1059                         "", str_temp.append(",0").c_str() );
1060         }
1061         delete qvReg2;
1062     }
1063 }
1064
1065 void delAsso( QVLCRegistry *qvReg, const char *psz_ext )
1066 {
1067     char psz_VLC[] = "VLC";
1068     char *psz_value = qvReg->ReadRegistryString( psz_ext, "", "" );
1069
1070     if( psz_value && !strcmp( strcat( psz_VLC, psz_ext ), psz_value ) )
1071     {
1072         free( psz_value );
1073         psz_value = qvReg->ReadRegistryString( psz_ext, "VLC.backup", "" );
1074         if( psz_value )
1075             qvReg->WriteRegistryString( psz_ext, "", psz_value );
1076
1077         qvReg->DeleteKey( psz_ext, "VLC.backup" );
1078     }
1079     delete( psz_value );
1080 }
1081 void SPrefsPanel::saveAsso()
1082 {
1083     QVLCRegistry * qvReg = NULL;
1084     for( int i = 0; i < listAsso.size(); i ++ )
1085     {
1086         qvReg  = new QVLCRegistry( HKEY_CLASSES_ROOT );
1087         if( listAsso[i]->checkState( 0 ) > 0 )
1088         {
1089             addAsso( qvReg, qtu( listAsso[i]->text( 0 ) ) );
1090         }
1091         else
1092         {
1093             delAsso( qvReg, qtu( listAsso[i]->text( 0 ) ) );
1094         }
1095     }
1096     /* Gruik ? Naaah */
1097     qobject_cast<QDialog *>(listAsso[0]->treeWidget()->parent())->accept();
1098     delete qvReg;
1099 }
1100
1101 #endif /* WIN32 */
1102