Commit 870a7f04 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - make the difference between DIALOG_USER_PROGRESS &&...

Qt4 - make the difference between DIALOG_USER_PROGRESS && DIALOG_INTF_PROGRESS, like on the Mac intf (not implemented in wx, IIRC) by using a QProgressBar inside the statusBar of the main Interface. Close #475 (longstanding one...)

parent a89f96d8
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "dialogs/errors.hpp" #include "dialogs/errors.hpp"
#include "dialogs/interaction.hpp" #include "dialogs/interaction.hpp"
#include "main_interface.hpp"
#include <QLabel> #include <QLabel>
#include <QLineEdit> #include <QLineEdit>
...@@ -98,8 +99,7 @@ InteractionDialog::InteractionDialog( intf_thread_t *_p_intf, ...@@ -98,8 +99,7 @@ InteractionDialog::InteractionDialog( intf_thread_t *_p_intf,
panel->setLayout( grid ); panel->setLayout( grid );
layout->addWidget( panel ); layout->addWidget( panel );
} }
else if( p_dialog->i_flags & DIALOG_USER_PROGRESS || else if( p_dialog->i_flags & DIALOG_USER_PROGRESS )
/* TEMPORARY ! */ p_dialog->i_flags & DIALOG_INTF_PROGRESS )
{ {
dialog = new QWidget( 0 );layout = new QVBoxLayout( dialog ); dialog = new QWidget( 0 );layout = new QVBoxLayout( dialog );
layout->setMargin( 2 ); layout->setMargin( 2 );
...@@ -112,6 +112,11 @@ InteractionDialog::InteractionDialog( intf_thread_t *_p_intf, ...@@ -112,6 +112,11 @@ InteractionDialog::InteractionDialog( intf_thread_t *_p_intf,
progressBar->setOrientation( Qt::Horizontal ); progressBar->setOrientation( Qt::Horizontal );
layout->addWidget( progressBar ); layout->addWidget( progressBar );
} }
else if( p_dialog->i_flags & DIALOG_INTF_PROGRESS )
{
progressBar = p_intf->p_sys->p_mi->pgBar;
progressBar->show();
}
else if( p_dialog->i_flags & DIALOG_PSZ_INPUT_OK_CANCEL ) else if( p_dialog->i_flags & DIALOG_PSZ_INPUT_OK_CANCEL )
{ {
dialog = new QWidget( 0 );layout = new QVBoxLayout( dialog ); dialog = new QWidget( 0 );layout = new QVBoxLayout( dialog );
...@@ -170,13 +175,18 @@ InteractionDialog::InteractionDialog( intf_thread_t *_p_intf, ...@@ -170,13 +175,18 @@ InteractionDialog::InteractionDialog( intf_thread_t *_p_intf,
void InteractionDialog::update() void InteractionDialog::update()
{ {
if( p_dialog->i_flags & DIALOG_USER_PROGRESS ) if( p_dialog->i_flags & DIALOG_USER_PROGRESS ||
p_dialog->i_flags & DIALOG_INTF_PROGRESS )
{ {
assert( progressBar ); assert( progressBar );
progressBar->setValue( (int)(p_dialog->val.f_float*10) ); progressBar->setValue( (int)( p_dialog->val.f_float * 10 ) );
description->setText( qfu( p_dialog->psz_description ) ); description->setText( qfu( p_dialog->psz_description ) );
msg_Dbg( p_intf, "Setting progress to %i", progressBar->value() ); msg_Dbg( p_intf, "Setting progress to %i", progressBar->value() );
} }
if( ( p_dialog->i_flags & DIALOG_INTF_PROGRESS ) &&
( p_dialog->val.f_float >= 100.0 ) )
progressBar->hide();
} }
InteractionDialog::~InteractionDialog() InteractionDialog::~InteractionDialog()
...@@ -223,3 +233,4 @@ void InteractionDialog::Finish( int i_ret ) ...@@ -223,3 +233,4 @@ void InteractionDialog::Finish( int i_ret )
vlc_mutex_unlock( &p_dialog->p_interaction->object_lock ); vlc_mutex_unlock( &p_dialog->p_interaction->object_lock );
playlist_Signal( THEPL ); playlist_Signal( THEPL );
} }
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#include <QToolBar> #include <QToolBar>
#include <QGroupBox> #include <QGroupBox>
#include <QDate> #include <QDate>
#include <QProgressBar>
#include <assert.h> #include <assert.h>
#include <vlc_keys.h> #include <vlc_keys.h>
...@@ -163,9 +164,13 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -163,9 +164,13 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
speedLabel->setFrameStyle( QFrame::Sunken | QFrame::Panel ); speedLabel->setFrameStyle( QFrame::Sunken | QFrame::Panel );
nameLabel->setFrameStyle( QFrame::Sunken | QFrame::StyledPanel); nameLabel->setFrameStyle( QFrame::Sunken | QFrame::StyledPanel);
pgBar = new QProgressBar;
pgBar->hide();
/* and adding those */ /* and adding those */
statusBar()->addWidget( nameLabel, 8 ); statusBar()->addWidget( nameLabel, 8 );
statusBar()->addPermanentWidget( speedLabel, 0 ); statusBar()->addPermanentWidget( speedLabel, 0 );
statusBar()->addPermanentWidget( pgBar, 0 );
statusBar()->addPermanentWidget( timeLabel, 0 ); statusBar()->addPermanentWidget( timeLabel, 0 );
/* timeLabel behaviour: /* timeLabel behaviour:
......
...@@ -49,6 +49,7 @@ class SpeedControlWidget; ...@@ -49,6 +49,7 @@ class SpeedControlWidget;
class QMenu; class QMenu;
class QSize; class QSize;
class QDockWidet; class QDockWidet;
class QProgressBar;
enum{ enum{
CONTROLS_HIDDEN = 0x0, CONTROLS_HIDDEN = 0x0,
...@@ -59,6 +60,10 @@ enum{ ...@@ -59,6 +60,10 @@ enum{
class MainInterface : public QVLCMW class MainInterface : public QVLCMW
{ {
Q_OBJECT; Q_OBJECT;
friend class VolumeClickHandler;
friend class InteractionDialog;
public: public:
MainInterface( intf_thread_t *); MainInterface( intf_thread_t *);
virtual ~MainInterface(); virtual ~MainInterface();
...@@ -85,7 +90,6 @@ protected: ...@@ -85,7 +90,6 @@ protected:
void dragLeaveEvent( QDragLeaveEvent * ); void dragLeaveEvent( QDragLeaveEvent * );
void closeEvent( QCloseEvent *); void closeEvent( QCloseEvent *);
friend class VolumeClickHandler;
private: private:
QSettings *settings; QSettings *settings;
QSystemTrayIcon *sysTray; QSystemTrayIcon *sysTray;
...@@ -95,6 +99,7 @@ private: ...@@ -95,6 +99,7 @@ private:
ControlsWidget *controls; ControlsWidget *controls;
QMenu *speedControlMenu; QMenu *speedControlMenu;
SpeedControlWidget *speedControl; SpeedControlWidget *speedControl;
QProgressBar *pgBar;
void handleMainUi( QSettings* ); void handleMainUi( QSettings* );
void privacy(); void privacy();
......
...@@ -283,6 +283,7 @@ static void Init( intf_thread_t *p_intf ) ...@@ -283,6 +283,7 @@ static void Init( intf_thread_t *p_intf )
else else
/*if( p_intf->pf_show_dialog )*/ /*if( p_intf->pf_show_dialog )*/
vlc_thread_ready( p_intf ); vlc_thread_ready( p_intf );
#ifdef ENABLE_NLS #ifdef ENABLE_NLS
// Translation - get locale // Translation - get locale
QLocale ql = QLocale::system(); QLocale ql = QLocale::system();
......
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