From 8c7eaa23f195ea75d963b78ecf83dba07cacbee7 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kempf Date: Thu, 4 Feb 2010 17:00:11 +0100 Subject: [PATCH] Qt: simple FirstRun dialog and rewording --- modules/gui/qt4/dialogs/firstrun.cpp | 62 ++++++++++------------------ modules/gui/qt4/dialogs/firstrun.hpp | 4 +- 2 files changed, 24 insertions(+), 42 deletions(-) diff --git a/modules/gui/qt4/dialogs/firstrun.cpp b/modules/gui/qt4/dialogs/firstrun.cpp index afaf98c93f..c5bbcf533c 100644 --- a/modules/gui/qt4/dialogs/firstrun.cpp +++ b/modules/gui/qt4/dialogs/firstrun.cpp @@ -23,10 +23,11 @@ #include "dialogs/firstrun.hpp" -#include "components/preferences_widgets.hpp" - #include #include +#include +#include +#include #include FirstRun::FirstRun( QWidget *_p, intf_thread_t *_p_intf ) @@ -39,15 +40,14 @@ FirstRun::FirstRun( QWidget *_p, intf_thread_t *_p_intf ) #endif } +#define ALBUM_ART_WHEN_ASKED 0 +#define ALBUM_ART_ALL 2 void FirstRun::save() { - QList::Iterator i; - for( i = controlsList.begin() ; i != controlsList.end() ; i++ ) - { - ConfigControl *c = qobject_cast(*i); - c->doApply( p_intf ); - } + config_PutInt( p_intf, "album-art", checkbox->isChecked() ? ALBUM_ART_ALL: ALBUM_ART_WHEN_ASKED ); + config_PutInt( p_intf, "qt-updates-notif", checkbox2->isChecked() ); config_PutInt( p_intf, "qt-privacy-ask", 0 ); + /* We have to save here because the user may not launch Prefs */ config_SaveConfigFile( p_intf, NULL ); close(); @@ -66,50 +66,32 @@ void FirstRun::buildPrivDialog() QGroupBox *blabla = new QGroupBox( qtr( "Privacy and Network Warning" ) ); QGridLayout *blablaLayout = new QGridLayout( blabla ); QLabel *text = new QLabel( qtr( - "

The VideoLAN Team doesn't like when an application goes " - "online without authorization.

\n " - "

VLC media player can retreive limited information from " - "the Internet in order to get CD covers or to check " - "for available updates.

\n" - "

VLC media player DOES NOT send or collect ANY " - "information, even anonymously, about your usage.

\n" - "

Therefore please select from the following options, the default being " - "almost no access to the web.

\n") ); + "

VideoLAN prefers when applications request authorization " + "before accessing Internet.

\n" + "

VLC media player can get information from the Internet " + "in order to get media informations or to check for available updates.

\n" + "

VLC media player doesn't send or collect any " + "information, even anonymously, about your usage.

\n" ) ); text->setWordWrap( true ); text->setTextFormat( Qt::RichText ); blablaLayout->addWidget( text, 0, 0 ) ; - QGroupBox *options = new QGroupBox; + QGroupBox *options = new QGroupBox( qtr( "Options" ) ); QGridLayout *optionsLayout = new QGridLayout( options ); gLayout->addWidget( blabla, 0, 0, 1, 3 ); gLayout->addWidget( options, 1, 0, 1, 3 ); - module_config_t *p_config; - ConfigControl *control; int line = 0; -#define CONFIG_GENERIC( option, type ) \ - p_config = config_FindConfig( VLC_OBJECT(p_intf), option ); \ - if( p_config ) \ - { \ - control = new type ## ConfigControl( VLC_OBJECT(p_intf), \ - p_config, options, false, optionsLayout, line ); \ - controlsList.append( control ); \ - } - -#define CONFIG_GENERIC_NOBOOL( option, type ) \ - p_config = config_FindConfig( VLC_OBJECT(p_intf), option ); \ - if( p_config ) \ - { \ - control = new type ## ConfigControl( VLC_OBJECT(p_intf), \ - p_config, options, optionsLayout, line ); \ - controlsList.append( control ); \ - } - - CONFIG_GENERIC( "album-art", IntegerList ); line++; + checkbox = new QCheckBox( qtr( "Allow fetching media information from Internet" ) ); + checkbox->setChecked( true ); + optionsLayout->addWidget( checkbox, line++, 0 ); + #ifdef UPDATE_CHECK - CONFIG_GENERIC_NOBOOL( "qt-updates-notif", Bool ); line++; + checkbox2 = new QCheckBox( qtr( "Check for updates" ) ); + checkbox2->setChecked( true ); + optionsLayout->addWidget( checkbox2, line++, 0 ); #endif QPushButton *ok = new QPushButton( qtr( "OK" ) ); diff --git a/modules/gui/qt4/dialogs/firstrun.hpp b/modules/gui/qt4/dialogs/firstrun.hpp index 3d2cbb4574..f45351344c 100644 --- a/modules/gui/qt4/dialogs/firstrun.hpp +++ b/modules/gui/qt4/dialogs/firstrun.hpp @@ -26,7 +26,7 @@ #include #include -class ConfigControl; +class QCheckBox; class FirstRun : public QWidget { Q_OBJECT @@ -44,7 +44,7 @@ class FirstRun : public QWidget } FirstRun( QWidget *, intf_thread_t * ); private: - QList controlsList; + QCheckBox *checkbox, *checkbox2; intf_thread_t *p_intf; void buildPrivDialog(); private slots: -- 2.39.5