[vlc-commits] qt: Editor - Add miniplayer toolbar support

Rohan Rajpal git at videolan.org
Wed Aug 21 16:27:06 CEST 2019


vlc | branch: master | Rohan Rajpal <rohan17089 at iiitd.ac.in> | Sat Aug  3 12:54:52 2019 +0530| [101ad7ab89a610be20eb36eba8a3dd36df1e8f83] | committer: Jean-Baptiste Kempf

qt: Editor - Add miniplayer toolbar support

Add support to make miniplayer toolbar editable

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

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

 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()
     }
 



More information about the vlc-commits mailing list