char *psz_returned[1]; ///< returned responses from the user
+ vlc_value_t val; ///< a value coming from core for dialogue
+
int i_widgets; ///< Number of dialog widgets
user_widget_t **pp_widgets; ///< Dialog widgets
#define DIALOG_CLEAR_NOSHOW 0x08
#define DIALOG_GOT_ANSWER 0x10
#define DIALOG_LOGIN_PW_OK_CANCEL 0x20
+#define DIALOG_USER_PROGRESS 0x40
/**
* Possible return codes
modalDelegate: self didEndSelector: nil contextInfo: nil];
[o_auth_win makeKeyWindow];
}
- else if( p_dialog->i_type & WIDGET_PROGRESS )
+ else if( p_dialog->i_flags & DIALOG_USER_PROGRESS )
{
- msg_Dbg( p_intf, "requested type: WIDGET_PROGRESS" );
+ msg_Dbg( p_intf, "requested flag: DIALOG_USER_PROGRESS" );
[o_prog_title setStringValue: o_title];
[o_prog_description setStringValue: o_description];
[o_prog_bar setDoubleValue: 0];
int i = 0;
for( i = 0 ; i< p_dialog->i_widgets; i++ )
{
- if( p_dialog->i_type & WIDGET_PROGRESS )
+ if( p_dialog->i_flags & DIALOG_USER_PROGRESS )
{
+ [o_prog_description setStringValue: \
+ [NSString stringWithUTF8String: p_dialog->psz_description]];
[o_prog_bar setDoubleValue: \
- (double)(p_dialog->pp_widgets[i]->val.f_float)];
+ (double)(p_dialog->val.f_float)];
if( [o_prog_bar doubleValue] == 100.0 )
{
-(void)hideDialog
{
msg_Dbg( p_intf, "hide event" );
- if( p_dialog->i_type & WIDGET_PROGRESS )
+ if( p_dialog->i_flags & DIALOG_USER_PROGRESS )
{
[NSApp endSheet: o_prog_win];
[o_prog_win close];
{
int i_ret;
interaction_dialog_t *p_new = NULL;
- user_widget_t *p_widget = NULL;
INTERACT_INIT( p_new );
p_new->i_type = INTERACT_DIALOG_ONEWAY;
p_new->psz_title = strdup( psz_title );
+ p_new->psz_description = strdup( psz_status );
+ p_new->val.f_float = f_pos;
- /* Progress bar */
- p_widget = (user_widget_t* )malloc( sizeof( user_widget_t ) );
- p_widget->i_type = WIDGET_PROGRESS;
- p_widget->psz_text = strdup( psz_status );
- p_widget->val.f_float = f_pos;
- INSERT_ELEM ( p_new->pp_widgets, p_new->i_widgets,
- p_new->i_widgets, p_widget );
+ p_new->i_flags = DIALOG_USER_PROGRESS;
i_ret = intf_Interact( p_this, p_new );
return;
}
- if( p_dialog->pp_widgets[0]->psz_text )
- free( p_dialog->pp_widgets[0]->psz_text );
- p_dialog->pp_widgets[0]->psz_text = strdup( psz_status );
+ if( p_dialog->psz_description )
+ free( p_dialog->psz_description );
+ p_dialog->psz_description = strdup( psz_status );
- p_dialog->pp_widgets[0]->val.f_float = f_pos;
+ p_dialog->val.f_float = f_pos;
p_dialog->i_status = UPDATED_DIALOG;
vlc_mutex_unlock( &p_interaction->object_lock) ;