Remove the "seeking too far" error, as it happens for broken AVI and is quite confusing
if( p_access->info.i_size < p_access->info.i_pos )
{
msg_Err( p_access, "seeking too far" );
if( p_access->info.i_size < p_access->info.i_pos )
{
msg_Err( p_access, "seeking too far" );
- intf_UserFatal( p_access, VLC_FALSE, _("File reading failed"),
- _("VLC seeked in the file too far. This usually means "
- "that your file is broken and therefore cannot be "
- "played." ) );
p_access->info.i_pos = p_access->info.i_size;
}
else if( p_access->info.i_pos < 0 )
p_access->info.i_pos = p_access->info.i_size;
}
else if( p_access->info.i_pos < 0 )
int i_ret;
msg_Dbg( p_access, "authentication failed" );
i_ret = intf_UserLoginPassword( p_access, _("HTTP authentication"),
int i_ret;
msg_Dbg( p_access, "authentication failed" );
i_ret = intf_UserLoginPassword( p_access, _("HTTP authentication"),
- _("Please enter a valid login name and a password."),
+ _("Please enter a valid login name and a password."),
&psz_login, &psz_password );
if( i_ret == DIALOG_OK_YES )
{
&psz_login, &psz_password );
if( i_ret == DIALOG_OK_YES )
{
#include <assert.h>
InteractionDialog::InteractionDialog( intf_thread_t *_p_intf,
#include <assert.h>
InteractionDialog::InteractionDialog( intf_thread_t *_p_intf,
- interaction_dialog_t *_p_dialog ) : QWidget( 0 ),
+ interaction_dialog_t *_p_dialog ) : QObject( 0 ),
p_intf( _p_intf), p_dialog( _p_dialog )
{
p_intf( _p_intf), p_dialog( _p_dialog )
{
- QVBoxLayout *layout = new QVBoxLayout( this );
+ QVBoxLayout *layout = NULL;
int i_ret = -1;
panel = NULL;
int i_ret = -1;
panel = NULL;
if( p_dialog->i_flags & DIALOG_BLOCKING_ERROR )
{
if( p_dialog->i_flags & DIALOG_BLOCKING_ERROR )
{
- i_ret = QMessageBox::critical( this, qfu( p_dialog->psz_title ),
+ i_ret = QMessageBox::critical( NULL, qfu( p_dialog->psz_title ),
qfu( p_dialog->psz_description ),
QMessageBox::Ok, 0, 0 );
}
qfu( p_dialog->psz_description ),
QMessageBox::Ok, 0, 0 );
}
}
else if( p_dialog->i_flags & DIALOG_YES_NO_CANCEL )
{
}
else if( p_dialog->i_flags & DIALOG_YES_NO_CANCEL )
{
- i_ret = QMessageBox::question( this,
+ p_dialog->i_status = SENT_DIALOG;
+ i_ret = QMessageBox::question( NULL,
qfu( p_dialog->psz_title), qfu( p_dialog->psz_description ),
p_dialog->psz_default_button ?
qfu( p_dialog->psz_default_button ) : QString::null,
qfu( p_dialog->psz_title), qfu( p_dialog->psz_description ),
p_dialog->psz_default_button ?
qfu( p_dialog->psz_default_button ) : QString::null,
}
else if( p_dialog->i_flags & DIALOG_LOGIN_PW_OK_CANCEL )
{
}
else if( p_dialog->i_flags & DIALOG_LOGIN_PW_OK_CANCEL )
{
+ dialog = new QWidget( 0 ); layout = new QVBoxLayout( dialog );
+ layout->setMargin( 2 );
panel = new QWidget( 0 );
QGridLayout *grid = new QGridLayout;
panel = new QWidget( 0 );
QGridLayout *grid = new QGridLayout;
panel->setLayout( grid );
layout->addWidget( panel );
}
panel->setLayout( grid );
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 );
+ layout->setMargin( 2 );
description = new QLabel( qfu( p_dialog->psz_description ) );
layout->addWidget( description );
description = new QLabel( qfu( p_dialog->psz_description ) );
layout->addWidget( description );
}
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 );
+ layout->setMargin( 2 );
description = new QLabel( qfu( p_dialog->psz_description ) );
layout->addWidget( description );
description = new QLabel( qfu( p_dialog->psz_description ) );
layout->addWidget( description );
layout->addWidget( inputEdit );
}
else
layout->addWidget( inputEdit );
}
else
- msg_Err( p_intf, "unknown dialog type" );
+ msg_Err( p_intf, "unknown dialog type %i", p_dialog->i_flags );
/* We used a message box */
if( i_ret != -1 )
/* We used a message box */
if( i_ret != -1 )
else
/* Custom box, finish it */
{
else
/* Custom box, finish it */
{
- QVLCFrame::doButtons( this, layout,
+ QVLCFrame::doButtons( dialog, layout,
&defaultButton, p_dialog->psz_default_button,
&altButton, p_dialog->psz_alternate_button,
&otherButton, p_dialog->psz_other_button );
if( p_dialog->psz_default_button )
&defaultButton, p_dialog->psz_default_button,
&altButton, p_dialog->psz_alternate_button,
&otherButton, p_dialog->psz_other_button );
if( p_dialog->psz_default_button )
- BUTTONACT( defaultButton, defaultB );
+ BUTTONACT( defaultButton, defaultB() );
if( p_dialog->psz_alternate_button )
if( p_dialog->psz_alternate_button )
- BUTTONACT( altButton, altB );
+ BUTTONACT( altButton, altB() );
if( p_dialog->psz_other_button )
if( p_dialog->psz_other_button )
- BUTTONACT( otherButton, otherB );
- setLayout( layout );
- setWindowTitle( qfu( p_dialog->psz_title ) );
+ BUTTONACT( otherButton, otherB() );
+ dialog->setLayout( layout );
+ dialog->setWindowTitle( qfu( p_dialog->psz_title ) );
-void InteractionDialog::Update()
+void InteractionDialog::update()
{
if( p_dialog->i_flags & DIALOG_USER_PROGRESS )
{
assert( progressBar );
progressBar->setValue( (int)(p_dialog->val.f_float*1000) );
{
if( p_dialog->i_flags & DIALOG_USER_PROGRESS )
{
assert( progressBar );
progressBar->setValue( (int)(p_dialog->val.f_float*1000) );
+ fprintf (stderr, "Setting progress to %i\n", progressBar->value() );
}
}
InteractionDialog::~InteractionDialog()
{
}
}
InteractionDialog::~InteractionDialog()
{
- if( panel ) delete panel;
+// if( panel ) delete panel;
+ if( dialog ) delete dialog;
}
void InteractionDialog::defaultB()
}
void InteractionDialog::defaultB()
class QProgressBar;
class QLineEdit;
class QProgressBar;
class QLineEdit;
-class InteractionDialog : public QWidget
+class InteractionDialog : public QObject
{
Q_OBJECT
public:
InteractionDialog( intf_thread_t *, interaction_dialog_t * );
virtual ~InteractionDialog();
{
Q_OBJECT
public:
InteractionDialog( intf_thread_t *, interaction_dialog_t * );
virtual ~InteractionDialog();
+ void update();
+ void show() { if( dialog ) dialog->show(); }
+ void hide() { if( dialog ) dialog->hide(); }
intf_thread_t *p_intf;
interaction_dialog_t *p_dialog;
intf_thread_t *p_intf;
interaction_dialog_t *p_dialog;
case INTERACT_UPDATE:
qdialog = (InteractionDialog*)(p_dialog->p_private);
if( qdialog)
case INTERACT_UPDATE:
qdialog = (InteractionDialog*)(p_dialog->p_private);
if( qdialog)
break;
case INTERACT_HIDE:
qdialog = (InteractionDialog*)(p_dialog->p_private);
break;
case INTERACT_HIDE:
qdialog = (InteractionDialog*)(p_dialog->p_private);
break;
case INTERACT_DESTROY:
qdialog = (InteractionDialog*)(p_dialog->p_private);
break;
case INTERACT_DESTROY:
qdialog = (InteractionDialog*)(p_dialog->p_private);
+ if( !p_dialog->i_flags & DIALOG_NONBLOCKING_ERROR )
+ delete qdialog;
p_dialog->i_status = DESTROYED_DIALOG;
break;
}
p_dialog->i_status = DESTROYED_DIALOG;
break;
}
QPushButton **other, char *psz_other )
{
#ifdef QT42
QPushButton **other, char *psz_other )
{
#ifdef QT42
+ fprintf( stderr, "Gra\n" );
#else
QHBoxLayout *buttons_layout = new QHBoxLayout;
QSpacerItem *spacerItem = new QSpacerItem( 40, 20,
#else
QHBoxLayout *buttons_layout = new QHBoxLayout;
QSpacerItem *spacerItem = new QSpacerItem( 40, 20,
{
fprintf( stderr, "Creating default button %s\n", psz_default );
*defaul = new QPushButton(0);
{
fprintf( stderr, "Creating default button %s\n", psz_default );
*defaul = new QPushButton(0);
buttons_layout->addWidget( *defaul );
(*defaul)->setText( qfu( psz_default ) );
}
buttons_layout->addWidget( *defaul );
(*defaul)->setText( qfu( psz_default ) );
}
p_new->i_type = INTERACT_DIALOG_TWOWAY;
p_new->psz_title = strdup( psz_title );
p_new->psz_description = strdup( psz_description );
p_new->i_type = INTERACT_DIALOG_TWOWAY;
p_new->psz_title = strdup( psz_title );
p_new->psz_description = strdup( psz_description );
+ p_new->psz_default_button = strdup( _("Ok" ) );
+ p_new->psz_alternate_button = strdup( _("Cancel" ) );
p_new->i_flags = DIALOG_LOGIN_PW_OK_CANCEL;
i_ret = DialogSend( p_this, p_new );
p_new->i_flags = DIALOG_LOGIN_PW_OK_CANCEL;
i_ret = DialogSend( p_this, p_new );
- if( i_ret != DIALOG_CANCELLED )
+ if( i_ret != DIALOG_CANCELLED && i_ret != VLC_EGENERIC )
- assert( p_new->psz_returned[0] && p_new->psz_returned[1] );
- *ppsz_login = strdup( p_new->psz_returned[0] );
- *ppsz_password = strdup( p_new->psz_returned[1] );
+ *ppsz_login = p_new->psz_returned[0]?
+ strdup( p_new->psz_returned[0] ) : NULL;
+ *ppsz_password = p_new->psz_returned[1]?
+ strdup( p_new->psz_returned[1] ) : NULL;
if( p_playlist->p_interaction )
{
intf_InteractionDestroy( p_playlist->p_interaction );
if( p_playlist->p_interaction )
{
intf_InteractionDestroy( p_playlist->p_interaction );
+ fprintf( stderr, "NOW NULL ****\n" );
+ p_playlist->p_interaction = NULL;