Changeset dc1c205280bafaefa53d5e81c4f13270226ee2e5

Show
Ignore:
Timestamp:
03/07/08 00:16:04 (6 months ago)
Author:
Jean-Baptiste Kempf <jb@videolan.org>
git-committer:
Jean-Baptiste Kempf <jb@videolan.org> 1204845364 -0800
git-parent:

[b474086030dda418c7be58fc5a4812332e6bd2a5]

git-author:
Jean-François Massol <jf@debian.(none)> 1204835168 +0100
Message:

Added import of configuration file support

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/qt4/dialogs/vlm.cpp

    rdbddc5a rdc1c205  
    131131    vlmItemLayout->addItem( spacer ); 
    132132 
     133    QPushButton *importButton = new QPushButton( qtr(  "Import" ) ); 
     134    ui.buttonBox->addButton( importButton, QDialogButtonBox::ActionRole ); 
     135 
    133136    QPushButton *exportButton = new QPushButton( qtr( "Export" ) ); 
    134137    ui.buttonBox->addButton( exportButton, QDialogButtonBox::ActionRole ); 
     
    150153    BUTTONACT( closeButton, close() ); 
    151154    BUTTONACT( exportButton, exportVLMConf() ); 
     155    BUTTONACT( importButton, importVLMConf() ); 
    152156    BUTTONACT( ui.addButton, addVLMItem() ); 
    153157    BUTTONACT( ui.clearButton, clearWidgets() ); 
     
    271275} 
    272276 
    273 // TODO : import configuration file 
     277 
    274278bool VLMDialog::importVLMConf() 
    275279{ 
     280    QString openVLMConfFileName = QFileDialog::getOpenFileName( 
     281            this, qtr( "Choose a VLM configuration file to open..." ), 
     282            qfu( p_intf->p_libvlc->psz_homedir ), 
     283            qtr( "VLM conf (*.vlm) ;; All (*.*)" ) ); 
     284 
     285    if( !openVLMConfFileName.isEmpty() ) 
     286    { 
     287        vlm_message_t *message; 
     288        QString command = "load \"" + openVLMConfFileName + "\""; 
     289        vlm_ExecuteCommand( p_vlm, qtu( command ) , &message ); 
     290        vlm_MessageDelete( message ); 
     291        return true; 
     292    } 
     293    return false; 
    276294} 
    277295