Commit 0f3df12e authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt, add a playback buttons group, with prev/play/next in the same deck

parent 9d390b3a
...@@ -32,6 +32,9 @@ ...@@ -32,6 +32,9 @@
#include "components/controller.hpp" #include "components/controller.hpp"
#include "components/controller_widget.hpp" #include "components/controller_widget.hpp"
#include "components/interface_widgets.hpp" #include "components/interface_widgets.hpp"
#include "util/buttons/DeckButtonsLayout.hpp"
#include "util/buttons/BrowseButton.hpp"
#include "util/buttons/RoundButton.hpp"
#include "dialogs_provider.hpp" /* Opening Dialogs */ #include "dialogs_provider.hpp" /* Opening Dialogs */
#include "actions_manager.hpp" /* *_ACTION */ #include "actions_manager.hpp" /* *_ACTION */
...@@ -132,8 +135,7 @@ void AbstractController::parseAndCreate( const QString& config, ...@@ -132,8 +135,7 @@ void AbstractController::parseAndCreate( const QString& config,
{ {
msg_Warn( p_intf, "Parsing error 3. Please, report this." ); msg_Warn( p_intf, "Parsing error 3. Please, report this." );
continue; continue;
} } }
}
createAndAddWidget( controlLayout, -1, i_type, i_option ); createAndAddWidget( controlLayout, -1, i_type, i_option );
} }
...@@ -221,7 +223,6 @@ void AbstractController::createAndAddWidget( QBoxLayout *controlLayout, ...@@ -221,7 +223,6 @@ void AbstractController::createAndAddWidget( QBoxLayout *controlLayout,
QWidget *AbstractController::createWidget( buttonType_e button, int options ) QWidget *AbstractController::createWidget( buttonType_e button, int options )
{ {
bool b_flat = options & WIDGET_FLAT; bool b_flat = options & WIDGET_FLAT;
bool b_big = options & WIDGET_BIG; bool b_big = options & WIDGET_BIG;
bool b_shiny = options & WIDGET_SHINY; bool b_shiny = options & WIDGET_SHINY;
...@@ -433,6 +434,20 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options ) ...@@ -433,6 +434,20 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
NORMAL_BUTTON( INFO ); NORMAL_BUTTON( INFO );
} }
break; break;
case PLAYBACK_BUTTONS:{
widget = new QWidget;
DeckButtonsLayout *layout = new DeckButtonsLayout( widget );
BrowseButton *prev = new BrowseButton( widget, BrowseButton::Backward );
BrowseButton *next = new BrowseButton( widget );
RoundButton *play = new RoundButton( widget );
layout->setBackwardButton( prev );
layout->setForwardButton( next );
layout->setRoundButton( play );
CONNECT_MAP_SET( prev, PREVIOUS_ACTION );
CONNECT_MAP_SET( next, NEXT_ACTION );
CONNECT_MAP_SET( play, PLAY_ACTION );
}
break;
default: default:
msg_Warn( p_intf, "This should not happen %i", button ); msg_Warn( p_intf, "This should not happen %i", button );
break; break;
......
...@@ -96,6 +96,7 @@ typedef enum buttonType_e ...@@ -96,6 +96,7 @@ typedef enum buttonType_e
MENU_BUTTONS, MENU_BUTTONS,
TELETEXT_BUTTONS, TELETEXT_BUTTONS,
ADVANCED_CONTROLLER, ADVANCED_CONTROLLER,
PLAYBACK_BUTTONS,
SPECIAL_MAX, SPECIAL_MAX,
WIDGET_SPACER = 0x40, WIDGET_SPACER = 0x40,
......
...@@ -31,6 +31,9 @@ ...@@ -31,6 +31,9 @@
#include "util/input_slider.hpp" #include "util/input_slider.hpp"
#include "util/customwidgets.hpp" #include "util/customwidgets.hpp"
#include "components/interface_widgets.hpp" #include "components/interface_widgets.hpp"
#include "util/buttons/DeckButtonsLayout.hpp"
#include "util/buttons/BrowseButton.hpp"
#include "util/buttons/RoundButton.hpp"
#include <QScrollArea> #include <QScrollArea>
#include <QGroupBox> #include <QGroupBox>
...@@ -415,6 +418,18 @@ WidgetListing::WidgetListing( intf_thread_t *p_intf, QWidget *_parent ) ...@@ -415,6 +418,18 @@ WidgetListing::WidgetListing( intf_thread_t *p_intf, QWidget *_parent )
} }
widgetItem->setText( qtr("Advanced Buttons") ); widgetItem->setText( qtr("Advanced Buttons") );
break; break;
case PLAYBACK_BUTTONS:
{
widget = new QWidget;
DeckButtonsLayout *layout = new DeckButtonsLayout( widget );
BrowseButton *prev = new BrowseButton( widget, BrowseButton::Backward );
BrowseButton *next = new BrowseButton( widget );
RoundButton *play = new RoundButton( widget );
layout->setBackwardButton( prev );
layout->setForwardButton( next );
layout->setRoundButton( play );
}
break;
default: default:
msg_Warn( p_intf, "This should not happen %i", i ); msg_Warn( p_intf, "This should not happen %i", i );
break; break;
......
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