const char *cancel;
/* Permanent parameters */
vlc_mutex_t lock;
- void (*pf_update) (void *, float);
+ void (*pf_update) (void *, const char *, float);
bool (*pf_check) (void *);
void (*pf_destroy) (void *);
void *p_sys;
#define dialog_ProgressCreate(o, t, m, c) \
dialog_ProgressCreate(VLC_OBJECT(o), t, m, c)
VLC_EXPORT( void, dialog_ProgressDestroy, (dialog_progress_bar_t *) );
-VLC_EXPORT( void, dialog_ProgressSet, (dialog_progress_bar_t *, float) );
+VLC_EXPORT( void, dialog_ProgressSet, (dialog_progress_bar_t *, const char *, float) );
VLC_EXPORT( bool, dialog_ProgressCancelled, (dialog_progress_bar_t *) );
VLC_EXPORT( int, dialog_Register, (vlc_object_t *) );
if( p_scan->p_dialog == NULL )
p_scan->p_dialog = dialog_ProgressCreate( p_scan->p_obj, _("Scanning DVB-T"), psz_text, _("Cancel") );
if( p_scan->p_dialog != NULL )
- /* FIXME: update text, not just percentage */
- dialog_ProgressSet( p_scan->p_dialog, /*psz_text, */100 * f_position );
+ dialog_ProgressSet( p_scan->p_dialog, psz_text, 100 * f_position );
free( psz_text );
}
double f_pos = 100.0 * stream_Tell( p_demux->s ) /
stream_Size( p_demux->s );
- dialog_ProgressSet( p_dialog, f_pos );
+ dialog_ProgressSet( p_dialog, NULL, f_pos );
i_dialog_update = mdate();
}
setMinimumDuration (0);
connect (this, SIGNAL(progressed(int)), SLOT(setValue(int)));
+ connect (this, SIGNAL(described(const QString&)),
+ SLOT(setLabelText(const QString&)));
connect (this, SIGNAL(canceled(void)), SLOT(saveCancel(void)));
data->pf_update = update;
{
}
-void QVLCProgressDialog::update (void *priv, float value)
+void QVLCProgressDialog::update (void *priv, const char *text, float value)
{
QVLCProgressDialog *self = static_cast<QVLCProgressDialog *>(priv);
+
+ if (text != NULL)
+ emit self->described (qfu(text));
emit self->progressed ((int)(value * 1000.));
}
DialogHandler *handler;
bool cancelled;
- static void update (void *, float);
+ static void update (void *, const char *, float);
static bool check (void *);
static void destroy (void *);
private slots:
signals:
void progressed (int);
+ void described (const QString&);
void destroyed (void);
};
free (dialog);
}
-void dialog_ProgressSet (dialog_progress_bar_t *dialog, float value)
+void dialog_ProgressSet (dialog_progress_bar_t *dialog, const char *text,
+ float value)
{
assert (dialog);
- dialog->pf_update (dialog->p_sys, value);
+ dialog->pf_update (dialog->p_sys, text, value);
}
bool dialog_ProgressCancelled (dialog_progress_bar_t *dialog)
p_update->release.psz_url, psz_downloaded, psz_size,
f_progress ) != -1 )
{
- dialog_ProgressSet( p_progress, /*FIXME psz_status,*/ f_progress );
+ dialog_ProgressSet( p_progress, psz_status, f_progress );
free( psz_status );
}
free( psz_downloaded );