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
cd929de4
Commit
cd929de4
authored
Apr 13, 2013
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: StandardPanel: Add spinner on network SD nodes.
parent
b79f9b0b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
0 deletions
+55
-0
modules/gui/qt4/components/playlist/playlist.cpp
modules/gui/qt4/components/playlist/playlist.cpp
+1
-0
modules/gui/qt4/components/playlist/selector.cpp
modules/gui/qt4/components/playlist/selector.cpp
+6
-0
modules/gui/qt4/components/playlist/selector.hpp
modules/gui/qt4/components/playlist/selector.hpp
+2
-0
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+40
-0
modules/gui/qt4/components/playlist/standardpanel.hpp
modules/gui/qt4/components/playlist/standardpanel.hpp
+6
-0
No files found.
modules/gui/qt4/components/playlist/playlist.cpp
View file @
cd929de4
...
...
@@ -141,6 +141,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
DCONNECT
(
selector
,
categoryActivated
(
playlist_item_t
*
,
bool
),
mainView
,
setRootItem
(
playlist_item_t
*
,
bool
)
);
mainView
->
setRootItem
(
p_root
,
false
);
CONNECT
(
selector
,
SDCategorySelected
(
bool
),
mainView
,
setWaiting
(
bool
)
);
/* */
split
=
new
PlaylistSplitter
(
this
);
...
...
modules/gui/qt4/components/playlist/selector.cpp
View file @
cd929de4
...
...
@@ -333,6 +333,7 @@ void PLSelector::createItems()
selItem
=
addItem
(
SD_TYPE
,
*
ppsz_longname
);
}
selItem
->
treeItem
()
->
setData
(
0
,
SD_CATEGORY_ROLE
,
*
p_category
);
putSDData
(
selItem
,
*
ppsz_name
,
*
ppsz_longname
);
if
(
!
icon
.
isNull
()
)
selItem
->
treeItem
()
->
setData
(
0
,
Qt
::
DecorationRole
,
icon
);
...
...
@@ -418,7 +419,12 @@ void PLSelector::setSource( QTreeWidgetItem *item )
/* */
if
(
pl_item
)
{
emit
categoryActivated
(
pl_item
,
false
);
int
i_cat
=
item
->
data
(
0
,
SD_CATEGORY_ROLE
).
toInt
();
emit
SDCategorySelected
(
i_cat
==
SD_CAT_INTERNET
||
i_cat
==
SD_CAT_LAN
);
}
}
PLSelItem
*
PLSelector
::
addItem
(
...
...
modules/gui/qt4/components/playlist/selector.hpp
View file @
cd929de4
...
...
@@ -62,6 +62,7 @@ enum {
IN_ITEM_ROLE
,
//input_item_t->i_id
SPECIAL_ROLE
,
//SpecialData
CAP_SEARCH_ROLE
,
SD_CATEGORY_ROLE
,
};
enum
ItemAction
{
...
...
@@ -154,6 +155,7 @@ private slots:
signals:
void
categoryActivated
(
playlist_item_t
*
,
bool
);
void
SDCategorySelected
(
bool
);
};
#endif
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
cd929de4
...
...
@@ -33,6 +33,7 @@
#include "components/playlist/ml_model.hpp"
/* MLModel */
#include "components/playlist/views.hpp"
/* 3 views */
#include "components/playlist/selector.hpp"
/* PLSelector */
#include "util/customwidgets.hpp"
/* PixmapAnimator */
#include "menus.hpp"
/* Popup */
#include "input_manager.hpp"
/* THEMIM */
#include "dialogs_provider.hpp"
/* THEDP */
...
...
@@ -87,6 +88,14 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
currentRootIndexId
=
-
1
;
lastActivatedId
=
-
1
;
QList
<
QString
>
frames
;
frames
<<
":/util/wait1"
;
frames
<<
":/util/wait2"
;
frames
<<
":/util/wait3"
;
frames
<<
":/util/wait4"
;
spinnerAnimation
=
new
PixmapAnimator
(
this
,
frames
);
CONNECT
(
spinnerAnimation
,
pixmapReady
(
const
QPixmap
&
),
this
,
updateViewport
()
);
/* Saved Settings */
int
i_savedViewMode
=
getSettings
()
->
value
(
"Playlist/view-mode"
,
TREE_VIEW
).
toInt
();
i_zoom
=
getSettings
()
->
value
(
"Playlist/zoom"
,
0
).
toInt
();
...
...
@@ -503,6 +512,20 @@ bool StandardPLPanel::eventFilter ( QObject *obj, QEvent * event )
"media source from the left."
),
QPalette
::
Text
);
}
else
if
(
spinnerAnimation
->
state
()
==
PixmapAnimator
::
Running
)
{
if
(
currentView
->
model
()
->
rowCount
()
)
spinnerAnimation
->
stop
();
/* Trick until SD emits events */
else
{
QWidget
*
viewport
=
qobject_cast
<
QWidget
*>
(
obj
);
QStylePainter
painter
(
viewport
);
QPixmap
*
spinner
=
spinnerAnimation
->
getPixmap
();
QPoint
point
=
viewport
->
geometry
().
center
();
point
-=
QPoint
(
spinner
->
size
().
width
()
/
2
,
spinner
->
size
().
height
()
/
2
);
painter
.
drawPixmap
(
point
,
*
spinner
);
}
}
}
return
false
;
}
...
...
@@ -682,6 +705,23 @@ void StandardPLPanel::showView( int i_view )
gotoPlayingItem
();
}
void
StandardPLPanel
::
setWaiting
(
bool
b
)
{
if
(
b
)
{
spinnerAnimation
->
setLoopCount
(
20
);
/* Trick until SD emits an event */
spinnerAnimation
->
start
();
}
else
spinnerAnimation
->
stop
();
}
void
StandardPLPanel
::
updateViewport
()
{
/* A single update on parent widget won't work */
currentView
->
viewport
()
->
repaint
();
}
int
StandardPLPanel
::
currentViewIndex
()
const
{
if
(
currentView
==
treeView
)
...
...
modules/gui/qt4/components/playlist/standardpanel.hpp
View file @
cd929de4
...
...
@@ -53,6 +53,7 @@ class PicFlowView;
class
LocationBar
;
class
PLSelector
;
class
PlaylistWidget
;
class
PixmapAnimator
;
class
StandardPLPanel
:
public
QWidget
{
...
...
@@ -110,10 +111,14 @@ private:
/* for popup */
QModelIndex
popupIndex
;
/* FIXME: don't store here, pass as Action param */
/* Wait spinner */
PixmapAnimator
*
spinnerAnimation
;
public
slots
:
void
setRootItem
(
playlist_item_t
*
,
bool
);
void
browseInto
(
const
QModelIndex
&
);
void
showView
(
int
);
void
setWaiting
(
bool
);
/* spinner */
private
slots
:
void
deleteSelection
();
...
...
@@ -140,6 +145,7 @@ private slots:
void
toggleColumnShown
(
int
);
void
cycleViews
();
void
updateViewport
();
/* spinner */
signals:
void
viewChanged
(
const
QModelIndex
&
);
...
...
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