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
277e9ab5
Commit
277e9ab5
authored
Sep 10, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix SD support
parent
75b1aa19
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
90 deletions
+94
-90
modules/gui/qt4/dialogs/playlist.cpp
modules/gui/qt4/dialogs/playlist.cpp
+86
-2
modules/gui/qt4/dialogs/playlist.hpp
modules/gui/qt4/dialogs/playlist.hpp
+7
-0
modules/gui/qt4/dialogs_provider.cpp
modules/gui/qt4/dialogs_provider.cpp
+0
-6
modules/gui/qt4/dialogs_provider.hpp
modules/gui/qt4/dialogs_provider.hpp
+1
-2
modules/gui/qt4/menus.cpp
modules/gui/qt4/menus.cpp
+0
-80
No files found.
modules/gui/qt4/dialogs/playlist.cpp
View file @
277e9ab5
...
...
@@ -27,7 +27,11 @@
#include "components/playlist/panels.hpp"
#include "components/playlist/selector.hpp"
#include <QHBoxLayout>
#include "menus.hpp"
#include <QSignalMapper>
#include <QMenu>
#include <QAction>
#include <QMenuBar>
#include "dialogs_provider.hpp"
PlaylistDialog
*
PlaylistDialog
::
instance
=
NULL
;
...
...
@@ -36,7 +40,11 @@ PlaylistDialog::PlaylistDialog( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
QWidget
*
main
=
new
QWidget
(
this
);
setCentralWidget
(
main
);
setWindowTitle
(
qtr
(
"Playlist"
)
);
QVLCMenu
::
createPlMenuBar
(
menuBar
(),
p_intf
);
SDMapper
=
new
QSignalMapper
();
connect
(
SDMapper
,
SIGNAL
(
mapped
(
QString
)),
this
,
SLOT
(
SDMenuAction
(
QString
)
)
);
createPlMenuBar
(
menuBar
(),
p_intf
);
selector
=
new
PLSelector
(
centralWidget
(),
p_intf
,
THEPL
);
selector
->
setMaximumWidth
(
130
);
...
...
@@ -60,3 +68,79 @@ PlaylistDialog::~PlaylistDialog()
{
writeSettings
(
"playlist"
);
}
void
PlaylistDialog
::
createPlMenuBar
(
QMenuBar
*
bar
,
intf_thread_t
*
p_intf
)
{
QMenu
*
manageMenu
=
new
QMenu
();
manageMenu
->
setTitle
(
qtr
(
"Add"
)
);
QMenu
*
subPlaylist
=
new
QMenu
();
subPlaylist
->
setTitle
(
qtr
(
"Add to current playlist"
)
);
subPlaylist
->
addAction
(
"&File..."
,
THEDP
,
SLOT
(
simplePLAppendDialog
()
)
);
subPlaylist
->
addAction
(
"&Advanced add..."
,
THEDP
,
SLOT
(
PLAppendDialog
()
)
);
manageMenu
->
addMenu
(
subPlaylist
);
manageMenu
->
addSeparator
();
QMenu
*
subML
=
new
QMenu
();
subML
->
setTitle
(
qtr
(
"Add to Media library"
)
);
subML
->
addAction
(
"&File..."
,
THEDP
,
SLOT
(
simpleMLAppendDialog
()
)
);
subML
->
addAction
(
"Directory"
,
THEDP
,
SLOT
(
openMLDirectory
()
));
subML
->
addAction
(
"&Advanced add..."
,
THEDP
,
SLOT
(
MLAppendDialog
()
)
);
manageMenu
->
addMenu
(
subML
);
manageMenu
->
addAction
(
"Open playlist file"
,
THEDP
,
SLOT
(
openPlaylist
()
));
bar
->
addMenu
(
manageMenu
);
bar
->
addMenu
(
SDMenu
()
);
}
QMenu
*
PlaylistDialog
::
SDMenu
()
{
QMenu
*
menu
=
new
QMenu
();
menu
->
setTitle
(
qtr
(
"Additional sources"
)
);
vlc_list_t
*
p_list
=
vlc_list_find
(
p_intf
,
VLC_OBJECT_MODULE
,
FIND_ANYWHERE
);
int
i_num
=
0
;
for
(
int
i_index
=
0
;
i_index
<
p_list
->
i_count
;
i_index
++
)
{
module_t
*
p_parser
=
(
module_t
*
)
p_list
->
p_values
[
i_index
].
p_object
;
if
(
!
strcmp
(
p_parser
->
psz_capability
,
"services_discovery"
)
)
i_num
++
;
}
for
(
int
i_index
=
0
;
i_index
<
p_list
->
i_count
;
i_index
++
)
{
module_t
*
p_parser
=
(
module_t
*
)
p_list
->
p_values
[
i_index
].
p_object
;
if
(
!
strcmp
(
p_parser
->
psz_capability
,
"services_discovery"
)
)
{
QAction
*
a
=
new
QAction
(
qfu
(
p_parser
->
psz_longname
),
menu
);
a
->
setCheckable
(
true
);
/* hack to handle submodules properly */
int
i
=
-
1
;
while
(
p_parser
->
pp_shortcuts
[
++
i
]
!=
NULL
);
i
--
;
if
(
playlist_IsServicesDiscoveryLoaded
(
THEPL
,
i
>=
0
?
p_parser
->
pp_shortcuts
[
i
]
:
p_parser
->
psz_object_name
)
)
{
a
->
setChecked
(
true
);
}
connect
(
a
,
SIGNAL
(
triggered
()
),
SDMapper
,
SLOT
(
map
()
)
);
SDMapper
->
setMapping
(
a
,
i
>=
0
?
p_parser
->
pp_shortcuts
[
i
]
:
p_parser
->
psz_object_name
);
menu
->
addAction
(
a
);
}
}
vlc_list_release
(
p_list
);
return
menu
;
}
void
PlaylistDialog
::
SDMenuAction
(
QString
data
)
{
char
*
psz_sd
=
data
.
toUtf8
().
data
();
if
(
!
playlist_IsServicesDiscoveryLoaded
(
THEPL
,
psz_sd
)
)
playlist_ServicesDiscoveryAdd
(
THEPL
,
psz_sd
);
else
playlist_ServicesDiscoveryRemove
(
THEPL
,
psz_sd
);
}
modules/gui/qt4/dialogs/playlist.hpp
View file @
277e9ab5
...
...
@@ -26,6 +26,7 @@
#include <QModelIndex>
#include "util/qvlcframe.hpp"
class
QSignalMapper
;
class
PLSelector
;
class
PLPanel
;
...
...
@@ -40,11 +41,17 @@ public:
}
virtual
~
PlaylistDialog
();
private:
void
createPlMenuBar
(
QMenuBar
*
bar
,
intf_thread_t
*
p_intf
);
QMenu
*
SDMenu
();
PlaylistDialog
(
intf_thread_t
*
);
static
PlaylistDialog
*
instance
;
QSignalMapper
*
SDMapper
;
PLSelector
*
selector
;
PLPanel
*
rightPanel
;
private
slots
:
void
SDMenuAction
(
QString
);
};
...
...
modules/gui/qt4/dialogs_provider.cpp
View file @
277e9ab5
...
...
@@ -37,9 +37,6 @@ DialogsProvider* DialogsProvider::instance = NULL;
DialogsProvider
::
DialogsProvider
(
intf_thread_t
*
_p_intf
)
:
QObject
(
NULL
),
p_intf
(
_p_intf
)
{
// idle_timer = new QTimer( this );
// idle_timer->start( 0 );
fixed_timer
=
new
QTimer
(
this
);
fixed_timer
->
start
(
150
/* milliseconds */
);
...
...
@@ -52,9 +49,6 @@ DialogsProvider::DialogsProvider( intf_thread_t *_p_intf ) :
SLOT
(
menuUpdateAction
(
QObject
*
))
);
}
DialogsProvider
::~
DialogsProvider
()
{
}
void
DialogsProvider
::
customEvent
(
QEvent
*
event
)
{
if
(
event
->
type
()
==
DialogEvent_Type
)
...
...
modules/gui/qt4/dialogs_provider.hpp
View file @
277e9ab5
...
...
@@ -50,8 +50,7 @@ public:
instance
=
new
DialogsProvider
(
p_intf
);
return
instance
;
}
virtual
~
DialogsProvider
();
QTimer
*
idle_timer
;
virtual
~
DialogsProvider
()
{};
QTimer
*
fixed_timer
;
protected:
friend
class
QVLCMenu
;
...
...
modules/gui/qt4/menus.cpp
View file @
277e9ab5
...
...
@@ -38,7 +38,6 @@ enum
};
static
QActionGroup
*
currentGroup
;
static
char
**
pp_sds
;
// Add static entries to menus
#define DP_SADD( text, help, icon, slot ) { if( strlen(icon) > 0 ) { QAction *action = menu->addAction( text, THEDP, SLOT( slot ) ); action->setIcon(QIcon(icon));} else { menu->addAction( text, THEDP, SLOT( slot ) ); } }
...
...
@@ -128,85 +127,6 @@ void QVLCMenu::createMenuBar( QMenuBar *bar, intf_thread_t *p_intf )
// BAR_ADD( HelpMenu(), qtr("Help" ) );
}
void
QVLCMenu
::
createPlMenuBar
(
QMenuBar
*
bar
,
intf_thread_t
*
p_intf
)
{
QMenu
*
manageMenu
=
new
QMenu
();
manageMenu
->
setTitle
(
qtr
(
"Operations"
)
);
QMenu
*
subPlaylist
=
new
QMenu
();
subPlaylist
->
setTitle
(
qtr
(
"Add to current playlist"
)
);
subPlaylist
->
addAction
(
"&File..."
,
THEDP
,
SLOT
(
simplePLAppendDialog
()
)
);
subPlaylist
->
addAction
(
"&Advanced add..."
,
THEDP
,
SLOT
(
PLAppendDialog
()
)
);
manageMenu
->
addMenu
(
subPlaylist
);
manageMenu
->
addSeparator
();
QMenu
*
subML
=
new
QMenu
();
subML
->
setTitle
(
qtr
(
"Add to Media library"
)
);
subML
->
addAction
(
"&File..."
,
THEDP
,
SLOT
(
simpleMLAppendDialog
()
)
);
subML
->
addAction
(
"Directory"
,
THEDP
,
SLOT
(
openMLDirectory
()
));
subML
->
addAction
(
"&Advanced add..."
,
THEDP
,
SLOT
(
MLAppendDialog
()
)
);
manageMenu
->
addMenu
(
subML
);
manageMenu
->
addAction
(
"Open playlist file"
,
THEDP
,
SLOT
(
openPlaylist
()
));
manageMenu
->
addSeparator
();
// manageMenu->addMenu( SDMenu( p_intf ) );
bar
->
addMenu
(
manageMenu
);
}
QMenu
*
QVLCMenu
::
SDMenu
(
intf_thread_t
*
p_intf
)
{
QMenu
*
menu
=
new
QMenu
();
menu
->
setTitle
(
qtr
(
"Services Discovery"
)
);
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
assert
(
p_playlist
);
vlc_list_t
*
p_list
=
vlc_list_find
(
p_intf
,
VLC_OBJECT_MODULE
,
FIND_ANYWHERE
);
int
i_num
=
0
;
for
(
int
i_index
=
0
;
i_index
<
p_list
->
i_count
;
i_index
++
)
{
module_t
*
p_parser
=
(
module_t
*
)
p_list
->
p_values
[
i_index
].
p_object
;
if
(
!
strcmp
(
p_parser
->
psz_capability
,
"services_discovery"
)
)
i_num
++
;
}
if
(
i_num
)
pp_sds
=
(
char
**
)
calloc
(
i_num
,
sizeof
(
void
*
)
);
for
(
int
i_index
=
0
;
i_index
<
p_list
->
i_count
;
i_index
++
)
{
module_t
*
p_parser
=
(
module_t
*
)
p_list
->
p_values
[
i_index
].
p_object
;
if
(
!
strcmp
(
p_parser
->
psz_capability
,
"services_discovery"
)
)
{
QAction
*
a
=
menu
->
addAction
(
qfu
(
p_parser
->
psz_longname
?
p_parser
->
psz_longname
:
(
p_parser
->
psz_shortname
?
p_parser
->
psz_shortname
:
p_parser
->
psz_object_name
)
)
);
a
->
setCheckable
(
true
);
/* hack to handle submodules properly */
int
i
=
-
1
;
while
(
p_parser
->
pp_shortcuts
[
++
i
]
!=
NULL
);
i
--
;
if
(
playlist_IsServicesDiscoveryLoaded
(
p_playlist
,
i
>=
0
?
p_parser
->
pp_shortcuts
[
i
]
:
p_parser
->
psz_object_name
)
)
{
a
->
setChecked
(
true
);
}
pp_sds
[
i_num
++
]
=
i
>=
0
?
p_parser
->
pp_shortcuts
[
i
]
:
p_parser
->
psz_object_name
;
}
}
vlc_list_release
(
p_list
);
vlc_object_release
(
p_playlist
);
return
menu
;
}
QMenu
*
QVLCMenu
::
FileMenu
()
{
QMenu
*
menu
=
new
QMenu
();
...
...
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