[vlc-commits] Qt: allow SQL-ML configuration

Jean-Baptiste Kempf git at videolan.org
Mon May 9 11:06:00 CEST 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue May  3 02:32:31 2011 +0200| [e3471a655766ebe136de42ad1abf10138cdd4227] | committer: Jean-Baptiste Kempf

Qt: allow SQL-ML configuration

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

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

 modules/gui/qt4/components/simple_preferences.cpp |   10 ++++++++++
 modules/gui/qt4/components/simple_preferences.hpp |    1 +
 modules/gui/qt4/dialogs/ml_configuration.cpp      |    4 ----
 modules/gui/qt4/dialogs/ml_configuration.hpp      |   11 ++---------
 modules/gui/qt4/ui/sprefs_interface.ui            |   15 +++++++++++----
 5 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/modules/gui/qt4/components/simple_preferences.cpp b/modules/gui/qt4/components/simple_preferences.cpp
index b957b73..f923866 100644
--- a/modules/gui/qt4/components/simple_preferences.cpp
+++ b/modules/gui/qt4/components/simple_preferences.cpp
@@ -29,6 +29,7 @@
 
 #include "components/simple_preferences.hpp"
 #include "components/preferences_widgets.hpp"
+#include "dialogs/ml_configuration.hpp"
 
 #include <vlc_config_cat.h>
 #include <vlc_configuration.h>
@@ -548,6 +549,8 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             ui.assoButton->hide();
             ui.assocLabel->hide();
 #endif
+            BUTTONACT( ui.sqlMLbtn, configML() );
+
             /* interface */
             char *psz_intf = config_GetPsz( p_intf, "intf" );
             if( psz_intf )
@@ -886,6 +889,13 @@ void SPrefsPanel::changeStyle( QString s_style )
     };
 }
 
+void SPrefsPanel::configML()
+{
+    MLConfDialog *mld = new MLConfDialog( this, p_intf );
+    mld->exec();
+    delete mld;
+}
+
 #ifdef WIN32
 #include <QDialogButtonBox>
 #include "util/registry.hpp"
diff --git a/modules/gui/qt4/components/simple_preferences.hpp b/modules/gui/qt4/components/simple_preferences.hpp
index a709f74..7307a76 100644
--- a/modules/gui/qt4/components/simple_preferences.hpp
+++ b/modules/gui/qt4/components/simple_preferences.hpp
@@ -137,6 +137,7 @@ private slots:
     void assoDialog();
     void saveAsso();
 #endif
+    void configML();
     void changeStyle( QString );
 };
 
diff --git a/modules/gui/qt4/dialogs/ml_configuration.cpp b/modules/gui/qt4/dialogs/ml_configuration.cpp
index 7fa9d38..2380b7b 100644
--- a/modules/gui/qt4/dialogs/ml_configuration.cpp
+++ b/modules/gui/qt4/dialogs/ml_configuration.cpp
@@ -244,10 +244,6 @@ MLConfDialog::MLConfDialog( QWidget *parent, intf_thread_t *_p_intf )
     CONNECT( recursivity, toggled( bool ), model, setRecursivity( bool ) );
 }
 
-MLConfDialog::~MLConfDialog()
-{
-}
-
 void MLConfDialog::init()
 {
     bool b_recursive = var_CreateGetBool( p_ml, "ml-recursive-scan" );
diff --git a/modules/gui/qt4/dialogs/ml_configuration.hpp b/modules/gui/qt4/dialogs/ml_configuration.hpp
index 43ab69d..5cefc6d 100644
--- a/modules/gui/qt4/dialogs/ml_configuration.hpp
+++ b/modules/gui/qt4/dialogs/ml_configuration.hpp
@@ -85,17 +85,10 @@ public slots:
 class MLConfDialog : public QVLCDialog
 {
     Q_OBJECT;
-    public:
-    static MLConfDialog * getInstance( intf_thread_t *p_intf )
-    {
-        if( !instance )
-            instance = new MLConfDialog( (QWidget *)p_intf->p_sys->p_mi, p_intf );
-        return instance;
-    }
-    virtual ~MLConfDialog();
+public:
+    MLConfDialog( QWidget *, intf_thread_t * );
 
 private:
-    MLConfDialog( QWidget *, intf_thread_t * );
     void init();
 
     vlc_array_t *p_monitored_dirs;
diff --git a/modules/gui/qt4/ui/sprefs_interface.ui b/modules/gui/qt4/ui/sprefs_interface.ui
index 268734d..a463ebf 100644
--- a/modules/gui/qt4/ui/sprefs_interface.ui
+++ b/modules/gui/qt4/ui/sprefs_interface.ui
@@ -246,7 +246,7 @@
         </property>
        </widget>
       </item>
-      <item row="1" column="0">
+      <item row="2" column="0">
        <widget class="QLabel" name="assocLabel">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
@@ -262,7 +262,7 @@
         </property>
        </widget>
       </item>
-      <item row="1" column="1">
+      <item row="2" column="1">
        <spacer name="horizontalSpacer_6">
         <property name="orientation">
          <enum>Qt::Horizontal</enum>
@@ -275,7 +275,7 @@
         </property>
        </spacer>
       </item>
-      <item row="1" column="2">
+      <item row="2" column="2">
        <widget class="QPushButton" name="assoButton">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -294,7 +294,7 @@
         </property>
        </widget>
       </item>
-      <item row="1" column="3">
+      <item row="2" column="3">
        <spacer name="horizontalSpacer_8">
         <property name="orientation">
          <enum>Qt::Horizontal</enum>
@@ -307,6 +307,13 @@
         </property>
        </spacer>
       </item>
+      <item row="1" column="0">
+       <widget class="QPushButton" name="sqlMLbtn">
+        <property name="text">
+         <string>Configure Media Library</string>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>



More information about the vlc-commits mailing list