Commit 745c83a0 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: allow loop/repeat button to be in a toolbar (part 1)

parent c5f0506c
......@@ -52,6 +52,7 @@ typedef enum actionType_e
SKIP_FW_ACTION,
QUIT_ACTION,
RANDOM_ACTION,
LOOP_ACTION,
} actionType_e;
class ActionsManager : public QObject
......
......@@ -367,6 +367,13 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
RANDOMButton, setChecked( bool ) );
}
break;
case LOOP_BUTTON:{
LoopButton *loopButton = new LoopButton;
setupButton( loopButton );
loopButton->setToolTip( qtr( "Click to toggle between loop one, loop all" ) );
loopButton->setCheckable( true );
}
break;
default:
msg_Warn( p_intf, "This should not happen %i", button );
break;
......
......@@ -81,6 +81,7 @@ typedef enum buttonType_e
SKIP_FW_BUTTON,
QUIT_BUTTON,
RANDOM_BUTTON,
LOOP_BUTTON,
BUTTON_MAX,
SPLITTER = 0x20,
......@@ -103,7 +104,8 @@ static const char* const nameL[BUTTON_MAX] = { N_("Play"), N_("Stop"), N_("Open"
N_("Previous"), N_("Next"), N_("Slower"), N_("Faster"), N_("Fullscreen"),
N_("De-Fullscreen"), N_("Extended panel"), N_("Playlist"), N_("Snapshot"),
N_("Record"), N_("A->B Loop"), N_("Frame By Frame"), N_("Trickplay Reverse"),
N_("Step backward" ), N_("Step forward"), N_("Quit"), N_("Random") };
N_("Step backward" ), N_("Step forward"), N_("Quit"), N_("Random"),
N_("Loop/Repeat mode") };
static const char* const tooltipL[BUTTON_MAX] = { I_PLAY_TOOLTIP,
N_("Stop playback"), N_("Open a medium"),
N_("Previous media in the playlist"),
......@@ -113,14 +115,15 @@ static const char* const tooltipL[BUTTON_MAX] = { I_PLAY_TOOLTIP,
N_( "Take a snapshot" ), N_( "Record" ),
N_( "Loop from point A to point B continuously." ), N_("Frame by frame"),
N_("Reverse"), N_("Step backward"), N_("Step forward"), N_("Quit"),
N_("Random") };
N_("Random"), N_("Change the loop and repeat modes") };
static const QString iconL[BUTTON_MAX] ={ ":/toolbar/play_b", ":/toolbar/stop_b",
":/toolbar/eject", ":/toolbar/previous_b", ":/toolbar/next_b",
":/toolbar/slower", ":/toolbar/faster", ":/toolbar/fullscreen",
":/toolbar/defullscreen", ":/toolbar/extended", ":/toolbar/playlist",
":/toolbar/snapshot", ":/toolbar/record", ":/toolbar/atob_nob",
":/toolbar/frame", ":/toolbar/reverse", ":/toolbar/skip_back",
":/toolbar/skip_fw", ":/toolbar/clear", ":/buttons/playlist/shuffle_on" };
":/toolbar/skip_fw", ":/toolbar/clear", ":/buttons/playlist/shuffle_on",
":/buttons/playlist/repeat_all" };
enum
{
......
......@@ -235,3 +235,22 @@ void AtoB_Button::setIcons( bool timeA, bool timeB )
}
}
void LoopButton::update()
{
/* if( model->hasRepeat() )
{
repeatButton->setIcon( QIcon( ":/buttons/playlist/repeat_one" ) );
repeatButton->setChecked( true );
}
else if( model->hasLoop() )
{
repeatButton->setIcon( QIcon( ":/buttons/playlist/repeat_all" ) );
repeatButton->setChecked( true );
}
else
{
repeatButton->setIcon( QIcon( ":/buttons/playlist/repeat_one" ) );
repeatButton->setChecked( false );
}*/
//BUTTONACT( repeatButton, toggleRepeat() );
}
......@@ -53,6 +53,13 @@ private slots:
void updateButton( bool );
};
class LoopButton : public QToolButton
{
Q_OBJECT
private slots:
void update();
};
class AtoB_Button : public QToolButton
{
Q_OBJECT
......
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