Commit 18859359 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Win32: hopefully improve the fontconfig cache display

(cherry picked from commit eed5cd17bb72639923faf541cc697467786adc2f)
(cherry picked from commit 7240444db88efabeea7e85310864f6b48c19537e)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent b2096f74
...@@ -183,13 +183,18 @@ void DialogHandler::requestAnswer (vlc_object_t *, void *value) ...@@ -183,13 +183,18 @@ void DialogHandler::requestAnswer (vlc_object_t *, void *value)
QVLCProgressDialog::QVLCProgressDialog (DialogHandler *parent, QVLCProgressDialog::QVLCProgressDialog (DialogHandler *parent,
struct dialog_progress_bar_t *data) struct dialog_progress_bar_t *data)
: QProgressDialog (qfu(data->message), : QProgressDialog ( ),
data->cancel ? ("&" + qfu(data->cancel)) : 0, 0, 1000),
handler (parent), handler (parent),
cancelled (false) cancelled (false)
{ {
setLabelText( qfu(data->message) );
setRange( 0, 0 );
if( data->cancel )
setCancelButton( new QPushButton( "&" + qfu(data->cancel) ) );
if (data->title != NULL) if (data->title != NULL)
setWindowTitle (qfu(data->title)); setWindowTitle (qfu(data->title));
setWindowRole ("vlc-progress"); setWindowRole ("vlc-progress");
setMinimumDuration (300); setMinimumDuration (300);
setValue( 0 ); setValue( 0 );
...@@ -205,14 +210,12 @@ QVLCProgressDialog::QVLCProgressDialog (DialogHandler *parent, ...@@ -205,14 +210,12 @@ QVLCProgressDialog::QVLCProgressDialog (DialogHandler *parent,
data->p_sys = this; data->p_sys = this;
} }
QVLCProgressDialog::~QVLCProgressDialog (void)
{
}
void QVLCProgressDialog::update (void *priv, const char *text, float value) void QVLCProgressDialog::update (void *priv, const char *text, float value)
{ {
QVLCProgressDialog *self = static_cast<QVLCProgressDialog *>(priv); QVLCProgressDialog *self = static_cast<QVLCProgressDialog *>(priv);
if( value > 0 )
self->setRange( 0, 1000 );
if (text != NULL) if (text != NULL)
emit self->described (qfu(text)); emit self->described (qfu(text));
emit self->progressed ((int)(value * 1000.)); emit self->progressed ((int)(value * 1000.));
...@@ -245,6 +248,7 @@ void DialogHandler::startProgressBar (vlc_object_t *, void *value) ...@@ -245,6 +248,7 @@ void DialogHandler::startProgressBar (vlc_object_t *, void *value)
dialog_progress_bar_t *data = (dialog_progress_bar_t *)value; dialog_progress_bar_t *data = (dialog_progress_bar_t *)value;
QWidget *dlg = new QVLCProgressDialog (this, data); QWidget *dlg = new QVLCProgressDialog (this, data);
QTimer::singleShot( 300, dlg, SLOT( show() ) );
// dlg->show (); // dlg->show ();
} }
......
...@@ -68,8 +68,6 @@ class QVLCProgressDialog : public QProgressDialog ...@@ -68,8 +68,6 @@ class QVLCProgressDialog : public QProgressDialog
public: public:
QVLCProgressDialog (DialogHandler *parent, QVLCProgressDialog (DialogHandler *parent,
struct dialog_progress_bar_t *); struct dialog_progress_bar_t *);
virtual ~QVLCProgressDialog (void);
private: private:
DialogHandler *handler; DialogHandler *handler;
bool cancelled; bool cancelled;
......
...@@ -359,8 +359,8 @@ static int Create( vlc_object_t *p_this ) ...@@ -359,8 +359,8 @@ static int Create( vlc_object_t *p_this )
_("Please wait while your font cache is rebuilt.\n" _("Please wait while your font cache is rebuilt.\n"
"This should take less than a few minutes."), NULL ); "This should take less than a few minutes."), NULL );
if( p_dialog ) /* if( p_dialog )
dialog_ProgressSet( p_dialog, NULL, 0.5 ); dialog_ProgressSet( p_dialog, NULL, 0.5 ); */
FcConfigBuildFonts( fcConfig ); FcConfigBuildFonts( fcConfig );
t2 = mdate(); t2 = mdate();
...@@ -368,7 +368,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -368,7 +368,7 @@ static int Create( vlc_object_t *p_this )
if( p_dialog ) if( p_dialog )
{ {
dialog_ProgressSet( p_dialog, NULL, 1.0 ); // dialog_ProgressSet( p_dialog, NULL, 1.0 );
dialog_ProgressDestroy( p_dialog ); dialog_ProgressDestroy( p_dialog );
p_dialog = NULL; p_dialog = NULL;
} }
......
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