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
8bc7546a
Commit
8bc7546a
authored
Dec 07, 2005
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve dialogs handling
parent
1003427e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
30 deletions
+72
-30
include/vlc_interaction.h
include/vlc_interaction.h
+15
-3
modules/gui/wxwidgets/interface.cpp
modules/gui/wxwidgets/interface.cpp
+15
-0
src/interface/interaction.c
src/interface/interaction.c
+42
-27
No files found.
include/vlc_interaction.h
View file @
8bc7546a
...
...
@@ -56,12 +56,23 @@ struct interaction_dialog_t
int
i_widgets
;
//< Nu,ber of dialog widgets
user_widget_t
**
pp_widgets
;
//< Dialog widgets
vlc_bool_t
b_have_answer
;
//< Has an answer been given ?
vlc_bool_t
b_reusable
;
//< Do we have to reuse this ?
vlc_bool_t
b_updated
;
//< Update for this one ?
vlc_bool_t
b_finished
;
//< Hidden by interface
void
*
p_private
;
//< Private interface data
int
i_status
;
//< Dialog status;
};
/**
* Possible status
*/
enum
{
NEW_DIALOG
,
SENT_DIALOG
,
UPDATED_DIALOG
,
ANSWERED_DIALOG
,
HIDING_DIALOG
,
HIDDEN_DIALOG
,
};
/**
...
...
@@ -81,6 +92,7 @@ enum
*/
enum
{
DIALOG_FIRST
,
DIALOG_NOACCESS
,
DIALOG_NOCODEC
,
DIALOG_NOAUDIO
,
...
...
modules/gui/wxwidgets/interface.cpp
View file @
8bc7546a
...
...
@@ -62,6 +62,11 @@
#include "../../../share/vlc16x16.xpm"
#endif
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static
int
DoInteract
(
intf_thread_t
*
,
interaction_dialog_t
*
,
int
);
/*****************************************************************************
* Local class declarations.
*****************************************************************************/
...
...
@@ -335,6 +340,8 @@ Interface::Interface( intf_thread_t *_p_intf, long style ):
extra_frame
=
0
;
playlist_manager
=
0
;
p_intf
->
pf_interact
=
DoInteract
;
/* Give our interface a nice little icon */
SetIcon
(
wxIcon
(
vlc_xpm
)
);
...
...
@@ -1155,6 +1162,14 @@ void Interface::TogglePlayButton( int i_playing_status )
GetToolBar
()
->
ToggleTool
(
PlayStream_Event
,
false
);
}
static
int
DoInteract
(
intf_thread_t
*
,
interaction_dialog_t
*
,
int
)
{
fprintf
(
stderr
,
"Doing interaction
\n
"
);
}
#if wxUSE_DRAG_AND_DROP
/*****************************************************************************
* Definition of DragAndDrop class.
...
...
src/interface/interaction.c
View file @
8bc7546a
...
...
@@ -125,32 +125,41 @@ void intf_InteractionManage( playlist_t *p_playlist )
{
interaction_dialog_t
*
p_dialog
=
p_interaction
->
pp_dialogs
[
i_index
];
if
(
p_dialog
->
b_have_answer
)
switch
(
p_dialog
->
i_status
)
{
case
ANSWERED_DIALOG
:
/// \todo Signal we have an answer
// - If have answer, signal what is waiting
// (vlc_cond ? dangerous in case of pb ?)
// Ask interface to hide it
msg_Dbg
(
p_interaction
,
"Hiding dialog %i"
,
p_dialog
->
i_id
);
p_interaction
->
p_intf
->
pf_interact
(
p_interaction
->
p_intf
,
p_dialog
,
INTERACT_HIDE
);
}
if
(
p_dialog
->
b_updated
)
{
p_dialog
->
b_finished
=
VLC_FALSE
;
p_dialog
->
i_status
=
HIDING_DIALOG
;
break
;
case
UPDATED_DIALOG
:
p_interaction
->
p_intf
->
pf_interact
(
p_interaction
->
p_intf
,
p_dialog
,
INTERACT_UPDATE
);
}
if
(
p_dialog
->
b_finished
&&
!
p_dialog
->
b_reusable
)
p_dialog
->
i_status
=
SENT_DIALOG
;
msg_Dbg
(
p_interaction
,
"Updating dialog %i, %i widgets"
,
p_dialog
->
i_id
,
p_dialog
->
i_widgets
);
break
;
case
HIDDEN_DIALOG
:
if
(
!
p_dialog
->
b_reusable
)
{
/// \todo Destroy the dialog
}
break
;
case
NEW_DIALOG
:
// This is truly a new dialog, send it.
p_interaction
->
p_intf
->
pf_interact
(
p_interaction
->
p_intf
,
p_dialog
,
INTERACT_NEW
);
msg_Dbg
(
p_interaction
,
"Creating dialog %i, %i widgets"
,
p_dialog
->
i_id
,
p_dialog
->
i_widgets
);
p_dialog
->
i_status
=
SENT_DIALOG
;
break
;
}
}
vlc_object_release
(
p_interaction
->
p_intf
);
...
...
@@ -167,7 +176,8 @@ void intf_InteractionManage( playlist_t *p_playlist )
new->pp_widgets = NULL; \
new->psz_title = NULL; \
new->psz_description = NULL; \
new->i_id = 0;
new->i_id = 0; \
new->i_status = NEW_DIALOG;
#define INTERACT_FREE( new ) \
if( new->psz_title ) free( new->psz_title ); \
...
...
@@ -194,6 +204,11 @@ void __intf_UserFatal( vlc_object_t *p_this, int i_id,
if
(
!
p_new
)
{
INTERACT_INIT
(
p_new
);
if
(
i_id
>
0
)
p_new
->
i_id
=
i_id
;
}
else
{
p_new
->
i_status
=
UPDATED_DIALOG
;
}
p_new
->
i_type
=
INTERACT_FATAL
;
...
...
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