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
f261c0d5
Commit
f261c0d5
authored
Nov 21, 2007
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add fonctionality to the update dialog - Patches by Rémi Duraffort
parent
160ba82b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
100 additions
and
31 deletions
+100
-31
modules/gui/qt4/dialogs/help.cpp
modules/gui/qt4/dialogs/help.cpp
+96
-30
modules/gui/qt4/dialogs/help.hpp
modules/gui/qt4/dialogs/help.hpp
+4
-1
No files found.
modules/gui/qt4/dialogs/help.cpp
View file @
f261c0d5
...
...
@@ -38,6 +38,8 @@
#include <QCheckBox>
#include <QGroupBox>
#include <QDialogButtonBox>
#include <QFileDialog>
HelpDialog
*
HelpDialog
::
instance
=
NULL
;
...
...
@@ -171,7 +173,7 @@ UpdateDialog::UpdateDialog( intf_thread_t *_p_intf) : QVLCFrame( _p_intf )
QGridLayout
*
layout
=
new
QGridLayout
(
this
);
QPushButton
*
closeButton
=
new
QPushButton
(
qtr
(
"&Close"
)
);
QPushButton
*
updateButton
=
new
QPushButton
(
qtr
(
"&Update List"
)
);
updateButton
=
new
QPushButton
(
qtr
(
"&Update List"
)
);
updateButton
->
setDefault
(
true
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
Qt
::
Horizontal
);
buttonBox
->
addButton
(
updateButton
,
QDialogButtonBox
::
ActionRole
);
...
...
@@ -197,10 +199,11 @@ UpdateDialog::UpdateDialog( intf_thread_t *_p_intf) : QVLCFrame( _p_intf )
layout
->
addWidget
(
checkGroup
,
0
,
0
);
layout
->
addWidget
(
buttonBox
,
1
,
0
);
BUTTONACT
(
updateButton
,
update
()
);
BUTTONACT
(
updateButton
,
update
OrUpload
()
);
BUTTONACT
(
closeButton
,
close
()
);
p_update
=
update_New
(
_p_intf
);
b_updated
=
false
;
}
UpdateDialog
::~
UpdateDialog
()
...
...
@@ -213,39 +216,102 @@ void UpdateDialog::close()
toggleVisible
();
}
void
UpdateDialog
::
update
()
void
UpdateDialog
::
update
OrUpload
()
{
update_Check
(
p_update
,
VLC_FALSE
);
update_iterator_t
*
p_uit
=
update_iterator_New
(
p_update
);
if
(
p_uit
)
if
(
!
b_updated
)
{
p_uit
->
i_rs
=
UPDATE_RELEASE_STATUS_NEWER
;
p_uit
->
i_t
=
UPDATE_FILE_TYPE_ALL
;
update_iterator_Action
(
p_uit
,
UPDATE_MIRROR
);
while
(
update_iterator_Action
(
p_uit
,
UPDATE_FILE
)
!=
UPDATE_FAIL
)
update_Check
(
p_update
,
VLC_FALSE
);
update_iterator_t
*
p_updateit
=
update_iterator_New
(
p_update
);
bool
b_download
=
false
;
if
(
p_updateit
)
{
p_updateit
->
i_rs
=
UPDATE_RELEASE_STATUS_NEWER
;
p_updateit
->
i_t
=
UPDATE_FILE_TYPE_ALL
;
update_iterator_Action
(
p_updateit
,
UPDATE_MIRROR
);
while
(
update_iterator_Action
(
p_updateit
,
UPDATE_FILE
)
!=
UPDATE_FAIL
)
{
switch
(
p_updateit
->
file
.
i_type
)
{
case
UPDATE_FILE_TYPE_INFO
:
checkInfo
->
setText
(
qtr
(
"Information"
)
+
" ("
+
qfu
(
p_updateit
->
release
.
psz_version
)
+
")"
);
checkInfo
->
setDisabled
(
false
);
checkInfo
->
setCheckState
(
Qt
::
Checked
);
b_download
=
true
;
break
;
case
UPDATE_FILE_TYPE_SOURCE
:
checkSource
->
setText
(
qtr
(
"Source"
)
+
" ("
+
qfu
(
p_updateit
->
release
.
psz_version
)
+
")"
);
checkSource
->
setDisabled
(
false
);
checkSource
->
setCheckState
(
Qt
::
Checked
);
b_download
=
true
;
break
;
case
UPDATE_FILE_TYPE_BINARY
:
checkBinary
->
setText
(
qtr
(
"Binary"
)
+
" ("
+
qfu
(
p_updateit
->
release
.
psz_version
)
+
")"
);
checkBinary
->
setDisabled
(
false
);
checkBinary
->
setCheckState
(
Qt
::
Checked
);
b_download
=
true
;
break
;
case
UPDATE_FILE_TYPE_PLUGIN
:
checkPlugin
->
setText
(
qtr
(
"Plugin"
)
+
" ("
+
qfu
(
p_updateit
->
release
.
psz_version
)
+
")"
);
checkPlugin
->
setDisabled
(
false
);
checkPlugin
->
setCheckState
(
Qt
::
Checked
);
b_download
=
true
;
break
;
default:
break
;
}
}
}
if
(
b_download
)
{
switch
(
p_uit
->
file
.
i_type
)
updateButton
->
setText
(
qtr
(
"Download"
)
);
b_updated
=
true
;
}
update_iterator_Delete
(
p_updateit
);
}
else
{
update_iterator_t
*
p_updateit
=
update_iterator_New
(
p_update
);
bool
b_download
=
false
;
if
(
p_updateit
)
{
QString
saveDir
=
QFileDialog
::
getExistingDirectory
(
this
,
qtr
(
"Choose a direcctory..."
),
qfu
(
p_intf
->
p_libvlc
->
psz_homedir
)
);
p_updateit
->
i_rs
=
UPDATE_RELEASE_STATUS_NEWER
;
p_updateit
->
i_t
=
UPDATE_FILE_TYPE_ALL
;
update_iterator_Action
(
p_updateit
,
UPDATE_MIRROR
);
while
(
update_iterator_Action
(
p_updateit
,
UPDATE_FILE
)
!=
UPDATE_FAIL
)
{
case
UPDATE_FILE_TYPE_INFO
:
checkInfo
->
setDisabled
(
false
);
checkInfo
->
setCheckState
(
Qt
::
Checked
);
break
;
case
UPDATE_FILE_TYPE_SOURCE
:
checkSource
->
setDisabled
(
false
);
checkSource
->
setCheckState
(
Qt
::
Checked
);
break
;
case
UPDATE_FILE_TYPE_BINARY
:
checkBinary
->
setDisabled
(
false
);
checkBinary
->
setCheckState
(
Qt
::
Checked
);
break
;
case
UPDATE_FILE_TYPE_PLUGIN
:
checkPlugin
->
setDisabled
(
false
);
checkPlugin
->
setCheckState
(
Qt
::
Checked
);
break
;
default:
break
;
b_download
=
false
;
switch
(
p_updateit
->
file
.
i_type
)
{
case
UPDATE_FILE_TYPE_INFO
:
if
(
checkInfo
->
isChecked
()
)
b_download
=
true
;
break
;
case
UPDATE_FILE_TYPE_SOURCE
:
if
(
checkSource
->
isChecked
()
)
b_download
=
true
;
break
;
case
UPDATE_FILE_TYPE_BINARY
:
if
(
checkBinary
->
isChecked
()
)
b_download
=
true
;
break
;
case
UPDATE_FILE_TYPE_PLUGIN
:
if
(
checkPlugin
->
isChecked
()
)
b_download
=
true
;
break
;
default:
break
;
}
if
(
b_download
)
{
QString
strFileName
=
p_updateit
->
file
.
psz_url
;
strFileName
.
remove
(
0
,
strFileName
.
lastIndexOf
(
"/"
)
+
1
);
update_download
(
p_updateit
,
qtu
(
(
saveDir
+
strFileName
)
)
);
}
}
}
}
update_iterator_Delete
(
p_uit
);
}
modules/gui/qt4/dialogs/help.hpp
View file @
f261c0d5
...
...
@@ -28,6 +28,7 @@
#include "util/qvlcframe.hpp"
class
QPushButton
;
class
QCheckBox
;
class
HelpDialog
:
public
QVLCFrame
...
...
@@ -85,14 +86,16 @@ public:
private:
UpdateDialog
(
intf_thread_t
*
);
static
UpdateDialog
*
instance
;
QPushButton
*
updateButton
;
QCheckBox
*
checkInfo
;
QCheckBox
*
checkSource
;
QCheckBox
*
checkBinary
;
QCheckBox
*
checkPlugin
;
update_t
*
p_update
;
bool
b_updated
;
private
slots
:
void
close
();
void
update
();
void
update
OrUpload
();
};
...
...
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