Commit 24706cde authored by Jean-Philippe André's avatar Jean-Philippe André

Lua dialogs: introduce "dlg:flush()"

After the next commit, you'll have to flush a dialog in order to
update it immediately on the screen.
Flush sends an update signal to the UI dialog provider.
parent dfaef0e6
...@@ -52,6 +52,7 @@ static int vlclua_dialog_create( lua_State *L ); ...@@ -52,6 +52,7 @@ static int vlclua_dialog_create( lua_State *L );
static int vlclua_dialog_delete( lua_State *L ); static int vlclua_dialog_delete( lua_State *L );
static int vlclua_dialog_show( lua_State *L ); static int vlclua_dialog_show( lua_State *L );
static int vlclua_dialog_hide( lua_State *L ); static int vlclua_dialog_hide( lua_State *L );
static int vlclua_dialog_flush( lua_State *L );
static int vlclua_dialog_add_button( lua_State *L ); static int vlclua_dialog_add_button( lua_State *L );
static int vlclua_dialog_add_label( lua_State *L ); static int vlclua_dialog_add_label( lua_State *L );
...@@ -98,6 +99,7 @@ static const luaL_Reg vlclua_dialog_reg[] = { ...@@ -98,6 +99,7 @@ static const luaL_Reg vlclua_dialog_reg[] = {
{ "show", vlclua_dialog_show }, { "show", vlclua_dialog_show },
{ "hide", vlclua_dialog_hide }, { "hide", vlclua_dialog_hide },
{ "close", vlclua_dialog_delete }, { "close", vlclua_dialog_delete },
{ "flush", vlclua_dialog_flush },
{ "add_button", vlclua_dialog_add_button }, { "add_button", vlclua_dialog_add_button },
{ "add_label", vlclua_dialog_add_label }, { "add_label", vlclua_dialog_add_label },
...@@ -311,6 +313,22 @@ static int vlclua_dialog_hide( lua_State *L ) ...@@ -311,6 +313,22 @@ static int vlclua_dialog_hide( lua_State *L )
} }
/** Flush the dialog */
static int vlclua_dialog_flush( lua_State *L )
{
vlc_object_t *p_mgr = vlclua_get_this( L );
extension_dialog_t **pp_dlg =
(extension_dialog_t**) luaL_checkudata( L, 1, "dialog" );
if( !pp_dlg || !*pp_dlg )
return luaL_error( L, "Can't get pointer to dialog" );
extension_dialog_t *p_dlg = *pp_dlg;
dialog_ExtensionUpdate( p_mgr, p_dlg );
return 1;
}
/** /**
* Create a button: add_button * Create a button: add_button
* Arguments: text, function (as string) * Arguments: text, function (as string)
......
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