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
e92bf8c4
Commit
e92bf8c4
authored
Mar 12, 2013
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: EPGItem: add parental rating
parent
e9adc2be
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
modules/gui/qt4/components/epg/EPGItem.cpp
modules/gui/qt4/components/epg/EPGItem.cpp
+19
-0
modules/gui/qt4/components/epg/EPGItem.hpp
modules/gui/qt4/components/epg/EPGItem.hpp
+3
-0
modules/gui/qt4/dialogs/epg.cpp
modules/gui/qt4/dialogs/epg.cpp
+4
-1
No files found.
modules/gui/qt4/components/epg/EPGItem.cpp
View file @
e92bf8c4
...
...
@@ -104,6 +104,19 @@ void EPGItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *option,
/* Draw the title. */
painter
->
drawText
(
mapped
,
Qt
::
AlignTop
|
Qt
::
AlignLeft
,
fm
.
elidedText
(
m_name
,
Qt
::
ElideRight
,
mapped
.
width
()
)
);
if
(
m_rating
>
0
&&
mapped
.
width
()
>
40
)
{
QRectF
iconsRect
=
QRectF
(
mapped
.
bottomRight
(),
mapped
.
bottomRight
()
);
iconsRect
.
adjust
(
-
20
,
-
20
,
0
,
0
);
painter
->
save
();
painter
->
setBrush
(
Qt
::
white
);
f
.
setPixelSize
(
8
);
painter
->
setFont
(
f
);
painter
->
drawRect
(
iconsRect
);
painter
->
drawText
(
iconsRect
,
Qt
::
AlignCenter
,
QString
(
"%1+"
).
arg
(
m_rating
)
);
painter
->
restore
();
}
mapped
.
adjust
(
0
,
20
,
0
,
0
);
QDateTime
m_end
=
m_start
.
addSecs
(
m_duration
);
...
...
@@ -158,6 +171,7 @@ bool EPGItem::setData( vlc_epg_event_t *data )
m_description
=
newdesc
;
m_shortDescription
=
newshortdesc
;
setDuration
(
data
->
i_duration
);
setRating
(
data
->
i_rating
);
update
();
return
true
;
}
...
...
@@ -185,6 +199,11 @@ void EPGItem::setDuration( int duration )
m_boundingRect
.
setWidth
(
duration
);
}
void
EPGItem
::
setRating
(
uint8_t
i_rating
)
{
m_rating
=
i_rating
;
}
QString
EPGItem
::
description
()
{
if
(
m_description
.
isEmpty
()
)
...
...
modules/gui/qt4/components/epg/EPGItem.hpp
View file @
e92bf8c4
...
...
@@ -49,10 +49,12 @@ public:
int
duration
()
const
;
const
QString
&
name
()
{
return
m_name
;
};
QString
description
();
int
rating
()
{
return
m_rating
;
}
bool
setData
(
vlc_epg_event_t
*
);
void
setRow
(
unsigned
int
);
void
setCurrent
(
bool
);
void
setDuration
(
int
duration
);
void
setRating
(
uint8_t
i_rating
);
void
updatePos
();
bool
endsBefore
(
const
QDateTime
&
)
const
;
bool
playsAt
(
const
QDateTime
&
)
const
;
...
...
@@ -73,6 +75,7 @@ private:
QString
m_description
;
QString
m_shortDescription
;
bool
m_current
;
uint8_t
m_rating
;
};
#endif // EPGITEM_H
modules/gui/qt4/dialogs/epg.cpp
View file @
e92bf8c4
...
...
@@ -109,10 +109,13 @@ void EpgDialog::displayEvent( EPGItem *epgItem )
if
(
!
epgItem
)
return
;
QDateTime
end
=
epgItem
->
start
().
addSecs
(
epgItem
->
duration
()
);
title
->
setText
(
QString
(
"%1 - %2 : %3"
)
title
->
setText
(
QString
(
"%1 - %2 : %3
%4
"
)
.
arg
(
epgItem
->
start
().
toString
(
"hh:mm"
)
)
.
arg
(
end
.
toString
(
"hh:mm"
)
)
.
arg
(
epgItem
->
name
()
)
.
arg
(
epgItem
->
rating
()
?
qtr
(
" (%1+ rated)"
).
arg
(
epgItem
->
rating
()
)
:
QString
()
)
);
description
->
setText
(
epgItem
->
description
()
);
}
...
...
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