[vlc-commits] commit: Qt/EPG: Try to display intelligently the short and long event description with the dedicated widgets . (Adrien Maglo )
git at videolan.org
git at videolan.org
Thu Jul 29 11:38:43 CEST 2010
vlc/vlc-1.1 | branch: master | Adrien Maglo <magsoft at videolan.org> | Wed Jul 28 20:25:16 2010 +0200| [15c5d37ec7ae7455eb5271e17ccc8fe92e8e15a1] | committer: Jean-Baptiste Kempf
Qt/EPG: Try to display intelligently the short and long event description with the dedicated widgets.
It depends of the channels. Some use only the short one, others only the long one and others both.
(cherry picked from commit ec1859e9991185b43b3b05815654e8326dd6728c)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=15c5d37ec7ae7455eb5271e17ccc8fe92e8e15a1
---
modules/gui/qt4/dialogs/epg.cpp | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/modules/gui/qt4/dialogs/epg.cpp b/modules/gui/qt4/dialogs/epg.cpp
index 6f45929..01143a7 100644
--- a/modules/gui/qt4/dialogs/epg.cpp
+++ b/modules/gui/qt4/dialogs/epg.cpp
@@ -94,14 +94,22 @@ void EpgDialog::showEvent( EPGEvent *event )
{
if( !event ) return;
+ QString titleDescription, textDescription;
+ if( event->description.isEmpty() )
+ textDescription = event->shortDescription;
+ else
+ {
+ textDescription = event->description;
+ if( !event->shortDescription.isEmpty() )
+ titleDescription = " - " + event->shortDescription;
+ }
+
QDateTime end = event->start.addSecs( event->duration );
title->setText( event->start.toString( "hh:mm" ) + " - "
+ end.toString( "hh:mm" ) + " : "
- + event->name
- + ( event->shortDescription.isEmpty()
- ? "" : " - " + event->shortDescription ) );
+ + event->name + titleDescription );
- description->setText( event->description );
+ description->setText( textDescription );
}
void EpgDialog::updateInfos()
More information about the vlc-commits
mailing list