Commit c50d31d8 authored by Thomas Guillem's avatar Thomas Guillem

dialog: add new dialog API

- vlc_dialog_wait_question will replace dialog_Question

- vlc_dialog_wait_question with i_type == VLC_DIALOG_QUESTION_CRITICAL and
  without action1/action2 will replace dialog_FatalWait

- vlc_dialog_wait_login will replace dialog_Login

- vlc_dialog_display_progress will replace dialog_Progress

- dialog_Fatal is replaced by vlc_dialog_display_error

- vlc_dialog_display_error will replace dialog_Fatal

- vlc_ext_dialog_update will repalace dialog_ExtensionUpdate

- vlc_dialog_wait_question and vlc_dialog_wait_login are interruptible via
  vlc_interrupt.

- Nothing prevents to have more than one dialog type displayed at a time.
parent 9d1b941b
This diff is collapsed.
...@@ -41,6 +41,8 @@ struct vlc_object_t ...@@ -41,6 +41,8 @@ struct vlc_object_t
VLC_COMMON_MEMBERS VLC_COMMON_MEMBERS
}; };
typedef struct vlc_dialog_provider vlc_dialog_provider;
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
......
This diff is collapsed.
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
#include <vlc_interface.h> #include <vlc_interface.h>
#include <vlc_charset.h> #include <vlc_charset.h>
#include <vlc_dialog.h>
#include <vlc_fs.h> #include <vlc_fs.h>
#include <vlc_cpu.h> #include <vlc_cpu.h>
#include <vlc_url.h> #include <vlc_url.h>
...@@ -235,6 +236,14 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, ...@@ -235,6 +236,14 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
} }
#endif #endif
priv->p_dialog_provider = vlc_dialog_provider_new();
if( priv->p_dialog_provider == NULL )
{
vlc_LogDeinit (p_libvlc);
module_EndBank (true);
return VLC_ENOMEM;
}
/* FIXME: could be replaced by using Unix sockets */ /* FIXME: could be replaced by using Unix sockets */
#ifdef HAVE_DBUS #ifdef HAVE_DBUS
...@@ -503,6 +512,8 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc ) ...@@ -503,6 +512,8 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
libvlc_Quit( p_libvlc ); libvlc_Quit( p_libvlc );
intf_DestroyAll( p_libvlc ); intf_DestroyAll( p_libvlc );
vlc_dialog_provider_release( priv->p_dialog_provider );
#ifdef ENABLE_VLM #ifdef ENABLE_VLM
/* Destroy VLM if created in libvlc_InternalInit */ /* Destroy VLM if created in libvlc_InternalInit */
if( priv->p_vlm ) if( priv->p_vlm )
......
...@@ -138,6 +138,8 @@ module_t *module_find_by_shortcut (const char *psz_shortcut); ...@@ -138,6 +138,8 @@ module_t *module_find_by_shortcut (const char *psz_shortcut);
/** /**
* Private LibVLC instance data. * Private LibVLC instance data.
*/ */
typedef struct vlc_dialog_provider vlc_dialog_provider;
typedef struct libvlc_priv_t typedef struct libvlc_priv_t
{ {
libvlc_int_t public_data; libvlc_int_t public_data;
...@@ -149,6 +151,7 @@ typedef struct libvlc_priv_t ...@@ -149,6 +151,7 @@ typedef struct libvlc_priv_t
vlc_logger_t *logger; vlc_logger_t *logger;
vlm_t *p_vlm; ///< the VLM singleton (or NULL) vlm_t *p_vlm; ///< the VLM singleton (or NULL)
vlc_object_t *p_legacy_dialog_provider; ///< dialog provider vlc_object_t *p_legacy_dialog_provider; ///< dialog provider
vlc_dialog_provider *p_dialog_provider; ///< dialog provider
struct playlist_t *playlist; ///< Playlist for interfaces struct playlist_t *playlist; ///< Playlist for interfaces
struct playlist_preparser_t *parser; ///< Input item meta data handler struct playlist_preparser_t *parser; ///< Input item meta data handler
struct vlc_actions *actions; ///< Hotkeys handler struct vlc_actions *actions; ///< Hotkeys handler
......
...@@ -526,6 +526,29 @@ vlc_credential_init ...@@ -526,6 +526,29 @@ vlc_credential_init
vlc_credential_clean vlc_credential_clean
vlc_credential_get vlc_credential_get
vlc_credential_store vlc_credential_store
vlc_dialog_display_error
vlc_dialog_display_error_va
vlc_dialog_display_progress
vlc_dialog_display_progress_va
vlc_dialog_id_dismiss
vlc_dialog_id_get_context
vlc_dialog_id_post_action
vlc_dialog_id_post_login
vlc_dialog_id_set_context
vlc_dialog_is_cancelled
vlc_dialog_provider_new
vlc_dialog_provider_release
vlc_dialog_provider_set_callbacks
vlc_dialog_provider_set_ext_callback
vlc_dialog_release
vlc_dialog_update_progress
vlc_dialog_update_progress_text
vlc_dialog_update_progress_text_va
vlc_dialog_wait_login
vlc_dialog_wait_login_va
vlc_dialog_wait_question
vlc_dialog_wait_question_va
vlc_ext_dialog_update
vlc_sem_init vlc_sem_init
vlc_sem_destroy vlc_sem_destroy
vlc_sem_post vlc_sem_post
......
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