diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2011-01-17 09:35:23 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-01-17 09:35:23 (GMT) |
commit | 1e179f6c0279adefc20924731b6e8378a89131de (patch) | |
tree | 1ce899307c51f03a73c7093477e829ae4091da78 /demos/qmediaplayer | |
parent | 6c52715202ad8fd3c3f4bb94207cb7627c12f995 (diff) | |
parent | 4631d297781b8ad4eba0735b7023265d4872c1cb (diff) | |
download | Qt-1e179f6c0279adefc20924731b6e8378a89131de.zip Qt-1e179f6c0279adefc20924731b6e8378a89131de.tar.gz Qt-1e179f6c0279adefc20924731b6e8378a89131de.tar.bz2 |
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts:
examples/webkit/imageanalyzer/imageanalyzer.h
examples/webkit/imageanalyzer/mainwindow.h
mkspecs/unsupported/qws/linux-x86-openkode-g++/qplatformdefs.h
src/corelib/io/qfsfileengine_iterator_unix.cpp
src/corelib/io/qfsfileengine_iterator_win.cpp
src/corelib/kernel/qcoreapplication.cpp
src/network/access/qnetworkaccessdatabackend.cpp
src/plugins/bearer/connman/qconnmanservice_linux.cpp
src/plugins/platforms/openvglite/qwindowsurface_vglite.h
src/s60installs/bwins/QtCoreu.def
src/s60installs/eabi/QtCoreu.def
src/s60installs/s60installs.pro
tools/assistant/tools/assistant/helpviewer_qwv.h
tools/qdoc3/test/qt-html-templates.qdocconf
Diffstat (limited to 'demos/qmediaplayer')
-rw-r--r-- | demos/qmediaplayer/main.cpp | 2 | ||||
-rw-r--r-- | demos/qmediaplayer/mediaplayer.cpp | 45 | ||||
-rw-r--r-- | demos/qmediaplayer/mediaplayer.h | 8 | ||||
-rw-r--r-- | demos/qmediaplayer/qmediaplayer.pro | 2 |
4 files changed, 54 insertions, 3 deletions
diff --git a/demos/qmediaplayer/main.cpp b/demos/qmediaplayer/main.cpp index 9f15e43..af2a330 100644 --- a/demos/qmediaplayer/main.cpp +++ b/demos/qmediaplayer/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/qmediaplayer/mediaplayer.cpp b/demos/qmediaplayer/mediaplayer.cpp index 5bf7d6d..68752a0 100644 --- a/demos/qmediaplayer/mediaplayer.cpp +++ b/demos/qmediaplayer/mediaplayer.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** @@ -46,6 +46,11 @@ #include "mediaplayer.h" #include "ui_settings.h" +#ifdef Q_OS_SYMBIAN +#include <cdbcols.h> +#include <cdblen.h> +#include <commdb.h> +#endif MediaVideoWidget::MediaVideoWidget(MediaPlayer *player, QWidget *parent) : Phonon::VideoWidget(parent), m_player(player), m_action(this) @@ -269,6 +274,10 @@ MediaPlayer::MediaPlayer() : fileMenu = new QMenu(this); QAction *openFileAction = fileMenu->addAction(tr("Open &File...")); QAction *openUrlAction = fileMenu->addAction(tr("Open &Location...")); +#ifdef Q_OS_SYMBIAN + QAction *selectIAPAction = fileMenu->addAction(tr("Select &IAP...")); + connect(selectIAPAction, SIGNAL(triggered(bool)), this, SLOT(selectIAP())); +#endif QAction *const openLinkAction = fileMenu->addAction(tr("Open &RAM File...")); connect(openLinkAction, SIGNAL(triggered(bool)), this, SLOT(openRamFile())); @@ -949,3 +958,37 @@ void MediaPlayer::hasVideoChanged(bool bHasVideo) m_videoWindow.setVisible(bHasVideo); m_fullScreenAction->setEnabled(bHasVideo); } + +#ifdef Q_OS_SYMBIAN +void MediaPlayer::selectIAP() +{ + TRAPD(err, selectIAPL()); + if (KErrNone != err) + QMessageBox::warning(this, "Phonon Mediaplayer", "Error selecting IAP", QMessageBox::Close); +} + +void MediaPlayer::selectIAPL() +{ + QVariant currentIAPValue = m_MediaObject.property("InternetAccessPointName"); + QString currentIAPString = currentIAPValue.toString(); + bool ok = false; + CCommsDatabase *commsDb = CCommsDatabase::NewL(EDatabaseTypeIAP); + CleanupStack::PushL(commsDb); + commsDb->ShowHiddenRecords(); + CCommsDbTableView* view = commsDb->OpenTableLC(TPtrC(IAP)); + QStringList items; + TInt currentIAP = 0; + for (TInt l = view->GotoFirstRecord(), i = 0; l != KErrNotFound; l = view->GotoNextRecord(), i++) { + TBuf<KCommsDbSvrMaxColumnNameLength> iapName; + view->ReadTextL(TPtrC(COMMDB_NAME), iapName); + QString iapString = QString::fromUtf16(iapName.Ptr(), iapName.Length()); + items << iapString; + if (iapString == currentIAPString) + currentIAP = i; + } + currentIAPString = QInputDialog::getItem(this, tr("Select Access Point"), tr("Select Access Point"), items, currentIAP, false, &ok); + if (ok) + m_MediaObject.setProperty("InternetAccessPointName", currentIAPString); + CleanupStack::PopAndDestroy(2); //commsDB, view +} +#endif diff --git a/demos/qmediaplayer/mediaplayer.h b/demos/qmediaplayer/mediaplayer.h index 73450fe..7ddb7ae 100644 --- a/demos/qmediaplayer/mediaplayer.h +++ b/demos/qmediaplayer/mediaplayer.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** @@ -141,12 +141,18 @@ private slots: void showContextMenu(const QPoint& point); void bufferStatus(int percent); void openUrl(); +#ifdef Q_OS_SYMBIAN + void selectIAP(); +#endif void openRamFile(); void configureEffect(); void hasVideoChanged(bool); private: bool playPauseForDialog(); +#ifdef Q_OS_SYMBIAN + void selectIAPL(); +#endif QIcon playIcon; QIcon pauseIcon; diff --git a/demos/qmediaplayer/qmediaplayer.pro b/demos/qmediaplayer/qmediaplayer.pro index 8803d2e..f8f81ad 100644 --- a/demos/qmediaplayer/qmediaplayer.pro +++ b/demos/qmediaplayer/qmediaplayer.pro @@ -33,5 +33,7 @@ symbian { include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) + LIBS += -lCommDb + TARGET.CAPABILITY="NetworkServices" } |