[vlc-devel] [PATCH 1/2] qt: expose has VLM property

Pierre Lamot pierre at videolabs.io
Tue Oct 6 09:31:30 CEST 2020


  some menus or shortcuts are only available when VLM is enabled
---
 modules/gui/qt/maininterface/main_interface.cpp | 8 ++++++++
 modules/gui/qt/maininterface/main_interface.hpp | 3 ++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/maininterface/main_interface.cpp b/modules/gui/qt/maininterface/main_interface.cpp
index 4472b6754d..3276a5fb38 100644
--- a/modules/gui/qt/maininterface/main_interface.cpp
+++ b/modules/gui/qt/maininterface/main_interface.cpp
@@ -257,6 +257,14 @@ MainInterface::~MainInterface()
     p_intf->p_sys->p_mi = NULL;
 }
 
+bool MainInterface::hasVLM() const {
+#ifdef ENABLE_VLM
+    return true;
+#else
+    return false;
+#endif
+}
+
 void MainInterface::computeMinimumSize()
 {
     int minWidth = 450;
diff --git a/modules/gui/qt/maininterface/main_interface.hpp b/modules/gui/qt/maininterface/main_interface.hpp
index 43acc95233..ed7bd6c772 100644
--- a/modules/gui/qt/maininterface/main_interface.hpp
+++ b/modules/gui/qt/maininterface/main_interface.hpp
@@ -152,6 +152,7 @@ class MainInterface : public QVLCMW
     Q_PROPERTY(bool mediaLibraryAvailable READ hasMediaLibrary CONSTANT)
     Q_PROPERTY(bool gridView READ hasGridView WRITE setGridView NOTIFY gridViewChanged)
     Q_PROPERTY(ColorSchemeModel* colorScheme READ getColorScheme CONSTANT)
+    Q_PROPERTY(bool hasVLM READ hasVLM CONSTANT)
 
 public:
     /* tors */
@@ -188,7 +189,7 @@ public:
     inline bool hasMediaLibrary() const { return b_hasMedialibrary; }
     inline bool hasGridView() const { return m_gridView; }
     inline ColorSchemeModel* getColorScheme() const { return m_colorScheme; }
-
+    bool hasVLM() const;
 
     bool hasEmbededVideo() const;
     VideoSurfaceProvider* getVideoSurfaceProvider() const;
-- 
2.25.1



More information about the vlc-devel mailing list