Changeset 54cfbbc8db822f49819f2230c74c7e8865772d7f

Show
Ignore:
Timestamp:
03/08/06 08:10:57 (2 years ago)
Author:
Clément Stenac <zorglub@videolan.org>
git-committer:
Clément Stenac <zorglub@videolan.org> 1154585457 +0000
git-parent:

[1c98d750758a7812c1c433d967564ad92f39ef98]

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

* Some Qt interaction stuff
* More useless interaction cleanup
* Small fix for make beautifier

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • extras/make.pl

    r9ec36c9 r54cfbbc  
    2424     chomp $line; 
    2525     # Skip entering/leaving directories and incomplete lines 
    26      if(  
     26     if( 
    2727    $line =~ /make\[([0-9]*)\]:.*/ || 
    28 #        $line =~ /.*\s\\$/ ||  
    29         $line =~ /^test\s\-z\s/ ||  
     28#       $line =~ /.*\s\\$/ || 
     29        $line =~ /^test\s\-z\s/ || 
    3030        $line =~ /^Making\sclean\sin\s\./ || 
    3131    $line =~ /then\smv\s-f/ || 
     32    $line =~ /.*make\s\s.*/ || 
    3233        $line =~ /make\s\sall-recursive/ || 
    3334        $line =~ /[A-z0-9-]*ar\s[A-z0-9]*\s([A-z0-9\-_\/\.]*)\s.*/ || 
     
    3536        $line =~ /^touch.*/ || 
    3637        $line =~ /^srcdir=.*/ || 
    37         $line =~ /^.* (lib[A-z0-9-_]*plugin.so).*/ ||  
     38        $line =~ /^.* (lib[A-z0-9-_]*plugin.so).*/ || 
    3839        $line =~ s/^rm\s\-f\s(.*)//g ) 
    3940     {} 
    40      # Info  
    41      elsif(  
     41     # Info 
     42     elsif( 
    4243          $line =~ s/^.* (lib.*\.so).*/ LINK    : $1/g || 
    4344          $line =~ s/^.* (lib.*\.o)\s\.\/(.*)/ COMPILE : $2/g || 
    4445          $line =~ s/^.* (lib.*\.o)\s`.*`(.*);\ \\/ COMPILE : $2/ || 
     46          $line =~ s/.*\-o\s([^\s]*)\s`.*`([^\s]*);.*/ COMPILE : $2/g || 
    4547          $line =~ s/^[A-z0-9-]*ranlib\s(.*)/ RANLIB  : $1/g || 
    4648          $line =~ s/^Making\sall\sin\s(.*)/MAKE     : $1/g || 
    47           $line =~ s/^Making\sclean\sin\s(.*)/CLEAN  : $1/g || 
    48           $line =~ s/.*\-o\s([^\s]*)\s.*/ BUILD   : $1/g) 
    49  
     49          $line =~ s/^Making\sclean\sin\s(.*)/CLEAN  : $1/g  ) 
    5050     { 
    5151    print $info.$line.$reset."\n"; 
     
    6464    print $error.$line.$reset."\n"; 
    6565     } 
    66      # Print unmatched lines  
     66     # Print unmatched lines 
    6767     else 
    6868     { 
    6969    print $line."\n"; 
    7070     } 
    71  
    7271} 
  • include/vlc_interaction.h

    r093de85 r54cfbbc  
    8282 
    8383/** 
    84  * Possible flags . Reusable and button types 
     84 * Possible flags . Dialog types 
    8585 */ 
    86 #define DIALOG_REUSABLE             0x01 
    87 #define DIALOG_YES_NO_CANCEL        0x04 
    88 #define DIALOG_CLEAR_NOSHOW         0x08 
    89 #define DIALOG_GOT_ANSWER           0x10 
    90 #define DIALOG_LOGIN_PW_OK_CANCEL   0x20 
    91 #define DIALOG_BLOCKING_ERROR       0x24 
    92 #define DIALOG_NONBLOCKING_ERROR    0x200 
    93 #define DIALOG_USER_PROGRESS        0x40 
    94 #define DIALOG_PSZ_INPUT_OK_CANCEL      0x80 
     86#define DIALOG_GOT_ANSWER           0x01 
     87#define DIALOG_YES_NO_CANCEL        0x02 
     88#define DIALOG_LOGIN_PW_OK_CANCEL   0x04 
     89#define DIALOG_PSZ_INPUT_OK_CANCEL  0x08 
     90#define DIALOG_BLOCKING_ERROR       0x10 
     91#define DIALOG_NONBLOCKING_ERROR    0x20 
     92#define DIALOG_WARNING              0x40 
     93#define DIALOG_USER_PROGRESS        0x80 
    9594#define DIALOG_INTF_PROGRESS        0x100 
    96 #define DIALOG_WARNING              0x400 
    9795 
    9896/** 
  • modules/demux/avi/avi.c

    r093de85 r54cfbbc  
    560560                        "work correctly.\nDo you want to " 
    561561                        "try to repair it (this might take a long time) ?" ), 
    562                         _( "Repair" ), _( "Don't repair" ), NULL ); 
     562                        _( "Repair" ), _( "Don't repair" ), _( "Cancel") ); 
    563563            if( i_create == DIALOG_OK_YES ) 
    564564            { 
  • modules/demux/avi/libavi.c

    r2cb472d r54cfbbc  
    3030 
    3131#define AVI_DEBUG 1 
    32  
    33 #define FREE( p ) \ 
    34     if( p ) {free( p ); p = NULL; } 
    3532 
    3633#define __EVEN( x ) ( (x)&0x01 ? (x)+1 : (x) ) 
     
    418415    if( p_strf->common.i_cat == AUDIO_ES ) 
    419416    { 
    420         FREE( p_strf->auds.p_wf ); 
     417        FREENULL( p_strf->auds.p_wf ); 
    421418    } 
    422419    else if( p_strf->common.i_cat == VIDEO_ES ) 
    423420    { 
    424         FREE( p_strf->vids.p_bih ); 
     421        FREENULL( p_strf->vids.p_bih ); 
    425422    } 
    426423} 
     
    472469    p_chk->idx1.i_entry_count = 0; 
    473470    p_chk->idx1.i_entry_max   = 0; 
    474     FREE( p_chk->idx1.entry ) 
     471    FREENULL( p_chk->idx1.entry ) 
    475472} 
    476473 
     
    557554    avi_chunk_indx_t *p_indx = (avi_chunk_indx_t*)p_chk; 
    558555 
    559     FREE( p_indx->idx.std ); 
    560     FREE( p_indx->idx.field ); 
    561     FREE( p_indx->idx.super ); 
     556    FREENULL( p_indx->idx.std ); 
     557    FREENULL( p_indx->idx.field ); 
     558    FREENULL( p_indx->idx.super ); 
    562559} 
    563560 
     
    630627{ 
    631628    avi_chunk_STRING_t *p_strz = (avi_chunk_STRING_t*)p_chk; 
    632     FREE( p_strz->p_type ); 
    633     FREE( p_strz->p_str ); 
     629    FREENULL( p_strz->p_type ); 
     630    FREENULL( p_strz->p_str ); 
    634631} 
    635632 
  • modules/gui/qt4/dialogs/interaction.cpp

    r14e11ab r54cfbbc  
    2121 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ 
    2222 
     23#include <QMessageBox> 
    2324#include "dialogs/interaction.hpp" 
    2425#include "util/qvlcframe.hpp" 
     
    3031                          p_intf( _p_intf), p_dialog( _p_dialog ) 
    3132{ 
    32     QVBoxLayout *layout = new QVBoxLayout; 
     33    QVBoxLayout *layout = new QVBoxLayout( this ); 
     34    int i_ret = -1; 
    3335    uiLogin = NULL; 
    3436    uiProgress = NULL; 
    3537    uiInput = NULL; 
    3638 
    37  
    3839    if( p_dialog->i_flags & DIALOG_BLOCKING_ERROR ) 
    3940    { 
    40  
    4141    } 
    4242    else if( p_dialog->i_flags & DIALOG_NONBLOCKING_ERROR ) 
     
    4646    else if( p_dialog->i_flags & DIALOG_YES_NO_CANCEL ) 
    4747    { 
    48         description = new QLabel( 0 ); 
    49         description->setText( qfu(p_dialog->psz_description) ); 
    50         layout->addWidget(description); 
     48        i_ret = QMessageBox::question( this, 
     49              qfu( p_dialog->psz_title), qfu( p_dialog->psz_description ), 
     50              p_dialog->psz_default_button ? 
     51                    qfu( p_dialog->psz_default_button ) : QString::null, 
     52              p_dialog->psz_alternate_button ? 
     53                    qfu( p_dialog->psz_alternate_button ) : QString::null, 
     54              p_dialog->psz_other_button ? 
     55                    qfu( p_dialog->psz_other_button ) : QString::null, 0, 
     56              p_dialog->psz_other_button ? 2 : -1 ); 
    5157    } 
    5258    else if( p_dialog->i_flags & DIALOG_LOGIN_PW_OK_CANCEL ) 
     
    6672        msg_Err( p_intf, "unknown dialog type" ); 
    6773 
    68     QVLCFrame::doButtons( this, layout, 
    69                           defaultButton, p_dialog->psz_default_button, 
    70                           altButton, p_dialog->psz_alternate_button, 
    71                           otherButton, p_dialog->psz_other_button ); 
    72     if( p_dialog->psz_default_button ) 
    73         connect( defaultButton, SIGNAL( clicked() ), this, SLOT( defaultB() ) ); 
    74     if( p_dialog->psz_alternate_button ) 
    75         connect( altButton, SIGNAL( clicked() ), this, SLOT( altB() ) ); 
    76     if( p_dialog->psz_other_button ) 
    77         connect( otherButton, SIGNAL( clicked() ), this, SLOT( otherB() ) ); 
    78   
    79     setLayout( layout ); 
    80     setWindowTitle( qfu( p_dialog->psz_title ) ); 
     74    /* We used a message box */ 
     75    if( i_ret != -1 ) 
     76    { 
     77        if( i_ret == 0 ) Finish( DIALOG_OK_YES ); 
     78        else if ( i_ret == 1 ) Finish( DIALOG_NO ); 
     79        else Finish( DIALOG_CANCELLED ); 
     80    } 
     81    else 
     82    /* Custom box, finish it */ 
     83    { 
     84        QVLCFrame::doButtons( this, layout, 
     85                              &defaultButton, p_dialog->psz_default_button, 
     86                              &altButton, p_dialog->psz_alternate_button, 
     87                              &otherButton, p_dialog->psz_other_button ); 
     88        if( p_dialog->psz_default_button ) 
     89            connect( defaultButton, SIGNAL( clicked() ), 
     90                     this, SLOT( defaultB() ) ); 
     91        if( p_dialog->psz_alternate_button ) 
     92            connect( altButton, SIGNAL( clicked() ), this, SLOT( altB() ) ); 
     93        if( p_dialog->psz_other_button ) 
     94            connect( otherButton, SIGNAL( clicked() ), this, SLOT( otherB() ) ); 
     95        setLayout( layout ); 
     96        setWindowTitle( qfu( p_dialog->psz_title ) ); 
     97    } 
    8198} 
    8299 
     
    107124void InteractionDialog::Finish( int i_ret ) 
    108125{ 
    109     vlc_mutex_lock( &p_dialog->p_interaction->object_lock );  
     126    vlc_mutex_lock( &p_dialog->p_interaction->object_lock ); 
    110127 
    111128    if( p_dialog->i_flags & DIALOG_LOGIN_PW_OK_CANCEL ) 
     
    124141    p_dialog->i_return = i_ret; 
    125142    hide(); 
    126     vlc_mutex_unlock( &p_dialog->p_interaction->object_lock );  
     143    vlc_mutex_unlock( &p_dialog->p_interaction->object_lock ); 
    127144} 
  • modules/gui/qt4/util/qvlcframe.hpp

    r14e11ab r54cfbbc  
    5858    } 
    5959    static void doButtons( QWidget *w, QBoxLayout *l, 
    60                            QPushButton *defaul, char *psz_default, 
    61                            QPushButton *alt, char *psz_alt, 
    62                            QPushButton *other, char *psz_other ) 
     60                           QPushButton **defaul, char *psz_default, 
     61                           QPushButton **alt, char *psz_alt, 
     62                           QPushButton **other, char *psz_other ) 
    6363    { 
    6464#ifdef QT42 
     
    7171        if( psz_default ) 
    7272        { 
    73             defaul = new QPushButton
    74             buttons_layout->addWidget( defaul ); 
    75             defaul->setText( qfu( psz_default ) ); 
     73            *defaul = new QPushButton(0)
     74            buttons_layout->addWidget( *defaul ); 
     75            (*defaul)->setText( qfu( psz_default ) ); 
    7676        } 
    7777        if( psz_alt ) 
    7878        { 
    79             alt = new QPushButton
    80             buttons_layout->addWidget( alt ); 
    81             alt->setText( qfu( psz_alt ) ); 
     79            *alt = new QPushButton(0)
     80            buttons_layout->addWidget( *alt ); 
     81            (*alt)->setText( qfu( psz_alt ) ); 
    8282        } 
    8383        if( psz_other ) 
    8484        { 
    85             other = new QPushButton
    86             buttons_layout->addWidget( other ); 
    87             other->setText( qfu( psz_other ) ); 
     85            *other = new QPushButton( 0 )
     86            buttons_layout->addWidget( *other ); 
     87            (*other)->setText( qfu( psz_other ) ); 
    8888        } 
    8989        l->addLayout( buttons_layout ); 
  • modules/gui/wxwidgets/dialogs/interaction.cpp

    r765427d r54cfbbc  
    179179        buttons_sizer->AddButton( cancel ); 
    180180    } 
     181#if 0 
    181182    else if( p_dialog->i_flags & DIALOG_CLEAR_NOSHOW ) 
    182183    { 
     
    197198        buttons_sizer->SetAffirmativeButton( close ); 
    198199    } 
     200#endif 
    199201    widgets_sizer->Layout(); 
    200202    widgets_panel->SetSizerAndFit( widgets_sizer ); 
  • src/interface/interaction.c

    r093de85 r54cfbbc  
    137137        case HIDDEN_DIALOG: 
    138138            if( !(p_dialog->i_flags & DIALOG_GOT_ANSWER) ) break; 
    139             if( !(p_dialog->i_flags & DIALOG_REUSABLE) ) 
    140             { 
    141                 p_dialog->i_action = INTERACT_DESTROY; 
    142                 val.p_address = p_dialog; 
    143                 if( p_interaction->p_intf ) 
    144                     var_Set( p_interaction->p_intf, "interaction", val ); 
    145             } 
     139            p_dialog->i_action = INTERACT_DESTROY; 
     140            val.p_address = p_dialog; 
     141            if( p_interaction->p_intf ) 
     142                var_Set( p_interaction->p_intf, "interaction", val ); 
    146143            break; 
    147144        case DESTROYED_DIALOG: 
     
    176173        p_new->b_cancelled = VLC_FALSE;                                   \ 
    177174        p_new->i_status = NEW_DIALOG;                                     \ 
     175        p_new->i_flags = 0; \ 
    178176        p_new->i_type = INTERACT_DIALOG_##type;                           \ 
    179177        p_new->psz_returned[0] = NULL;                                    \ 
     
    197195    va_list args; 
    198196    DIALOG_INIT( ONEWAY ); 
    199      
     197 
    200198    p_new->psz_title = strdup( psz_title ); 
    201199    FORMAT_DESC;