Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
a3f6eeeb
Commit
a3f6eeeb
authored
Aug 15, 2014
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: don't use a modal dialog for continuing the playback
Close #11705 #11703
parent
87f2fe30
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
6 deletions
+75
-6
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+1
-6
modules/gui/qt4/input_manager.hpp
modules/gui/qt4/input_manager.hpp
+2
-0
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+53
-0
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/main_interface.hpp
+8
-0
modules/gui/qt4/qt4.cpp
modules/gui/qt4/qt4.cpp
+11
-0
No files found.
modules/gui/qt4/input_manager.cpp
View file @
a3f6eeeb
...
...
@@ -136,12 +136,7 @@ void InputManager::setInput( input_thread_t *_p_input )
!
var_GetFloat
(
p_input
,
"start-time"
)
&&
!
var_GetFloat
(
p_input
,
"stop-time"
)
)
{
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
);
emit
continuePlayback
(
(
int64_t
)
i_time
*
1000
);
}
}
}
...
...
modules/gui/qt4/input_manager.hpp
View file @
a3f6eeeb
...
...
@@ -223,6 +223,8 @@ signals:
void
titleChanged
(
bool
);
void
chapterChanged
(
bool
);
void
inputCanSeek
(
bool
);
/// You can continuePlayback
void
continuePlayback
(
int64_t
);
/// Statistics are updated
void
statisticsUpdated
(
input_item_t
*
);
void
infoChanged
(
input_item_t
*
);
...
...
modules/gui/qt4/main_interface.cpp
View file @
a3f6eeeb
...
...
@@ -60,6 +60,8 @@
#include <QStackedWidget>
#include <QFileInfo>
#include <QTimer>
#include <vlc_keys.h>
/* Wheel event */
#include <vlc_vout_display.h>
/* vout_thread_t and VOUT_ events */
...
...
@@ -364,6 +366,56 @@ void MainInterface::reloadPrefs()
}
}
void
MainInterface
::
createContinueDialog
(
QWidget
*
w
)
{
/* Create non-modal continueDialog */
continueDialog
=
new
QWidget
(
w
);
continueDialog
->
hide
();
QHBoxLayout
*
continueDialogLayout
=
new
QHBoxLayout
(
continueDialog
);
continueDialogLayout
->
setSpacing
(
0
);
continueDialogLayout
->
setMargin
(
0
);
QLabel
*
continueLabel
=
new
QLabel
(
qtr
(
"Do you want to restart the playback where left off?"
)
);
QToolButton
*
cancel
=
new
QToolButton
(
continueDialog
);
cancel
->
setAutoRaise
(
true
);
cancel
->
setText
(
"X"
);
QPushButton
*
ok
=
new
QPushButton
(
qtr
(
"&Continue"
)
);
continueDialogLayout
->
addWidget
(
continueLabel
);
continueDialogLayout
->
addStretch
(
1
);
continueDialogLayout
->
addWidget
(
ok
);
continueDialogLayout
->
addWidget
(
cancel
);
CONNECT
(
cancel
,
clicked
(),
continueDialog
,
hide
()
);
BUTTONACT
(
ok
,
continuePlayback
()
);
CONNECT
(
THEMIM
->
getIM
(),
continuePlayback
(
int64_t
),
this
,
showContinueDialog
(
int64_t
)
);
w
->
layout
()
->
addWidget
(
continueDialog
);
}
void
MainInterface
::
showContinueDialog
(
int64_t
_time
)
{
int
setting
=
var_InheritInteger
(
p_intf
,
"qt-continue"
);
if
(
setting
==
0
)
return
;
i_continueTime
=
_time
;
if
(
setting
==
2
)
continuePlayback
();
else
{
continueDialog
->
setVisible
(
true
);
QTimer
::
singleShot
(
6000
,
continueDialog
,
SLOT
(
hide
()));
}
}
void
MainInterface
::
continuePlayback
()
{
var_SetTime
(
THEMIM
->
getInput
(),
"time"
,
i_continueTime
);
continueDialog
->
hide
();
}
void
MainInterface
::
createMainWidget
(
QSettings
*
creationSettings
)
{
/* Create the main Widget and the mainLayout */
...
...
@@ -373,6 +425,7 @@ void MainInterface::createMainWidget( QSettings *creationSettings )
main
->
setContentsMargins
(
0
,
0
,
0
,
0
);
mainLayout
->
setSpacing
(
0
);
mainLayout
->
setMargin
(
0
);
createContinueDialog
(
main
);
/* */
stackCentralW
=
new
QVLCStackedWidget
(
main
);
...
...
modules/gui/qt4/main_interface.hpp
View file @
a3f6eeeb
...
...
@@ -111,6 +111,7 @@ private:
void
createMainWidget
(
QSettings
*
);
void
createStatusBar
();
void
createPlaylist
();
void
createContinueDialog
(
QWidget
*
w
);
/* Systray */
void
createSystray
();
...
...
@@ -146,6 +147,10 @@ private:
PlaylistWidget
*
playlistWidget
;
//VisualSelector *visualSelector;
/* continue */
QWidget
*
continueDialog
;
int64_t
i_continueTime
;
/* Status Bar */
QLabel
*
nameLabel
;
QLabel
*
cryptedLabel
;
...
...
@@ -252,6 +257,9 @@ private slots:
void
setBoss
();
void
setRaise
();
void
showContinueDialog
(
int64_t
);
void
continuePlayback
();
signals:
void
askGetVideo
(
WId
*
p_id
,
int
*
pi_x
,
int
*
pi_y
,
unsigned
*
pi_width
,
unsigned
*
pi_height
);
...
...
modules/gui/qt4/qt4.cpp
View file @
a3f6eeeb
...
...
@@ -185,12 +185,21 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * );
#define FULLSCREEN_CONTROL_PIXELS N_( "Fullscreen controller mouse sensitivity" )
#define CONTINUE_PLAYBACK_TEXT N_("Continue playback?")
static
const
int
i_notification_list
[]
=
{
NOTIFICATION_NEVER
,
NOTIFICATION_MINIMIZED
,
NOTIFICATION_ALWAYS
};
static
const
char
*
const
psz_notification_list_text
[]
=
{
N_
(
"Never"
),
N_
(
"When minimized"
),
N_
(
"Always"
)
};
static
const
int
i_continue_list
[]
=
{
0
,
1
,
2
};
static
const
char
*
const
psz_continue_list_text
[]
=
{
N_
(
"Never"
),
N_
(
"Ask"
),
N_
(
"Always"
)
};
/**********************************************************************/
vlc_module_begin
()
set_shortname
(
"Qt"
)
...
...
@@ -233,6 +242,8 @@ vlc_module_begin ()
RECENTPLAY_TEXT
,
false
)
add_string
(
"qt-recentplay-filter"
,
""
,
RECENTPLAY_FILTER_TEXT
,
RECENTPLAY_FILTER_LONGTEXT
,
false
)
add_integer
(
"qt-continue"
,
1
,
CONTINUE_PLAYBACK_TEXT
,
CONTINUE_PLAYBACK_TEXT
,
false
)
change_integer_list
(
i_continue_list
,
psz_continue_list_text
)
#ifdef UPDATE_CHECK
add_bool
(
"qt-updates-notif"
,
true
,
UPDATER_TEXT
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment