[vlc-commits] Qt: provide overloaded checkbox_list method

Jean-Baptiste Kempf git at videolan.org
Wed Feb 8 12:56:39 CET 2012


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Feb  8 12:31:02 2012 +0100| [effc65ccba7bb037e3c3b7d8ca0a07a45ae07c4c] | committer: Jean-Baptiste Kempf

Qt: provide overloaded checkbox_list method

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

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

 modules/gui/qt4/components/preferences_widgets.cpp |   16 ++++++++++++++++
 modules/gui/qt4/components/preferences_widgets.hpp |    1 +
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp
index 20ffa05..5c0ed71 100644
--- a/modules/gui/qt4/components/preferences_widgets.cpp
+++ b/modules/gui/qt4/components/preferences_widgets.cpp
@@ -741,6 +741,22 @@ void ModuleListConfigControl::checkbox_lists( module_t *p_parser )
             cbl->checkBox->setChecked( true );
 }
 
+void ModuleListConfigControl::checkbox_lists( QString label, QString help, const char* psz_module )
+{
+    QCheckBox *cb = new QCheckBox( label );
+    checkBoxListItem *cbl = new checkBoxListItem;
+
+    CONNECT( cb, stateChanged( int ), this, onUpdate() );
+    if( !help.isEmpty() )
+        cb->setToolTip( formatTooltip( help ) );
+    cbl->checkBox = cb;
+
+    cbl->psz_module = strdup( psz_module );
+    modules.append( cbl );
+
+    if( p_item->value.psz && strstr( p_item->value.psz, cbl->psz_module ) )
+        cbl->checkBox->setChecked( true );
+}
 
 void ModuleListConfigControl::finish( bool bycat )
 {
diff --git a/modules/gui/qt4/components/preferences_widgets.hpp b/modules/gui/qt4/components/preferences_widgets.hpp
index bc509be..f7d7e36 100644
--- a/modules/gui/qt4/components/preferences_widgets.hpp
+++ b/modules/gui/qt4/components/preferences_widgets.hpp
@@ -395,6 +395,7 @@ public slots:
 private:
     void finish( bool );
     void checkbox_lists(module_t*);
+    void checkbox_lists( QString, QString, const char* );
     QList<checkBoxListItem*> modules;
     QGroupBox *groupBox;
     QLineEdit *text;



More information about the vlc-commits mailing list