Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
b90119f4
Commit
b90119f4
authored
Nov 27, 2009
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: firstRun dialog is now separated
parent
6629593f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
174 additions
and
97 deletions
+174
-97
modules/gui/qt4/Modules.am
modules/gui/qt4/Modules.am
+3
-0
modules/gui/qt4/dialogs/firstrun.cpp
modules/gui/qt4/dialogs/firstrun.cpp
+128
-0
modules/gui/qt4/dialogs/firstrun.hpp
modules/gui/qt4/dialogs/firstrun.hpp
+40
-0
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+3
-94
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/main_interface.hpp
+0
-3
No files found.
modules/gui/qt4/Modules.am
View file @
b90119f4
...
...
@@ -40,6 +40,7 @@ nodist_SOURCES_qt4 = \
dialogs/openurl.moc.cpp \
dialogs/podcast_configuration.moc.cpp \
dialogs/vlm.moc.cpp \
dialogs/firstrun.moc.cpp \
components/extended_panels.moc.cpp \
components/info_panels.moc.cpp \
components/preferences_widgets.moc.cpp \
...
...
@@ -228,6 +229,7 @@ SOURCES_qt4 = qt4.cpp \
dialogs/open.cpp \
dialogs/openurl.cpp \
dialogs/vlm.cpp \
dialogs/firstrun.cpp \
dialogs/podcast_configuration.cpp \
components/extended_panels.cpp \
components/info_panels.cpp \
...
...
@@ -275,6 +277,7 @@ noinst_HEADERS = \
dialogs/open.hpp \
dialogs/openurl.hpp \
dialogs/vlm.hpp \
dialogs/firstrun.hpp \
dialogs/podcast_configuration.hpp \
components/extended_panels.hpp \
components/info_panels.hpp \
...
...
modules/gui/qt4/dialogs/firstrun.cpp
0 → 100644
View file @
b90119f4
/*****************************************************************************
* firstrun : First Run dialogs
****************************************************************************
* Copyright © 2009 VideoLAN
* $Id$
*
* Authors: Jean-Baptiste Kempf <jb (at) 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 "dialogs/firstrun.hpp"
#include "components/preferences_widgets.hpp"
#include <QGridLayout>
#include <QGroupBox>
FirstRun
::
FirstRun
(
QWidget
*
_p
,
intf_thread_t
*
_p_intf
)
:
QWidget
(
_p
),
p_intf
(
_p_intf
)
{
#ifndef HAVE_MAEMO
/**
* Ask for the network policy on FIRST STARTUP
**/
if
(
config_GetInt
(
p_intf
,
"qt-privacy-ask"
)
)
{
buildPrivDialog
();
setVisible
(
true
);
}
else
close
();
#endif
}
void
FirstRun
::
save
()
{
QList
<
ConfigControl
*>::
Iterator
i
;
for
(
i
=
controlsList
.
begin
()
;
i
!=
controlsList
.
end
()
;
i
++
)
{
ConfigControl
*
c
=
qobject_cast
<
ConfigControl
*>
(
*
i
);
c
->
doApply
(
p_intf
);
}
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
();
}
void
FirstRun
::
buildPrivDialog
()
{
setWindowTitle
(
qtr
(
"Privacy and Network Policies"
)
);
setWindowRole
(
"vlc-privacy"
);
setWindowModality
(
Qt
::
ApplicationModal
);
setWindowFlags
(
Qt
::
Dialog
);
setAttribute
(
Qt
::
WA_DeleteOnClose
);
QGridLayout
*
gLayout
=
new
QGridLayout
(
this
);
QGroupBox
*
blabla
=
new
QGroupBox
(
qtr
(
"Privacy and Network Warning"
)
);
QGridLayout
*
blablaLayout
=
new
QGridLayout
(
blabla
);
QLabel
*
text
=
new
QLabel
(
qtr
(
"<p>The <i>VideoLAN Team</i> doesn't like when an application goes "
"online without authorization.</p>
\n
"
"<p><i>VLC media player</i> can retreive limited information from "
"the Internet in order to get CD covers or to check "
"for available updates.</p>
\n
"
"<p><i>VLC media player</i> <b>DOES NOT</b> send or collect <b>ANY</b> "
"information, even anonymously, about your usage.</p>
\n
"
"<p>Therefore please select from the following options, the default being "
"almost no access to the web.</p>
\n
"
)
);
text
->
setWordWrap
(
true
);
text
->
setTextFormat
(
Qt
::
RichText
);
blablaLayout
->
addWidget
(
text
,
0
,
0
)
;
QGroupBox
*
options
=
new
QGroupBox
;
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
++
;
#ifdef UPDATE_CHECK
CONFIG_GENERIC_NOBOOL
(
"qt-updates-notif"
,
Bool
);
line
++
;
#endif
QPushButton
*
ok
=
new
QPushButton
(
qtr
(
"OK"
)
);
gLayout
->
addWidget
(
ok
,
2
,
2
);
CONNECT
(
ok
,
clicked
(),
this
,
save
()
);
}
modules/gui/qt4/dialogs/firstrun.hpp
0 → 100644
View file @
b90119f4
/*****************************************************************************
* firstrun : First Run dialogs
****************************************************************************
* Copyright © 2009 VideoLAN
* $Id$
*
* Authors: Jean-Baptiste Kempf <jb (at) 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 "qt4.hpp"
#include <QWidget>
class
ConfigControl
;
class
FirstRun
:
public
QWidget
{
Q_OBJECT
public:
FirstRun
(
QWidget
*
,
intf_thread_t
*
);
private:
QList
<
ConfigControl
*>
controlsList
;
intf_thread_t
*
p_intf
;
void
buildPrivDialog
();
private
slots
:
void
save
();
};
modules/gui/qt4/main_interface.cpp
View file @
b90119f4
...
...
@@ -40,6 +40,7 @@
#include "components/controller.hpp"
#include "components/playlist/playlist.hpp"
#include "dialogs/external.hpp"
#include "dialogs/firstrun.hpp"
#include "menus.hpp"
#include "recents.hpp"
...
...
@@ -98,8 +99,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
stackCentralOldState
=
HIDDEN_TAB
;
i_bg_height
=
0
;
/* Ask for
p
rivacy */
askForPrivacy
(
);
/* Ask for
P
rivacy */
new
FirstRun
(
this
,
p_intf
);
/**
* Configuration and settings
...
...
@@ -592,98 +593,6 @@ inline void MainInterface::initSystray()
#endif
}
inline
void
MainInterface
::
askForPrivacy
()
{
#ifndef HAVE_MAEMO
/**
* Ask for the network policy on FIRST STARTUP
**/
if
(
config_GetInt
(
p_intf
,
"qt-privacy-ask"
)
)
{
QList
<
ConfigControl
*>
controls
;
if
(
privacyDialog
(
&
controls
)
==
QDialog
::
Accepted
)
{
QList
<
ConfigControl
*>::
Iterator
i
;
for
(
i
=
controls
.
begin
()
;
i
!=
controls
.
end
()
;
i
++
)
{
ConfigControl
*
c
=
qobject_cast
<
ConfigControl
*>
(
*
i
);
c
->
doApply
(
p_intf
);
}
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
);
}
}
#endif
}
int
MainInterface
::
privacyDialog
(
QList
<
ConfigControl
*>
*
controls
)
{
QDialog
*
privacy
=
new
QDialog
(
this
);
privacy
->
setWindowTitle
(
qtr
(
"Privacy and Network Policies"
)
);
privacy
->
setWindowRole
(
"vlc-privacy"
);
QGridLayout
*
gLayout
=
new
QGridLayout
(
privacy
);
QGroupBox
*
blabla
=
new
QGroupBox
(
qtr
(
"Privacy and Network Warning"
)
);
QGridLayout
*
blablaLayout
=
new
QGridLayout
(
blabla
);
QLabel
*
text
=
new
QLabel
(
qtr
(
"<p>The <i>VideoLAN Team</i> doesn't like when an application goes "
"online without authorization.</p>
\n
"
"<p><i>VLC media player</i> can retreive limited information from "
"the Internet in order to get CD covers or to check "
"for available updates.</p>
\n
"
"<p><i>VLC media player</i> <b>DOES NOT</b> send or collect <b>ANY</b> "
"information, even anonymously, about your usage.</p>
\n
"
"<p>Therefore please select from the following options, the default being "
"almost no access to the web.</p>
\n
"
)
);
text
->
setWordWrap
(
true
);
text
->
setTextFormat
(
Qt
::
RichText
);
blablaLayout
->
addWidget
(
text
,
0
,
0
)
;
QGroupBox
*
options
=
new
QGroupBox
;
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 ); \
controls->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 ); \
controls->append( control ); \
}
CONFIG_GENERIC
(
"album-art"
,
IntegerList
);
line
++
;
#ifdef UPDATE_CHECK
CONFIG_GENERIC_NOBOOL
(
"qt-updates-notif"
,
Bool
);
line
++
;
#endif
QPushButton
*
ok
=
new
QPushButton
(
qtr
(
"OK"
)
);
gLayout
->
addWidget
(
ok
,
2
,
2
);
CONNECT
(
ok
,
clicked
(),
privacy
,
accept
()
);
return
privacy
->
exec
();
}
/**********************************************************************
* Handling of sizing of the components
...
...
modules/gui/qt4/main_interface.hpp
View file @
b90119f4
...
...
@@ -111,9 +111,6 @@ private:
void
createMainWidget
(
QSettings
*
);
void
createStatusBar
();
void
askForPrivacy
();
int
privacyDialog
(
QList
<
ConfigControl
*>
*
controls
);
/* Systray */
void
handleSystray
();
void
createSystray
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment