[vlc-commits] Qt: implement new ext dialog callback
Thomas Guillem
git at videolan.org
Thu Feb 4 15:28:05 CET 2016
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Feb 4 13:23:17 2016 +0100| [2efce84f08558d551263723ac2b0b941b5d7b9d6] | committer: Thomas Guillem
Qt: implement new ext dialog callback
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2efce84f08558d551263723ac2b0b941b5d7b9d6
---
modules/gui/qt4/dialogs/extensions.cpp | 32 +++++++++-----------------------
1 file changed, 9 insertions(+), 23 deletions(-)
diff --git a/modules/gui/qt4/dialogs/extensions.cpp b/modules/gui/qt4/dialogs/extensions.cpp
index ea82bdb..f7a68af 100644
--- a/modules/gui/qt4/dialogs/extensions.cpp
+++ b/modules/gui/qt4/dialogs/extensions.cpp
@@ -43,19 +43,15 @@
ExtensionsDialogProvider *ExtensionsDialogProvider::instance = NULL;
-static int DialogCallback( vlc_object_t *p_this, const char *psz_variable,
- vlc_value_t old_val, vlc_value_t new_val,
- void *param );
+static void DialogCallback( extension_dialog_t *p_ext_dialog,
+ void *p_data );
ExtensionsDialogProvider::ExtensionsDialogProvider( intf_thread_t *_p_intf,
extensions_manager_t *p_mgr )
: QObject( NULL ), p_intf( _p_intf ), p_extensions_manager( p_mgr )
{
- // At this point, we consider that the Qt interface already called
- // dialog_Register() in order to be the extension dialog provider
- var_Create( p_intf, "dialog-extension", VLC_VAR_ADDRESS );
- var_AddCallback( p_intf, "dialog-extension", DialogCallback, NULL );
+ vlc_dialog_provider_set_ext_callback( p_intf, DialogCallback, NULL );
CONNECT( this, SignalDialog( extension_dialog_t* ),
this, UpdateExtDialog( extension_dialog_t* ) );
@@ -64,7 +60,7 @@ ExtensionsDialogProvider::ExtensionsDialogProvider( intf_thread_t *_p_intf,
ExtensionsDialogProvider::~ExtensionsDialogProvider()
{
msg_Dbg( p_intf, "ExtensionsDialogProvider is quitting..." );
- var_DelCallback( p_intf, "dialog-extension", DialogCallback, NULL );
+ vlc_dialog_provider_set_ext_callback( p_intf, NULL, NULL );
}
/** Create a dialog
@@ -154,24 +150,14 @@ void ExtensionsDialogProvider::ManageDialog( extension_dialog_t *p_dialog )
/**
* Ask the dialogs provider to create a new dialog
**/
-static int DialogCallback( vlc_object_t *p_this, const char *psz_variable,
- vlc_value_t old_val, vlc_value_t new_val,
- void *param )
+static void DialogCallback( extension_dialog_t *p_ext_dialog,
+ void *p_data )
{
- (void) p_this;
- (void) psz_variable;
- (void) old_val;
- (void) param;
+ (void) p_data;
ExtensionsDialogProvider *p_edp = ExtensionsDialogProvider::getInstance();
- if( !p_edp )
- return VLC_EGENERIC;
- if( !new_val.p_address )
- return VLC_EGENERIC;
-
- extension_dialog_t *p_dialog = ( extension_dialog_t* ) new_val.p_address;
- p_edp->ManageDialog( p_dialog );
- return VLC_SUCCESS;
+ if( p_edp )
+ p_edp->ManageDialog( p_ext_dialog );
}
More information about the vlc-commits
mailing list