13 * |
13 * |
14 * Description: Videolist content widget implementation |
14 * Description: Videolist content widget implementation |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
|
18 // Version : %version: 13 % |
|
19 |
|
20 // INCLUDE FILES |
18 #include <hbpushbutton.h> |
21 #include <hbpushbutton.h> |
19 #include <hblabel.h> |
22 #include <hblabel.h> |
20 #include <qgraphicsitem.h> |
23 #include <qgraphicsitem.h> |
21 #include <hbinstance.h> |
24 #include <hbinstance.h> |
22 |
25 |
23 #include "videohintwidget.h" |
26 #include "videohintwidget.h" |
24 #include "videocollectionuiloader.h" |
27 #include "videocollectionuiloader.h" |
25 #include "videocollectionviewutils.h" |
28 #include "videocollectionviewutils.h" |
|
29 #include "videocollectiontrace.h" |
26 |
30 |
27 // --------------------------------------------------------------------------- |
31 // --------------------------------------------------------------------------- |
28 // Constructor |
32 // Constructor |
29 // --------------------------------------------------------------------------- |
33 // --------------------------------------------------------------------------- |
30 // |
34 // |
31 VideoHintWidget::VideoHintWidget(VideoCollectionUiLoader *uiLoader, QGraphicsItem *parent) : |
35 VideoHintWidget::VideoHintWidget( VideoCollectionUiLoader *uiLoader, QGraphicsItem *parent ) |
32 HbWidget(parent), |
36 : HbWidget( parent ) |
33 mUiLoader(uiLoader), |
37 , mUiLoader( uiLoader ) |
34 mServiceIcon(0), |
38 , mServiceIcon( 0 ) |
35 mAddVideosIcon(0), |
39 , mAddVideosIcon( 0 ) |
36 mCurrentLevel(AllVideos), |
40 , mCurrentLevel( AllVideos ) |
37 mButtonShown(false), |
41 , mButtonShown( false ) |
38 mActivated(false) |
42 , mActivated( false ) |
39 { |
43 { |
|
44 FUNC_LOG; |
40 // NOP |
45 // NOP |
41 } |
46 } |
42 |
47 |
43 // --------------------------------------------------------------------------- |
48 // --------------------------------------------------------------------------- |
44 // Destructor |
49 // Destructor |
45 // --------------------------------------------------------------------------- |
50 // --------------------------------------------------------------------------- |
46 // |
51 // |
47 VideoHintWidget::~VideoHintWidget() |
52 VideoHintWidget::~VideoHintWidget() |
48 { |
53 { |
|
54 FUNC_LOG; |
49 delete mServiceIcon; |
55 delete mServiceIcon; |
50 delete mAddVideosIcon; |
56 delete mAddVideosIcon; |
51 } |
57 } |
52 |
58 |
53 // --------------------------------------------------------------------------- |
59 // --------------------------------------------------------------------------- |
54 // initialize |
60 // initialize |
55 // --------------------------------------------------------------------------- |
61 // --------------------------------------------------------------------------- |
56 // |
62 // |
57 int VideoHintWidget::initialize() |
63 int VideoHintWidget::initialize() |
58 { |
64 { |
|
65 FUNC_LOG; |
59 VideoCollectionViewUtils& utils = VideoCollectionViewUtils::instance(); |
66 VideoCollectionViewUtils& utils = VideoCollectionViewUtils::instance(); |
60 return utils.getServiceIconStrings(mServiceIconString, mServiceIconPressedString); |
67 return utils.getServiceIconStrings(mServiceIconString, mServiceIconPressedString); |
61 } |
68 } |
62 |
69 |
63 // --------------------------------------------------------------------------- |
70 // --------------------------------------------------------------------------- |
64 // setLevel |
71 // setLevel |
65 // --------------------------------------------------------------------------- |
72 // --------------------------------------------------------------------------- |
66 // |
73 // |
67 void VideoHintWidget::setLevel(HintLevel level) |
74 void VideoHintWidget::setLevel(HintLevel level) |
68 { |
75 { |
|
76 FUNC_LOG; |
|
77 INFO_1("VideoHintWidget::setLevel() level: %d", level); |
69 mCurrentLevel = level; |
78 mCurrentLevel = level; |
70 if(mActivated) { |
79 if(mActivated) { |
71 updateUiComponents(); |
80 updateUiComponents(); |
72 } |
81 } |
73 } |
82 } |
88 // orientationChanged |
99 // orientationChanged |
89 // --------------------------------------------------------------------------- |
100 // --------------------------------------------------------------------------- |
90 // |
101 // |
91 void VideoHintWidget::orientationChangedSlot(Qt::Orientation targetOrientation) |
102 void VideoHintWidget::orientationChangedSlot(Qt::Orientation targetOrientation) |
92 { |
103 { |
|
104 FUNC_LOG; |
93 Q_UNUSED(targetOrientation); |
105 Q_UNUSED(targetOrientation); |
94 updateUiComponents(); |
106 updateUiComponents(); |
95 } |
107 } |
96 |
108 |
97 // --------------------------------------------------------------------------- |
109 // --------------------------------------------------------------------------- |
98 // activate |
110 // activate |
99 // --------------------------------------------------------------------------- |
111 // --------------------------------------------------------------------------- |
100 // |
112 // |
101 void VideoHintWidget::activate() |
113 void VideoHintWidget::activate() |
102 { |
114 { |
|
115 FUNC_LOG; |
103 if (!mActivated) |
116 if (!mActivated) |
104 { |
117 { |
105 if(mServiceIconString.isEmpty() || |
118 if(mServiceIconString.isEmpty() || |
106 mServiceIconPressedString.isEmpty()) |
119 mServiceIconPressedString.isEmpty()) |
107 { |
120 { |
114 this, SLOT(orientationChangedSlot(Qt::Orientation))); |
127 this, SLOT(orientationChangedSlot(Qt::Orientation))); |
115 |
128 |
116 mServiceIcon = new HbIcon(mServiceIconString); |
129 mServiceIcon = new HbIcon(mServiceIconString); |
117 mServiceIcon->setIconName(mServiceIconPressedString, QIcon::Normal, QIcon::On); |
130 mServiceIcon->setIconName(mServiceIconPressedString, QIcon::Normal, QIcon::On); |
118 |
131 |
119 mAddVideosIcon = new HbIcon(":/images/mono_video_addvideos.svg"); |
132 mAddVideosIcon = new HbIcon("qtg_mono_add_to_video_collection"); |
120 |
133 |
121 updateUiComponents(); |
134 updateUiComponents(); |
122 |
135 |
123 setVisible(true); |
136 setVisible(true); |
124 |
137 |
166 // updateUiComponents |
180 // updateUiComponents |
167 // --------------------------------------------------------------------------- |
181 // --------------------------------------------------------------------------- |
168 // |
182 // |
169 void VideoHintWidget::updateUiComponents() |
183 void VideoHintWidget::updateUiComponents() |
170 { |
184 { |
|
185 FUNC_LOG; |
171 HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0); |
186 HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0); |
172 if (mainWnd) |
187 if (mainWnd) |
173 { |
188 { |
174 HbPushButton *serviceButton = |
189 HbPushButton *serviceButton = |
175 mUiLoader->findWidget<HbPushButton>( |
190 mUiLoader->findWidget<HbPushButton>( |