[vlc-devel] [PATCH 12/19] qt: overload mediainfoDialog to show with playlist item index

Fatih Uzunoglu fuzun54 at outlook.com
Wed Aug 12 23:17:19 CEST 2020


---
 modules/gui/qt/dialogs/dialogs_provider.cpp | 21 ++++++++++++++++++++-
 modules/gui/qt/dialogs/dialogs_provider.hpp |  6 +++++-
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/dialogs/dialogs_provider.cpp b/modules/gui/qt/dialogs/dialogs_provider.cpp
index d1df96cb61..5b022a0944 100644
--- a/modules/gui/qt/dialogs/dialogs_provider.cpp
+++ b/modules/gui/qt/dialogs/dialogs_provider.cpp
@@ -284,7 +284,7 @@ void DialogsProvider::aboutDialog()
     AboutDialog::getInstance( p_intf )->toggleVisible();
 }
 
-void DialogsProvider::mediaInfoDialog()
+void DialogsProvider::mediaInfoDialog( void )
 {
     MediaInfoDialog *dialog = MediaInfoDialog::getInstance( p_intf );
     if( !dialog->isVisible() || dialog->currentTab() != MediaInfoDialog::META_PANEL )
@@ -293,6 +293,25 @@ void DialogsProvider::mediaInfoDialog()
         dialog->hide();
 }
 
+void DialogsProvider::mediaInfoDialog( const PlaylistItem& pItem )
+{
+    input_item_t *p_input = nullptr;
+
+    vlc_playlist_item_t * const playlistItem = pItem.raw();
+
+    if( playlistItem )
+    {
+        p_input = vlc_playlist_item_GetMedia(playlistItem);
+    }
+
+    if( p_input )
+    {
+        MediaInfoDialog * const mid = new MediaInfoDialog( p_intf, p_input );
+        mid->setParent( p_intf->p_sys->p_mi, Qt::Dialog );
+        mid->showTab( MediaInfoDialog::META_PANEL );
+    }
+}
+
 void DialogsProvider::mediaCodecDialog()
 {
     MediaInfoDialog *dialog = MediaInfoDialog::getInstance( p_intf );
diff --git a/modules/gui/qt/dialogs/dialogs_provider.hpp b/modules/gui/qt/dialogs/dialogs_provider.hpp
index fb53428ca1..4cd94cd9a0 100644
--- a/modules/gui/qt/dialogs/dialogs_provider.hpp
+++ b/modules/gui/qt/dialogs/dialogs_provider.hpp
@@ -33,6 +33,9 @@
 #include "qt.hpp"
 
 #include "dialogs/open/open.hpp"
+
+#include "playlist/playlist_item.hpp"
+
 #include <QObject>
 #include <QStringList>
 
@@ -119,7 +122,8 @@ private:
 
 public slots:
     void bookmarksDialog();
-    void mediaInfoDialog();
+    void mediaInfoDialog( void );
+    void mediaInfoDialog( const PlaylistItem& pItem );
     void mediaCodecDialog();
     void prefsDialog();
     void extendedDialog();
-- 
2.25.1



More information about the vlc-devel mailing list