[vlc-commits] qt: disable access to Bookmark dialogs when medialibrary is disabled

Pierre Lamot git at videolan.org
Thu Oct 15 10:33:11 CEST 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Thu Oct  8 15:28:57 2020 +0200| [bac5c35958e7fa36aea4115cc2564fadbefd1b4f] | committer: Pierre Lamot

qt: disable access to Bookmark dialogs when medialibrary is disabled

  bookmark are stored in the medialibrary

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

 modules/gui/qt/menus/menus.cpp               | 17 ++++++++++-------
 modules/gui/qt/menus/qml/GlobalShortcuts.qml |  2 +-
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/modules/gui/qt/menus/menus.cpp b/modules/gui/qt/menus/menus.cpp
index f846e2a3a7..25a091a66c 100644
--- a/modules/gui/qt/menus/menus.cpp
+++ b/modules/gui/qt/menus/menus.cpp
@@ -527,13 +527,16 @@ QMenu *VLCMenuBar::NavigMenu( intf_thread_t *p_intf, QMenu *menu )
     menu->addMenu( submenu );
     menu->addMenu( new CheckableListMenu( qtr("&Program") , THEMIM->getPrograms(), CheckableListMenu::GROUPED , menu) );
 
-    submenu = new QMenu( qtr( I_MENU_BOOKMARK ), menu );
-    submenu->setTearOffEnabled( true );
-    addDPStaticEntry( submenu, qtr( "&Manage" ), "",
-                      &DialogsProvider::bookmarksDialog, "Ctrl+B" );
-    submenu->addSeparator();
-    action = menu->addMenu( submenu );
-    action->setData( "bookmark" );
+    if (p_intf->p_sys->p_mi->hasMediaLibrary() )
+    {
+        submenu = new QMenu( qtr( I_MENU_BOOKMARK ), menu );
+        submenu->setTearOffEnabled( true );
+        addDPStaticEntry( submenu, qtr( "&Manage" ), "",
+                          &DialogsProvider::bookmarksDialog, "Ctrl+B" );
+        submenu->addSeparator();
+        action = menu->addMenu( submenu );
+        action->setData( "bookmark" );
+    }
 
     menu->addSeparator();
 
diff --git a/modules/gui/qt/menus/qml/GlobalShortcuts.qml b/modules/gui/qt/menus/qml/GlobalShortcuts.qml
index 489a4cad97..ca98e4024a 100644
--- a/modules/gui/qt/menus/qml/GlobalShortcuts.qml
+++ b/modules/gui/qt/menus/qml/GlobalShortcuts.qml
@@ -35,7 +35,7 @@ Item {
     Shortcut{ context: Qt.ApplicationShortcut; sequence:"Ctrl+J"; onActivated: dialogProvider.mediaCodecDialog(); }
     Shortcut{ context: Qt.ApplicationShortcut; sequence:"Ctrl+M"; onActivated: dialogProvider.messagesDialog(); }
     Shortcut{ context: Qt.ApplicationShortcut; sequence:"Ctrl+P"; onActivated: dialogProvider.prefsDialog(); }
-    Shortcut{ context: Qt.ApplicationShortcut; sequence:"Ctrl+B"; onActivated: dialogProvider.bookmarksDialog(); }
+    Shortcut{ context: Qt.ApplicationShortcut; sequence:"Ctrl+B"; onActivated: dialogProvider.bookmarksDialog(); enabled: !!medialib}
     Shortcut{ context: Qt.ApplicationShortcut; sequence:"Ctrl+T"; onActivated: dialogProvider.gotoTimeDialog(); }
     Shortcut{ context: Qt.ApplicationShortcut; sequence:"F1";     onActivated: dialogProvider.helpDialog(); }
 



More information about the vlc-commits mailing list