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
4db8257a
Commit
4db8257a
authored
May 14, 2006
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* first implementation of a widget-free authentication-dialogue (core and OSX only, refs #553)
parent
4e0d4c98
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
81 additions
and
40 deletions
+81
-40
extras/MacOSX/Resources/English.lproj/Interaction.nib/classes.nib
...acOSX/Resources/English.lproj/Interaction.nib/classes.nib
+10
-1
extras/MacOSX/Resources/English.lproj/Interaction.nib/info.nib
...s/MacOSX/Resources/English.lproj/Interaction.nib/info.nib
+3
-3
extras/MacOSX/Resources/English.lproj/Interaction.nib/keyedobjects.nib
.../Resources/English.lproj/Interaction.nib/keyedobjects.nib
+0
-0
include/vlc_interaction.h
include/vlc_interaction.h
+10
-6
modules/access/http.c
modules/access/http.c
+3
-2
modules/gui/macosx/interaction.h
modules/gui/macosx/interaction.h
+12
-0
modules/gui/macosx/interaction.m
modules/gui/macosx/interaction.m
+34
-0
src/interface/interaction.c
src/interface/interaction.c
+9
-28
No files found.
extras/MacOSX/Resources/English.lproj/Interaction.nib/classes.nib
View file @
4db8257a
...
...
@@ -2,10 +2,19 @@
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {cancelAndClose = id; };
ACTIONS = {cancelAndClose = id;
okayAndClose = id;
};
CLASS = VLCInteraction;
LANGUAGE = ObjC;
OUTLETS = {
"o_auth_cancel_btn" = id;
"o_auth_description" = id;
"o_auth_login_fld" = id;
"o_auth_login_txt" = id;
"o_auth_ok_btn" = id;
"o_auth_pw_fld" = id;
"o_auth_pw_txt" = id;
"o_auth_title" = id;
"o_auth_win" = id;
"o_prog_bar" = id;
"o_prog_cancel_btn" = id;
"o_prog_description" = id;
...
...
extras/MacOSX/Resources/English.lproj/Interaction.nib/info.nib
View file @
4db8257a
...
...
@@ -3,14 +3,14 @@
<plist
version=
"1.0"
>
<dict>
<key>
IBDocumentLocation
</key>
<string>
103 27
356 240 0 0 1440 878
</string>
<string>
97 142
356 240 0 0 1440 878
</string>
<key>
IBFramework Version
</key>
<string>
443.0
</string>
<key>
IBOpenObjects
</key>
<array>
<integer>
5
</integer>
<integer>
5
5
</integer>
</array>
<key>
IBSystem Version
</key>
<string>
8
H14
</string>
<string>
8
I127
</string>
</dict>
</plist>
extras/MacOSX/Resources/English.lproj/Interaction.nib/keyedobjects.nib
View file @
4db8257a
No preview for this file type
include/vlc_interaction.h
View file @
4db8257a
...
...
@@ -5,6 +5,7 @@
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
* Felix Kühne <fkuehne@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
...
...
@@ -52,6 +53,8 @@ struct interaction_dialog_t
char
*
psz_title
;
///< Title
char
*
psz_description
;
///< Descriptor string
char
*
psz_returned
[
1
];
///< returned responses from the user
int
i_widgets
;
///< Number of dialog widgets
user_widget_t
**
pp_widgets
;
///< Dialog widgets
...
...
@@ -70,12 +73,13 @@ struct interaction_dialog_t
/**
* Possible flags . Reusable and button types
*/
#define DIALOG_REUSABLE 0x01
#define DIALOG_OK_CANCEL 0x02
#define DIALOG_YES_NO 0x04
#define DIALOG_YES_NO_CANCEL 0x04
#define DIALOG_CLEAR_NOSHOW 0x08
#define DIALOG_GOT_ANSWER 0x10
#define DIALOG_REUSABLE 0x01
#define DIALOG_OK_CANCEL 0x02
#define DIALOG_YES_NO 0x04
#define DIALOG_YES_NO_CANCEL 0x04
#define DIALOG_CLEAR_NOSHOW 0x08
#define DIALOG_GOT_ANSWER 0x10
#define DIALOG_LOGIN_PW_OK_CANCEL 0x20
/**
* Possible return codes
...
...
modules/access/http.c
View file @
4db8257a
...
...
@@ -290,8 +290,9 @@ connect:
char
*
psz_login
=
NULL
;
char
*
psz_password
=
NULL
;
int
i_ret
;
msg_Dbg
(
p_access
,
"authentication failed"
);
i_ret
=
intf_UserLoginPassword
(
p_access
,
"HTTP authentication"
,
"Please enter a valid login and password."
,
&
psz_login
,
&
psz_password
);
i_ret
=
intf_UserLoginPassword
(
p_access
,
_
(
"HTTP authentication"
),
_
(
"Please enter a valid login name and a password."
),
&
psz_login
,
&
psz_password
);
if
(
i_ret
==
DIALOG_OK_YES
)
{
msg_Dbg
(
p_access
,
"retrying with user=%s, pwd=%s"
,
...
...
modules/gui/macosx/interaction.h
View file @
4db8257a
...
...
@@ -38,12 +38,24 @@
IBOutlet
id
o_prog_title
;
IBOutlet
id
o_prog_win
;
/* authentication dialogue */
IBOutlet
id
o_auth_cancel_btn
;
IBOutlet
id
o_auth_description
;
IBOutlet
id
o_auth_login_fld
;
IBOutlet
id
o_auth_login_txt
;
IBOutlet
id
o_auth_ok_btn
;
IBOutlet
id
o_auth_pw_fld
;
IBOutlet
id
o_auth_pw_txt
;
IBOutlet
id
o_auth_title
;
IBOutlet
id
o_auth_win
;
interaction_dialog_t
*
p_dialog
;
intf_thread_t
*
p_intf
;
BOOL
nib_interact_loaded
;
}
-
(
IBAction
)
cancelAndClose
:(
id
)
sender
;
-
(
IBAction
)
okayAndClose
:(
id
)
sender
;
-
(
id
)
initDialog
:
(
interaction_dialog_t
*
)
_p_dialog
;
-
(
void
)
runDialog
;
...
...
modules/gui/macosx/interaction.m
View file @
4db8257a
...
...
@@ -120,6 +120,10 @@
nib_interact_loaded
=
[
NSBundle
loadNibNamed
:
@"Interaction"
owner
:
self
];
[
o_prog_cancel_btn
setTitle
:
_NS
(
"Cancel"
)];
[
o_prog_bar
setUsesThreadedAnimation
:
YES
];
[
o_auth_login_txt
setStringValue
:
_NS
(
"Login:"
)];
[
o_auth_pw_txt
setStringValue
:
_NS
(
"Password:"
)];
[
o_auth_cancel_btn
setTitle
:
_NS
(
"Cancel"
)];
[
o_auth_ok_btn
setTitle
:
_NS
(
"OK"
)];
}
NSString
*
o_title
=
[
NSString
stringWithUTF8String
:
p_dialog
->
psz_title
?
p_dialog
->
psz_title
:
"title"
];
...
...
@@ -177,6 +181,17 @@
o_window
,
self
,
@selector
(
sheetDidEnd
:
returnCode
:
contextInfo
:
),
\
NULL
,
nil
,
o_description
);
}
else
if
(
p_dialog
->
i_flags
&
DIALOG_LOGIN_PW_OK_CANCEL
)
{
msg_Dbg
(
p_intf
,
"requested flag: DIALOG_LOGIN_PW_OK_CANCEL"
);
[
o_auth_title
setStringValue
:
o_title
];
[
o_auth_description
setStringValue
:
o_description
];
[
o_auth_login_fld
setStringValue
:
@""
];
[
o_auth_pw_fld
setStringValue
:
@""
];
[
NSApp
beginSheet
:
o_auth_win
modalForWindow
:
o_window
\
modalDelegate
:
self
didEndSelector
:
nil
contextInfo
:
nil
];
[
o_auth_win
makeKeyWindow
];
}
else
if
(
p_dialog
->
i_type
&
WIDGET_PROGRESS
)
{
msg_Dbg
(
p_intf
,
"requested type: WIDGET_PROGRESS"
);
...
...
@@ -244,6 +259,11 @@
[
NSApp
endSheet
:
o_prog_win
];
[
o_prog_win
close
];
}
if
(
p_dialog
->
i_flags
&
DIALOG_LOGIN_PW_OK_CANCEL
)
{
[
NSApp
endSheet
:
o_auth_win
];
[
o_auth_win
close
];
}
}
-
(
void
)
destroyDialog
...
...
@@ -261,4 +281,18 @@
msg_Dbg
(
p_intf
,
"dialog cancelled"
);
}
-
(
IBAction
)
okayAndClose
:(
id
)
sender
{
msg_Dbg
(
p_intf
,
"dialog's okay btn pressed, returning values"
);
vlc_mutex_lock
(
&
p_dialog
->
p_interaction
->
object_lock
);
if
(
p_dialog
->
i_flags
==
DIALOG_LOGIN_PW_OK_CANCEL
)
{
p_dialog
->
psz_returned
[
0
]
=
strdup
(
[[
o_auth_login_fld
stringValue
]
UTF8String
]
);
p_dialog
->
psz_returned
[
1
]
=
strdup
(
[[
o_auth_pw_fld
stringValue
]
UTF8String
]
);
}
p_dialog
->
i_return
=
DIALOG_OK_YES
;
p_dialog
->
i_status
=
ANSWERED_DIALOG
;
vlc_mutex_unlock
(
&
p_dialog
->
p_interaction
->
object_lock
);
}
@end
src/interface/interaction.c
View file @
4db8257a
...
...
@@ -5,6 +5,7 @@
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
* Felix Kühne <fkuehne@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
...
...
@@ -406,47 +407,24 @@ int __intf_UserLoginPassword( vlc_object_t *p_this,
char
**
ppsz_login
,
char
**
ppsz_password
)
{
int
i_ret
;
interaction_dialog_t
*
p_new
=
NULL
;
user_widget_t
*
p_widget
=
NULL
;
INTERACT_INIT
(
p_new
);
p_new
->
i_type
=
INTERACT_DIALOG_TWOWAY
;
p_new
->
psz_title
=
strdup
(
psz_title
);
p_new
->
psz_description
=
strdup
(
psz_description
);
/* Text */
p_widget
=
(
user_widget_t
*
)
malloc
(
sizeof
(
user_widget_t
)
);
p_widget
->
i_type
=
WIDGET_TEXT
;
p_widget
->
psz_text
=
strdup
(
psz_description
);
p_widget
->
val
.
psz_string
=
NULL
;
INSERT_ELEM
(
p_new
->
pp_widgets
,
p_new
->
i_widgets
,
p_new
->
i_widgets
,
p_widget
);
/* Login */
p_widget
=
(
user_widget_t
*
)
malloc
(
sizeof
(
user_widget_t
)
);
p_widget
->
i_type
=
WIDGET_INPUT_TEXT
;
p_widget
->
psz_text
=
strdup
(
_
(
"Login"
)
);
p_widget
->
val
.
psz_string
=
NULL
;
INSERT_ELEM
(
p_new
->
pp_widgets
,
p_new
->
i_widgets
,
p_new
->
i_widgets
,
p_widget
);
/* Password */
p_widget
=
(
user_widget_t
*
)
malloc
(
sizeof
(
user_widget_t
)
);
p_widget
->
i_type
=
WIDGET_INPUT_TEXT
;
p_widget
->
psz_text
=
strdup
(
_
(
"Password"
)
);
p_widget
->
val
.
psz_string
=
NULL
;
INSERT_ELEM
(
p_new
->
pp_widgets
,
p_new
->
i_widgets
,
p_new
->
i_widgets
,
p_widget
);
p_new
->
i_flags
=
DIALOG_OK_CANCEL
;
p_new
->
i_flags
=
DIALOG_LOGIN_PW_OK_CANCEL
;
i_ret
=
intf_Interact
(
p_this
,
p_new
);
if
(
i_ret
!=
DIALOG_CANCELLED
)
{
*
ppsz_login
=
strdup
(
p_new
->
p
p_widgets
[
1
]
->
val
.
psz_string
);
*
ppsz_password
=
strdup
(
p_new
->
p
p_widgets
[
2
]
->
val
.
psz_string
);
*
ppsz_login
=
strdup
(
p_new
->
p
sz_returned
[
0
]
);
*
ppsz_password
=
strdup
(
p_new
->
p
sz_returned
[
1
]
);
}
return
i_ret
;
}
...
...
@@ -671,6 +649,9 @@ static void intf_InteractionDialogDestroy( interaction_dialog_t *p_dialog )
}
FREE
(
p_dialog
->
psz_title
);
FREE
(
p_dialog
->
psz_description
);
FREE
(
p_dialog
->
psz_returned
[
0
]
);
FREE
(
p_dialog
->
psz_returned
[
1
]
);
free
(
p_dialog
);
}
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