Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
4dc4a8d0
Commit
4dc4a8d0
authored
Jun 16, 2008
by
Jean-Philippe Andre
Committed by
Jean-Baptiste Kempf
Jun 16, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt menus: add loadSubtitlesFile
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
895c05d7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
17 deletions
+50
-17
modules/gui/qt4/dialogs_provider.cpp
modules/gui/qt4/dialogs_provider.cpp
+19
-0
modules/gui/qt4/dialogs_provider.hpp
modules/gui/qt4/dialogs_provider.hpp
+2
-0
modules/gui/qt4/menus.cpp
modules/gui/qt4/menus.cpp
+29
-17
No files found.
modules/gui/qt4/dialogs_provider.cpp
View file @
4dc4a8d0
...
...
@@ -529,3 +529,22 @@ void DialogsProvider::doInteraction( intf_dialog_args_t *p_arg )
break
;
}
}
void
DialogsProvider
::
loadSubtitlesFile
()
{
playlist_t
*
p_playlist
=
pl_Yield
(
p_intf
);
if
(
!
p_playlist
||
!
p_playlist
->
p_input
)
{
msg_Err
(
p_intf
,
"cannot get input"
);
return
;
}
QString
qsFile
=
QFileDialog
::
getOpenFileName
(
NULL
,
qtr
(
"Choose subtitles file"
),
""
,
qtr
(
"Subtitles files (*.cdg *.idx *.srt *.sub *.utf);;"
"All files (*)"
)
);
if
(
!
input_AddSubtitles
(
p_playlist
->
p_input
,
qtu
(
qsFile
),
true
)
)
msg_Warn
(
p_intf
,
"unable to load subtitles file..."
);
pl_Release
(
p_playlist
);
}
modules/gui/qt4/dialogs_provider.hpp
View file @
4dc4a8d0
...
...
@@ -187,6 +187,8 @@ public slots:
void
openAPlaylist
();
void
saveAPlaylist
();
void
loadSubtitlesFile
();
void
quit
();
};
...
...
modules/gui/qt4/menus.cpp
View file @
4dc4a8d0
...
...
@@ -455,15 +455,23 @@ QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current )
if
(
current
->
isEmpty
()
)
{
ACT_ADD
(
current
,
"video-es"
,
qtr
(
"Video &Track"
)
);
QAction
*
action
;
QMenu
*
submenu
=
new
QMenu
(
qtr
(
"&Subtitles Track"
),
current
);
action
=
current
->
addMenu
(
submenu
);
action
->
setData
(
"spu-es"
);
submenu
->
addAction
(
qfu
(
"Load File..."
),
THEDP
,
SLOT
(
loadSubtitlesFile
()
)
);
ACT_ADD
(
current
,
"fullscreen"
,
qtr
(
"&Fullscreen"
)
);
ACT_ADD
(
current
,
"zoom"
,
qtr
(
"&Zoom"
)
);
ACT_ADD
(
current
,
"deinterlace"
,
qtr
(
"&Deinterlace"
)
);
ACT_ADD
(
current
,
"aspect-ratio"
,
qtr
(
"&Aspect Ratio"
)
);
ACT_ADD
(
current
,
"crop"
,
qtr
(
"&Crop"
)
);
ACT_ADD
(
current
,
"video-on-top"
,
qtr
(
"Always &On Top"
)
);
ACT_ADD
(
current
,
"directx-wallpaper"
,
qtr
(
"&DirectX Wallpaper"
)
);
/* FIXME
*/
ACT_ADD
(
current
,
"video-snapshot"
,
qtr
(
"
&
Snapshot"
)
);
ACT_ADD
(
current
,
"ffmpeg-pp-q"
,
qtr
(
"D&ecoder"
)
);
/* FIXME
*/
/* ACT_ADD( current, "directx-wallpaper", qtr( "DirectX Wallpaper" ) );
*/
ACT_ADD
(
current
,
"video-snapshot"
,
qtr
(
"Snapshot"
)
);
/* ACT_ADD( current, "ffmpeg-pp-q", qtr( "Decoder" ) );
*/
}
p_input
=
THEMIM
->
getInput
();
...
...
@@ -838,7 +846,7 @@ QMenu * QVLCMenu::Populate( intf_thread_t *p_intf,
if
(
objects
[
i
]
==
0
)
{
continue
;
p_object
=
NULL
;
}
else
{
...
...
@@ -850,6 +858,15 @@ QMenu * QVLCMenu::Populate( intf_thread_t *p_intf,
}
}
/* Some specific stuff */
if
(
p_object
&&
!
strcmp
(
varnames
[
i
],
"spu-es"
)
)
{
vlc_object_t
*
p_vout
=
(
vlc_object_t
*
)(
vlc_object_find
(
p_object
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
)
);
if
(
!
p_vout
)
continue
;
}
/* Ugly specific stuff */
if
(
strstr
(
varnames
[
i
],
"intf-add"
)
)
UpdateItem
(
p_intf
,
menu
,
varnames
[
i
],
p_object
,
false
);
...
...
@@ -923,12 +940,6 @@ void QVLCMenu::UpdateItem( intf_thread_t *p_intf, QMenu *menu,
return
;
}
if
(
!
strcmp
(
psz_var
,
"spu-es"
)
)
{
/* TODO: add a static entry "Load File..." */
return
;
}
/* Check the type of the object variable */
if
(
!
strcmp
(
psz_var
,
"audio-es"
)
||
!
strcmp
(
psz_var
,
"video-es"
)
)
...
...
@@ -951,7 +962,8 @@ void QVLCMenu::UpdateItem( intf_thread_t *p_intf, QMenu *menu,
}
/* Make sure we want to display the variable */
if
(
IsMenuEmpty
(
psz_var
,
p_object
)
)
return
;
if
(
menu
->
isEmpty
()
&&
IsMenuEmpty
(
psz_var
,
p_object
)
)
return
;
/* Get the descriptive name of the variable */
int
i_ret
=
var_Change
(
p_object
,
psz_var
,
VLC_VAR_GETTEXT
,
&
text
,
NULL
);
...
...
@@ -965,6 +977,7 @@ void QVLCMenu::UpdateItem( intf_thread_t *p_intf, QMenu *menu,
{
action
=
new
QAction
(
TEXT_OR_VAR
,
menu
);
menu
->
addAction
(
action
);
action
->
setData
(
psz_var
);
}
if
(
i_type
&
VLC_VAR_HASCHOICE
)
...
...
@@ -973,17 +986,15 @@ void QVLCMenu::UpdateItem( intf_thread_t *p_intf, QMenu *menu,
if
(
b_submenu
)
{
QMenu
*
submenu
;
action
->
setEnabled
(
true
);
submenu
=
action
->
menu
();
if
(
!
submenu
)
{
submenu
=
new
QMenu
(
menu
);
action
->
setMenu
(
submenu
);
}
submenu
->
setEnabled
(
true
);
if
(
CreateChoicesMenu
(
submenu
,
psz_var
,
p_object
,
true
)
==
0
)
menu
->
addMenu
(
submenu
);
action
->
setEnabled
(
CreateChoicesMenu
(
submenu
,
psz_var
,
p_object
,
true
)
==
0
);
}
else
CreateChoicesMenu
(
menu
,
psz_var
,
p_object
,
true
);
...
...
@@ -1020,7 +1031,8 @@ int QVLCMenu::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
i_type
=
var_Type
(
p_object
,
psz_var
);
/* Make sure we want to display the variable */
if
(
IsMenuEmpty
(
psz_var
,
p_object
,
b_root
)
)
return
VLC_EGENERIC
;
if
(
submenu
->
isEmpty
()
&&
IsMenuEmpty
(
psz_var
,
p_object
,
b_root
)
)
return
VLC_EGENERIC
;
switch
(
i_type
&
VLC_VAR_TYPE
)
{
...
...
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