Changeset a94647f04b28484b49f16ce252523b38343b6b58

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

[ff5e7fa774f237f3a8d1204cd9a5b61c1df93079]

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

Misc cleanups in Qt4. (Closes:#736)
Fix m3u export

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • NEWS

    r27bf7df ra94647f  
    1212 * This version of VLC contains a new interface for Windows and Linux. This 
    1313   interface lacks a few features that used to be present in vlc 0.8.6:  
    14    "Streaming wizard" and "VLM control". These features will be replaced 
    15    by a better alternative in the next version. If you absolutely need these 
    16    features, we advise you to keep vlc 0.8.6 
     14   - "Streaming wizard" and "VLM control". These features will be replaced 
     15     by a better alternative in the next version. If you absolutely need these 
     16     features, we advise you to keep vlc 0.8.6 
     17   - Similarly, "Bookmarks" will be reintroduced in an improved version at a  
     18     later point 
    1719 
    1820Changes: 
  • include/vlc_intf_strings.h

    rfbf4c80 ra94647f  
    3131/*************** Open dialogs **************/ 
    3232 
    33 #define I_POP_SEL_FILES N_("Select one or more files to open") 
     33#define I_OP_OPF        N_("Quick &Open File...") 
     34#define I_OP_ADVOP      N_("&Advanced Open...") 
     35#define I_OP_OPDIR      N_("Open &Directory...") 
     36 
     37#define I_OP_SEL_FILES  N_("Select one or more files to open") 
    3438 
    3539/******************* Menus *****************/ 
     40 
     41#define I_MENU_INFO  N_("Information...") 
     42#define I_MENU_MSG   N_("Messages...") 
     43#define I_MENU_EXT   N_("Extended settings...") 
     44 
     45#define I_MENU_ABOUT N_("About VLC media player...") 
    3646 
    3747/* Playlist popup */ 
     
    4555#define I_POP_SAVE N_("Save...") 
    4656 
     57/*************** Playlist *************/ 
     58 
     59#define I_PL_LOOP       N_("Repeat all") 
     60#define I_PL_REPEAT     N_("Repeat one") 
     61#define I_PL_NOREPEAT   N_("No repeat") 
     62 
     63#define I_PL_RANDOM     N_("Random") 
     64#define I_PL_NORANDOM   N_("No random") 
     65 
     66#define I_PL_ADDPL      N_("Add to playlist") 
     67#define I_PL_ADDML      N_("Add to media library") 
     68 
     69#define I_PL_ADDF       N_("Add file...") 
     70#define I_PL_ADVADD     N_("Advanced open...") 
     71#define I_PL_ADDDIR     N_("Add directory...") 
     72 
     73#define I_PL_SAVE       N_("Save playlist to file...") 
     74#define I_PL_LOAD       N_("Load playlist file...") 
     75 
     76#define I_PL_SEARCH     N_("Search") 
     77#define I_PL_FILTER     N_("Search filter") 
     78 
     79#define I_PL_SD         N_("Additional sources") 
     80 
    4781/*************** Preferences *************/ 
    4882 
  • modules/gui/qt4/components/playlist/standardpanel.cpp

    rbc32a19 ra94647f  
    2727#include "components/playlist/panels.hpp" 
    2828#include "util/customwidgets.hpp" 
     29 
     30#include <vlc_intf_strings.h> 
    2931 
    3032#include <QTreeView> 
     
    5456    view->setAlternatingRowColors( true ); 
    5557    view->header()->resizeSection( 0, 230 ); 
    56     view->header()->resizeSection( 2, 60 ); 
     58    view->header()->resizeSection( 1, 170 ); 
    5759    view->header()->setSortIndicatorShown( true ); 
    5860    view->header()->setClickable( true ); 
     
    9698    QSpacerItem *spacer = new QSpacerItem( 10, 20 );buttons->addItem( spacer ); 
    9799 
    98     QLabel *filter = new QLabel( qfu( "&Search:" ) + " " ); 
     100    QLabel *filter = new QLabel( qtr(I_PL_SEARCH) + " " ); 
    99101    buttons->addWidget( filter ); 
    100     searchLine = new  ClickLineEdit( qfu( "Playlist filter" ), 0 ); 
     102    searchLine = new  ClickLineEdit( qtr(I_PL_FILTER), 0 ); 
    101103    CONNECT( searchLine, textChanged(QString), this, search(QString)); 
    102104    buttons->addWidget( searchLine ); filter->setBuddy( searchLine ); 
     
    118120    { 
    119121        model->setRepeat( false ); model->setLoop( true ); 
    120         repeatButton->setText( qtr( "Repeat All" ) ); 
     122        repeatButton->setText( qtr(I_PL_LOOP) ); 
    121123    } 
    122124    else if( model->hasLoop() ) 
    123125    { 
    124126        model->setRepeat( false ) ; model->setLoop( false ); 
    125         repeatButton->setText( qtr( "No Repeat" ) ); 
     127        repeatButton->setText( qtr(I_PL_NOREPEAT) ); 
    126128    } 
    127129    else 
    128130    { 
    129131        model->setRepeat( true ); 
    130         repeatButton->setText( qtr( "Repeat One" ) ); 
     132        repeatButton->setText( qtr(I_PL_REPEAT) ); 
    131133    } 
    132134} 
     
    136138    bool prev = model->hasRandom(); 
    137139    model->setRandom( !prev ); 
    138     randomButton->setText( prev ? qtr( "No Random" ) : qtr( "Random" ) ); 
     140    randomButton->setText( prev ? qtr(I_PL_NORANDOM) : qtr(I_PL_RANDOM) ); 
    139141} 
    140142 
     
    160162    { 
    161163        addButton->setEnabled( true ); 
    162         addButton->setToolTip( qtr("Add to playlist" ) ); 
     164        addButton->setToolTip( qtr(I_PL_ADDPL) ); 
    163165    } 
    164166    else if( currentRootId == THEPL->p_ml_category->i_id || 
     
    166168    { 
    167169        addButton->setEnabled( true ); 
    168         addButton->setToolTip( qtr("Add to media library" ) ); 
     170        addButton->setToolTip( qtr(I_PL_ADDML) ); 
    169171    } 
    170172    else 
     
    178180        currentRootId == THEPL->p_local_onelevel->i_id ) 
    179181    { 
    180         popup->addAction( qtr("Add file"), THEDP, SLOT( simplePLAppendDialog() ) ); 
    181         popup->addAction( qtr("Advanced add"), THEDP, SLOT( PLAppendDialog() ) ); 
     182        popup->addAction( qtr(I_PL_ADDF), THEDP, SLOT(simplePLAppendDialog())); 
     183        popup->addAction( qtr(I_PL_ADVADD), THEDP, SLOT(PLAppendDialog()) ); 
     184        popup->addAction( qtr(I_PL_ADDDIR), THEDP, SLOT( PLAppendDir()) ); 
    182185    } 
    183186    else if( currentRootId == THEPL->p_ml_category->i_id || 
    184187             currentRootId == THEPL->p_ml_onelevel->i_id ) 
    185188    { 
    186         popup->addAction( qtr("Add file"), THEDP, SLOT( simpleMLAppendDialog() ) ); 
    187         popup->addAction( qtr("Advanced add"), THEDP, SLOT( MLAppendDialog() ) ); 
    188         popup->addAction( qtr("Directory"), THEDP, SLOT( openMLDirectory() ) ); 
     189        popup->addAction( qtr(I_PL_ADDF), THEDP, SLOT(simpleMLAppendDialog())); 
     190        popup->addAction( qtr(I_PL_ADVADD), THEDP, SLOT( MLAppendDialog() ) ); 
     191        popup->addAction( qtr(I_PL_ADDDIR), THEDP, SLOT( MLAppendDir() ) ); 
    189192    } 
    190193    popup->popup( QCursor::pos() ); 
  • modules/gui/qt4/dialogs/messages.cpp

    rbb727b7 ra94647f  
    157157            "Texts / Logs (*.log *.txt);; All (*.*) "); 
    158158 
    159     if( saveLogFileName != NULL
     159    if( !saveLogFileName.isNull()
    160160    { 
    161161        QFile file(saveLogFileName); 
  • modules/gui/qt4/dialogs_provider.cpp

    r4595653 ra94647f  
    6767} 
    6868 
     69void DialogsProvider::quit() 
     70{ 
     71    p_intf->b_die = VLC_TRUE; 
     72    QApplication::quit(); 
     73} 
     74 
    6975void DialogsProvider::customEvent( QEvent *event ) 
    7076{ 
     
    9197               popupMenu( de->i_dialog ); break; 
    9298            case INTF_DIALOG_FILEINFO: 
    93                MediaInfoDialog(); break; 
     99               mediaInfoDialog(); break; 
    94100            case INTF_DIALOG_INTERACTION: 
    95101               doInteraction( de->p_arg ); break; 
     
    104110} 
    105111 
     112/**************************************************************************** 
     113 * Individual simple dialogs 
     114 ****************************************************************************/ 
    106115void DialogsProvider::playlistDialog() 
    107116{ 
     
    109118} 
    110119 
     120void DialogsProvider::prefsDialog() 
     121{ 
     122    PrefsDialog::getInstance( p_intf )->toggleVisible(); 
     123} 
     124void DialogsProvider::extendedDialog() 
     125{ 
     126    ExtendedDialog::getInstance( p_intf )->toggleVisible(); 
     127} 
     128 
     129void DialogsProvider::messagesDialog() 
     130{ 
     131    MessagesDialog::getInstance( p_intf )->toggleVisible(); 
     132} 
     133 
     134void DialogsProvider::helpDialog() 
     135{ 
     136    HelpDialog::getInstance( p_intf )->toggleVisible(); 
     137} 
     138 
     139void DialogsProvider::aboutDialog() 
     140{ 
     141    AboutDialog::getInstance( p_intf )->toggleVisible(); 
     142} 
     143 
     144void DialogsProvider::mediaInfoDialog() 
     145{ 
     146    MediaInfoDialog::getInstance( p_intf )->toggleVisible(); 
     147} 
     148 
     149void DialogsProvider::bookmarksDialog() 
     150{ 
     151} 
     152 
     153/**************************************************************************** 
     154 * All the open/add stuff 
     155 ****************************************************************************/ 
     156 
    111157void DialogsProvider::openDialog() 
    112158{ 
     
    123169    OpenDialog::getInstance( p_intf->p_sys->p_mi  , p_intf )->showTab( i_tab ); 
    124170} 
     171 
     172/**** Simple open ****/ 
     173 
     174QStringList DialogsProvider::showSimpleOpen() 
     175{ 
     176    QString FileTypes; 
     177    FileTypes = _("Media Files"); 
     178    FileTypes += " ( "; 
     179    FileTypes += EXTENSIONS_MEDIA; 
     180    FileTypes += ");;"; 
     181    FileTypes += _("Video Files"); 
     182    FileTypes += " ( "; 
     183    FileTypes += EXTENSIONS_VIDEO; 
     184    FileTypes += ");;"; 
     185    FileTypes += _("Sound Files"); 
     186    FileTypes += " ( "; 
     187    FileTypes += EXTENSIONS_AUDIO; 
     188    FileTypes += ");;"; 
     189    FileTypes += _("PlayList Files"); 
     190    FileTypes += " ( "; 
     191    FileTypes += EXTENSIONS_PLAYLIST; 
     192    FileTypes += ");;"; 
     193    FileTypes += _("All Files"); 
     194    FileTypes += " (*.*)"; 
     195    FileTypes.replace(QString(";*"), QString(" *")); 
     196    return QFileDialog::getOpenFileNames( NULL, qfu(I_OP_SEL_FILES ), 
     197                    p_intf->p_libvlc->psz_homedir, FileTypes ); 
     198} 
     199 
     200void DialogsProvider::addFromSimple( bool pl, bool go) 
     201{ 
     202    QStringList files = DialogsProvider::showSimpleOpen(); 
     203    int i = 0; 
     204    foreach( QString file, files ) 
     205    { 
     206        const char * psz_utf8 = qtu( file ); 
     207        playlist_Add( THEPL, psz_utf8, NULL, 
     208                      go ? ( PLAYLIST_APPEND | ( i ? 0 : PLAYLIST_GO ) | 
     209                                               ( i ? PLAYLIST_PREPARSE : 0 ) ) 
     210                         : ( PLAYLIST_APPEND | PLAYLIST_PREPARSE ), 
     211                      PLAYLIST_END, 
     212                      pl ? VLC_TRUE : VLC_FALSE ); 
     213        i++; 
     214    } 
     215} 
     216 
     217void DialogsProvider::simplePLAppendDialog() 
     218{ 
     219    addFromSimple( true, false ); 
     220} 
     221 
     222void DialogsProvider::simpleMLAppendDialog() 
     223{ 
     224    addFromSimple( false, false ); 
     225} 
     226 
     227void DialogsProvider::simpleOpenDialog() 
     228{ 
     229    addFromSimple( true, true ); 
     230} 
     231 
     232void DialogsProvider::openPlaylist() 
     233{ 
     234    QStringList files = showSimpleOpen(); 
     235    foreach( QString file, files ) 
     236    { 
     237        playlist_Import( THEPL, qtu(file) ); 
     238    } 
     239} 
     240 
     241void DialogsProvider::savePlaylist() 
     242{ 
     243    QFileDialog *qfd = new QFileDialog( NULL, 
     244                                   qtr("Choose a filename to save playlist"), 
     245                                   p_intf->p_libvlc->psz_homedir, 
     246                                   qfu("XSPF playlist (*.xspf);; ") + 
     247                                   qfu("M3U playlist (*.m3u);; Any (*.*) ") ); 
     248    qfd->setFileMode( QFileDialog::AnyFile ); 
     249    qfd->setAcceptMode( QFileDialog::AcceptSave ); 
     250    qfd->setConfirmOverwrite( true ); 
     251 
     252    if( qfd->exec() == QDialog::Accepted ) 
     253    { 
     254        if( qfd->selectedFiles().count() > 0 ) 
     255        { 
     256            char *psz_module, *psz_m3u = "export-m3u", 
     257                 *psz_xspf = "export-xspf"; 
     258 
     259            QString file = qfd->selectedFiles().first(); 
     260            QString filter = qfd->selectedFilter(); 
     261 
     262            if( file.contains(".xsp") || 
     263                ( filter.contains(".xspf") && !file.contains(".m3u") ) ) 
     264            { 
     265                psz_module = psz_xspf; 
     266                if( !file.contains( ".xsp" ) ) 
     267                    file.append( ".xspf" ); 
     268            } 
     269            else 
     270            { 
     271                psz_module = psz_m3u; 
     272                if( !file.contains( ".m3u" ) ) 
     273                    file.append( ".m3u" ); 
     274            } 
     275 
     276            playlist_Export( THEPL, qtu(file), THEPL->p_playlist_category, 
     277                             psz_module); 
     278        } 
     279    } 
     280    delete qfd; 
     281} 
     282 
     283static void openDirectory( intf_thread_t* p_intf, bool pl, bool go ) 
     284{ 
     285    QString dir = QFileDialog::getExistingDirectory ( 0, 
     286                                                     _("Open directory") ); 
     287    input_item_t *p_input = input_ItemNewExt( THEPL, qtu(dir), NULL, 
     288                                               0, NULL, -1 ); 
     289    playlist_AddInput( THEPL, p_input, 
     290                       go ? ( PLAYLIST_APPEND | PLAYLIST_GO ) : PLAYLIST_APPEND, 
     291                       PLAYLIST_END, pl); 
     292    input_Read( THEPL, p_input, VLC_FALSE ); 
     293} 
     294 
     295void DialogsProvider::PLAppendDir() 
     296{ 
     297    openDirectory( p_intf, true, false ); 
     298} 
     299 
     300void DialogsProvider::MLAppendDir() 
     301{ 
     302    openDirectory( p_intf, false , false ); 
     303} 
     304 
     305 
     306/**************************************************************************** 
     307 * Sout emulation 
     308 ****************************************************************************/ 
     309 
     310void DialogsProvider::streamingDialog() 
     311{ 
     312    OpenDialog *o = new OpenDialog( p_intf->p_sys->p_mi, p_intf, true ); 
     313    if ( o->exec() == QDialog::Accepted ) 
     314    { 
     315        SoutDialog *s = new SoutDialog( p_intf->p_sys->p_mi, p_intf ); 
     316        if( s->exec() == QDialog::Accepted ) 
     317        { 
     318            msg_Err(p_intf, "mrl %s\n", qta(s->mrl)); 
     319            /* Just do it */ 
     320            int i_len = strlen( qtu(s->mrl) ) + 10; 
     321            char *psz_option = (char*)malloc(i_len); 
     322            snprintf( psz_option, i_len - 1, ":sout=%s", qtu(s->mrl)); 
     323 
     324            playlist_AddExt( THEPL, qtu( o->mrl ), "Streaming", 
     325                             PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END, 
     326                             -1, &psz_option, 1, VLC_TRUE ); 
     327        } 
     328        delete s; 
     329    } 
     330    delete o; 
     331} 
     332 
     333/**************************************************************************** 
     334 * Menus / Interaction 
     335 ****************************************************************************/ 
     336 
     337void DialogsProvider::menuAction( QObject *data ) 
     338{ 
     339    QVLCMenu::DoAction( p_intf, data ); 
     340} 
     341 
     342void DialogsProvider::menuUpdateAction( QObject *data ) 
     343{ 
     344    MenuFunc * f = qobject_cast<MenuFunc *>(data); 
     345    f->doFunc( p_intf ); 
     346} 
     347 
     348void DialogsProvider::SDMenuAction( QString data ) 
     349{ 
     350    char *psz_sd = data.toUtf8().data(); 
     351    if( !playlist_IsServicesDiscoveryLoaded( THEPL, psz_sd ) ) 
     352        playlist_ServicesDiscoveryAdd( THEPL, psz_sd ); 
     353    else 
     354        playlist_ServicesDiscoveryRemove( THEPL, psz_sd ); 
     355} 
     356 
    125357 
    126358void DialogsProvider::doInteraction( intf_dialog_args_t *p_arg ) 
     
    156388} 
    157389 
    158 void DialogsProvider::quit() 
    159 { 
    160     p_intf->b_die = VLC_TRUE; 
    161     QApplication::quit(); 
    162 } 
    163  
    164 void DialogsProvider::MediaInfoDialog() 
    165 { 
    166     MediaInfoDialog::getInstance( p_intf )->toggleVisible(); 
    167 } 
    168  
    169 void DialogsProvider::streamingDialog() 
    170 { 
    171     OpenDialog *o = new OpenDialog( p_intf->p_sys->p_mi, p_intf, true ); 
    172     if ( o->exec() == QDialog::Accepted ) 
    173     { 
    174         SoutDialog *s = new SoutDialog( p_intf->p_sys->p_mi, p_intf ); 
    175         if( s->exec() == QDialog::Accepted ) 
    176         { 
    177             msg_Err(p_intf, "mrl %s\n", qta(s->mrl)); 
    178             /* Just do it */ 
    179             int i_len = strlen( qtu(s->mrl) ) + 10; 
    180             char *psz_option = (char*)malloc(i_len); 
    181             snprintf( psz_option, i_len - 1, ":sout=%s", qtu(s->mrl)); 
    182  
    183             playlist_AddExt( THEPL, qtu( o->mrl ), "Streaming", 
    184                              PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END, 
    185                              -1, &psz_option, 1, VLC_TRUE ); 
    186         } 
    187         delete s; 
    188     } 
    189     delete o; 
    190 } 
    191  
    192 void DialogsProvider::prefsDialog() 
    193 { 
    194     PrefsDialog::getInstance( p_intf )->toggleVisible(); 
    195 } 
    196 void DialogsProvider::extendedDialog() 
    197 { 
    198     ExtendedDialog::getInstance( p_intf )->toggleVisible(); 
    199 } 
    200  
    201 void DialogsProvider::messagesDialog() 
    202 { 
    203     MessagesDialog::getInstance( p_intf )->toggleVisible(); 
    204 } 
    205  
    206 void DialogsProvider::helpDialog() 
    207 { 
    208     HelpDialog::getInstance( p_intf )->toggleVisible(); 
    209 } 
    210  
    211 void DialogsProvider::aboutDialog() 
    212 { 
    213     AboutDialog::getInstance( p_intf )->toggleVisible(); 
    214 } 
    215  
    216 void DialogsProvider::menuAction( QObject *data ) 
    217 { 
    218     QVLCMenu::DoAction( p_intf, data ); 
    219 } 
    220  
    221 void DialogsProvider::menuUpdateAction( QObject *data ) 
    222 { 
    223     MenuFunc * f = qobject_cast<MenuFunc *>(data); 
    224     f->doFunc( p_intf ); 
    225 } 
    226  
    227 void DialogsProvider::SDMenuAction( QString data ) 
    228 { 
    229     char *psz_sd = data.toUtf8().data(); 
    230     if( !playlist_IsServicesDiscoveryLoaded( THEPL, psz_sd ) ) 
    231         playlist_ServicesDiscoveryAdd( THEPL, psz_sd ); 
    232     else 
    233         playlist_ServicesDiscoveryRemove( THEPL, psz_sd ); 
    234 } 
    235  
    236  
    237 void DialogsProvider::simplePLAppendDialog() 
    238 { 
    239     QStringList files = showSimpleOpen(); 
    240     QString file; 
    241     foreach( file, files ) 
    242     { 
    243         const char * psz_utf8 = qtu( file ); 
    244         playlist_Add( THEPL, psz_utf8, NULL, 
    245                 PLAYLIST_APPEND | PLAYLIST_PREPARSE, PLAYLIST_END, VLC_TRUE ); 
    246     } 
    247 } 
    248  
    249 void DialogsProvider::simpleMLAppendDialog() 
    250 { 
    251     QStringList files = showSimpleOpen(); 
    252     QString file; 
    253     foreach( file, files ) 
    254     { 
    255         const char * psz_utf8 =  qtu( file ); 
    256         playlist_Add( THEPL, psz_utf8, psz_utf8, 
    257                       PLAYLIST_APPEND | PLAYLIST_PREPARSE, PLAYLIST_END, 
    258                       VLC_TRUE); 
    259     } 
    260 } 
    261  
    262 void DialogsProvider::simpleOpenDialog() 
    263 { 
    264     QStringList files = showSimpleOpen(); 
    265     QString file; 
    266     for( size_t i = 0 ; i< files.size(); i++ ) 
    267     { 
    268         const char * psz_utf8 = qtu( files[i] ); 
    269         /* Play the first one, parse and enqueue the other ones */ 
    270         playlist_Add( THEPL, psz_utf8, NULL, 
    271                       PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO) | 
    272                       ( i ? PLAYLIST_PREPARSE : 0 ), 
    273                       PLAYLIST_END, VLC_TRUE ); 
    274     } 
    275 } 
    276  
    277 void DialogsProvider::openPlaylist() 
    278 { 
    279     QStringList files = showSimpleOpen(); 
    280     QString file; 
    281     for( size_t i = 0 ; i< files.size(); i++ ) 
    282     { 
    283         const char * psz_utf8 = qtu( files[i] ); 
    284         playlist_Import( THEPL, psz_utf8 ); 
    285     } 
    286 } 
    287  
    288 void DialogsProvider::openDirectory() 
    289 { 
    290     QString dir = QFileDialog::getExistingDirectory ( 0, 
    291                                                      _("Open directory") ); 
    292     const char *psz_utf8 = qtu( dir ); 
    293     input_item_t *p_input = input_ItemNewExt( THEPL, psz_utf8, NULL, 
    294                                                0, NULL, -1 ); 
    295     playlist_AddInput( THEPL, p_input, PLAYLIST_APPEND, PLAYLIST_END, VLC_TRUE); 
    296     input_Read( THEPL, p_input, VLC_FALSE ); 
    297 } 
    298 void DialogsProvider::openMLDirectory() 
    299 { 
    300     QString dir = QFileDialog::getExistingDirectory ( 0, 
    301                                                      _("Open directory") ); 
    302     const char *psz_utf8 = qtu( dir ); 
    303     input_item_t *p_input = input_ItemNewExt( THEPL, psz_utf8, NULL, 
    304                                                0, NULL, -1 ); 
    305     playlist_AddInput( THEPL, p_input, PLAYLIST_APPEND, PLAYLIST_END, 
    306                         VLC_FALSE ); 
    307     input_Read( THEPL, p_input, VLC_FALSE ); 
    308 } 
    309  
    310 QStringList DialogsProvider::showSimpleOpen() 
    311 { 
    312     QString FileTypes; 
    313     FileTypes = _("Media Files"); 
    314     FileTypes += " ( "; 
    315     FileTypes += EXTENSIONS_MEDIA; 
    316     FileTypes += ");;"; 
    317     FileTypes += _("Video Files"); 
    318     FileTypes += " ( "; 
    319     FileTypes += EXTENSIONS_VIDEO; 
    320     FileTypes += ");;"; 
    321     FileTypes += _("Sound Files"); 
    322     FileTypes += " ( "; 
    323     FileTypes += EXTENSIONS_AUDIO; 
    324     FileTypes += ");;"; 
    325     FileTypes += _("PlayList Files"); 
    326     FileTypes += " ( "; 
    327     FileTypes += EXTENSIONS_PLAYLIST; 
    328     FileTypes += ");;"; 
    329     FileTypes += _("All Files"); 
    330     FileTypes += " (*.*)"; 
    331     FileTypes.replace(QString(";*"), QString(" *")); 
    332     return QFileDialog::getOpenFileNames( NULL, qfu(I_POP_SEL_FILES ), 
    333                     p_intf->p_libvlc->psz_homedir, FileTypes ); 
    334 } 
    335  
    336390void DialogsProvider::switchToSkins() 
    337391{ 
     
    339393} 
    340394 
    341 void DialogsProvider::bookmarksDialog() 
    342 { 
    343 } 
    344  
    345395void DialogsProvider::popupMenu( int i_dialog ) 
    346396{ 
    347  
    348 
     397
  • modules/gui/qt4/dialogs_provider.hpp

    re9735ab ra94647f  
    7171    static DialogsProvider *instance; 
    7272    QStringList showSimpleOpen(); 
     73    void addFromSimple( bool, bool ); 
    7374 
    7475public slots: 
    7576    void playlistDialog(); 
    7677    void bookmarksDialog(); 
    77     void MediaInfoDialog(); 
     78    void mediaInfoDialog(); 
    7879    void prefsDialog(); 
    7980    void extendedDialog(); 
     
    9394    void streamingDialog(); 
    9495    void openPlaylist(); 
    95     void openDirectory(); 
    96     void openMLDirectory(); 
     96    void savePlaylist(); 
     97    void PLAppendDir(); 
     98    void MLAppendDir(); 
    9799    void quit(); 
    98100    void switchToSkins(); 
  • modules/gui/qt4/menus.cpp

    re9735ab ra94647f  
    2828#include <QSignalMapper> 
    2929 
     30#include <vlc_intf_strings.h> 
     31 
    3032#include "main_interface.hpp" 
    31  
    3233#include "menus.hpp" 
    3334#include "dialogs_provider.hpp" 
     
    156157    menu->addSeparator(); 
    157158 
    158     DP_SADD( qtr( "Open playlist file"), "", "", openPlaylist() ); 
    159 //    DP_SADD( qtr( "Save playlist to file" ), "", "", savePlaylist() ); 
     159    DP_SADD( qtr(I_PL_LOAD), "", "", openPlaylist() ); 
     160    DP_SADD( qtr(I_PL_SAVE), "", "", savePlaylist() ); 
    160161    menu->addSeparator(); 
    161162    menu->addAction( qtr("Undock from interface"), mi, 
     
    176177        menu->addSeparator(); 
    177178    } 
    178     DP_SADD( qtr("Messages" ), "", "", messagesDialog() ); 
    179     DP_SADD( qtr("Information") , "", "", MediaInfoDialog() ); 
    180     DP_SADD( qtr("Bookmarks"), "", "", bookmarksDialog() ); 
    181     DP_SADD( qtr("Extended settings"), "","",extendedDialog() ); 
     179    DP_SADD( qtr(I_MENU_MSG), "", "", messagesDialog() ); 
     180    DP_SADD( qtr(I_MENU_INFO) , "", "", mediaInfoDialog() ); 
     181    DP_SADD( qtr(I_MENU_EXT), "","",extendedDialog() ); 
    182182    if( mi ) 
    183183    { 
     
    291291{ 
    292292    QMenu *menu = new QMenu(); 
    293     menu->setTitle( qtr( "Additional sources" ) ); 
     293    menu->setTitle( qtr(I_PL_SD) ); 
    294294    vlc_list_t *p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, 
    295295                                        FIND_ANYWHERE ); 
     
    332332    DP_SADD( qtr("Help") , "", "", helpDialog() ); 
    333333                menu->addSeparator(); 
    334     DP_SADD( qtr("About VLC media player..."), "", "", aboutDialog() ); 
     334    DP_SADD( qtr(I_MENU_ABOUT), "", "", aboutDialog() ); 
    335335    return menu; 
    336336} 
  • modules/misc/playlist/m3u.c

    rd3fe7f2 ra94647f  
    4343 * Export_M3U: main export function 
    4444 *****************************************************************************/ 
    45 int Export_M3U( vlc_object_t *p_this ) 
     45static void DoChildren( playlist_t *p_playlist, playlist_export_t *p_export, 
     46                        playlist_item_t *p_root ) 
    4647{ 
    47     playlist_t *p_playlist = (playlist_t*)p_this; 
    48     playlist_export_t *p_export = (playlist_export_t *)p_playlist->p_private; 
    4948    int i, j; 
    5049 
    51     msg_Dbg(p_playlist, "saving using M3U format"); 
    52  
    53     /* Write header */ 
    54     fprintf( p_export->p_file, "#EXTM3U\n" ); 
    55  
    5650    /* Go through the playlist and add items */ 
    57     for( i = 0; i< p_export->p_root->i_children ; i++) 
     51    for( i = 0; i< p_root->i_children ; i++) 
    5852    { 
    59         playlist_item_t *p_current = p_export->p_root->pp_children[i]; 
     53        playlist_item_t *p_current = p_root->pp_children[i]; 
    6054        if( p_current->i_flags & PLAYLIST_SAVE_FLAG ) 
    6155            continue; 
     56 
     57        if( p_current->i_children >= 0 ) 
     58        { 
     59            DoChildren( p_playlist, p_export, p_current ); 
     60            continue; 
     61        } 
     62 
     63        assert( p_current->p_input->psz_uri ); 
    6264 
    6365        /* General info */ 
     
    100102                 p_current->p_input->psz_uri ); 
    101103    } 
     104} 
     105 
     106int Export_M3U( vlc_object_t *p_this ) 
     107{ 
     108    playlist_t *p_playlist = (playlist_t*)p_this; 
     109    playlist_export_t *p_export = (playlist_export_t *)p_playlist->p_private; 
     110 
     111    msg_Dbg(p_playlist, "saving using M3U format"); 
     112 
     113    /* Write header */ 
     114    fprintf( p_export->p_file, "#EXTM3U\n" ); 
     115 
     116    DoChildren( p_playlist, p_export, p_export->p_root ); 
    102117    return VLC_SUCCESS; 
    103118} 
     119