Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
3fbfb3d4
Commit
3fbfb3d4
authored
Dec 11, 2005
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle removal
Improve non-handling by interfaces without interaction
parent
59a8d434
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
75 additions
and
15 deletions
+75
-15
modules/gui/wxwidgets/dialogs.cpp
modules/gui/wxwidgets/dialogs.cpp
+6
-1
modules/gui/wxwidgets/dialogs/interaction.cpp
modules/gui/wxwidgets/dialogs/interaction.cpp
+3
-1
modules/gui/wxwidgets/dialogs/interaction.hpp
modules/gui/wxwidgets/dialogs/interaction.hpp
+1
-0
modules/gui/wxwidgets/interface.cpp
modules/gui/wxwidgets/interface.cpp
+0
-7
src/interface/interaction.c
src/interface/interaction.c
+60
-6
src/playlist/playlist.c
src/playlist/playlist.c
+5
-0
No files found.
modules/gui/wxwidgets/dialogs.cpp
View file @
3fbfb3d4
...
...
@@ -549,7 +549,6 @@ void DialogsProvider::OnInteraction( wxCommandEvent& event )
}
p_dialog
=
p_arg
->
p_dialog
;
/** \bug We store the interface object for the dialog in the p_private
* field of the core dialog object. This is not safe if we change
* interface while a dialog is loaded */
...
...
@@ -568,6 +567,12 @@ void DialogsProvider::OnInteraction( wxCommandEvent& event )
case
INTERACT_HIDE
:
p_wxdialog
=
(
InteractionDialog
*
)(
p_dialog
->
p_private
);
p_wxdialog
->
Hide
();
p_dialog
->
i_status
=
HIDDEN_DIALOG
;
break
;
case
INTERACT_DESTROY
:
p_wxdialog
=
(
InteractionDialog
*
)(
p_dialog
->
p_private
);
/// \todo
p_dialog
->
i_status
=
DESTROYED_DIALOG
;
break
;
}
}
modules/gui/wxwidgets/dialogs/interaction.cpp
View file @
3fbfb3d4
...
...
@@ -118,6 +118,7 @@ void InteractionDialog::Render()
InputWidget
widget
;
widget
.
control
=
input
;
widget
.
val
=
&
p_widget
->
val
;
widget
.
i_type
=
WIDGET_INPUT_TEXT
;
input_widgets
.
push_back
(
widget
);
}
}
...
...
@@ -167,7 +168,8 @@ void InteractionDialog::Finish( int i_ret )
vector
<
InputWidget
>::
iterator
it
=
input_widgets
.
begin
();
while
(
it
<
input_widgets
.
end
()
)
{
(
*
it
).
val
->
psz_string
=
strdup
(
(
*
it
).
control
->
GetValue
().
mb_str
()
);
if
(
(
*
it
).
i_type
==
WIDGET_INPUT_TEXT
)
(
*
it
).
val
->
psz_string
=
strdup
(
(
*
it
).
control
->
GetValue
().
mb_str
()
);
it
++
;
}
Hide
();
...
...
modules/gui/wxwidgets/dialogs/interaction.hpp
View file @
3fbfb3d4
...
...
@@ -38,6 +38,7 @@ namespace wxvlc
/// \todo Clean up
wxTextCtrl
*
control
;
vlc_value_t
*
val
;
int
i_type
;
};
class
InteractionDialog
:
public
wxFrame
...
...
modules/gui/wxwidgets/interface.cpp
View file @
3fbfb3d4
...
...
@@ -1217,13 +1217,6 @@ static int InteractCallback( vlc_object_t *p_this,
Interface
*
p_interface
=
(
Interface
*
)
param
;
interaction_dialog_t
*
p_dialog
=
(
interaction_dialog_t
*
)(
new_val
.
p_address
);
/// Not handled
if
(
p_dialog
->
i_action
==
INTERACT_HIDE
)
{
p_dialog
->
i_status
=
HIDDEN_DIALOG
;
return
0
;
}
wxCommandEvent
event
(
wxEVT_INTERACTION
,
-
1
);
event
.
SetClientData
(
new_val
.
p_address
);
p_interface
->
AddPendingEvent
(
event
);
...
...
src/interface/interaction.c
View file @
3fbfb3d4
...
...
@@ -52,6 +52,8 @@ static int intf_WaitAnswer( interaction_t *p_interact,
static
int
intf_Send
(
interaction_t
*
p_interact
,
interaction_dialog_t
*
p_dialog
);
static
interaction_dialog_t
*
intf_InteractionGetById
(
vlc_object_t
*
,
int
);
static
void
intf_InteractionDialogDestroy
(
interaction_dialog_t
*
p_dialog
);
/**
* Send an interaction element to the user
...
...
@@ -90,7 +92,18 @@ int __intf_Interact( vlc_object_t *p_this, interaction_dialog_t *
*/
void
intf_InteractionDestroy
(
interaction_t
*
p_interaction
)
{
/// \todo Code this, and call it
int
i
;
// Remove all dialogs - Interfaces must be able to clean up their data
for
(
i
=
p_interaction
->
i_dialogs
-
1
;
i
>=
0
;
i
--
)
{
interaction_dialog_t
*
p_dialog
=
p_interaction
->
pp_dialogs
[
i
];
intf_InteractionDialogDestroy
(
p_dialog
);
REMOVE_ELEM
(
p_interaction
->
pp_dialogs
,
p_interaction
->
i_dialogs
,
i
);
}
vlc_object_destroy
(
p_interaction
);
}
/**
...
...
@@ -121,12 +134,23 @@ void intf_InteractionManage( playlist_t *p_playlist )
for
(
i_index
=
0
;
i_index
<
p_interaction
->
i_dialogs
;
i_index
++
)
{
interaction_dialog_t
*
p_dialog
=
p_interaction
->
pp_dialogs
[
i_index
];
// Give default answer
p_dialog
->
i_return
=
DIALOG_DEFAULT
;
if
(
p_dialog
->
i_flags
&
DIALOG_OK_CANCEL
)
p_dialog
->
i_return
=
DIALOG_CANCELLED
;
if
(
p_dialog
->
i_flags
&
DIALOG_YES_NO_CANCEL
)
p_dialog
->
i_return
=
DIALOG_CANCELLED
;
p_dialog
->
i_status
=
ANSWERED_DIALOG
;
// Pretend we have hidden and destroyed it
if
(
p_dialog
->
i_status
==
HIDDEN_DIALOG
)
{
p_dialog
->
i_status
=
DESTROYED_DIALOG
;
}
else
{
p_dialog
->
i_status
=
HIDING_DIALOG
;
}
}
}
else
...
...
@@ -170,10 +194,14 @@ void intf_InteractionManage( playlist_t *p_playlist )
}
break
;
case
DESTROYED_DIALOG
:
msg_Dbg
(
p_interaction
,
"Removing dialog %i"
,
p_dialog
->
i_id
);
// Interface has now destroyed it, remove it
/// \todo Remove it from the list
/// \todo Free data fields
free
(
p_dialog
);
REMOVE_ELEM
(
p_interaction
->
pp_dialogs
,
p_interaction
->
i_dialogs
,
i_index
);
i_index
--
;
intf_InteractionDialogDestroy
(
p_dialog
);
break
;
case
NEW_DIALOG
:
// This is truly a new dialog, send it.
p_dialog
->
i_action
=
INTERACT_NEW
;
...
...
@@ -203,6 +231,7 @@ void intf_InteractionManage( playlist_t *p_playlist )
new->psz_title = NULL; \
new->psz_description = NULL; \
new->i_id = 0; \
new->i_flags = 0; \
new->i_status = NEW_DIALOG;
#define INTERACT_FREE( new ) \
...
...
@@ -246,6 +275,7 @@ void __intf_UserFatal( vlc_object_t *p_this,
p_widget
=
(
user_widget_t
*
)
malloc
(
sizeof
(
user_widget_t
)
);
p_widget
->
i_type
=
WIDGET_TEXT
;
p_widget
->
val
.
psz_string
=
NULL
;
va_start
(
args
,
psz_format
);
vasprintf
(
&
p_widget
->
psz_text
,
psz_format
,
args
);
...
...
@@ -286,6 +316,7 @@ int __intf_UserLoginPassword( vlc_object_t *p_this,
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
);
...
...
@@ -309,7 +340,7 @@ int __intf_UserLoginPassword( vlc_object_t *p_this,
i_ret
=
intf_Interact
(
p_this
,
p_new
);
if
(
i_ret
==
DIALOG_OK_YES
)
if
(
i_ret
!=
DIALOG_CANCELLED
)
{
*
ppsz_login
=
strdup
(
p_new
->
pp_widgets
[
1
]
->
val
.
psz_string
);
*
ppsz_password
=
strdup
(
p_new
->
pp_widgets
[
2
]
->
val
.
psz_string
);
...
...
@@ -427,6 +458,7 @@ static int intf_WaitAnswer( interaction_t *p_interact, interaction_dialog_t *p_d
/// \todo Check that the initiating object is not dying
while
(
p_dialog
->
i_status
!=
ANSWERED_DIALOG
&&
p_dialog
->
i_status
!=
HIDING_DIALOG
&&
p_dialog
->
i_status
!=
HIDDEN_DIALOG
&&
!
p_dialog
->
p_parent
->
b_die
)
{
msleep
(
100000
);
...
...
@@ -464,6 +496,8 @@ static int intf_Send( interaction_t *p_interact, interaction_dialog_t *p_dialog
}
else
p_dialog
->
i_status
=
UPDATED_DIALOG
;
// Pretend we already retrieved the "answer"
p_dialog
->
i_flags
|=
DIALOG_GOT_ANSWER
;
vlc_mutex_unlock
(
&
p_interact
->
object_lock
);
return
VLC_SUCCESS
;
}
...
...
@@ -486,3 +520,23 @@ static interaction_dialog_t *intf_InteractionGetById( vlc_object_t* p_this,
}
return
NULL
;
}
#define FREE( i ) { if( i ) free( i ); i = NULL; }
static
void
intf_InteractionDialogDestroy
(
interaction_dialog_t
*
p_dialog
)
{
int
i
;
for
(
i
=
p_dialog
->
i_widgets
-
1
;
i
>=
0
;
i
--
)
{
user_widget_t
*
p_widget
=
p_dialog
->
pp_widgets
[
i
];
FREE
(
p_widget
->
psz_text
);
FREE
(
p_widget
->
val
.
psz_string
);
REMOVE_ELEM
(
p_dialog
->
pp_widgets
,
p_dialog
->
i_widgets
,
i
);
free
(
p_widget
);
}
FREE
(
p_dialog
->
psz_title
);
FREE
(
p_dialog
->
psz_description
);
free
(
p_dialog
);
}
src/playlist/playlist.c
View file @
3fbfb3d4
...
...
@@ -237,6 +237,11 @@ int playlist_Destroy( playlist_t * p_playlist )
p_playlist
->
pp_sds
[
0
]
->
psz_module
);
}
if
(
p_playlist
->
p_interaction
)
{
intf_InteractionDestroy
(
p_playlist
->
p_interaction
);
}
vlc_thread_join
(
p_playlist
->
p_preparse
);
vlc_thread_join
(
p_playlist
);
...
...
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