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