[vlc-devel] commit: Added import of configuration file support ( Jean-François Massol )

git version control git at videolan.org
Fri Mar 7 00:17:42 CET 2008


vlc | branch: master | Jean-François Massol <jf at debian.(none)> | Thu Mar  6 21:26:08 2008 +0100| [dc1c205280bafaefa53d5e81c4f13270226ee2e5]

Added import of configuration file support

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dc1c205280bafaefa53d5e81c4f13270226ee2e5
---

 modules/gui/qt4/dialogs/vlm.cpp |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/dialogs/vlm.cpp b/modules/gui/qt4/dialogs/vlm.cpp
index fc1e42d..264d66b 100644
--- a/modules/gui/qt4/dialogs/vlm.cpp
+++ b/modules/gui/qt4/dialogs/vlm.cpp
@@ -130,6 +130,9 @@ VLMDialog::VLMDialog( QWidget *parent, intf_thread_t *_p_intf ) : QVLCDialog( pa
         new QSpacerItem( 10, 10, QSizePolicy::Minimum, QSizePolicy::Expanding);
     vlmItemLayout->addItem( spacer );
 
+    QPushButton *importButton = new QPushButton( qtr(  "Import" ) );
+    ui.buttonBox->addButton( importButton, QDialogButtonBox::ActionRole );
+
     QPushButton *exportButton = new QPushButton( qtr( "Export" ) );
     ui.buttonBox->addButton( exportButton, QDialogButtonBox::ActionRole );
 
@@ -149,6 +152,7 @@ VLMDialog::VLMDialog( QWidget *parent, intf_thread_t *_p_intf ) : QVLCDialog( pa
 
     BUTTONACT( closeButton, close() );
     BUTTONACT( exportButton, exportVLMConf() );
+    BUTTONACT( importButton, importVLMConf() );
     BUTTONACT( ui.addButton, addVLMItem() );
     BUTTONACT( ui.clearButton, clearWidgets() );
     BUTTONACT( ui.saveButton, saveModifications() );
@@ -270,9 +274,23 @@ bool VLMDialog::exportVLMConf()
     return false;
 }
 
-// TODO : import configuration file
+
 bool VLMDialog::importVLMConf()
 {
+    QString openVLMConfFileName = QFileDialog::getOpenFileName(
+            this, qtr( "Choose a VLM configuration file to open..." ),
+            qfu( p_intf->p_libvlc->psz_homedir ),
+            qtr( "VLM conf (*.vlm) ;; All (*.*)" ) );
+
+    if( !openVLMConfFileName.isEmpty() )
+    {
+        vlm_message_t *message;
+        QString command = "load \"" + openVLMConfFileName + "\"";
+        vlm_ExecuteCommand( p_vlm, qtu( command ) , &message );
+        vlm_MessageDelete( message );
+        return true;
+    }
+    return false;
 }
 
 void VLMDialog::clearWidgets()




More information about the vlc-devel mailing list