[vlc-devel] [PATCH 11/15] qt: Editor - Add miniplayer toolbar support

Rohan Rajpal rohan17089 at iiitd.ac.in
Mon Aug 12 15:24:25 CEST 2019


Add support to make miniplayer toolbar editable
---
 modules/gui/qt/dialogs/toolbareditor.cpp     | 9 ++++++---
 modules/gui/qt/dialogs/toolbareditor.hpp     | 2 +-
 modules/gui/qt/qml/dialogs/ToolbarEditor.qml | 5 ++++-
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/modules/gui/qt/dialogs/toolbareditor.cpp b/modules/gui/qt/dialogs/toolbareditor.cpp
index 93c0c7941c..452a184994 100644
--- a/modules/gui/qt/dialogs/toolbareditor.cpp
+++ b/modules/gui/qt/dialogs/toolbareditor.cpp
@@ -151,7 +151,7 @@ void ToolbarEditorDialog::newProfile()
     if( !ok ) return;
 
     QVariant config;
-    QMetaObject::invokeMethod(editorView->rootObject(),"getConfig",
+    QMetaObject::invokeMethod(editorView->rootObject(),"getProfileConfig",
                               Q_RETURN_ARG(QVariant, config));
 
     profileCombo->addItem( name, config.toString() );
@@ -165,8 +165,11 @@ void ToolbarEditorDialog::deleteProfile()
 
 void ToolbarEditorDialog::changeProfile( int i )
 {
-    QString config = profileCombo->itemData( i ).toString();
-    emit updatePlayerModel(config);
+    QStringList qs_list = profileCombo->itemData( i ).toString().split( "|" );
+    if( qs_list.count() < 2 )
+            return;
+    emit updatePlayerModel("MainPlayerToolbar",qs_list[0]);
+    emit updatePlayerModel("MiniPlayerToolbar",qs_list[1]);
 }
 
 void ToolbarEditorDialog::deleteCursor()
diff --git a/modules/gui/qt/dialogs/toolbareditor.hpp b/modules/gui/qt/dialogs/toolbareditor.hpp
index be27ff6ac2..58e38449c1 100644
--- a/modules/gui/qt/dialogs/toolbareditor.hpp
+++ b/modules/gui/qt/dialogs/toolbareditor.hpp
@@ -50,7 +50,7 @@ private:
     QQuickWidget *editorView;
 
 signals:
-    void updatePlayerModel(QString config);
+    void updatePlayerModel(QString toolbarName,QString config);
     void saveConfig();
 };
 
diff --git a/modules/gui/qt/qml/dialogs/ToolbarEditor.qml b/modules/gui/qt/qml/dialogs/ToolbarEditor.qml
index b065a184e1..faadccf25f 100644
--- a/modules/gui/qt/qml/dialogs/ToolbarEditor.qml
+++ b/modules/gui/qt/qml/dialogs/ToolbarEditor.qml
@@ -117,7 +117,10 @@ Rectangle{
 
     Connections{
         target: toolbareditor
-        onUpdatePlayerModel: playerControlBarModel.reloadConfig(config)
+        onUpdatePlayerModel: {
+            if (toolbarName == "MainPlayerToolbar")
+                playerControlBarModel.reloadConfig(config)
+        }
         onSaveConfig: playerControlBarModel.saveConfig()
     }
 
-- 
2.17.1



More information about the vlc-devel mailing list