Commit 06b23fcb authored by Thomas Guillem's avatar Thomas Guillem

dialog: add a default username for dialog_Login

parent 5456b78d
......@@ -72,15 +72,16 @@ typedef struct dialog_login_t
{
const char *title;
const char *message;
const char *default_username;
char **username;
char **password;
/* if store is NULL, password can't be stored (there is no keystore) */
bool *store;
} dialog_login_t;
VLC_API void dialog_Login(vlc_object_t *, char **, char **, bool *, const char *, const char *, ...) VLC_FORMAT (6, 7);
#define dialog_Login(o, u, p, s, t, ...) \
dialog_Login(VLC_OBJECT(o), u, p, s, t, __VA_ARGS__)
VLC_API void dialog_Login(vlc_object_t *, const char *, char **, char **, bool *, const char *, const char *, ...) VLC_FORMAT (7, 8);
#define dialog_Login(o, u, p, s, t, v, ...) \
dialog_Login(VLC_OBJECT(o), u, p, s, t, v, __VA_ARGS__)
/**
* A question dialog.
......
......@@ -141,7 +141,8 @@ void dialog_VFatal (vlc_object_t *obj, bool modal, const char *title,
* 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,
void dialog_Login (vlc_object_t *obj, const char *default_username,
char **username, char **password,
bool *store, const char *title, const char *fmt, ...)
{
assert ((username != NULL) && (password != NULL));
......@@ -160,7 +161,8 @@ void dialog_Login (vlc_object_t *obj, char **username, char **password,
va_start (ap, fmt);
if (vasprintf (&text, fmt, ap) != -1)
{
dialog_login_t dialog = { title, text, username, password, store };
dialog_login_t dialog = { title, text, default_username, username,
password, store };
var_SetAddress (provider, "dialog-login", &dialog);
free (text);
}
......
......@@ -399,7 +399,8 @@ vlc_credential_get(vlc_credential *p_credential, vlc_object_t *p_parent,
return false;
}
va_end(ap);
dialog_Login(p_parent, &p_credential->psz_dialog_username,
dialog_Login(p_parent, p_credential->psz_username,
&p_credential->psz_dialog_username,
&p_credential->psz_dialog_password,
p_credential->p_keystore ? &p_credential->b_store : NULL,
psz_dialog_title, psz_dialog_text);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment