Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
faad0752
Commit
faad0752
authored
Jan 13, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alert the user when something wrong accure during the update.
parent
6162f894
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
18 deletions
+34
-18
include/vlc_update.h
include/vlc_update.h
+1
-1
modules/gui/qt4/dialogs/help.cpp
modules/gui/qt4/dialogs/help.cpp
+25
-11
modules/gui/qt4/dialogs/help.hpp
modules/gui/qt4/dialogs/help.hpp
+4
-1
src/misc/update.c
src/misc/update.c
+4
-5
No files found.
include/vlc_update.h
View file @
faad0752
...
...
@@ -232,7 +232,7 @@ struct update_t
VLC_EXPORT
(
update_t
*
,
__update_New
,
(
vlc_object_t
*
)
);
VLC_EXPORT
(
void
,
update_Delete
,
(
update_t
*
)
);
VLC_EXPORT
(
void
,
update_Check
,
(
update_t
*
,
void
(
*
callback
)(
void
*
),
void
*
)
);
VLC_EXPORT
(
void
,
update_Check
,
(
update_t
*
,
void
(
*
callback
)(
void
*
,
vlc_bool_t
),
void
*
)
);
VLC_EXPORT
(
int
,
update_CompareReleaseToCurrent
,
(
update_t
*
)
);
VLC_EXPORT
(
void
,
update_Download
,
(
update_t
*
,
char
*
)
);
...
...
modules/gui/qt4/dialogs/help.cpp
View file @
faad0752
...
...
@@ -180,10 +180,16 @@ void AboutDialog::close()
* UpdateDialog
*****************************************************************************/
/* callback to get information from the core */
static
void
UpdateCallback
(
void
*
data
)
static
void
UpdateCallback
(
void
*
data
,
vlc_bool_t
b_ret
)
{
UpdateDialog
*
UDialog
=
(
UpdateDialog
*
)
data
;
QEvent
*
event
=
new
QEvent
(
QEvent
::
User
);
QEvent
*
event
;
if
(
b_ret
)
event
=
new
QEvent
(
(
QEvent
::
Type
)
UDOkEvent
);
else
event
=
new
QEvent
(
(
QEvent
::
Type
)
UDErrorEvent
);
QApplication
::
postEvent
(
UDialog
,
event
);
}
...
...
@@ -254,22 +260,30 @@ void UpdateDialog::UpdateOrDownload()
/* Handle the events */
void
UpdateDialog
::
customEvent
(
QEvent
*
event
)
{
updateNotify
();
if
(
event
->
type
()
==
UDOkEvent
)
updateNotify
(
true
);
else
updateNotify
(
false
);
}
/* Notify the end of the update_Check */
void
UpdateDialog
::
updateNotify
()
void
UpdateDialog
::
updateNotify
(
bool
b_result
)
{
if
(
update_CompareReleaseToCurrent
(
p_update
)
==
UpdateReleaseStatusNewer
)
/* The update finish without errors */
if
(
b_result
)
{
b_checked
=
true
;
updateButton
->
setText
(
"Download"
);
updateLabel
->
setText
(
qtr
(
"There is a new version of vlc :
\n
"
)
+
qfu
(
p_update
->
release
.
psz_desc
)
);
if
(
update_CompareReleaseToCurrent
(
p_update
)
==
UpdateReleaseStatusNewer
)
{
b_checked
=
true
;
updateButton
->
setText
(
"Download"
);
updateLabel
->
setText
(
qtr
(
"There is a new version of vlc :
\n
"
)
+
qfu
(
p_update
->
release
.
psz_desc
)
);
}
else
updateLabel
->
setText
(
qtr
(
"You have the latest version of vlc"
)
);
}
else
{
updateLabel
->
setText
(
qtr
(
"You have the latest version of vlc"
)
);
}
updateLabel
->
setText
(
qtr
(
"An error occure while checking for updates"
)
);
adjustSize
();
updateButton
->
setEnabled
(
true
);
}
...
...
modules/gui/qt4/dialogs/help.hpp
View file @
faad0752
...
...
@@ -75,6 +75,9 @@ public slots:
#ifdef UPDATE_CHECK
static
int
UDOkEvent
=
QEvent
::
User
+
1
;
static
int
UDErrorEvent
=
QEvent
::
User
+
2
;
class
UpdateDialog
:
public
QVLCFrame
{
Q_OBJECT
;
...
...
@@ -86,7 +89,7 @@ public:
return
instance
;
}
virtual
~
UpdateDialog
();
void
updateNotify
();
void
updateNotify
(
bool
);
private:
UpdateDialog
(
intf_thread_t
*
);
...
...
src/misc/update.c
View file @
faad0752
...
...
@@ -1007,7 +1007,7 @@ typedef struct
{
VLC_COMMON_MEMBERS
update_t
*
p_update
;
void
(
*
pf_callback
)(
void
*
);
void
(
*
pf_callback
)(
void
*
,
vlc_bool_t
);
void
*
p_data
;
}
update_check_thread_t
;
...
...
@@ -1021,7 +1021,7 @@ void update_CheckReal( update_check_thread_t *p_uct );
* \param p_data pointer to some datas to give to the callback
* \returns nothing
*/
void
update_Check
(
update_t
*
p_update
,
void
(
*
pf_callback
)(
void
*
),
void
*
p_data
)
void
update_Check
(
update_t
*
p_update
,
void
(
*
pf_callback
)(
void
*
,
vlc_bool_t
),
void
*
p_data
)
{
assert
(
p_update
);
...
...
@@ -1044,9 +1044,8 @@ void update_CheckReal( update_check_thread_t *p_uct )
b_ret
=
GetUpdateFile
(
p_uct
->
p_update
);
vlc_mutex_unlock
(
&
p_uct
->
p_update
->
lock
);
/* FIXME: return b_ret in pf_callback */
if
(
b_ret
&&
p_uct
->
pf_callback
)
(
p_uct
->
pf_callback
)(
p_uct
->
p_data
);
if
(
p_uct
->
pf_callback
)
(
p_uct
->
pf_callback
)(
p_uct
->
p_data
,
b_ret
);
vlc_object_destroy
(
p_uct
);
}
...
...
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