1 /*****************************************************************************
2 * firstrun : First Run dialogs
3 ****************************************************************************
4 * Copyright © 2009 VideoLAN
7 * Authors: Jean-Baptiste Kempf <jb (at) videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #include "dialogs/firstrun.hpp"
26 #include "components/preferences_widgets.hpp"
28 #include <QGridLayout>
32 FirstRun::FirstRun( QWidget *_p, intf_thread_t *_p_intf )
33 : QWidget( _p ), p_intf( _p_intf )
36 msg_Dbg( p_intf, "Boring first Run Wizard" );
44 QList<ConfigControl *>::Iterator i;
45 for( i = controlsList.begin() ; i != controlsList.end() ; i++ )
47 ConfigControl *c = qobject_cast<ConfigControl *>(*i);
50 config_PutInt( p_intf, "qt-privacy-ask", 0 );
51 /* We have to save here because the user may not launch Prefs */
52 config_SaveConfigFile( p_intf, NULL );
56 void FirstRun::buildPrivDialog()
58 setWindowTitle( qtr( "Privacy and Network Policies" ) );
59 setWindowRole( "vlc-privacy" );
60 setWindowModality( Qt::ApplicationModal );
61 setWindowFlags( Qt::Dialog );
62 setAttribute( Qt::WA_DeleteOnClose );
64 QGridLayout *gLayout = new QGridLayout( this );
66 QGroupBox *blabla = new QGroupBox( qtr( "Privacy and Network Warning" ) );
67 QGridLayout *blablaLayout = new QGridLayout( blabla );
68 QLabel *text = new QLabel( qtr(
69 "<p>The <i>VideoLAN Team</i> doesn't like when an application goes "
70 "online without authorization.</p>\n "
71 "<p><i>VLC media player</i> can retreive limited information from "
72 "the Internet in order to get CD covers or to check "
73 "for available updates.</p>\n"
74 "<p><i>VLC media player</i> <b>DOES NOT</b> send or collect <b>ANY</b> "
75 "information, even anonymously, about your usage.</p>\n"
76 "<p>Therefore please select from the following options, the default being "
77 "almost no access to the web.</p>\n") );
78 text->setWordWrap( true );
79 text->setTextFormat( Qt::RichText );
81 blablaLayout->addWidget( text, 0, 0 ) ;
83 QGroupBox *options = new QGroupBox;
84 QGridLayout *optionsLayout = new QGridLayout( options );
86 gLayout->addWidget( blabla, 0, 0, 1, 3 );
87 gLayout->addWidget( options, 1, 0, 1, 3 );
88 module_config_t *p_config;
89 ConfigControl *control;
92 #define CONFIG_GENERIC( option, type ) \
93 p_config = config_FindConfig( VLC_OBJECT(p_intf), option ); \
96 control = new type ## ConfigControl( VLC_OBJECT(p_intf), \
97 p_config, options, false, optionsLayout, line ); \
98 controlsList.append( control ); \
101 #define CONFIG_GENERIC_NOBOOL( option, type ) \
102 p_config = config_FindConfig( VLC_OBJECT(p_intf), option ); \
105 control = new type ## ConfigControl( VLC_OBJECT(p_intf), \
106 p_config, options, optionsLayout, line ); \
107 controlsList.append( control ); \
110 CONFIG_GENERIC( "album-art", IntegerList ); line++;
112 CONFIG_GENERIC_NOBOOL( "qt-updates-notif", Bool ); line++;
115 QPushButton *ok = new QPushButton( qtr( "OK" ) );
117 gLayout->addWidget( ok, 2, 2 );
119 CONNECT( ok, clicked(), this, save() );