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

[Qt] Parsing of generic toolbars and auto-creation of those bars.

This introduce a parseAndCreate function that creates all the needed buttons from a QString input.
This also introduce a next-frame button and the code needed behind it.
parent bc01f895
This diff is collapsed.
...@@ -66,19 +66,23 @@ typedef enum buttonType_e ...@@ -66,19 +66,23 @@ typedef enum buttonType_e
SLOWER_BUTTON, SLOWER_BUTTON,
FASTER_BUTTON, FASTER_BUTTON,
FULLSCREEN_BUTTON, FULLSCREEN_BUTTON,
DEFULLSCREEN_BUTTON,
EXTENDED_BUTTON, EXTENDED_BUTTON,
PLAYLIST_BUTTON, PLAYLIST_BUTTON,
SNAPSHOT_BUTTON, SNAPSHOT_BUTTON,
RECORD_BUTTON, RECORD_BUTTON,
ATOB_BUTTON, ATOB_BUTTON,
#if 0
FRAME_BUTTON, FRAME_BUTTON,
#endif
INPUT_SLIDER, INPUT_SLIDER,
VOLUME_SLIDER, VOLUME_SLIDER,
MENU_BUTTONS, MENU_BUTTONS,
TELETEXT_BUTTONS, TELETEXT_BUTTONS,
VOLUME, VOLUME,
WIDGET_SPACER,
WIDGET_SPACER_EXTEND,
TIME_LABEL,
SPLITTER,
ADVANCED_CONTROLLER,
} buttonType_e; } buttonType_e;
typedef enum actionType_e typedef enum actionType_e
...@@ -95,15 +99,24 @@ typedef enum actionType_e ...@@ -95,15 +99,24 @@ typedef enum actionType_e
PLAYLIST_ACTION, PLAYLIST_ACTION,
SNAPSHOT_ACTION, SNAPSHOT_ACTION,
RECORD_ACTION, RECORD_ACTION,
FRAME_ACTION,
ATOB_ACTION ATOB_ACTION
} actionType_e; } actionType_e;
enum
{
WIDGET_NORMAL = 0x0,
WIDGET_FLAT = 0x1,
WIDGET_BIG = 0x2,
WIDGET_SHINY = 0x4,
};
class AbstractController : public QFrame class AbstractController : public QFrame
{ {
Q_OBJECT Q_OBJECT
public: public:
AbstractController( intf_thread_t *_p_i ); AbstractController( intf_thread_t *_p_i );
virtual ~AbstractController() {}; int getWidth() { return controlLayout->columnCount(); }
protected: protected:
intf_thread_t *p_intf; intf_thread_t *p_intf;
...@@ -111,11 +124,14 @@ protected: ...@@ -111,11 +124,14 @@ protected:
QSignalMapper *toolbarActionsMapper; QSignalMapper *toolbarActionsMapper;
QGridLayout *controlLayout; QGridLayout *controlLayout;
QWidget *createWidget( buttonType_e, bool b_flat = false, AdvControlsWidget *advControls;
bool b_big = false, bool b_shiny = false );
void setupButton( QAbstractButton * ); void parseAndCreateLine( QString config, int i_line );
private: private:
QWidget *createWidget( buttonType_e, int *i_size,
int options = WIDGET_NORMAL );
void setupButton( QAbstractButton * );
QWidget *discFrame(); QWidget *discFrame();
QWidget *telexFrame(); QWidget *telexFrame();
...@@ -134,9 +150,7 @@ protected slots: ...@@ -134,9 +150,7 @@ protected slots:
void playlist(); void playlist();
void snapshot(); void snapshot();
void record(); void record();
#if 0
void frame(); void frame();
#endif
virtual void setStatus( int ); virtual void setStatus( int );
...@@ -146,6 +160,14 @@ signals: ...@@ -146,6 +160,14 @@ signals:
void inputIsRecordable( bool ); /// same ? void inputIsRecordable( bool ); /// same ?
}; };
/**
* SPECIAL Widgets that are a bit more than just a ToolButton
* and have an icon/behaviour that changes depending on the context:
* - playButton
* - A->B Button
* - Teletext group buttons
* - Sound Widget group
**/
class PlayButton : public QToolButton class PlayButton : public QToolButton
{ {
Q_OBJECT Q_OBJECT
...@@ -199,7 +221,14 @@ class AdvControlsWidget : public AbstractController ...@@ -199,7 +221,14 @@ class AdvControlsWidget : public AbstractController
Q_OBJECT Q_OBJECT
public: public:
AdvControlsWidget( intf_thread_t * ); AdvControlsWidget( intf_thread_t * );
virtual ~AdvControlsWidget(); };
/* Slider Bar */
class InputControlsWidget : public AbstractController
{
Q_OBJECT
public:
InputControlsWidget( intf_thread_t * );
}; };
/* Button Bar */ /* Button Bar */
...@@ -214,7 +243,6 @@ public: ...@@ -214,7 +243,6 @@ public:
protected: protected:
friend class MainInterface; friend class MainInterface;
AdvControlsWidget *advControls;
bool b_advancedVisible; bool b_advancedVisible;
protected slots: protected slots:
......
...@@ -152,8 +152,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -152,8 +152,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
**************************/ **************************/
/* Connect the input manager to the GUI elements it manages */ /* Connect the input manager to the GUI elements it manages */
/* It is also connected to the control->slider, see the ControlsWidget */ /* Change the SpeedRate in the Status Bar */
/* Change the SpeedRate in the Status */
CONNECT( THEMIM->getIM(), rateChanged( int ), this, setRate( int ) ); CONNECT( THEMIM->getIM(), rateChanged( int ), this, setRate( int ) );
/** /**
...@@ -379,9 +378,11 @@ void MainInterface::handleMainUi( QSettings *settings ) ...@@ -379,9 +378,11 @@ void MainInterface::handleMainUi( QSettings *settings )
settings->value( "adv-controls", false ).toBool() ); settings->value( "adv-controls", false ).toBool() );
CONNECT( controls, advancedControlsToggled( bool ), CONNECT( controls, advancedControlsToggled( bool ),
this, doComponentsUpdate() ); this, doComponentsUpdate() );
InputControlsWidget *inputC = new InputControlsWidget( p_intf );
/* Add the controls Widget to the main Widget */ /* Add the controls Widget to the main Widget */
mainLayout->insertWidget( 0, controls, 0, Qt::AlignBottom ); mainLayout->insertWidget( 0, controls, 0, Qt::AlignBottom );
mainLayout->insertWidget( 0, inputC, 0, Qt::AlignBottom );
/* Create the Speed Control Widget */ /* Create the Speed Control Widget */
speedControl = new SpeedControlWidget( p_intf ); speedControl = new SpeedControlWidget( p_intf );
......
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