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 <QGridLayout>
30 #include <QPushButton>
33 FirstRun::FirstRun( QWidget *_p, intf_thread_t *_p_intf )
34 : QWidget( _p ), p_intf( _p_intf )
37 msg_Dbg( p_intf, "Boring first Run Wizard" );
43 #define ALBUM_ART_WHEN_ASKED 0
44 #define ALBUM_ART_ALL 2
48 config_PutInt( p_intf, "album-art", checkbox->isChecked() ? ALBUM_ART_ALL: ALBUM_ART_WHEN_ASKED );
50 config_PutInt( p_intf, "qt-updates-notif", checkbox2->isChecked() );
52 config_PutInt( p_intf, "qt-privacy-ask", 0 );
54 /* We have to save here because the user may not launch Prefs */
55 config_SaveConfigFile( p_intf, NULL );
59 void FirstRun::buildPrivDialog()
61 setWindowTitle( qtr( "Privacy and Network Policies" ) );
62 setWindowRole( "vlc-privacy" );
63 setWindowModality( Qt::ApplicationModal );
64 setWindowFlags( Qt::Dialog );
65 setAttribute( Qt::WA_DeleteOnClose );
67 QGridLayout *gLayout = new QGridLayout( this );
69 QGroupBox *blabla = new QGroupBox( qtr( "Privacy and Network Warning" ) );
70 QGridLayout *blablaLayout = new QGridLayout( blabla );
71 QLabel *text = new QLabel( qtr(
72 "<p><i>VideoLAN</i> prefers when applications request authorization "
73 "before accessing Internet.</p>\n"
74 "<p><b>VLC media player</b> can get information from the Internet "
75 "in order to get <b>medias information</b> or to check for available <b>updates</b>.</p>\n"
76 "<p><i>VLC media player</i> <b>doesn't</b> send or collect any "
77 "information, even anonymously, about your usage.</p>\n" ) );
78 text->setWordWrap( true );
79 text->setTextFormat( Qt::RichText );
81 blablaLayout->addWidget( text, 0, 0 ) ;
83 QGroupBox *options = new QGroupBox( qtr( "Options" ) );
84 QGridLayout *optionsLayout = new QGridLayout( options );
86 gLayout->addWidget( blabla, 0, 0, 1, 3 );
87 gLayout->addWidget( options, 1, 0, 1, 3 );
90 checkbox = new QCheckBox( qtr( "Allow fetching media information from Internet" ) );
91 checkbox->setChecked( true );
92 optionsLayout->addWidget( checkbox, line++, 0 );
95 checkbox2 = new QCheckBox( qtr( "Check for updates" ) );
96 checkbox2->setChecked( true );
97 optionsLayout->addWidget( checkbox2, line++, 0 );
100 QPushButton *ok = new QPushButton( qtr( "OK" ) );
102 gLayout->addWidget( ok, 2, 2 );
104 CONNECT( ok, clicked(), this, save() );