30 #include <hbtoolbar.h> |
30 #include <hbtoolbar.h> |
31 #include <hbaction.h> |
31 #include <hbaction.h> |
32 #include <hbmessagebox.h> |
32 #include <hbmessagebox.h> |
33 #include <hbnotificationdialog.h> |
33 #include <hbnotificationdialog.h> |
34 |
34 |
35 #include <shareuidialog.h> |
35 #include <shareui.h> |
36 |
36 |
37 #include "cxeviewfindercontrol.h" |
37 #include "cxeviewfindercontrol.h" |
38 #include "cxuienums.h" |
38 #include "cxuienums.h" |
39 #include "cxuipostcaptureview.h" |
39 #include "cxuipostcaptureview.h" |
40 #include "cxeengine.h" |
40 #include "cxeengine.h" |
134 mImageLabel = qobject_cast<HbLabel *>(widget); |
134 mImageLabel = qobject_cast<HbLabel *>(widget); |
135 CX_DEBUG_ASSERT(mImageLabel); |
135 CX_DEBUG_ASSERT(mImageLabel); |
136 |
136 |
137 // get toolbar pointers from the documentloader |
137 // get toolbar pointers from the documentloader |
138 widget = mDocumentLoader->findWidget(STILL_POST_CAPTURE_TOOLBAR); |
138 widget = mDocumentLoader->findWidget(STILL_POST_CAPTURE_TOOLBAR); |
|
139 // This resize is a workaround to get toolbar shown correctly. |
|
140 widget->resize(60, 300); |
139 mStillToolbar = qobject_cast<HbToolBar *> (widget); |
141 mStillToolbar = qobject_cast<HbToolBar *> (widget); |
140 CX_DEBUG_ASSERT(mStillToolbar); |
142 CX_DEBUG_ASSERT(mStillToolbar); |
141 |
143 |
142 widget = mDocumentLoader->findWidget(VIDEO_POST_CAPTURE_TOOLBAR); |
144 widget = mDocumentLoader->findWidget(VIDEO_POST_CAPTURE_TOOLBAR); |
|
145 // This resize is a workaround to get toolbar shown correctly. |
|
146 widget->resize(60, 300); |
143 mVideoToolbar = qobject_cast<HbToolBar *> (widget); |
147 mVideoToolbar = qobject_cast<HbToolBar *> (widget); |
144 CX_DEBUG_ASSERT(mVideoToolbar); |
148 CX_DEBUG_ASSERT(mVideoToolbar); |
145 |
149 |
146 widget = mDocumentLoader->findWidget(EMBEDDED_POST_CAPTURE_TOOLBAR); |
150 widget = mDocumentLoader->findWidget(EMBEDDED_POST_CAPTURE_TOOLBAR); |
|
151 // This resize is a workaround to get toolbar shown correctly. |
|
152 widget->resize(60, 300); |
147 mEmbeddedToolbar = qobject_cast<HbToolBar *> (widget); |
153 mEmbeddedToolbar = qobject_cast<HbToolBar *> (widget); |
148 CX_DEBUG_ASSERT(mEmbeddedToolbar); |
154 CX_DEBUG_ASSERT(mEmbeddedToolbar); |
149 |
155 |
150 mStopViewfinderTimer.setSingleShot(true); |
156 mStopViewfinderTimer.setSingleShot(true); |
151 connect(&mStopViewfinderTimer, SIGNAL(timeout()), |
157 connect(&mStopViewfinderTimer, SIGNAL(timeout()), |
202 /*! |
208 /*! |
203 Slot for starting video playing. |
209 Slot for starting video playing. |
204 */ |
210 */ |
205 void CxuiPostcaptureView::playVideo() |
211 void CxuiPostcaptureView::playVideo() |
206 { |
212 { |
|
213 |
207 launchNotSupportedNotification(); |
214 launchNotSupportedNotification(); |
208 //! @todo needs an implementation |
215 //! @todo needs an implementation |
209 CX_DEBUG_IN_FUNCTION(); |
216 CX_DEBUG_IN_FUNCTION(); |
|
217 |
210 } |
218 } |
211 |
219 |
212 // --------------------------------------------------------------------------- |
220 // --------------------------------------------------------------------------- |
213 // CxuiPostcaptureView::showDeleteNote |
221 // CxuiPostcaptureView::showDeleteNote |
214 // |
222 // |
243 CX_DEBUG_ENTER_FUNCTION(); |
251 CX_DEBUG_ENTER_FUNCTION(); |
244 |
252 |
245 hideControls(); |
253 hideControls(); |
246 |
254 |
247 HbMessageBox *dlg = qobject_cast<HbMessageBox*>(sender()); |
255 HbMessageBox *dlg = qobject_cast<HbMessageBox*>(sender()); |
248 if(dlg && action == dlg->primaryAction()) { |
256 |
|
257 // check that it was "primary action" that closed the dialog |
|
258 if (dlg && dlg->actions().at(0) == action) { |
249 // User confirmed delete |
259 // User confirmed delete |
250 QString filename = getCurrentFilename(); |
260 QString filename = getCurrentFilename(); |
251 QFileInfo fileInfo(filename); |
261 QFileInfo fileInfo(filename); |
252 if (fileInfo.exists()) { |
262 if (fileInfo.exists()) { |
253 //! @todo |
263 //! @todo |
274 void CxuiPostcaptureView::launchShare() |
284 void CxuiPostcaptureView::launchShare() |
275 { |
285 { |
276 CX_DEBUG_ENTER_FUNCTION(); |
286 CX_DEBUG_ENTER_FUNCTION(); |
277 |
287 |
278 stopTimers(); |
288 stopTimers(); |
279 stopViewfinder(); |
|
280 releaseCamera(); |
289 releaseCamera(); |
281 |
290 |
282 QString filename = getCurrentFilename(); |
291 QString filename = getCurrentFilename(); |
283 |
292 |
284 QVariantList filelist; |
293 QStringList filelist; |
285 filelist.append(QVariant(filename)); |
294 filelist.append(filename); |
286 |
295 |
287 ShareUi dialog; |
296 ShareUi dialog; |
288 dialog.init(filelist, true); |
297 dialog.send(filelist, true); |
289 |
298 |
290 showControls(); |
299 showControls(); |
291 |
300 |
292 CX_DEBUG_EXIT_FUNCTION(); |
301 CX_DEBUG_EXIT_FUNCTION(); |
293 } |
302 } |
465 // |
474 // |
466 // --------------------------------------------------------------------------- |
475 // --------------------------------------------------------------------------- |
467 // |
476 // |
468 void CxuiPostcaptureView::mousePressEvent(QGraphicsSceneMouseEvent *event) |
477 void CxuiPostcaptureView::mousePressEvent(QGraphicsSceneMouseEvent *event) |
469 { |
478 { |
470 |
479 //! @todo temporary workaround for title bar mouse event handling bug |
471 if (event->type() == QEvent::GraphicsSceneMousePress) { |
480 if (event->type() == QEvent::GraphicsSceneMousePress && event->scenePos().y() > 70) { |
472 mPostcaptureTimer.stop(); |
481 mPostcaptureTimer.stop(); |
473 toggleControls(); |
482 toggleControls(); |
474 event->accept(); |
483 event->accept(); |
475 } |
484 } |
476 |
485 |
604 Launches "Not supported yet" notification. |
613 Launches "Not supported yet" notification. |
605 */ |
614 */ |
606 void CxuiPostcaptureView::launchNotSupportedNotification() |
615 void CxuiPostcaptureView::launchNotSupportedNotification() |
607 { |
616 { |
608 CX_DEBUG_ENTER_FUNCTION(); |
617 CX_DEBUG_ENTER_FUNCTION(); |
609 |
618 HbNotificationDialog::launchDialog("Notification", "Not supported yet"); |
610 // Instantiate a popup |
|
611 HbNotificationDialog note; |
|
612 note.setTitle("Notification"); |
|
613 note.setText("Not supported yet"); |
|
614 note.exec(); |
|
615 |
|
616 CX_DEBUG_EXIT_FUNCTION(); |
619 CX_DEBUG_EXIT_FUNCTION(); |
617 } |
620 } |
618 |
621 |
619 /* ! |
622 /* ! |
620 * gets the filename of the current file |
623 * gets the filename of the current file |