Commit f70392c3 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: fix the postprocessing menu

Close #11613

(cherry picked from commit d65b41f4da915e148a42b5699962947134fcc7dd)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent ba7ed3b8
......@@ -50,6 +50,7 @@
#include "util/qmenuview.hpp" /* Simple Playlist menu */
#include "components/playlist/playlist_model.hpp" /* PLModel getter */
#include "components/playlist/standardpanel.hpp" /* PLView getter */
#include "components/extended_panels.hpp"
#include <QMenu>
#include <QMenuBar>
......@@ -83,6 +84,7 @@ static QActionGroup *currentGroup;
QMenu *VLCMenuBar::recentsMenu = NULL;
QMenu *VLCMenuBar::audioDeviceMenu = NULL;
QMenu *VLCMenuBar::ppMenu = NULL;
/**
* @brief Add static entries to DP in menus
......@@ -247,7 +249,8 @@ static int VideoAutoMenuBuilder( playlist_t *pl, input_thread_t *p_input,
PUSH_VAR( "crop" );
PUSH_VAR( "deinterlace" );
PUSH_VAR( "deinterlace-mode" );
PUSH_VAR( "postprocess" );
VLCMenuBar::ppMenu->setEnabled( p_object != NULL );
if( p_object )
vlc_object_release( p_object );
......@@ -684,7 +687,8 @@ QMenu *VLCMenuBar::VideoMenu( intf_thread_t *p_intf, QMenu *current )
/* Rendering modifiers */
addActionWithSubmenu( current, "deinterlace", qtr( "&Deinterlace" ) );
addActionWithSubmenu( current, "deinterlace-mode", qtr( "&Deinterlace mode" ) );
addActionWithSubmenu( current, "postprocess", qtr( "&Post processing" ) );
ppMenu = PPMenu( p_intf );
current->addMenu( ppMenu );
current->addSeparator();
/* Other actions */
......@@ -1638,3 +1642,30 @@ void VLCMenuBar::updateRecents( intf_thread_t *p_intf )
}
}
}
QMenu *VLCMenuBar::PPMenu( intf_thread_t *p_intf )
{
int i_q = ExtVideo::getPostprocessing( p_intf );
QMenu *submenu = new QMenu( "&Post processing" );
QActionGroup *actionGroup = new QActionGroup(submenu);
QAction *action;
#define ADD_PP_ACTION( text, value ) \
action = new QAction( qtr(text), submenu ); \
action->setData( value ); \
action->setCheckable(true); \
if( value == i_q ) action->setChecked( true ); \
submenu->addAction( action ); \
actionGroup->addAction( action );
ADD_PP_ACTION( "Disable", -1 );
submenu->addSeparator();
ADD_PP_ACTION( "Lowest", 1 );
ADD_PP_ACTION( "Middle", 3 );
ADD_PP_ACTION( "Highest", 6 );
CONNECT( actionGroup, triggered( QAction *), ActionsManager::getInstance( p_intf ), PPaction( QAction * ) );
return submenu;
}
......@@ -99,6 +99,8 @@ public:
};
Q_DECLARE_FLAGS(actionflags, actionflag)
static QMenu *ppMenu;
private:
/* All main Menus */
static QMenu *FileMenu( intf_thread_t *, QWidget *, MainInterface * mi = NULL );
......@@ -133,6 +135,7 @@ private:
}
static QMenu *HelpMenu( QWidget * );
static QMenu *PPMenu( intf_thread_t *p_intf );
/* Popups Menus */
static void PopupMenuStaticEntries( QMenu *menu );
......
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