26 #include <hblistwidgetitem.h> |
26 #include <hblistwidgetitem.h> |
27 #include <hbratingslider.h> |
27 #include <hbratingslider.h> |
28 #include <hblistwidget.h> |
28 #include <hblistwidget.h> |
29 #include <hblistviewitem.h> |
29 #include <hblistviewitem.h> |
30 #include <hbextendedlocale.h> |
30 #include <hbextendedlocale.h> |
|
31 #include <hbanchorlayout.h> |
31 |
32 |
32 #include "mpxvideo_debug.h" |
33 #include "mpxvideo_debug.h" |
33 #include "mpxvideoplaybackdocumentloader.h" |
34 #include "mpxvideoplaybackdocumentloader.h" |
34 #include "mpxvideoplaybackfiledetailswidget.h" |
35 #include "mpxvideoplaybackfiledetailswidget.h" |
35 #include "mpxvideoplaybackdocumentloader.h" |
36 #include "mpxvideoplaybackdocumentloader.h" |
55 // ------------------------------------------------------------------------------------------------- |
56 // ------------------------------------------------------------------------------------------------- |
56 // |
57 // |
57 QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget() |
58 QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget() |
58 { |
59 { |
59 MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget()")); |
60 MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget()")); |
60 |
|
61 if ( mListWidget ) |
|
62 { |
|
63 delete mListWidget; |
|
64 } |
|
65 } |
|
66 |
|
67 // ------------------------------------------------------------------------------------------------- |
|
68 // QMPXVideoPlaybackFileDetailsWidget::initialize |
|
69 // ------------------------------------------------------------------------------------------------- |
|
70 // |
|
71 void QMPXVideoPlaybackFileDetailsWidget::initialize() |
|
72 { |
|
73 MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::initialize")); |
|
74 |
|
75 updateWithFileDetails( mController->fileDetails() ); |
|
76 } |
61 } |
77 |
62 |
78 // ------------------------------------------------------------------------------------------------- |
63 // ------------------------------------------------------------------------------------------------- |
79 // QMPXVideoPlaybackFileDetailsWidget::updateWithFileDetails |
64 // QMPXVideoPlaybackFileDetailsWidget::updateWithFileDetails |
80 // ------------------------------------------------------------------------------------------------- |
65 // ------------------------------------------------------------------------------------------------- |
99 // |
84 // |
100 // set the min/max number of lines in the second row |
85 // set the min/max number of lines in the second row |
101 // |
86 // |
102 HbListViewItem *prototype = mListWidget->listItemPrototype(); |
87 HbListViewItem *prototype = mListWidget->listItemPrototype(); |
103 prototype->setSecondaryTextRowCount( 1, 30 ); |
88 prototype->setSecondaryTextRowCount( 1, 30 ); |
104 |
89 |
|
90 // |
|
91 // Title |
|
92 // |
|
93 makeTitleItem( details ); |
|
94 |
105 if ( ! mFileDetailsUpdated ) |
95 if ( ! mFileDetailsUpdated ) |
106 { |
96 { |
107 HbExtendedLocale locale = HbExtendedLocale::system(); |
97 HbExtendedLocale locale = HbExtendedLocale::system(); |
108 |
98 |
109 mFileDetailsUpdated = true; |
99 mFileDetailsUpdated = true; |
110 |
100 |
111 // |
|
112 // Title |
|
113 // |
|
114 makeTitleItem( details ); |
|
115 |
|
116 // |
101 // |
117 // Description |
102 // Description |
118 // |
103 // |
119 addItemToListWidget( |
104 addItemToListWidget( |
120 hbTrId( "txt_videos_list_description" ), details->mDescription ); |
105 hbTrId( "txt_videos_list_description" ), details->mDescription ); |
121 |
106 |
122 |
|
123 // |
107 // |
124 // Duration |
108 // Duration |
125 // |
109 // |
126 if ( details->mPlaybackMode != EMPXVideoLiveStreaming && details->mDuration > 0 ) |
110 if ( details->mPlaybackMode != EMPXVideoLiveStreaming && details->mDuration > 0 ) |
127 { |
111 { |
130 value = value % 3600; |
114 value = value % 3600; |
131 QString min = locale.toString( value / 60 ); |
115 QString min = locale.toString( value / 60 ); |
132 value = value % 60; |
116 value = value % 60; |
133 QString sec = locale.toString( value ); |
117 QString sec = locale.toString( value ); |
134 |
118 |
135 addItemToListWidget( |
119 addItemToListWidget( |
136 hbTrId( "txt_videos_list_duration" ), |
120 hbTrId( "txt_videos_list_duration" ), |
137 hbTrId( "txt_videos_list_l1_l2_l3" ).arg( hour ).arg( min ).arg( sec ) ); |
121 hbTrId( "txt_videos_list_l1l2l3" ).arg( hour ).arg( min ).arg( sec ) ); |
138 } |
122 } |
139 |
123 |
140 // |
124 // |
141 // Date/Time |
125 // Date/Time |
142 // |
126 // |
143 makeDateTimeItem( details ); |
127 makeDateTimeItem( details ); |
144 |
128 |
145 // |
129 // |
146 // Location |
130 // Location |
147 // |
131 // |
148 addItemToListWidget( hbTrId( "txt_videos_list_location" ), details->mLocation ); |
132 addItemToListWidget( hbTrId( "txt_videos_list_location" ), details->mLocation ); |
149 |
133 |
150 // |
134 // |
151 // Author |
135 // Author |
152 // |
136 // |
153 addItemToListWidget( hbTrId( "txt_videos_list_author" ), details->mArtist ); |
137 addItemToListWidget( hbTrId( "txt_videos_list_author" ), details->mArtist ); |
154 |
138 |
155 // |
139 // |
156 // Copyright |
140 // Copyright |
157 // |
141 // |
158 addItemToListWidget( hbTrId( "txt_videos_list_copyright" ), details->mCopyright ); |
142 addItemToListWidget( hbTrId( "txt_videos_list_copyright" ), details->mCopyright ); |
159 |
143 |
160 // |
144 // |
161 // Language |
145 // Language |
162 // |
146 // |
163 addItemToListWidget( hbTrId( "txt_videos_list_language" ), details->mLanguage ); |
147 addItemToListWidget( hbTrId( "txt_videos_list_language" ), details->mLanguage ); |
164 |
148 |
165 // |
149 // |
166 // Keywords |
150 // Keywords |
167 // |
151 // |
168 addItemToListWidget( hbTrId( "txt_videos_list_keywords" ), details->mKeywords ); |
152 addItemToListWidget( hbTrId( "txt_videos_list_keywords" ), details->mKeywords ); |
169 |
153 |
170 // |
154 // |
171 // Size |
155 // Size |
172 // |
156 // |
173 makeSizeItem( details ); |
157 makeSizeItem( details ); |
174 |
158 |
180 QString resolution = hbTrId( "txt_videos_list_l1l2" ) |
164 QString resolution = hbTrId( "txt_videos_list_l1l2" ) |
181 .arg( locale.toString( details->mVideoWidth ) ) |
165 .arg( locale.toString( details->mVideoWidth ) ) |
182 .arg( locale.toString( details->mVideoHeight ) ); |
166 .arg( locale.toString( details->mVideoHeight ) ); |
183 addItemToListWidget( hbTrId( "txt_videos_list_resolution" ), resolution ); |
167 addItemToListWidget( hbTrId( "txt_videos_list_resolution" ), resolution ); |
184 } |
168 } |
185 |
169 |
186 // |
170 // |
187 // Format |
171 // Format |
188 // |
172 // |
189 addItemToListWidget( hbTrId( "txt_videos_list_format" ), details->mMimeType ); |
173 addItemToListWidget( hbTrId( "txt_videos_list_format" ), details->mMimeType ); |
190 |
174 |
191 // |
175 // |
192 // Bitrate |
176 // Bitrate |
193 // |
177 // |
194 makeBitRateItem( details ); |
178 makeBitRateItem( details ); |
195 |
179 |
196 // |
180 // |
197 // Folder |
181 // Folder |
198 // |
182 // |
199 if ( details->mPlaybackMode == EMPXVideoLocal || |
183 if ( details->mPlaybackMode == EMPXVideoLocal || |
200 details->mPlaybackMode == EMPXVideoProgressiveDownload) |
184 details->mPlaybackMode == EMPXVideoProgressiveDownload) |
201 { |
185 { |
202 QFileInfo fileInfo( details->mClipName ); |
186 QFileInfo fileInfo( details->mClipName ); |
203 QString folder = fileInfo.dir().dirName(); |
187 QString folder = fileInfo.dir().dirName(); |
204 addItemToListWidget( hbTrId( "txt_videos_list_collection_name" ), folder ); |
188 addItemToListWidget( hbTrId( "txt_videos_list_collection_name" ), folder ); |
205 } |
189 } |
206 |
|
207 } |
190 } |
208 |
191 |
209 // |
192 // |
210 // Set the rect size dynamically based on the view mode |
193 // Set the rect size dynamically based on the view mode |
211 // |
194 // |
212 QString sectionName; |
195 QGraphicsWidget *content = loader->findWidget( QString( "content" ) ); |
213 |
196 HbAnchorLayout *layout = static_cast<HbAnchorLayout*>( content->layout() ); |
214 if ( mController->viewMode() == EDetailsView ) |
197 |
215 { |
198 if ( layout ) |
216 sectionName = "detailsView"; |
199 { |
217 } |
200 QGraphicsWidget *titleLayout = loader->findWidget( QString( "titleLayout" ) ); |
218 else if ( mController->viewMode() == EAudioOnlyView ) |
201 QRectF titleRect = titleLayout->geometry(); |
219 { |
202 |
220 sectionName = "audioOnlyView"; |
203 switch ( mController->viewMode() ) |
221 } |
204 { |
222 |
205 case EDetailsView: |
223 bool ok = false; |
206 { |
224 loader->load( KMPXPLAYBACKVIEW_XML, sectionName, &ok ); |
207 layout->setAnchor( titleLayout, Hb::BottomEdge, this, Hb::TopEdge, 0 ); |
225 |
208 layout->setAnchor( layout, Hb::BottomEdge, this, Hb::BottomEdge, 0 ); |
226 if ( ! ok ) |
209 |
227 { |
210 break; |
228 MPX_DEBUG(_L("QMPXVideoPlaybackFileDetailsWidget failed to load section")); |
211 } |
|
212 case EAudioOnlyView: |
|
213 { |
|
214 QGraphicsWidget *controlLayout = loader->findWidget( QString( "controlBarLayout" ) ); |
|
215 QRectF controlRect = controlLayout->geometry(); |
|
216 |
|
217 layout->setAnchor( |
|
218 this, Hb::TopEdge, titleLayout, |
|
219 Hb::BottomEdge, titleRect.bottom() - titleRect.top() ); |
|
220 |
|
221 layout->setAnchor( |
|
222 this, Hb::BottomEdge, |
|
223 layout, Hb::BottomEdge, layout->geometry().height() - controlRect.top() ); |
|
224 |
|
225 break; |
|
226 } |
|
227 } |
229 } |
228 } |
230 } |
229 } |
231 } |
230 } |
232 |
231 |
233 // ------------------------------------------------------------------------------------------------- |
232 // ------------------------------------------------------------------------------------------------- |