Commit d7cb06d6 authored by Jean-Philippe André's avatar Jean-Philippe André

Extensions/Qt: buildsystem + menu entries

You can now play with extensions, from the menu View > Extensions
parent 58f43231
......@@ -20,6 +20,7 @@ nodist_SOURCES_qt4 = \
dialogs_provider.moc.cpp \
input_manager.moc.cpp \
actions_manager.moc.cpp \
extensions_manager.moc.cpp \
recents.moc.cpp \
variables.moc.cpp \
dialogs/playlist.moc.cpp \
......@@ -41,6 +42,7 @@ nodist_SOURCES_qt4 = \
dialogs/podcast_configuration.moc.cpp \
dialogs/vlm.moc.cpp \
dialogs/firstrun.moc.cpp \
dialogs/extensions.moc.cpp \
components/extended_panels.moc.cpp \
components/info_panels.moc.cpp \
components/preferences_widgets.moc.cpp \
......@@ -210,6 +212,7 @@ SOURCES_qt4 = qt4.cpp \
dialogs_provider.cpp \
input_manager.cpp \
actions_manager.cpp \
extensions_manager.cpp \
recents.cpp \
variables.cpp \
dialogs/playlist.cpp \
......@@ -231,6 +234,7 @@ SOURCES_qt4 = qt4.cpp \
dialogs/vlm.cpp \
dialogs/firstrun.cpp \
dialogs/podcast_configuration.cpp \
dialogs/extensions.cpp \
components/extended_panels.cpp \
components/info_panels.cpp \
components/preferences_widgets.cpp \
......@@ -258,6 +262,7 @@ noinst_HEADERS = \
dialogs_provider.hpp \
input_manager.hpp \
actions_manager.hpp \
extensions_manager.hpp \
recents.hpp \
variables.hpp \
dialogs/playlist.hpp \
......@@ -279,6 +284,7 @@ noinst_HEADERS = \
dialogs/vlm.hpp \
dialogs/firstrun.hpp \
dialogs/podcast_configuration.hpp \
dialogs/extensions.hpp \
components/extended_panels.hpp \
components/info_panels.hpp \
components/preferences_widgets.hpp \
......
......@@ -32,6 +32,7 @@
#include "main_interface.hpp"
#include "input_manager.hpp"
#include "actions_manager.hpp"
#include "extensions_manager.hpp" // killInstance
#include "util/customwidgets.hpp"
#include "util/qt_dirs.hpp"
......@@ -318,6 +319,9 @@ MainInterface::~MainInterface()
/* Be sure to kill the actionsManager... FIXME */
ActionsManager::killInstance();
/* Idem, FIXME */
ExtensionsManager::killInstance();
/* Delete the FSC controller */
delete fullscreenControls;
......
......@@ -43,6 +43,7 @@
#include "input_manager.hpp" /* Input Management */
#include "recents.hpp" /* Recent Items */
#include "actions_manager.hpp"
#include "extensions_manager.hpp"
#include <QMenu>
#include <QMenuBar>
......@@ -471,6 +472,13 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf,
":/menu/preferences", SLOT( toolbarDialog() ) );
menu->addSeparator();
/* Extensions */
menu->addSeparator();
QMenu *extmenu = ExtensionsMenu( p_intf, menu );
MenuFunc *f = new MenuFunc( menu, 5 );
CONNECT( menu, aboutToShow(), THEDP->menusUpdateMapper, map() );
THEDP->menusUpdateMapper->setMapping( menu, f );
return menu;
}
......@@ -487,6 +495,44 @@ QMenu *QVLCMenu::InterfacesMenu( intf_thread_t *p_intf, QMenu *current )
return Populate( p_intf, current, varnames, objects );
}
/**
* Extensions Sub-Menu
* EXPERIMENTAL
**/
QMenu *QVLCMenu::ExtensionsMenu( intf_thread_t *p_intf, QMenu *current )
{
QMenu *extMenu = NULL;
QAction *extAction = NULL;
foreach( QAction *action, current->actions() )
{
if( action->text() == qtr( "&Extensions" ) )
{
extAction = action;
break;
}
}
ExtensionsManager *extMgr = ExtensionsManager::getInstance( p_intf );
extMenu = new QMenu( qtr( "&Extensions" ) );
if( extMgr->isLoaded() )
{
/* Let the ExtensionsManager build itself the menu */
extMgr->menu( extMenu );
}
else
{
extMenu->addAction( qtr( "&Load extensions" ),
extMgr, SLOT( loadExtensions() ) );
}
if( extAction )
extAction->setMenu( extMenu );
else
current->addMenu( extMenu );
}
/**
* Main Audio Menu
**/
......
......@@ -109,6 +109,7 @@ private:
static QMenu *ViewMenu( intf_thread_t *, MainInterface *,
bool with = true );
static QMenu *InterfacesMenu( intf_thread_t *p_intf, QMenu * );
static QMenu *ExtensionsMenu( intf_thread_t *p_intf, QMenu * );
static QMenu *NavigMenu( intf_thread_t *, QMenu * );
static QMenu *NavigMenu( intf_thread_t *, QWidget * );
......@@ -163,6 +164,7 @@ public:
case 2: QVLCMenu::VideoMenu( p_intf, menu ); break;
case 3: QVLCMenu::RebuildNavigMenu( p_intf, menu ); break;
case 4: QVLCMenu::InterfacesMenu( p_intf, menu ); break;
case 5: QVLCMenu::ExtensionsMenu( p_intf, menu ); break;
}
}
private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment