Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
b47ec401
Commit
b47ec401
authored
Mar 07, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dialog_Login: simple replacement for intf_UserLoginPassword
parent
d5c12fe6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
4 deletions
+60
-4
include/vlc_dialog.h
include/vlc_dialog.h
+15
-0
src/interface/dialog.c
src/interface/dialog.c
+44
-4
src/libvlccore.sym
src/libvlccore.sym
+1
-0
No files found.
include/vlc_dialog.h
View file @
b47ec401
...
...
@@ -64,6 +64,21 @@ void dialog_FatalWait (vlc_object_t *obj, const char *title,
#define dialog_FatalWait(o, t, ...) \
dialog_FatalWait(VLC_OBJECT(o), t, __VA_ARGS__)
/**
* A login dialog.
*/
typedef
struct
dialog_login_t
{
const
char
*
title
;
const
char
*
message
;
char
**
username
;
char
**
password
;
}
dialog_login_t
;
VLC_EXPORT
(
void
,
dialog_Login
,
(
vlc_object_t
*
,
char
**
,
char
**
,
const
char
*
,
const
char
*
)
);
#define dialog_Login(o, u, p, t, m) \
dialog_Login(VLC_OBJECT(o), u, p, t, m)
VLC_EXPORT
(
int
,
dialog_Register
,
(
vlc_object_t
*
)
);
VLC_EXPORT
(
int
,
dialog_Unregister
,
(
vlc_object_t
*
)
);
#define dialog_Register(o) dialog_Register(VLC_OBJECT(o))
...
...
src/interface/dialog.c
View file @
b47ec401
...
...
@@ -92,6 +92,15 @@ static vlc_object_t *dialog_GetProvider (vlc_object_t *obj)
return
provider
;
}
/**
* Sends an error message through the user interface (if any).
* @param obj the VLC object emitting the error
* @param modal whether to wait for user to acknowledge the error
* before returning control to the caller
* @param title title of the error dialog
* @param fmt format string for the error message
* @param ap parameters list for the formatted error message
*/
void
dialog_VFatal
(
vlc_object_t
*
obj
,
bool
modal
,
const
char
*
title
,
const
char
*
fmt
,
va_list
ap
)
{
...
...
@@ -108,11 +117,42 @@ void dialog_VFatal (vlc_object_t *obj, bool modal, const char *title,
return
;
}
if
(
vasprintf
(
&
text
,
fmt
,
ap
)
==
-
1
)
if
(
vasprintf
(
&
text
,
fmt
,
ap
)
!=
-
1
)
{
dialog_fatal_t
dialog
=
{
title
,
text
,
modal
,
};
var_SetAddress
(
provider
,
"dialog-fatal"
,
&
dialog
);
free
(
text
);
}
vlc_object_release
(
provider
);
}
#undef dialog_Login
/**
* Requests a username and password through the user interface.
* @param obj the VLC object requesting credential informations
* @param username a pointer to the specified username [OUT]
* @param password a pointer to the specified password [OUT]
* @param title title for the dialog
* @param text text for the dialog
* @return Nothing. If a user name resp. a password was specified,
* it will be returned as a heap-allocated character array
* into the username resp password pointer. Those must be freed with free().
* Otherwise *username resp *password will be NULL.
*/
void
dialog_Login
(
vlc_object_t
*
obj
,
char
**
username
,
char
**
password
,
const
char
*
title
,
const
char
*
text
)
{
assert
((
username
!=
NULL
)
&&
(
password
!=
NULL
));
*
username
=
*
password
=
NULL
;
if
(
obj
->
i_flags
&
OBJECT_FLAGS_NOINTERACT
)
return
;
vlc_object_t
*
provider
=
dialog_GetProvider
(
obj
);
if
(
provider
==
NULL
)
return
;
dialog_fatal_t
dialog
=
{
title
,
text
,
modal
,
};
var_SetAddress
(
provider
,
"dialog-fatal"
,
&
dialog
);
free
(
text
);
dialog_login_t
dialog
=
{
title
,
text
,
username
,
password
,
};
var_SetAddress
(
provider
,
"dialog-login"
,
&
dialog
);
vlc_object_release
(
provider
);
}
src/libvlccore.sym
View file @
b47ec401
...
...
@@ -102,6 +102,7 @@ decode_URI_duplicate
demux_PacketizerDestroy
demux_PacketizerNew
demux_vaControlHelper
dialog_Login
dialog_Register
dialog_Unregister
dialog_VFatal
...
...
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