Commit 13bb59c7 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: restore time where you left off

This copies the MacOS way

Close #5315
parent b70cb5b9
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <QFile> #include <QFile>
#include <QDir> #include <QDir>
#include <QSignalMapper> #include <QSignalMapper>
#include <QMessageBox>
#include <assert.h> #include <assert.h>
...@@ -110,6 +111,7 @@ void InputManager::setInput( input_thread_t *_p_input ) ...@@ -110,6 +111,7 @@ void InputManager::setInput( input_thread_t *_p_input )
msg_Dbg( p_intf, "IM: Setting an input" ); msg_Dbg( p_intf, "IM: Setting an input" );
vlc_object_hold( p_input ); vlc_object_hold( p_input );
addCallbacks(); addCallbacks();
UpdateStatus(); UpdateStatus();
UpdateName(); UpdateName();
UpdateArt(); UpdateArt();
...@@ -119,6 +121,22 @@ void InputManager::setInput( input_thread_t *_p_input ) ...@@ -119,6 +121,22 @@ void InputManager::setInput( input_thread_t *_p_input )
p_item = input_GetItem( p_input ); p_item = input_GetItem( p_input );
emit rateChanged( var_GetFloat( p_input, "rate" ) ); emit rateChanged( var_GetFloat( p_input, "rate" ) );
/* Get Saved Time */
int i_time = RecentsMRL::getInstance( p_intf )->time( p_item->psz_uri );
if( i_time > 0 )
{
THEMIM->togglePlayPause();
if( QMessageBox::question( NULL,
_("Continue playback?"),
_("Do you want to restart the playback where left off?"),
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes )
== QMessageBox::Yes )
var_SetTime( p_input, "time", (int64_t)i_time * 1000 );
THEMIM->togglePlayPause();
}
} }
else else
{ {
......
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