]> git.sesse.net Git - vlc/commitdiff
Qt: external progressBar, simplification for win32 style
authorJean-Baptiste Kempf <jb@videolan.org>
Tue, 15 Jun 2010 22:44:37 +0000 (00:44 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 15 Jun 2010 22:44:37 +0000 (00:44 +0200)
modules/gui/qt4/dialogs/external.cpp
modules/gui/qt4/dialogs/external.hpp

index f51645d85ce878696dc9c6a1a0e8eb4a514cfcfd..9e86da874f443ebf11d17d08b83f966064ebddd2 100644 (file)
@@ -183,11 +183,15 @@ void DialogHandler::requestAnswer (vlc_object_t *, void *value)
 
 QVLCProgressDialog::QVLCProgressDialog (DialogHandler *parent,
                                         struct dialog_progress_bar_t *data)
-    : QProgressDialog (qfu(data->message),
-                       data->cancel ? ("&" + qfu(data->cancel)) : 0, 0, 1000),
+    : QProgressDialog ( ),
       handler (parent),
       cancelled (false)
 {
+    setLabelText( qfu(data->message) );
+    setRange( 0, 0 );
+
+    if( data->cancel )
+        setCancelButton( new QPushButton( "&" + qfu(data->cancel) ) );
     if (data->title != NULL)
         setWindowTitle (qfu(data->title));
     setWindowRole ("vlc-progress");
@@ -205,14 +209,12 @@ QVLCProgressDialog::QVLCProgressDialog (DialogHandler *parent,
     data->p_sys = this;
 }
 
-QVLCProgressDialog::~QVLCProgressDialog (void)
-{
-}
 
 void QVLCProgressDialog::update (void *priv, const char *text, float value)
 {
     QVLCProgressDialog *self = static_cast<QVLCProgressDialog *>(priv);
-
+    if( value > 0 )
+        self->setRange( 0, 1000 );
     if (text != NULL)
         emit self->described (qfu(text));
     emit self->progressed ((int)(value * 1000.));
index 250842e73163561b69e50e9bf7e9b942ab405f54..44b0a2a3da77b3232e28c0d52728f989343275cb 100644 (file)
@@ -68,8 +68,6 @@ class QVLCProgressDialog : public QProgressDialog
 public:
     QVLCProgressDialog (DialogHandler *parent,
                         struct dialog_progress_bar_t *);
-    virtual ~QVLCProgressDialog (void);
-
 private:
     DialogHandler *handler;
     bool cancelled;