9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: Implementation of QMPXVideoPlaybackProgressBar |
14 * Description: Implementation of QMPXVideoPlaybackDetailsPlaybackWindow |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 // Version : %version: 13 % |
18 // Version : %version: 16 % |
19 |
19 |
20 |
20 |
21 |
21 |
22 #include <QFileInfo> |
|
23 #include <QGraphicsSceneMouseEvent> |
22 #include <QGraphicsSceneMouseEvent> |
24 |
23 |
25 |
|
26 #include <hblabel.h> |
|
27 #include <hbframeitem.h> |
24 #include <hbframeitem.h> |
28 #include <hbpushbutton.h> |
25 #include <hbpushbutton.h> |
29 #include <hbframedrawer.h> |
26 #include <hbframedrawer.h> |
30 |
27 |
31 #include "mpxvideo_debug.h" |
28 #include "mpxvideo_debug.h" |
80 mPlayButton = qobject_cast<HbPushButton*>( widget ); |
77 mPlayButton = qobject_cast<HbPushButton*>( widget ); |
81 mPlayButton->setFlag( QGraphicsItem::ItemIsFocusable, false ); |
78 mPlayButton->setFlag( QGraphicsItem::ItemIsFocusable, false ); |
82 |
79 |
83 connect( mPlayButton, SIGNAL( released() ), this, SLOT( playPause() ) ); |
80 connect( mPlayButton, SIGNAL( released() ), this, SLOT( playPause() ) ); |
84 |
81 |
85 QGraphicsItem *widget1 = mPlayButton->primitive( HbStyle::P_PushButton_background ); |
|
86 widget1->setVisible( false ); |
|
87 |
|
88 // |
82 // |
89 // Set framedrawer for semi transparent background |
83 // Set framedrawer for semi transparent background |
90 // |
84 // |
91 HbFrameItem *frameItem = new HbFrameItem ( mPlayButton ); |
85 HbFrameDrawer *drawer = mPlayButton->frameBackground(); |
92 frameItem->setGeometry( mPlayButton->boundingRect() ); |
86 |
93 frameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_multimedia_trans" ); |
87 if( drawer == NULL ) |
94 frameItem->frameDrawer().setFrameType( HbFrameDrawer::NinePieces ); |
88 { |
95 frameItem->frameDrawer().setFillWholeRect( true ); |
89 drawer = new HbFrameDrawer(); |
96 |
90 } |
|
91 |
|
92 drawer->setFillWholeRect( true ); |
|
93 drawer->setFrameType( HbFrameDrawer::NinePieces ); |
|
94 drawer->setFrameGraphicsName( "qtg_fr_multimedia_trans" ); |
|
95 mPlayButton->setFrameBackground( drawer ); |
|
96 |
97 // |
97 // |
98 // create 'attach' button and connect corresponding signal/slot |
98 // create 'attach' button and connect corresponding signal/slot |
99 // |
99 // |
100 QGraphicsWidget *detailsAttachWidget = loader->findWidget( QString( "detailsAttachButton" ) ); |
100 QGraphicsWidget *detailsAttachWidget = loader->findWidget( QString( "detailsAttachButton" ) ); |
101 HbPushButton *attachButton = qobject_cast<HbPushButton*>( detailsAttachWidget ); |
101 HbPushButton *attachButton = qobject_cast<HbPushButton*>( detailsAttachWidget ); |
102 connect( attachButton, SIGNAL( released() ), mController, SLOT( attachVideo() ) ); |
102 connect( attachButton, SIGNAL( released() ), mController, SLOT( attachVideo() ) ); |
103 |
103 |
104 // |
104 // |
105 // create 'share' button |
105 // create 'share' button and connect corresponding signal/slot |
106 // signal and slot to be created when requirement for 'share' operation is confirmed |
106 // |
107 // |
|
108 QGraphicsWidget *detailsShareWidget = loader->findWidget( QString( "detailsShareButton" ) ); |
107 QGraphicsWidget *detailsShareWidget = loader->findWidget( QString( "detailsShareButton" ) ); |
109 HbPushButton *shareButton = qobject_cast<HbPushButton*>( detailsShareWidget ); |
108 HbPushButton *shareButton = qobject_cast<HbPushButton*>( detailsShareWidget ); |
|
109 connect( shareButton, SIGNAL( released() ), mController, SLOT( sendVideo() ) ); |
110 |
110 |
111 // |
111 // |
112 // by default in xml layout, attachButton is not visible while shareButton is visible. |
112 // by default in xml layout, attachButton is not visible while shareButton is visible. |
113 // if it's an 'attach' operation, reverse the visibility order |
113 // if it's an 'attach' operation, reverse the visibility order |
114 // |
114 // |
115 if ( mController->isAttachOperation() ) |
115 if ( mController->isAttachOperation() ) |
116 { |
116 { |
117 attachButton->setVisible( true ); |
117 attachButton->setVisible( true ); |
118 shareButton->setVisible( false ); |
118 shareButton->setVisible( false ); |
119 } |
119 } |
120 |
120 else |
|
121 { |
|
122 // |
|
123 // dim "share" button for streaming |
|
124 // |
|
125 if ( mController->fileDetails()->mPlaybackMode == EMPXVideoStreaming || |
|
126 mController->fileDetails()->mPlaybackMode == EMPXVideoLiveStreaming ) |
|
127 { |
|
128 shareButton->setEnabled( false ); |
|
129 } |
|
130 } |
121 } |
131 } |
122 |
132 |
123 updateState( mController->state() ); |
133 updateState( mController->state() ); |
124 } |
134 } |
125 |
135 |