Changeset 928454fad876fb8f5dc7b993dca4670460a008af

Show
Ignore:
Timestamp:
14/09/06 23:19:34 (2 years ago)
Author:
Clément Stenac <zorglub@videolan.org>
git-committer:
Clément Stenac <zorglub@videolan.org> 1158268774 +0000
git-parent:

[6cdb3e2829ba401c9781e1532479db658d87c69b]

git-author:
Clément Stenac <zorglub@videolan.org> 1158268774 +0000
Message:

Fix a number of problems with interaction dialogs
Remove the "seeking too far" error, as it happens for broken AVI and is quite confusing

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/access/file.c

    r89298c1 r928454f  
    517517    { 
    518518        msg_Err( p_access, "seeking too far" ); 
    519         intf_UserFatal( p_access, VLC_FALSE, _("File reading failed"),  
    520                         _("VLC seeked in the file too far. This usually means " 
    521                           "that your file is broken and therefore cannot be " 
    522                           "played." ) ); 
    523519        p_access->info.i_pos = p_access->info.i_size; 
    524520    } 
  • modules/access/http.c

    r8ce6877 r928454f  
    286286        msg_Dbg( p_access, "authentication failed" ); 
    287287        i_ret = intf_UserLoginPassword( p_access, _("HTTP authentication"), 
    288                         _("Please enter a valid login name and a password."),  
     288                        _("Please enter a valid login name and a password."), 
    289289                                                &psz_login, &psz_password ); 
    290290        if( i_ret == DIALOG_OK_YES ) 
  • modules/gui/qt4/dialogs/interaction.cpp

    r6523dc2 r928454f  
    3535 
    3636InteractionDialog::InteractionDialog( intf_thread_t *_p_intf, 
    37                          interaction_dialog_t *_p_dialog ) : QWidget( 0 ), 
     37                         interaction_dialog_t *_p_dialog ) : QObject( 0 ), 
    3838                          p_intf( _p_intf), p_dialog( _p_dialog ) 
    3939{ 
    40     QVBoxLayout *layout = new QVBoxLayout( this )
     40    QVBoxLayout *layout = NULL
    4141    int i_ret = -1; 
    4242    panel = NULL; 
     43    dialog = NULL; 
    4344 
    4445    if( p_dialog->i_flags & DIALOG_BLOCKING_ERROR ) 
    4546    { 
    46         i_ret = QMessageBox::critical( this, qfu( p_dialog->psz_title ), 
     47        i_ret = QMessageBox::critical( NULL, qfu( p_dialog->psz_title ), 
    4748                                       qfu( p_dialog->psz_description ), 
    4849                                       QMessageBox::Ok, 0, 0 ); 
     
    6566    else if( p_dialog->i_flags & DIALOG_YES_NO_CANCEL ) 
    6667    { 
    67         i_ret = QMessageBox::question( this, 
     68        p_dialog->i_status = SENT_DIALOG; 
     69        i_ret = QMessageBox::question( NULL, 
    6870              qfu( p_dialog->psz_title), qfu( p_dialog->psz_description ), 
    6971              p_dialog->psz_default_button ? 
     
    7779    else if( p_dialog->i_flags & DIALOG_LOGIN_PW_OK_CANCEL ) 
    7880    { 
     81        dialog = new QWidget( 0 ); layout = new QVBoxLayout( dialog ); 
     82        layout->setMargin( 2 ); 
    7983        panel = new QWidget( 0 ); 
    8084        QGridLayout *grid = new QGridLayout; 
     
    9498        layout->addWidget( panel ); 
    9599    } 
    96     else if( p_dialog->i_flags & DIALOG_USER_PROGRESS ) 
     100    else if( p_dialog->i_flags & DIALOG_USER_PROGRESS || 
     101             /* TEMPORARY ! */ p_dialog->i_flags & DIALOG_INTF_PROGRESS ) 
    97102    { 
     103        dialog = new QWidget( 0 );layout = new QVBoxLayout( dialog ); 
     104        layout->setMargin( 2 ); 
    98105        description = new QLabel( qfu( p_dialog->psz_description ) ); 
    99106        layout->addWidget( description ); 
     
    107114    else if( p_dialog->i_flags & DIALOG_PSZ_INPUT_OK_CANCEL ) 
    108115    { 
     116        dialog = new QWidget( 0 );layout = new QVBoxLayout( dialog ); 
     117        layout->setMargin( 2 ); 
    109118        description = new QLabel( qfu( p_dialog->psz_description ) ); 
    110119        layout->addWidget( description ); 
     
    114123    } 
    115124    else 
    116         msg_Err( p_intf, "unknown dialog type" ); 
     125        msg_Err( p_intf, "unknown dialog type %i", p_dialog->i_flags ); 
    117126 
    118127    /* We used a message box */ 
     
    126135    /* Custom box, finish it */ 
    127136    { 
    128         QVLCFrame::doButtons( this, layout, 
     137        QVLCFrame::doButtons( dialog, layout, 
    129138                              &defaultButton, p_dialog->psz_default_button, 
    130139                              &altButton, p_dialog->psz_alternate_button, 
    131140                              &otherButton, p_dialog->psz_other_button ); 
    132141        if( p_dialog->psz_default_button ) 
    133             BUTTONACT( defaultButton, defaultB ); 
     142            BUTTONACT( defaultButton, defaultB() ); 
    134143        if( p_dialog->psz_alternate_button ) 
    135             BUTTONACT( altButton, altB ); 
     144            BUTTONACT( altButton, altB() ); 
    136145        if( p_dialog->psz_other_button ) 
    137             BUTTONACT( otherButton, otherB ); 
    138         setLayout( layout ); 
    139         setWindowTitle( qfu( p_dialog->psz_title ) ); 
     146            BUTTONACT( otherButton, otherB() ); 
     147        dialog->setLayout( layout ); 
     148        dialog->setWindowTitle( qfu( p_dialog->psz_title ) ); 
    140149    } 
    141150} 
    142151 
    143 void InteractionDialog::Update() 
     152void InteractionDialog::update() 
    144153{ 
    145154    if( p_dialog->i_flags & DIALOG_USER_PROGRESS ) 
     
    147156        assert( progressBar ); 
    148157        progressBar->setValue( (int)(p_dialog->val.f_float*1000) ); 
     158        fprintf (stderr, "Setting progress to %i\n", progressBar->value() ); 
    149159    } 
    150160} 
     
    152162InteractionDialog::~InteractionDialog() 
    153163{ 
    154     if( panel ) delete panel; 
     164//    if( panel ) delete panel; 
     165    if( dialog ) delete dialog; 
    155166} 
    156167 
  • modules/gui/qt4/dialogs/interaction.hpp

    rc5ee72d r928454f  
    3333class QLineEdit; 
    3434 
    35 class InteractionDialog : public QWidge
     35class InteractionDialog : public QObjec
    3636{ 
    3737    Q_OBJECT 
     
    4040    virtual ~InteractionDialog(); 
    4141 
    42     void Update(); 
     42    void update(); 
     43    void show() { if( dialog ) dialog->show(); } 
     44    void hide() { if( dialog ) dialog->hide(); } 
    4345 
    4446private: 
    4547    QWidget *panel; 
     48    QWidget *dialog; 
    4649    intf_thread_t *p_intf; 
    4750    interaction_dialog_t *p_dialog; 
  • modules/gui/qt4/dialogs_provider.cpp

    r897144d r928454f  
    124124        qdialog = (InteractionDialog*)(p_dialog->p_private); 
    125125        if( qdialog) 
    126             qdialog->Update(); 
     126            qdialog->update(); 
    127127        break; 
    128128    case INTERACT_HIDE: 
     
    134134    case INTERACT_DESTROY: 
    135135        qdialog = (InteractionDialog*)(p_dialog->p_private); 
    136         delete qdialog; 
     136        if( !p_dialog->i_flags & DIALOG_NONBLOCKING_ERROR ) 
     137            delete qdialog; 
    137138        p_dialog->i_status = DESTROYED_DIALOG; 
    138139        break; 
  • modules/gui/qt4/util/qvlcframe.hpp

    r4717c1a r928454f  
    6666    { 
    6767#ifdef QT42 
     68        fprintf( stderr, "Gra\n" ); 
    6869#else 
    6970        QHBoxLayout *buttons_layout = new QHBoxLayout; 
     
    7677            fprintf( stderr, "Creating default button %s\n", psz_default ); 
    7778            *defaul = new QPushButton(0); 
     79            (*defaul)->setFocus(); 
    7880            buttons_layout->addWidget( *defaul ); 
    7981            (*defaul)->setText( qfu( psz_default ) ); 
  • src/interface/interaction.c

    r7a57427 r928454f  
    368368    p_new->psz_title = strdup( psz_title ); 
    369369    p_new->psz_description = strdup( psz_description ); 
     370    p_new->psz_default_button = strdup( _("Ok" ) ); 
     371    p_new->psz_alternate_button = strdup( _("Cancel" ) ); 
    370372 
    371373    p_new->i_flags = DIALOG_LOGIN_PW_OK_CANCEL; 
     
    373375    i_ret = DialogSend( p_this, p_new ); 
    374376 
    375     if( i_ret != DIALOG_CANCELLED ) 
    376     { 
    377         assert( p_new->psz_returned[0] && p_new->psz_returned[1] ); 
    378         *ppsz_login = strdup( p_new->psz_returned[0] ); 
    379         *ppsz_password = strdup( p_new->psz_returned[1] ); 
     377    if( i_ret != DIALOG_CANCELLED && i_ret != VLC_EGENERIC ) 
     378    { 
     379        *ppsz_login = p_new->psz_returned[0]? 
     380                                strdup( p_new->psz_returned[0] ) : NULL; 
     381        *ppsz_password = p_new->psz_returned[1]? 
     382                                strdup( p_new->psz_returned[1] ) : NULL; 
    380383    } 
    381384    return i_ret; 
  • src/playlist/thread.c

    r315069b r928454f  
    212212    { 
    213213        intf_InteractionDestroy( p_playlist->p_interaction ); 
     214        fprintf( stderr, "NOW NULL ****\n" ); 
     215        p_playlist->p_interaction = NULL; 
    214216    } 
    215217}