author | hgs |
Fri, 15 Oct 2010 16:26:27 +0300 | |
changeset 57 | 21be958eb3ce |
parent 54 | a8ba0c289b44 |
permissions | -rw-r--r-- |
24 | 1 |
/* |
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
// System includes |
|
19 |
#include <HbListView> |
|
20 |
#include <HbAction> |
|
21 |
#include <HbAbstractViewItem> |
|
22 |
#include <HbMenu> |
|
23 |
#include <HbMessageBox> |
|
54 | 24 |
#include <HbSelectionDialog> |
24 | 25 |
|
26 |
// User includes |
|
27 |
#include "radiohistoryview.h" |
|
28 |
#include "radiowindow.h" |
|
29 |
#include "radiologger.h" |
|
30 |
#include "radiouiloader.h" |
|
31 |
#include "radiouiengine.h" |
|
32 |
#include "radiohistorymodel.h" |
|
33 |
#include "radiohistoryitem.h" |
|
54 | 34 |
#include "radioutil.h" |
24 | 35 |
|
36 |
// BEGIN TEMPORARY TEST CODE CODE |
|
37 |
#include <QTimer> |
|
38 |
#include "radiostationmodel.h" |
|
39 |
||
40 |
struct Song |
|
41 |
{ |
|
42 |
const char* mArtist; |
|
43 |
const char* mTitle; |
|
44 |
}; |
|
45 |
const Song KRecognizedSongs[] = { |
|
46 |
{ "Red Hot Chili Peppers", "Under The Bridge" }, |
|
51 | 47 |
{ "", "No One Knows" }, |
24 | 48 |
{ "The Presidents of the United States of America", "Dune Buggy" }, |
49 |
{ "System of a Down", "Aerials" }, |
|
50 |
{ "The White Stripes", "Seven Nation Army" }, |
|
51 |
{ "Alice In Chains", "When The Sun Rose Again" }, |
|
52 |
{ "Bullet For My Valentine", "Tears Don't Fall" } |
|
53 |
}; |
|
54 |
const int KSongsCount = sizeof( KRecognizedSongs ) / sizeof( KRecognizedSongs[0] ); |
|
55 |
// END TEMPORARY TEST CODE CODE |
|
56 |
||
57 |
/*! |
|
58 |
* |
|
59 |
*/ |
|
60 |
RadioHistoryView::RadioHistoryView() : |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
61 |
RadioViewBase(), |
24 | 62 |
mHistoryList( 0 ), |
63 |
mAllSongsButton( 0 ), |
|
64 |
mTaggedSongsButton( 0 ), |
|
65 |
mSelectedItem( new RadioHistoryItem() ), |
|
66 |
mCurrentRow( -1 ), |
|
67 |
mSongIndex( 0 ) |
|
68 |
{ |
|
69 |
} |
|
70 |
||
71 |
/*! |
|
72 |
* |
|
73 |
*/ |
|
74 |
RadioHistoryView::~RadioHistoryView() |
|
75 |
{ |
|
76 |
} |
|
77 |
||
78 |
/*! |
|
79 |
* |
|
80 |
*/ |
|
81 |
void RadioHistoryView::setNonTaggedIcon( const HbIcon& nonTaggedIcon ) |
|
82 |
{ |
|
83 |
mNonTaggedIcon = nonTaggedIcon; |
|
84 |
mNonTaggedIcon.setColor( Qt::white ); |
|
85 |
} |
|
86 |
||
87 |
/*! |
|
88 |
* |
|
89 |
*/ |
|
90 |
HbIcon RadioHistoryView::nonTaggedIcon() const |
|
91 |
{ |
|
92 |
return mNonTaggedIcon; |
|
93 |
} |
|
94 |
||
95 |
/*! |
|
96 |
* |
|
97 |
*/ |
|
98 |
void RadioHistoryView::setTaggedIcon( const HbIcon& taggedIcon ) |
|
99 |
{ |
|
100 |
mTaggedIcon = taggedIcon; |
|
101 |
} |
|
102 |
||
103 |
/*! |
|
104 |
* |
|
105 |
*/ |
|
106 |
HbIcon RadioHistoryView::taggedIcon() const |
|
107 |
{ |
|
108 |
return mTaggedIcon; |
|
109 |
} |
|
110 |
||
111 |
/*! |
|
112 |
* Private slot |
|
113 |
* |
|
114 |
*/ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
115 |
void RadioHistoryView::updateViewMode() |
24 | 116 |
{ |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
117 |
QString section = DOCML::HV_SECTION_HISTORY_MODE; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
118 |
bool showTagged = false; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
119 |
|
24 | 120 |
if ( sender() == mTaggedSongsButton ) { |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
121 |
section = DOCML::HV_SECTION_FAVORITE_MODE; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
122 |
showTagged = true; |
24 | 123 |
} |
124 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
125 |
loadSection( DOCML::FILE_HISTORYVIEW, section ); |
24 | 126 |
historyModel().setShowTagged( showTagged ); |
127 |
||
128 |
updateVisibilities(); |
|
129 |
} |
|
130 |
||
131 |
/*! |
|
132 |
* Private slot |
|
133 |
* |
|
134 |
*/ |
|
54 | 135 |
void RadioHistoryView::openMultiSelection() |
24 | 136 |
{ |
54 | 137 |
showSelectionDialog( &mUiEngine->historyModel() , |
138 |
hbTrId( "txt_fmradio_title_delete_song_information" ), |
|
139 |
hbTrId( "txt_common_button_delete_toolbar" ) ); |
|
24 | 140 |
} |
141 |
||
142 |
/*! |
|
143 |
* Private slot |
|
144 |
* |
|
145 |
*/ |
|
146 |
void RadioHistoryView::updateVisibilities() |
|
147 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
148 |
const int itemCount = mUiEngine->historyModel().rowCount(); |
24 | 149 |
loadSection( DOCML::FILE_HISTORYVIEW, itemCount ? DOCML::HV_SECTION_SHOW_LIST : DOCML::HV_SECTION_HIDE_LIST ); |
150 |
} |
|
151 |
||
152 |
/*! |
|
153 |
* Private slot |
|
154 |
* |
|
155 |
*/ |
|
156 |
void RadioHistoryView::showContextMenu( const QModelIndex& index ) |
|
157 |
{ |
|
158 |
*mSelectedItem = historyModel().itemAtIndex( index ); |
|
159 |
mCurrentRow = index.row(); |
|
160 |
||
161 |
HbMenu* menu = mUiLoader->findObject<HbMenu>( DOCML::HV_NAME_CONTEXT_MENU ); |
|
162 |
||
163 |
if ( HbAction* tagAction = mUiLoader->findObject<HbAction>( DOCML::HV_NAME_CONTEXT_TAG ) ) { |
|
164 |
if ( mSelectedItem->isTagged() ) { |
|
165 |
tagAction->setText( hbTrId( "txt_rad_menu_remove_tag" ) ); |
|
166 |
} else { |
|
167 |
tagAction->setText( hbTrId( "txt_rad_menu_tag_song" ) ); |
|
168 |
} |
|
169 |
} |
|
170 |
||
171 |
if ( HbAction* searchAction = mUiLoader->findObject<HbAction>( DOCML::HV_NAME_CONTEXT_SEARCH ) ) { |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
172 |
//TODO: Add support for other music store |
24 | 173 |
searchAction->setVisible( false ); |
174 |
} |
|
175 |
||
176 |
HbAbstractViewItem* item = mHistoryList->itemByIndex( index ); |
|
177 |
QPointF coords = item->pos(); |
|
178 |
coords.setY( mHistoryList->contentWidget()->pos().y() + coords.y() ); |
|
179 |
menu->setPreferredPos( QPointF( size().width() / 2 - menu->size().width() / 2, coords.y() + menu->size().height() / 2 ) ); |
|
180 |
||
181 |
menu->show(); |
|
182 |
} |
|
183 |
||
184 |
/*! |
|
185 |
* Private slot |
|
186 |
* |
|
187 |
*/ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
188 |
void RadioHistoryView::handleLongPress( HbAbstractViewItem* item ) |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
189 |
{ |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
190 |
showContextMenu( item->modelIndex() ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
191 |
} |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
192 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
193 |
/*! |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
194 |
* Private slot |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
195 |
* |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
196 |
*/ |
24 | 197 |
void RadioHistoryView::toggleTagging() |
198 |
{ |
|
57 | 199 |
bool favoriteMode = mTaggedSongsButton->isChecked(); |
200 |
if ( favoriteMode ) { |
|
201 |
HbMessageBox::question( hbTrId( "txt_rad_info_remove_song_from_tagged_songs" ), this, |
|
202 |
SLOT(handleRemoveTag(HbAction*)), HbMessageBox::Yes | HbMessageBox::No ); |
|
203 |
||
204 |
} else { |
|
205 |
historyModel().toggleTagging( *mSelectedItem, mCurrentRow ); |
|
206 |
mSelectedItem->reset(); |
|
207 |
mCurrentRow = -1; |
|
208 |
updateVisibilities(); |
|
209 |
} |
|
24 | 210 |
} |
211 |
||
212 |
/*! |
|
213 |
* Private slot |
|
214 |
* |
|
215 |
*/ |
|
57 | 216 |
void RadioHistoryView::handleRemoveTag( HbAction* answer ) |
217 |
{ |
|
218 |
HbDialog* dlg = static_cast<HbDialog*>( sender() ); |
|
219 |
if( dlg->actions().first() == answer ) { |
|
220 |
historyModel().toggleTagging( *mSelectedItem, mCurrentRow ); |
|
221 |
mSelectedItem->reset(); |
|
222 |
mCurrentRow = -1; |
|
223 |
updateVisibilities(); |
|
224 |
} else { |
|
225 |
// Do Nothing |
|
226 |
} |
|
227 |
} |
|
228 |
||
229 |
||
230 |
/*! |
|
231 |
* Private slot |
|
232 |
* |
|
233 |
*/ |
|
24 | 234 |
void RadioHistoryView::openOviStore() |
235 |
{ |
|
236 |
QString msg = "To be implemented: Open ovi store. Artist: %1, Title: %2"; |
|
237 |
HbMessageBox::information( msg.arg( mSelectedItem->artist() ).arg( mSelectedItem->title() ) ); |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
238 |
mUiEngine->openMusicStore( *mSelectedItem ); |
24 | 239 |
} |
240 |
||
241 |
/*! |
|
242 |
* Private slot |
|
243 |
* |
|
244 |
*/ |
|
245 |
void RadioHistoryView::openOtherStore() |
|
246 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
247 |
mUiEngine->openMusicStore( *mSelectedItem, RadioUiEngine::OtherStore ); |
24 | 248 |
} |
249 |
||
250 |
/*! |
|
251 |
* Private slot |
|
252 |
* TEMPORARY TEST CODE |
|
253 |
*/ |
|
254 |
void RadioHistoryView::addSongs() |
|
255 |
{ |
|
256 |
for ( int i = 0; i < KSongsCount; ++i ) { |
|
257 |
QTimer::singleShot( 1000 + i * 1500, this, SLOT(addOneSong()) ); |
|
258 |
} |
|
259 |
} |
|
260 |
||
261 |
/*! |
|
262 |
* Private slot |
|
263 |
* TEMPORARY TEST CODE |
|
264 |
*/ |
|
265 |
void RadioHistoryView::addOneSong() |
|
266 |
{ |
|
267 |
Song song = KRecognizedSongs[mSongIndex++]; |
|
268 |
mSongIndex %= KSongsCount; |
|
269 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
270 |
RadioStation station = mUiEngine->stationModel().currentStation(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
271 |
mUiEngine->historyModel().addItem( song.mArtist, song.mTitle, station ); |
24 | 272 |
} |
273 |
||
274 |
/*! |
|
275 |
* \reimp |
|
276 |
* |
|
277 |
*/ |
|
278 |
void RadioHistoryView::init() |
|
279 |
{ |
|
280 |
LOG_METHOD; |
|
34 | 281 |
loadSection( DOCML::FILE_HISTORYVIEW, DOCML::SECTION_LAZY_LOAD ); |
24 | 282 |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
283 |
RadioHistoryModel* historyModel = &mUiEngine->historyModel(); |
24 | 284 |
historyModel->setShowDetails( mOrientation == Qt::Horizontal ); |
285 |
||
286 |
if ( !mNonTaggedIcon.isNull() && !mTaggedIcon.isNull() ) { |
|
287 |
historyModel->setIcons( mNonTaggedIcon.qicon(), mTaggedIcon.qicon() ); |
|
288 |
} |
|
289 |
||
290 |
mHistoryList = mUiLoader->findObject<HbListView>( DOCML::HV_NAME_HISTORY_LIST ); |
|
57 | 291 |
mHistoryList->setScrollingStyle( HbListView::PanWithFollowOn ); |
24 | 292 |
mHistoryList->setModel( historyModel ); |
293 |
mHistoryList->setSelectionMode( HbListView::NoSelection ); |
|
294 |
mHistoryList->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); |
|
51 | 295 |
mHistoryList->setItemPixmapCacheEnabled( true ); // Improves scrolling FPS rate |
24 | 296 |
|
297 |
mAllSongsButton = mUiLoader->findObject<HbAction>( DOCML::HV_NAME_ALL_SONGS_BUTTON ); |
|
298 |
mTaggedSongsButton = mUiLoader->findObject<HbAction>( DOCML::HV_NAME_TAGGED_SONGS_BUTTON ); |
|
299 |
||
54 | 300 |
if ( HbAction* multiDelAction = mUiLoader->findObject<HbAction>( DOCML::HV_NAME_MULTI_DELETE_ACTION ) ) { |
301 |
Radio::connect( multiDelAction, SIGNAL(triggered()), |
|
302 |
this, SLOT(openMultiSelection()) ); |
|
24 | 303 |
} |
304 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
305 |
Radio::connect( mTaggedSongsButton, SIGNAL(triggered()), |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
306 |
this, SLOT(updateViewMode()) ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
307 |
Radio::connect( mAllSongsButton, SIGNAL(triggered()), |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
308 |
this, SLOT(updateViewMode()) ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
309 |
Radio::connect( historyModel, SIGNAL(itemAdded()), |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
310 |
this, SLOT(updateVisibilities()) ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
311 |
Radio::connect( mHistoryList, SIGNAL(activated(QModelIndex)), |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
312 |
this, SLOT(showContextMenu(QModelIndex)) ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
313 |
Radio::connect( mHistoryList, SIGNAL(longPressed(HbAbstractViewItem*,QPointF)), |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
314 |
this, SLOT(handleLongPress(HbAbstractViewItem*)) ); |
24 | 315 |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
316 |
connectCommonMenuItem( MenuItem::Exit ); |
24 | 317 |
connectCommonMenuItem( MenuItem::UseLoudspeaker ); |
318 |
||
51 | 319 |
initContextMenu(); |
320 |
||
24 | 321 |
initBackAction(); |
322 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
323 |
updateViewMode(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
324 |
|
24 | 325 |
// BEGIN TEMPORARY TEST CODE |
326 |
if ( HbAction* addSongsAction = mUiLoader->findObject<HbAction>( "hv:add_songs_action" ) ) { |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
327 |
Radio::connect( addSongsAction, SIGNAL(triggered()), |
24 | 328 |
this, SLOT(addSongs()) ); |
329 |
} |
|
330 |
// END TEMPORARY TEST CODE |
|
331 |
} |
|
332 |
||
333 |
/*! |
|
334 |
* \reimp |
|
335 |
* |
|
336 |
*/ |
|
337 |
void RadioHistoryView::setOrientation() |
|
338 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
339 |
if ( mUiEngine ) { |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
340 |
RadioHistoryModel& model = mUiEngine->historyModel(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
341 |
model.setShowDetails( mOrientation == Qt::Horizontal ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
342 |
} |
24 | 343 |
} |
344 |
||
345 |
/*! |
|
346 |
* \reimp |
|
347 |
* |
|
348 |
*/ |
|
349 |
void RadioHistoryView::userAccepted() |
|
350 |
{ |
|
54 | 351 |
HbSelectionDialog* dlg = static_cast<HbSelectionDialog*>( sender() ); |
352 |
if(dlg) { |
|
353 |
bool favoriteMode = mTaggedSongsButton->isChecked(); |
|
354 |
QModelIndexList selected = dlg->selectedModelIndexes(); |
|
355 |
int count = selected.count(); |
|
356 |
if( count == mUiEngine->historyModel().rowCount() ) { |
|
357 |
mUiEngine->historyModel().removeAll( favoriteMode ); |
|
358 |
} else { |
|
359 |
mUiEngine->historyModel().removeByModelIndices( selected, favoriteMode ); |
|
360 |
} |
|
361 |
QString msg = hbTrId("txt_rad_dpophead_l1_song_information_removed", count ); |
|
362 |
RadioUtil::showDiscreetNote( msg ); |
|
363 |
updateVisibilities(); |
|
364 |
} |
|
24 | 365 |
} |
366 |
||
367 |
/*! |
|
368 |
* |
|
369 |
*/ |
|
51 | 370 |
void RadioHistoryView::initContextMenu() |
371 |
{ |
|
372 |
// Context menu actions |
|
373 |
connectXmlElement( DOCML::HV_NAME_TOGGLE_TAG_ACTION, SIGNAL(triggered()), |
|
374 |
this, SLOT(toggleTagging()) ); |
|
375 |
connectXmlElement( DOCML::HV_NAME_OVI_STORE_ACTION, SIGNAL(triggered()), |
|
376 |
this, SLOT(openOviStore()) ); |
|
377 |
||
378 |
// TODO: Get additional music stores. For now use "Amazon" for demonstration purposes |
|
379 |
const QString otherStoreFormatter = hbTrId( "txt_rad_menu_search_from_other_store" ); |
|
380 |
if ( HbMenu* contextMenu = mUiLoader->findObject<HbMenu>( DOCML::HV_NAME_CONTEXT_MENU ) ) { |
|
57 | 381 |
contextMenu->setParent( this ); |
51 | 382 |
contextMenu->addAction( otherStoreFormatter.arg( "Amazon" ), this, SLOT(openOtherStore()) ); |
383 |
} |
|
384 |
} |
|
385 |
||
386 |
/*! |
|
387 |
* |
|
388 |
*/ |
|
24 | 389 |
RadioHistoryModel& RadioHistoryView::historyModel() const |
390 |
{ |
|
391 |
return *static_cast<RadioHistoryModel*>( mHistoryList->model() ); |
|
392 |
} |