# HG changeset patch # User hgs # Date 1286964931 -10800 # Node ID 16e4b90079601ebd6d7dbdc076d3b6c2bfde895f # Parent 001a94c71129914bc657340766f2d0632fb85caa 201039_4 diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/bthid/bthidkbdsettings/group/bthidkbdsettings.mmp --- a/bluetoothengine/bthid/bthidkbdsettings/group/bthidkbdsettings.mmp Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/bthid/bthidkbdsettings/group/bthidkbdsettings.mmp Wed Oct 13 13:15:31 2010 +0300 @@ -50,9 +50,6 @@ SOURCE bthidpluginimplementationtable.cpp btkeysettinglist.cpp btkeyenumtextsettingitem.cpp APP_LAYER_SYSTEMINCLUDE -#ifdef __SERIES60_HELP -SYSTEMINCLUDE /epoc32/include/cshelp -#endif SYSTEMINCLUDE ../../../inc //***********ECOM resource definition****************** @@ -101,9 +98,6 @@ LIBRARY cenrepnotifhandler.lib DEBUGLIBRARY flogger.lib -#ifdef __SERIES60_HELP -LIBRARY hlplch.lib // Help library -#endif // End of file diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/bthid/keyboard/inc/finder.h --- a/bluetoothengine/bthid/keyboard/inc/finder.h Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/bthid/keyboard/inc/finder.h Wed Oct 13 13:15:31 2010 +0300 @@ -203,97 +203,4 @@ return (iField != 0); } -// ---------------------------------------------------------------------- -/** - * Field finder for the ordinary mouse fields. - */ -class TMouseFinder : public MHidFieldFinder - { -public: - // From MHidFieldFinder - virtual TBool BeginCollection(const CCollection *aCollection); - virtual TBool EndCollection(const CCollection *aCollection); - virtual void Field(const CField* aField); - -public: - /** Constructor */ - TMouseFinder(); - - /** - * Get the field containing the standard keys, if found. - * @return CField* Pointer to the field, or NULL. - */ - inline const CField* ButtonsField() const; - /** - * Get the field containing the xy field, if found. - * @return CField* Pointer to the field, or NULL. - */ - inline const CField* XYField() const; - /** - * Get the field containing the wheel info, if found. - * @return CField* Pointer to the field, or NULL. - */ - inline const CField* WheelField() const; - /** - * Check whether the required fields have been found. - * @return ETrue if they have. - */ - inline TBool Found() const; - - /** - * Check whether a given field contains the XY Coordinates - * @param aField Pointer to the field to test. - * @return ETrue if it does. - */ - TBool IsXY(const CField* aField) const; - /** - * Check whether a given field contains the Buttons. - * @param aField Pointer to the field to test. - * @return ETrue if it does. - */ - TBool IsButtons(const CField* aField) const; - /** - * Check whether a given field contains a wheel. - * @param aField Pointer to the field to test. - * @return ETrue if it does. - */ - TBool IsWheel(const CField* aField) const; - -private: - /** Pointer to the field containing the XY pointer info. */ - const CField* iXY; - - /** Pointer to the field containing the buttons. */ - const CField* iButtons; - - /** Pointer to the field containing the Wheel info. */ - const CField* iWheel; - - /** Pointer to the top level application collection being searched. */ - const CCollection* iAppCollection; - }; -// ---------------------------------------------------------------------- - -inline TBool TMouseFinder::Found() const - { - // Standard and modifier key fields are always necessary, but the - // Wheel field is optional: - // - return iButtons && iXY; - } - -inline const CField* TMouseFinder::ButtonsField() const - { - return iButtons; - } - -inline const CField* TMouseFinder::XYField() const - { - return iXY; - } - -inline const CField* TMouseFinder::WheelField() const - { - return iWheel; - } #endif diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/bthid/keyboard/src/finder.cpp --- a/bluetoothengine/bthid/keyboard/src/finder.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/bthid/keyboard/src/finder.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -254,138 +254,3 @@ { return !Found(); } - -// ---------------------------------------------------------------------- -TMouseFinder::TMouseFinder() : - iXY(0), iButtons(0), iWheel(0), iAppCollection(0) - { - // Nothing else to do - } - -// ---------------------------------------------------------------------- - -TBool TMouseFinder::BeginCollection(const CCollection *aCollection) - { - TBool examineCollection = ETrue; - - if ((aCollection->IsApplication()) && (iAppCollection == 0)) - { - // Top-level application collection. - - if ((aCollection->UsagePage() == EUsagePageGenericDesktop) - && (aCollection->Usage() == EGenericDesktopUsageMouse)) - { - // Collection is a mouse device: - iAppCollection = aCollection; - iXY = iWheel = iButtons = 0; - } - else - { - // Skip other types of top-level application collection: - examineCollection = EFalse; - } - } - - return examineCollection; - } - -TBool TMouseFinder::EndCollection(const CCollection *aCollection) - { - TBool continueSearch = ETrue; - - DBG(RDebug::Print(_L("[HID]\tTHeadsetFinder::EndCollection"))); - if (aCollection == iAppCollection) - { - // Top-level application(Generic Desktop:Mouse) finished: - // - iAppCollection = 0; - - // Stop if we've found a mouse we can use in this - // application collection: - // - continueSearch = !Found(); - } - - return continueSearch; - } - -void TMouseFinder::Field(const CField* aField) - { - if (iAppCollection) - { - if (IsWheel(aField)) - { - iWheel = aField; - } - - if (IsXY(aField)) - { - iXY = aField; - } - - if (IsButtons(aField)) - { - iButtons = aField; - } - } - } - -// ---------------------------------------------------------------------- - - -TBool TMouseFinder::IsXY(const CField* aField) const - { - TBool found = EFalse; - - if (aField->IsInput() && aField->IsData() && (aField->UsagePage() - == EUsagePageGenericDesktop)) - { - - if (aField->HasUsage(EGenericDesktopUsageX) && aField->HasUsage( - EGenericDesktopUsageY)) - { - DBG(RDebug::Print(_L("[HID]\tXY field found"))); - found = ETrue; - } - } - - return found; - } - -TBool TMouseFinder::IsButtons(const CField* aField) const - { - TBool found = EFalse; - - if (aField->IsInput() && aField->IsData() && (aField->UsagePage() - == EUsagePageButton)) - { - const TInt KMinButtons = 1; - const TInt KMaxButtons = 15; - - // Test for a field containing at least num lock or caps lock - if ((aField->UsageMin() >= KMinButtons) && (aField->UsageMax() - <= KMaxButtons)) - { - DBG(RDebug::Print(_L("[HID]\tButtons field found"))); - found = ETrue; - } - } - - return found; - } - -TBool TMouseFinder::IsWheel(const CField* aField) const - { - TBool found = EFalse; - - if (aField->IsInput() && aField->IsData() && (aField->UsagePage() - == EUsagePageGenericDesktop)) - { - if (aField->HasUsage(EGenericDesktopUsageWheel)) - { - found = ETrue; - } - } - - return found; - } diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/bthid/mouse/hidmousedriver/src/finder.cpp --- a/bluetoothengine/bthid/mouse/hidmousedriver/src/finder.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/bthid/mouse/hidmousedriver/src/finder.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -135,12 +135,13 @@ if (aField->IsInput() && aField->IsData() && (aField->UsagePage() == EUsagePageButton)) { - const TInt KMinButtons = 1; - const TInt KMaxButtons = 15; - - // Test for a field containing at least num lock or caps lock - if ( (aField->UsageMin() >= KMinButtons) - && (aField->UsageMax() <= KMaxButtons) ) + const TInt KButton1 = 1; + const TInt KButton2 = 2; + const TInt KButton3 = 3; + // Test for fields containing mouse buttons, only three mouse buttons event are handled + // in mouse driver anyway, detecting for KButton1, KButton2 & KButton3 here. + if ( (aField->UsageMin() <= KButton1) + && (aField->UsageMax() >= KButton3) ) { DBG(RDebug::Print(_L("[HID]\tButtons field found"))); found = ETrue; diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btindicator/btindicator.pro --- a/bluetoothengine/btindicator/btindicator.pro Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btindicator/btindicator.pro Wed Oct 13 13:15:31 2010 +0300 @@ -28,6 +28,9 @@ MOC_DIR = moc OBJECTS_DIR = obj +TRANSLATIONS = btindimenu.ts +# Only one .ts file allowed for a .pro file. + LIBS += -lxqservice -lcpframework symbian { TARGET.EPOCALLOWDLLDATA = 1 diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btnotif/btdevicedialogplugin/docml/bt-send-dialog.docml --- a/bluetoothengine/btnotif/btdevicedialogplugin/docml/bt-send-dialog.docml Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btnotif/btdevicedialogplugin/docml/bt-send-dialog.docml Wed Oct 13 13:15:31 2010 +0300 @@ -1,8 +1,8 @@ - + + - @@ -13,7 +13,6 @@ - @@ -35,12 +34,12 @@ - - - - - - + + + + + + diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialogpluginerrors.h --- a/bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialogpluginerrors.h Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialogpluginerrors.h Wed Oct 13 13:15:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -26,5 +26,8 @@ const int ParameterError = HbDeviceDialog::PluginErrors + 1; // Unknown device dialog error const int UnknownDeviceDialogError = HbDeviceDialog::PluginErrors + 2; +// DocML loading error +const int DocMLLoadingError = HbDeviceDialog::PluginErrors + 3; + #endif // BTDEVICEDIALOGPLUGINERRORS_H diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btnotif/btdevicedialogplugin/inc/btrecvcompleteddialogwidget.h --- a/bluetoothengine/btnotif/btdevicedialogplugin/inc/btrecvcompleteddialogwidget.h Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btnotif/btdevicedialogplugin/inc/btrecvcompleteddialogwidget.h Wed Oct 13 13:15:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -28,18 +28,6 @@ #include #include #include -#include - - -class CoversationViewServiceStarter : public QRunnable - { -public: - CoversationViewServiceStarter(qint64 conversationId); - ~CoversationViewServiceStarter(); - void run(); -private: - qint64 mCnvId; - }; class BTRecvcompletedDialogWidget : public QObject, diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btnotif/btdevicedialogplugin/inc/btsenddialogwidget.h --- a/bluetoothengine/btnotif/btdevicedialogplugin/inc/btsenddialogwidget.h Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btnotif/btdevicedialogplugin/inc/btsenddialogwidget.h Wed Oct 13 13:15:31 2010 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0"" @@ -19,16 +19,12 @@ #ifndef BTSENDDIALOGWIDGET_H #define BTSENDDIALOGWIDGET_H -#include #include #include #include -#include #include -#include #include #include -#include #include @@ -49,31 +45,25 @@ virtual QObject *signalSender() const; public slots: -// void hideClicked(); void cancelClicked(); -// void inputClosed(HbAction* action); private: - bool constructDialog(const QVariantMap ¶meters); - void hideEvent(QHideEvent *event); - void showEvent(QShowEvent *event); + void constructDialog(const QVariantMap ¶meters); signals: void deviceDialogClosed(); private: HbDocumentLoader *mLoader; - // QStandardItemModel* mContentItemModel; - HbProgressBar* mProgressBar; - HbLabel* mDialogHeading; - HbLabel* mFileIconLabel; - HbLabel* mFileNameLabel; - HbLabel* mFileSizeLabel; - -// HbListView* mListView; + HbProgressBar *mProgressBar; + HbLabel *mDialogHeading; + HbLabel *mFileIconLabel; + HbLabel *mFileNameLabel; + HbLabel *mFileSizeLabel; HbDialog *mSendDialog; HbAction *mHideAction; HbAction *mCancelAction; int mFileIndex; + int mLastError; Q_DISABLE_COPY(BTSendDialogWidget) diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btnotif/btdevicedialogplugin/src/btrecvcompleteddialogwidget.cpp --- a/bluetoothengine/btnotif/btdevicedialogplugin/src/btrecvcompleteddialogwidget.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btnotif/btdevicedialogplugin/src/btrecvcompleteddialogwidget.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -16,46 +16,13 @@ */ #include "btrecvcompleteddialogwidget.h" -#include -#include -#include #include "bluetoothdevicedialogs.h" const char* DOCML_BT_RECV_CMPLTD_DIALOG = ":/docml/bt-receive-done-dialog.docml"; -const qint64 KBluetoothMsgsConversationId = 0x01; - - -CoversationViewServiceStarter::CoversationViewServiceStarter(qint64 conversationId) -:mCnvId(conversationId) - { - - } - -CoversationViewServiceStarter::~CoversationViewServiceStarter() - { - - } - -void CoversationViewServiceStarter::run() - { - QList args; - QString serviceName("com.nokia.services.hbserviceprovider"); - QString operation("open(qint64)"); - XQAiwRequest* request; - XQApplicationManager appManager; - request = appManager.create(serviceName, "conversationview", operation, false); // not embedded - if ( request == NULL ) - { - return; - } - args << QVariant(mCnvId); - request->setArguments(args); - request->send(); - delete request; - } BTRecvcompletedDialogWidget::BTRecvcompletedDialogWidget(const QVariantMap ¶meters) + :mLoader(0), mOpenConversationView(false) { @@ -190,14 +157,6 @@ void BTRecvcompletedDialogWidget::showClicked() { - if(mOpenConversationView) - { - CoversationViewServiceStarter* service = new CoversationViewServiceStarter(KBluetoothMsgsConversationId); - service->setAutoDelete(true); - - QThreadPool::globalInstance()->start(service); - } - QVariantMap data; data.insert(QString("actionResult"), QVariant(TBluetoothDialogParams::EShow)); emit deviceDialogData(data); diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btnotif/btdevicedialogplugin/src/btsenddialogwidget.cpp --- a/bluetoothengine/btnotif/btdevicedialogplugin/src/btsenddialogwidget.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btnotif/btdevicedialogplugin/src/btsenddialogwidget.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0"" @@ -16,12 +16,7 @@ */ #include "btsenddialogwidget.h" -#include -#include -#include -#include -#include -#include +#include "btdevicedialogpluginerrors.h" #define LOC_SENDING_FILES_TO_DEVICE hbTrId("txt_bt_title_sending_file_l1l2_to_3") @@ -31,56 +26,29 @@ BTSendDialogWidget::BTSendDialogWidget(const QVariantMap ¶meters) { mLoader = 0; + mLastError = NoError; constructDialog(parameters); } BTSendDialogWidget::~BTSendDialogWidget() { delete mLoader; - /* if(mContentItemModel) - { - delete mContentItemModel; - mContentItemModel = NULL; - }*/ } bool BTSendDialogWidget::setDeviceDialogParameters(const QVariantMap ¶meters) { + mLastError = NoError; if(mFileIndex != parameters.value("currentFileIdx").toString().toInt() ) { mDialogHeading->setTextWrapping(Hb::TextWordWrap); mDialogHeading->setAlignment(Qt::AlignHCenter); - //Todo - replace this with the actual text from parameters QString headLabel = QString(LOC_SENDING_FILES_TO_DEVICE).arg(parameters.value("currentFileIdx").toInt()) .arg(parameters.value("totalFilesCnt").toInt()) .arg(parameters.value("destinationName").toString()); - /* headLabel.append(QString("Sending file ")); - headLabel.append(parameters.value("currentFileIdx").toString()); - headLabel.append('/'); - headLabel.append(parameters.value("totalFilesCnt").toString()); - headLabel.append(QString(" to ")); - headLabel.append(parameters.value("destinationName").toString());*/ mDialogHeading->setPlainText(headLabel); - /* QStringList info; - info.append(parameters.value("fileName").toString()); - info.append(parameters.value("fileSzTxt").toString()); - - QStandardItem* listitem = new QStandardItem(); - // parameters. - listitem->setData(info, Qt::DisplayRole); - - //Todo - Insert file icons here thumbnail icon - QIcon icon(QString(":/icons/qtg_large_bluetooth.svg")); - listitem->setIcon(icon); - - delete mContentItemModel; - mContentItemModel = new QStandardItemModel(this); - mListView->setModel(mContentItemModel);//, prototype); - - mContentItemModel->appendRow(listitem);*/ - //Todo - Insert file icons here thumbnail icon + //Todo - Insert file icons here instead of bluetooth image QIcon icon(QString(":/icons/qtg_large_bluetooth.svg")); mFileIconLabel->setIcon(icon); mFileNameLabel->setPlainText(parameters.value("fileName").toString()); @@ -99,7 +67,7 @@ int BTSendDialogWidget::deviceDialogError() const { - return 0; + return mLastError; } void BTSendDialogWidget::closeDeviceDialog(bool byClient) @@ -120,8 +88,9 @@ return const_cast(this); } -bool BTSendDialogWidget::constructDialog(const QVariantMap&/*parameters*/) +void BTSendDialogWidget::constructDialog(const QVariantMap& parameters) { + Q_UNUSED(parameters); mLoader = new HbDocumentLoader(); bool ok = false; @@ -133,59 +102,23 @@ mFileIconLabel = qobject_cast(mLoader->findWidget("fileIcon")); mFileNameLabel = qobject_cast(mLoader->findWidget("fileName")); mFileSizeLabel = qobject_cast(mLoader->findWidget("fileSize")); - // mSendDialog->setHeadingWidget(mLabel); - /* mListView = qobject_cast(mLoader->findWidget("listView")); - if(mListView) - { - mContentItemModel = new QStandardItemModel(this); - mListView->setModel(mContentItemModel);//, prototype); - }*/ mProgressBar = qobject_cast(mLoader->findWidget("sendProgressBar")); - - // HbAction* hide = new HbAction("Hide"); - // HbAction* cancel = new HbAction("Cancel"); - - // this->addAction(hide); - // this->addAction(cancel); - - // QGraphicsWidget *widget = mLoader->findWidget(QString("container")); - // this->setContentWidget(widget); + mSendDialog->setBackgroundFaded(false); + mSendDialog->setDismissPolicy(HbPopup::NoDismiss); + mSendDialog->setTimeout(HbPopup::NoTimeout); + mSendDialog->setAttribute(Qt::WA_DeleteOnClose); + + mCancelAction = static_cast( mLoader->findObject( "cancelAction" ) ); + + connect(mCancelAction, SIGNAL(triggered()), this, SLOT(cancelClicked())); } - - mSendDialog->setBackgroundFaded(false); - mSendDialog->setDismissPolicy(HbPopup::NoDismiss); - mSendDialog->setTimeout(HbPopup::NoTimeout); - mSendDialog->setAttribute(Qt::WA_DeleteOnClose); - - mHideAction = static_cast( mLoader->findObject( "hideAction" ) ); - mHideAction->disconnect(mSendDialog); // Todo: needed? - - mCancelAction = static_cast( mLoader->findObject( "cancelAction" ) ); - mCancelAction->disconnect(mSendDialog); // Todo: needed? - - connect(mCancelAction, SIGNAL(triggered()), this, SLOT(cancelClicked())); - - return true; + else + { + mLastError = DocMLLoadingError; + } } -/*void BTSendDialogWidget::hideEvent(QHideEvent *event) - { - HbDialog::hideEvent(event); - emit deviceDialogClosed(); - } - -void BTSendDialogWidget::showEvent(QShowEvent *event) - { - HbDialog::showEvent(event); - }*/ - -/*void BTSendDialogWidget::hideClicked() - { - // TODO - this->close(); - emit deviceDialogClosed(); - }*/ void BTSendDialogWidget::cancelClicked() { @@ -193,14 +126,4 @@ emit deviceDialogClosed(); } -/*void BTSendDialogWidget::inputClosed(HbAction* action) - { - QVariantMap data; - - HbDialog *dlg=static_cast(sender()); - if(dlg->actions().first() == action) { - } - else if(dlg->actions().at(1) == action) { - } - }*/ diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btnotif/btnotifsrv/inc/btnotifoutgoingpairinghandler.h --- a/bluetoothengine/btnotif/btnotifsrv/inc/btnotifoutgoingpairinghandler.h Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btnotif/btnotifsrv/inc/btnotifoutgoingpairinghandler.h Wed Oct 13 13:15:31 2010 +0300 @@ -22,7 +22,7 @@ #include #include #include "btnotifclientserver.h" -#include "btnotifBasePairingHandler.h" +#include "btnotifbasepairinghandler.h" #include #include "btnotificationresult.h" #include "bluetoothdevicedialogs.h" diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btnotif/btnotifsrv/src/btnotifpairnotifier.cpp --- a/bluetoothengine/btnotif/btnotifsrv/src/btnotifpairnotifier.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btnotif/btnotifsrv/src/btnotifpairnotifier.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -163,7 +163,7 @@ } else { - // We don't have any friendly name then chek if we have the device name + // We don't have any friendly name then check if we have the device name // otherwise use the Alias if(0 >= iCurrentDeviceName.Length()) { diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btpbap/src/Pbapplugin.cpp --- a/bluetoothengine/btpbap/src/Pbapplugin.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btpbap/src/Pbapplugin.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -142,7 +142,7 @@ // TInt CPBAPplugin::Disconnect( const TBTDevAddr& aAddr, TBTDisconnectType /*aDiscType*/ ) { - if ( iObserver ) + if ( !iObserver ) { return KErrGeneral; } diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btsac/inc/btsacGavdp.h --- a/bluetoothengine/btsac/inc/btsacGavdp.h Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btsac/inc/btsacGavdp.h Wed Oct 13 13:15:31 2010 +0300 @@ -244,9 +244,7 @@ private: // Data - MInternalGavdpUser* iObserver; - - CBTSACStreamerController* iStreamer; + MInternalGavdpUser* iObserver; RSocketServ iSockServ; RGavdp iGavdp; diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btsac/inc/btsacdefs.h --- a/bluetoothengine/btsac/inc/btsacdefs.h Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btsac/inc/btsacdefs.h Wed Oct 13 13:15:31 2010 +0300 @@ -67,7 +67,8 @@ enum TBTPanicCode { EBTPanicNullPointer = 33400, - EBTPanicSocketExists + EBTPanicSocketExists, + EBTPanicCouldntOpenGavdp }; #endif // BTSACDEFS_H diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btsac/src/btsacGavdp.cpp --- a/bluetoothengine/btsac/src/btsacGavdp.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btsac/src/btsacGavdp.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -663,15 +663,25 @@ TRACE_INFO((_L("CBTSACGavdp::GAVDP_BearerReady() Got a bearer, for session %d"), aAddr.Session())) // AV sockets don't foward opts yet so use addr version + TBTDevAddr RemoteBDAddr = aAddr.BTAddr(); RBTPhysicalLinkAdapter phy; - TBTDevAddr RemoteBDAddr = aAddr.BTAddr(); TInt err = phy.Open(iSockServ, RemoteBDAddr); - TUint16 packets = EAnyACLPacket; - err = phy.RequestChangeSupportedPacketTypes(packets); - TRACE_INFO((_L("CBTSACGavdp::GAVDP_BearerReady() Modified PHY, result %d"), err)) - - // state handles the call-back - iObserver->GAVDP_BearerReady(aNewSocket, aAddr); + TRACE_INFO((_L("CBTSACGavdp::GAVDP_BearerReady() RBTPhysicalLinkAdapter::Open returned %d"), err)) + if ( !err ) + { + TUint16 packets = EAnyACLPacket; + err = phy.RequestChangeSupportedPacketTypes(packets); + TRACE_INFO((_L("CBTSACGavdp::GAVDP_BearerReady() Modified PHY, result %d"), err)) + phy.Close(); + } + if ( err ) + { + iObserver->GAVDP_Error(err, KNullDesC8()); + } + else + { + iObserver->GAVDP_BearerReady(aNewSocket, aAddr); + } } ///////////////////// Call Backs from GAVDP End./////////////////// diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btsac/src/btsacStateListening.cpp --- a/bluetoothengine/btsac/src/btsacStateListening.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btsac/src/btsacStateListening.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -318,16 +318,12 @@ { Parent().SetRemoteAddr(TBTDevAddr()); } - TInt err = Parent().iGavdp->Shutdown(); - if(!err) - { - TRACE_INFO((_L("CBtsacListening::GoListen(), Signalling disconnected, Re-listen..."))) - // Starts to listen for inbound signalling channel connections. - err = Parent().iGavdp->Listen(); - } + TRACE_INFO((_L("CBtsacListening::GoListen(), Signalling disconnected, Re-listen..."))) + // Starts to listen for inbound signalling channel connections. + TInt err = Parent().iGavdp->Listen(); if(err) { - // Shutdown failed, reset gavdp + // Listen request failed, reset gavdp TRACE_INFO((_L("CBtsacListening::GoListen(), error = %d."), err)) ResetGavdp(); } @@ -341,7 +337,8 @@ { TRACE_FUNC Parent().iGavdp->Close(); - if( Parent().iGavdp->Open() == KErrNone ) + TInt err = Parent().iGavdp->Open(); + if( !err ) { iInitializationProcedure = EInitProcedureWaitingConfConfirmed; if(iPendingRequests == KRequestNone) @@ -353,7 +350,8 @@ } else { - TRACE_INFO((_L("CBtsacListening::ResetGavdp() Couldn't open gavdp."))) + TRACE_INFO((_L("CBtsacListening::ResetGavdp() Couldn't open gavdp, err %d"), err)) + __ASSERT_DEBUG(err != KErrNone, PANIC(EBTPanicCouldntOpenGavdp)); return KErrGeneral; } } diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btui/btcpplugin/btcpplugin.pro --- a/bluetoothengine/btui/btcpplugin/btcpplugin.pro Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btui/btcpplugin/btcpplugin.pro Wed Oct 13 13:15:31 2010 +0300 @@ -25,9 +25,8 @@ MOC_DIR = moc OBJECTS_DIR = obj -TRANSLATIONS += btviews.ts \ - btdialogs.ts \ - btindimenu.ts +TRANSLATIONS = btviews.ts +# Removed btdialogs.ts and btindimenu.ts since only one .ts file allowed for a .pro file. btdialogs.ts moved to btuidelegate.pro RESOURCES += btcpplugin.qrc # Input diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btui/btcpplugin/btcpuibaseview.cpp --- a/bluetoothengine/btui/btcpplugin/btcpuibaseview.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btui/btcpplugin/btcpuibaseview.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -25,6 +25,8 @@ #include "btuidevtypemap.h" #include #include +#include "btqtconstants.h" + /*! This constructor constructs new setting and device models. @@ -33,9 +35,11 @@ CpBaseSettingView(0, parent), mViewMgr(0), mDelegate(0), mPreviousView(0), mBack(0), mQuery(0), mContextMenu(0), mBtuiModelSortFilter(0) { + BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); mSettingModel = new BtSettingModel(this); mDeviceModel = new BtDeviceModel(this); initialise(); + BOstraceFunctionExit1(DUMMY_DEVLIST, this); } /*! @@ -48,9 +52,11 @@ CpBaseSettingView(0, parent), mViewMgr(0), mDelegate(0), mPreviousView(0), mBack(0), mQuery(0), mContextMenu(0), mBtuiModelSortFilter(0) { + BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); mSettingModel = new BtSettingModel(settingModel, this); mDeviceModel = new BtDeviceModel(deviceModel, this); initialise(); + BOstraceFunctionExit1(DUMMY_DEVLIST, this); } /*! @@ -67,16 +73,18 @@ delete mContextMenu; } - BOstraceFunctionExit0(DUMMY_DEVLIST); + BOstraceFunctionExit1(DUMMY_DEVLIST, this); } void BtcpuiBaseView::initialise() { + BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); bool ret(false); mMainWindow = hbInstance->allMainWindows().first(); mContextMenu = new HbMenu(); ret = connect(mContextMenu, SIGNAL(triggered(HbAction *)), this, SLOT(contextMenuTriggered(HbAction *))); - BTUI_ASSERT_X( ret, "bt-main-view", "Context Menu can't connect" ); + BTUI_ASSERT_X( ret, "BtcpuiBaseView::initialise()", "Context Menu can't connect" ); + BOstraceFunctionExit1(DUMMY_DEVLIST, this); } void BtcpuiBaseView::setPreviousView(BtcpuiBaseView *view) @@ -99,7 +107,7 @@ else { setNavigationAction(0); } - BOstraceFunctionExit0(DUMMY_DEVLIST); + BOstraceFunctionExit1(DUMMY_DEVLIST, this); } void BtcpuiBaseView::setViewMgr(BtcpuiViewMgr *mgr) @@ -113,7 +121,7 @@ if ( mPreviousView ) { viewMgr()->switchView(this, mPreviousView, QVariant(), true); } - BOstraceFunctionExit0(DUMMY_DEVLIST); + BOstraceFunctionExit1(DUMMY_DEVLIST, this); } BtSettingModel *BtcpuiBaseView::settingModel() @@ -139,28 +147,31 @@ mDelegate = BtDelegateFactory::newDelegate(type, mSettingModel, mDeviceModel); ok = connect(mDelegate, SIGNAL(delegateCompleted(int,BtAbstractDelegate*)), receiver, member); - BOstraceExt1(TRACE_DEBUG, DUMMY_DEVLIST, "BtcpuiBaseView::createDelegate signal connect %d", ok); + BOstraceExt1(TRACE_DEBUG, DUMMY_DEVLIST, "BtcpuiBaseView::createDelegate new: signal connect %d", ok); if (!ok) { delete mDelegate; mDelegate = 0; } } - BOstraceExt2(TRACE_DEBUG, DUMMY_DEVLIST, "BtcpuiBaseView::createDelegate: mDe: 0x%08X, ret %d", mDelegate, ok); + BOstraceExt2(TRACE_DEBUG, DUMMY_DEVLIST, "BtcpuiBaseView::createDelegate(): mDe: 0x%08X, ret %d", mDelegate, ok); return ok; } bool BtcpuiBaseView::createExecuteDelegate(BtDelegate::EditorType type, QObject *receiver, const char *member, const QVariant ¶m) { + BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); bool ok = createDelegate(type, receiver, member); if (ok) { mDelegate->exec(param); } + BOstraceFunctionExitExt(DUMMY_DEVLIST, this, ok); return ok; } void BtcpuiBaseView::viewByDeviceTypeDialog() { + BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); if ( !mQuery ) { mQuery = new HbSelectionDialog(); QStringList devTypeList; @@ -183,6 +194,7 @@ mQuery->setHeadingWidget(headingLabel); } mQuery->open(this,SLOT(viewByDialogClosed(HbAction*))); + BOstraceFunctionExit1(DUMMY_DEVLIST, this); } void BtcpuiBaseView::viewByDialogClosed(HbAction* action) @@ -193,6 +205,7 @@ int BtcpuiBaseView::selectedDeviceTypes(HbAction* action) { + BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); int devTypesWanted = 0; disconnect( mQuery, 0, this, 0); // remove signal @@ -231,10 +244,11 @@ } } + BOstraceFunctionExitExt(DUMMY_DEVLIST, this, devTypesWanted); return devTypesWanted; } -void BtcpuiBaseView::deviceSelected(const QModelIndex& modelIndex) +void BtcpuiBaseView::openDeviceView(const QModelIndex& modelIndex) { BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); BtcpuiBaseView *devView = viewMgr()->deviceView(); @@ -244,7 +258,7 @@ QVariant params; params.setValue(index); viewMgr()->switchView(this, devView, params, false); - BOstraceFunctionExit0(DUMMY_DEVLIST); + BOstraceFunctionExit1(DUMMY_DEVLIST, this); } void BtcpuiBaseView::createContextMenuActions(int majorRole) @@ -255,23 +269,38 @@ void BtcpuiBaseView::take(BtAbstractDelegate *delegate) { + BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); mDelegate = delegate; if (mDelegate) { disconnect(mDelegate, 0, 0, 0); connect(mDelegate, SIGNAL(delegateCompleted(int,BtAbstractDelegate*)), this, SLOT(handleDelegateCompleted(int))); } + BOstraceFunctionExit1(DUMMY_DEVLIST, this); } +// this could be made virtual if derived classes need different functionality void BtcpuiBaseView::contextMenuTriggered(HbAction *action) { + BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); if(!(action->text().compare(hbTrId("txt_common_menu_open")))) { - deviceSelected(mLongPressedItem->modelIndex()); - } + openDeviceView(mLongPressedItem->modelIndex()); + } + else if (!(action->text().compare(hbTrId("txt_bt_menu_connect_audio"))) + || !(action->text().compare(hbTrId("txt_bt_menu_connect")))) { + connectToDevice(mLongPressedItem->modelIndex()); + } + else if (!(action->text().compare(hbTrId("txt_bt_menu_disconnect_audio"))) + || !(action->text().compare(hbTrId("txt_bt_menu_disconnect")))) { + disconnectFromDevice(mLongPressedItem->modelIndex()); + } + BOstraceFunctionExit1(DUMMY_DEVLIST, this); } + void BtcpuiBaseView::showContextMenu(HbAbstractViewItem *item, const QPointF &coords) { + BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); mLongPressedItem = item; mContextMenu->clearActions(); @@ -285,13 +314,46 @@ } mContextMenu->setPreferredPos(coords); mContextMenu->open(); + + BOstraceFunctionExit1(DUMMY_DEVLIST, this); +} + +void BtcpuiBaseView::connectToDevice(const QModelIndex& modelIndex) +{ + BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); + QModelIndex index = mBtuiModelSortFilter->mapToSource(modelIndex); + + QVariant param; + param.setValue(index); + + (void) createExecuteDelegate(BtDelegate::ConnectService, + this, SLOT(handleDelegateCompleted(int,BtAbstractDelegate*)), param); + + BOstraceFunctionExit1(DUMMY_DEVLIST, this); +} + +void BtcpuiBaseView::disconnectFromDevice(const QModelIndex& modelIndex) +{ + BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); + QModelIndex index = mBtuiModelSortFilter->mapToSource(modelIndex); + QVariant deviceBtAddress = mDeviceModel->data(index, BtDeviceModel::ReadableBdaddrRole); + + QListparamList; + paramList.append(QVariant(ServiceLevel)); + paramList.append(deviceBtAddress); + + (void) createExecuteDelegate(BtDelegate::DisconnectService, + this, SLOT(handleDelegateCompleted(int,BtAbstractDelegate*)), QVariant(paramList)); + + BOstraceFunctionExit1(DUMMY_DEVLIST, this); } void BtcpuiBaseView::handleDelegateCompleted(int error, BtAbstractDelegate* delegate) { BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, error ); + Q_UNUSED(delegate); Q_UNUSED(error); delete mDelegate; mDelegate = 0; - BOstraceFunctionExit0(DUMMY_DEVLIST); + BOstraceFunctionExit1(DUMMY_DEVLIST, this); } diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btui/btcpplugin/btcpuibaseview.h --- a/bluetoothengine/btui/btcpplugin/btcpuibaseview.h Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btui/btcpplugin/btcpuibaseview.h Wed Oct 13 13:15:31 2010 +0300 @@ -58,7 +58,7 @@ void viewByDeviceTypeDialog(); virtual void viewByDialogClosed(HbAction* action); void contextMenuTriggered(HbAction *action); - void deviceSelected(const QModelIndex& modelIndex); + void openDeviceView(const QModelIndex& modelIndex); void showContextMenu(HbAbstractViewItem *item, const QPointF &coords); void handleDelegateCompleted(int error, BtAbstractDelegate* delegate); @@ -89,6 +89,10 @@ virtual void createContextMenuActions(int majorRole); + virtual void connectToDevice(const QModelIndex& modelIndex); + + virtual void disconnectFromDevice(const QModelIndex& modelIndex); + protected: enum devTypeSelectionList { diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btui/btcpplugin/btcpuidevicedetailsview.cpp --- a/bluetoothengine/btui/btcpplugin/btcpuidevicedetailsview.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btui/btcpplugin/btcpuidevicedetailsview.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -15,15 +15,10 @@ * */ #include "btcpuidevicedetailsview.h" -#include -#include -#include -#include -#include +#include #include -#include -#include #include +#include // docml to load const char* BTUI_DEVICEDETAILSVIEW_DOCML = ":/docml/bt-device-details-view.docml"; @@ -69,12 +64,12 @@ void BtCpUiDeviceDetailsView::setDeviceName(const QString &deviceName) { BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); - //todo: use Localised string Id,If Loc ID is used - //wrong string is displayed. Need to correct text map file. - QString heading(hbTrId("%1 details")); - if(mGroupBox) { - mGroupBox->setHeading(heading.arg(deviceName)); + if(mGroupBox) { + QString heading = HbParameterLengthLimiter(hbTrId( + "txt_bt_subhead_1_details")).arg(deviceName); + + mGroupBox->setHeading(heading); } BOstraceFunctionExit0(DUMMY_DEVLIST); } @@ -92,7 +87,7 @@ { BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); if (item && mLayout) { - //todo: with out this item is not removed from the view. + //With out this item is not removed from the view. item->setVisible(false); mLayout->removeItem(item); delete item; diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btui/btcpplugin/btcpuidevicedetailsview.h --- a/bluetoothengine/btui/btcpplugin/btcpuidevicedetailsview.h Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btui/btcpplugin/btcpuidevicedetailsview.h Wed Oct 13 13:15:31 2010 +0300 @@ -17,9 +17,6 @@ #ifndef BTCPUIDEVICEDETAILSVIEW_H #define BTCPUIDEVICEDETAILSVIEW_H -#include -#include -#include #include #include #include diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btui/btcpplugin/btcpuideviceview.cpp --- a/bluetoothengine/btui/btcpplugin/btcpuideviceview.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btui/btcpplugin/btcpuideviceview.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -30,9 +30,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -45,6 +45,10 @@ // docml to load const char* BTUI_DEVICEVIEW_DOCML = ":/docml/bt-device-view.docml"; + +// ToDo: should use base class delegate instead of mAbstractDelegate, also base class createDelegate() +// and createExecuteDelegate() + BtcpuiDeviceView::BtcpuiDeviceView(BtSettingModel &settingModel, BtDeviceModel &deviceModel, QGraphicsItem *parent) : @@ -562,7 +566,7 @@ void BtcpuiDeviceView::pairDelegateCompleted(int status) { - BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); + BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, status ); Q_UNUSED(status); //TODO: handle the error here if (mAbstractDelegate) @@ -641,7 +645,8 @@ mAbstractDelegate = BtDelegateFactory::newDelegate( BtDelegate::DisconnectService, mSettingModel, mDeviceModel); // todo: check return value of connect - connect( mAbstractDelegate, SIGNAL(delegateCompleted(int,BtAbstractDelegate*)), this, SLOT(disconnectDelegateCompleted(int)) ); + connect( mAbstractDelegate, SIGNAL(delegateCompleted(int,BtAbstractDelegate*)), this, + SLOT(disconnectDelegateCompleted(int)) ); mAbstractDelegate->exec(QVariant(list)); } BOstraceFunctionExit0(DUMMY_DEVLIST); diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btui/btcpplugin/btcpuimainview.cpp --- a/bluetoothengine/btui/btcpplugin/btcpuimainview.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btui/btcpplugin/btcpuimainview.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -598,13 +598,13 @@ mDeviceList = qobject_cast( mLoader->findWidget( "deviceList" ) ); BTUI_ASSERT_X( mDeviceList != 0, "bt-main-view", "Device List (grid view) not found" ); - ret = connect(mDeviceList, SIGNAL(activated(QModelIndex)), this, SLOT(deviceSelected(QModelIndex))); - BTUI_ASSERT_X( ret, "bt-main-view", "deviceSelected can't connect" ); + ret = connect(mDeviceList, SIGNAL(activated(QModelIndex)), this, SLOT(openDeviceView(QModelIndex))); + BTUI_ASSERT_X( ret, "bt-main-view", "openDeviceView can't connect" ); ret = connect(mDeviceList, SIGNAL(longPressed(HbAbstractViewItem*, QPointF)), this, SLOT(showContextMenu(HbAbstractViewItem*, QPointF))); - BTUI_ASSERT_X( ret, "bt-main-view", "deviceSelected can't connect" ); + BTUI_ASSERT_X( ret, "bt-main-view", "showContextMenu can't connect" ); mOrientation = mMainWindow->orientation(); @@ -642,9 +642,6 @@ mVisibilityMode = qobject_cast( mLoader->findWidget( "visibilityMode" ) ); BTUI_ASSERT_X( mVisibilityMode != 0, "bt-main-view", "visibility combobox not found" ); // add new item for temporary visibility - // NOTE: translation (at least default english) gives string "(p)Visible for 5 min", - // if setting 1 min --> "(s)Visible for 1 min", ie p=plural, s=singular, but these should - // not be shown to the user! // ToDo: change this to use translation once it starts working QString tempVis(hbTrId("txt_bt_setlabel_visibility_val_visible_for_l1_min", 5)); //QString tempVis(hbTrId("Visible for 5 min")); @@ -771,10 +768,15 @@ void BtcpuiMainView::createContextMenuActions(int majorRole) { + BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); if (majorRole & BtuiDevProperty::Connected) { mContextMenu->addAction(hbTrId("txt_bt_menu_disconnect")); } else { mContextMenu->addAction(hbTrId("txt_bt_menu_connect")); - } + } + BOstraceFunctionExit0(DUMMY_DEVLIST); } + + + diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btui/btcpplugin/btcpuimainview.h --- a/bluetoothengine/btui/btcpplugin/btcpuimainview.h Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btui/btcpplugin/btcpuimainview.h Wed Oct 13 13:15:31 2010 +0300 @@ -61,11 +61,8 @@ void changePowerState(); void changeVisibility(int index); void changeBtLocalName(); - void updateSettingItems(const QModelIndex &topLeft, const QModelIndex &bottomRight); - void launchDeviceDiscovery(); - void goToSearchView(); //from delegate classes @@ -111,6 +108,7 @@ void updateOptionsMenu(); + private: // search view. Owned diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btui/btcpplugin/btcpuisearchview.cpp --- a/bluetoothengine/btui/btcpplugin/btcpuisearchview.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btui/btcpplugin/btcpuisearchview.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -38,14 +38,15 @@ #include "btuimodelsortfilter.h" #include "btuiviewutil.h" #include "btcpuiviewmgr.h" +#include +#include "btqtconstants.h" // docml to load const char* BTUI_SEARCHVIEW_DOCML = ":/docml/bt-search-view.docml"; -BtcpuiSearchView::BtcpuiSearchView(BtSettingModel &settingModel, - BtDeviceModel &deviceModel, - QGraphicsItem *parent) : - BtcpuiBaseView(settingModel,deviceModel, parent) +BtcpuiSearchView::BtcpuiSearchView(BtSettingModel &settingModel, + BtDeviceModel &deviceModel, QGraphicsItem *parent) : + BtcpuiBaseView(settingModel, deviceModel, parent), mSecondaryDelegate(0) { bool ret(false); @@ -96,7 +97,7 @@ ret = connect(mDeviceList, SIGNAL(longPressed(HbAbstractViewItem*, QPointF)), this, SLOT(showContextMenu(HbAbstractViewItem*, QPointF))); - BTUI_ASSERT_X( ret, "bt-search-view", "deviceSelected can't connect" ); + BTUI_ASSERT_X( ret, "bt-search-view", "showContextMenu can't connect" ); mDeviceList->setSelectionMode( HbAbstractItemView::SingleSelection ); @@ -140,8 +141,8 @@ BTUI_ASSERT_X( optionsMenu != 0, "BtcpuiSearchView::BtcpuiSearchView", "Options menu not found" ); this->setMenu(optionsMenu); - ret = connect(mDeviceList, SIGNAL(activated(QModelIndex)), this, SLOT(deviceSelected(QModelIndex))); - BTUI_ASSERT_X( ret, "BtcpuiSearchView::BtcpuiSearchView", "deviceSelected can't connect" ); + ret = connect(mDeviceList, SIGNAL(activated(QModelIndex)), this, SLOT(openDeviceView(QModelIndex))); + BTUI_ASSERT_X( ret, "BtcpuiSearchView::BtcpuiSearchView", "openDeviceView can't connect" ); bool regStatus(false); regStatus = HbStyleLoader::registerFilePath(":/docml/btcpuisearchlistviewitem.widgetml"); @@ -172,6 +173,7 @@ { delete mLoader; // Also deletes all widgets that it constructed. delete mBtuiModelSortFilter; + delete mSecondaryDelegate; HbStyleLoader::unregisterFilePath(":/docml/btcpuisearchlistviewitem.widgetml"); HbStyleLoader::unregisterFilePath(":/docml/btcpuisearchlistviewitem.css"); } @@ -300,3 +302,71 @@ } } } + +void BtcpuiSearchView::connectToDevice(const QModelIndex& modelIndex) +{ + BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); + + bool ok(false); + if(!mSecondaryDelegate) { + mSecondaryDelegate = BtDelegateFactory::newDelegate( + BtDelegate::ConnectService, mSettingModel, mDeviceModel); + ok = connect(mSecondaryDelegate, + SIGNAL(delegateCompleted(int,BtAbstractDelegate*)), this, + SLOT(secondaryDelegateCompleted(int,BtAbstractDelegate*))); + BOstraceExt1(TRACE_DEBUG, DUMMY_DEVLIST, "BtcpuiSearchView::connectToDevice signal connect %d", ok); + if (!ok) { + delete mSecondaryDelegate; + mSecondaryDelegate = 0; + } + else { + QModelIndex index = mBtuiModelSortFilter->mapToSource(modelIndex); + QVariant param; + param.setValue(index); + mSecondaryDelegate->exec(param); + } + } + + BOstraceFunctionExit0(DUMMY_DEVLIST); +} + +void BtcpuiSearchView::secondaryDelegateCompleted(int error, BtAbstractDelegate* delegate) +{ + BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, error ); + Q_UNUSED(error); + Q_UNUSED(delegate); + + delete mSecondaryDelegate; + mSecondaryDelegate = 0; + BOstraceFunctionExit0(DUMMY_DEVLIST); +} + +void BtcpuiSearchView::disconnectFromDevice(const QModelIndex& modelIndex) +{ + BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); + + bool ok(false); + if(!mSecondaryDelegate) { + mSecondaryDelegate = BtDelegateFactory::newDelegate( + BtDelegate::DisconnectService, mSettingModel, mDeviceModel); + ok = connect(mSecondaryDelegate, + SIGNAL(delegateCompleted(int,BtAbstractDelegate*)), this, + SLOT(secondaryDelegateCompleted(int,BtAbstractDelegate*))); + BOstraceExt1(TRACE_DEBUG, DUMMY_DEVLIST, "BtcpuiSearchView::connectToDevice signal connect %d", ok); + if (!ok) { + delete mSecondaryDelegate; + mSecondaryDelegate = 0; + } + else { + QModelIndex index = mBtuiModelSortFilter->mapToSource(modelIndex); + QVariant deviceBtAddress = mDeviceModel->data(index, BtDeviceModel::ReadableBdaddrRole); + + QListparamList; + paramList.append(QVariant(ServiceLevel)); + paramList.append(deviceBtAddress); + + mSecondaryDelegate->exec(paramList); + } + } + BOstraceFunctionExit0(DUMMY_DEVLIST); +} diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btui/btcpplugin/btcpuisearchview.h --- a/bluetoothengine/btui/btcpplugin/btcpuisearchview.h Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btui/btcpplugin/btcpuisearchview.h Wed Oct 13 13:15:31 2010 +0300 @@ -42,12 +42,17 @@ virtual void activateView( const QVariant& value, bool backNavi); virtual void deactivateView(); virtual void createContextMenuActions(int majorRole); + virtual void connectToDevice(const QModelIndex& modelIndex); + virtual void disconnectFromDevice(const QModelIndex& modelIndex); + + public slots: void changeOrientation( Qt::Orientation orientation ); void stopSearching(); void retrySearch(); virtual void viewByDialogClosed(HbAction* action); void deviceSearchCompleted(int error); + void secondaryDelegateCompleted(int error, BtAbstractDelegate* delegate); private: virtual void take(BtAbstractDelegate *delegate); @@ -65,6 +70,12 @@ HbAction* mViewBy; HbAction* mStop; HbAction* mRetry; + + //This is used to perform connect/disconnect operations. + //Inquiry delegate will be primary delegate, since Inquiry + //delegate is active most of the time, this secondary + //delegate is used to perform connect/disconnect. + BtAbstractDelegate* mSecondaryDelegate; }; diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btui/btuidelegate/btdelegateconnect.cpp --- a/bluetoothengine/btui/btuidelegate/btdelegateconnect.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btui/btuidelegate/btdelegateconnect.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -29,6 +29,7 @@ #include #include #include +#include BtDelegateConnect::BtDelegateConnect( BtSettingModel* settingModel, @@ -137,6 +138,8 @@ } if( error ) { + QString prompt = HbParameterLengthLimiter(hbTrId("txt_bt_info_unable_to_connect_with_bluetooth")).arg(mDeviceName); + HbMessageBox::warning(prompt); emitCommandComplete(error); } BOstraceFunctionExit1( DUMMY_DEVLIST, this ); @@ -195,6 +198,10 @@ } else { // command is finished + if(aErr){ + QString prompt = HbParameterLengthLimiter(hbTrId("txt_bt_info_unable_to_connect_with_bluetooth")).arg(mDeviceName); + HbMessageBox::warning(prompt); + } emitCommandComplete(aErr); } BOstraceFunctionExit1( DUMMY_DEVLIST, this ); diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btui/btuidelegate/btdelegatedevsecurity.cpp --- a/bluetoothengine/btui/btuidelegate/btdelegatedevsecurity.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btui/btuidelegate/btdelegatedevsecurity.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -32,7 +32,7 @@ QObject *parent) : BtAbstractDelegate(settingModel, deviceModel, parent), mBtEngDevMan(0), mDisconnectDelegate(0), mBtEngAddr(0), mRegDevArray(0), mOperation(0), - mDevice(0),mNewDev(0), mActiveHandling(false),mAddingBlockedDev(false) + mDevice(0),mNewDev(0), mActiveHandling(false),mAddingDevToRegistry(false) { BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); mRegDevArray = new CBTDeviceArray(1); @@ -187,7 +187,6 @@ { BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); if ( mActiveHandling ) { - mAddingBlockedDev = false; emitCommandComplete(KErrNone); } BOstraceFunctionExit1( DUMMY_DEVLIST, this ); @@ -213,9 +212,9 @@ return; } if ( !err ) { - if ( mAddingBlockedDev ) { + if ( mAddingDevToRegistry ) { // blocked a device which was not in the registry originally - mAddingBlockedDev = false; + mAddingDevToRegistry = false; delete mNewDev; mNewDev = 0; } @@ -271,8 +270,9 @@ emitCommandComplete( KErrArgument ); } } - else if ( err == KErrNotFound && mOperation == BtBlock) { // device not in registry, need to add it - mAddingBlockedDev = true; + else if ( err == KErrNotFound && ((mOperation == BtBlock) || + (mOperation == BtAuthorize))) { // device not in registry, need to add it + mAddingDevToRegistry = true; TRAP( err, { mNewDev = CBTDevice::NewL( mBtEngAddr ); }); @@ -293,17 +293,21 @@ int cod = (index.data(BtDeviceModel::CoDRole)).toInt(); mNewDev->SetDeviceClass(cod); TBTDeviceSecurity security = mNewDev->GlobalSecurity(); - security.SetBanned( ETrue ); - security.SetNoAuthorise( EFalse ); // set trust status to false + if (mOperation == BtBlock) { + security.SetBanned( ETrue ); + security.SetNoAuthorise( EFalse ); // set trust status to false + mNewDev->DeleteLinkKey(); + mNewDev->SetPaired(EFalse); + } else { // BtAuthorize + security.SetNoAuthorise( ETrue ); // set trust status to true + security.SetBanned( EFalse ); + } mNewDev->SetGlobalSecurity( security ); - mNewDev->DeleteLinkKey(); - mNewDev->SetPaired(EFalse); err = mBtEngDevMan->AddDevice( *mNewDev ); // see callback HandleDevManComplete() } } } if (err) { - mAddingBlockedDev = false; emitCommandComplete( err ); } } @@ -316,7 +320,7 @@ // no dialogs here since stack provides "unpaired to %1" dialog // and failures are not reported mActiveHandling = false; - mAddingBlockedDev = false; + mAddingDevToRegistry = false; if ( mNewDev ) { delete mNewDev; mNewDev = 0; diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btui/btuidelegate/btdelegatedevsecurity.h --- a/bluetoothengine/btui/btuidelegate/btdelegatedevsecurity.h Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btui/btuidelegate/btdelegatedevsecurity.h Wed Oct 13 13:15:31 2010 +0300 @@ -74,7 +74,7 @@ CBTDevice *mNewDev; int mActiveHandling; QModelIndex mIndex; - bool mAddingBlockedDev; + bool mAddingDevToRegistry; Q_DISABLE_COPY(BtDelegateDevSecurity) }; diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btui/btuidelegate/btdelegatepair.cpp --- a/bluetoothengine/btui/btuidelegate/btdelegatepair.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btui/btuidelegate/btdelegatepair.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -109,13 +109,13 @@ addrReadbleStringToSymbian( strBtAddr, btEngddr ); TBTDeviceClass btEngDeviceClass(cod); error = mBtengConnMan->PairDevice(btEngddr, btEngDeviceClass); - launchWaitDialog(); } if(error) { emitCommandComplete(error); + return; } - + launchWaitDialog(); } diff -r 001a94c71129 -r 16e4b9007960 bluetoothengine/btui/btuidelegate/btuidelegate.pro --- a/bluetoothengine/btui/btuidelegate/btuidelegate.pro Wed Sep 29 13:09:05 2010 +0300 +++ b/bluetoothengine/btui/btuidelegate/btuidelegate.pro Wed Oct 13 13:15:31 2010 +0300 @@ -21,6 +21,8 @@ INCLUDEPATH += . \ ../inc +TRANSLATIONS = btdialogs.ts +# Only one .ts file allowed for a .pro file. btviews.ts is in btcpplugin.pro RESOURCES += btuidelegate.qrc CONFIG += qt \ diff -r 001a94c71129 -r 16e4b9007960 btobexprofiles/obexreceiveservices/bip/group/obexservicebip.mmp --- a/btobexprofiles/obexreceiveservices/bip/group/obexservicebip.mmp Wed Sep 29 13:09:05 2010 +0300 +++ b/btobexprofiles/obexreceiveservices/bip/group/obexservicebip.mmp Wed Oct 13 13:15:31 2010 +0300 @@ -39,6 +39,7 @@ USERINCLUDE ../inc +USERINCLUDE ../../btconversationviewlauncher/inc SYSTEMINCLUDE ../../../obexserviceman/utils/inc MW_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore @@ -67,6 +68,7 @@ LIBRARY btengconnman.lib //btengconnman.dll LIBRARY HbCore.lib LIBRARY HbWidgets.lib +LIBRARY btconversationviewlauncher.lib DEBUGLIBRARY flogger.lib // For logging diff -r 001a94c71129 -r 16e4b9007960 btobexprofiles/obexreceiveservices/bip/inc/BIPController.h --- a/btobexprofiles/obexreceiveservices/bip/inc/BIPController.h Wed Sep 29 13:09:05 2010 +0300 +++ b/btobexprofiles/obexreceiveservices/bip/inc/BIPController.h Wed Oct 13 13:15:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -37,6 +37,7 @@ class CBIPCapabilityHandler; class CBIPImageHandler; +class CBtConversationViewLauncher; /** * Backup status. @@ -169,6 +170,7 @@ CHbDeviceDialogSymbian* iRecvDoneDialog; TBool iShowRecvCompleteDialog; CHbDeviceDialogSymbian* iMemoryFullDailog; + CBtConversationViewLauncher* iBtCnvViewLauncher; }; _LIT(KBipPanicCategory, "BIP"); diff -r 001a94c71129 -r 16e4b9007960 btobexprofiles/obexreceiveservices/bip/src/BIPController.cpp --- a/btobexprofiles/obexreceiveservices/bip/src/BIPController.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/btobexprofiles/obexreceiveservices/bip/src/BIPController.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -34,6 +34,7 @@ #include #include "debug.h" #include +#include "btconversationviewlauncher.h" // CONSTANTS _LIT8(KBipCapabilityType, "x-bt/img-capabilities\0"); @@ -77,6 +78,7 @@ iResultArray = new(ELeave) CBTDeviceArray(1); // Get default folder from CenRep TObexUtilsMessageHandler::GetCenRepKeyStringValueL(KCRUidBluetoothEngine, KLCReceiveFolder, iCenRepFolder); + iBtCnvViewLauncher = CBtConversationViewLauncher::NewL(); TRACE_FUNC_EXIT } @@ -106,6 +108,7 @@ delete iFailureDialog; delete iRecvDoneDialog; delete iMemoryFullDailog; + delete iBtCnvViewLauncher; TRACE_FUNC_EXIT } @@ -1056,6 +1059,10 @@ }break; case TBluetoothDialogParams::EShow: + { + TRAP_IGNORE(iBtCnvViewLauncher->LaunchConversationViewL()); + } + //No break statement after the preview case since the receive dialog must be closed anyway case TBluetoothDialogParams::ECancelShow: { //In case of Show, the device dialog will handle the opening of conversation view. diff -r 001a94c71129 -r 16e4b9007960 btobexprofiles/obexreceiveservices/btconversationviewlauncher/btconversationviewlauncher.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/btobexprofiles/obexreceiveservices/btconversationviewlauncher/btconversationviewlauncher.pro Wed Oct 13 13:15:31 2010 +0300 @@ -0,0 +1,43 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + + +TEMPLATE = lib +TARGET = btconversationviewlauncher + +TARGET.UID3 = 0xA89FB97A + +TARGET.CAPABILITY = CAP_GENERAL_DLL + +INCLUDEPATH += ./inc + +CONFIG += hb + +# Input +SOURCES += ./src/btconversationviewlauncher.cpp + +HEADERS += ./inc/btconversationviewlauncher.h + +LIBS += -lhbcore \ + -lxqservice \ + -lxqserviceutil + +symbian*: { + TARGET.EPOCALLOWDLLDATA = 1 + MMP_RULES -= "OPTION_REPLACE ARMCC --export_all_vtbl -D__QT_NOEFFECTMACRO_DONOTUSE" + } + +BLD_INF_RULES.prj_exports += "./rom/btconversationviewlauncher.iby CORE_APP_LAYER_IBY_EXPORT_PATH(btconversationviewlauncher.iby)" diff -r 001a94c71129 -r 16e4b9007960 btobexprofiles/obexreceiveservices/btconversationviewlauncher/bwins/btconversationviewlauncheru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/btobexprofiles/obexreceiveservices/btconversationviewlauncher/bwins/btconversationviewlauncheru.def Wed Oct 13 13:15:31 2010 +0300 @@ -0,0 +1,5 @@ +EXPORTS + ?NewL@CBtConversationViewLauncher@@SAPAV1@XZ @ 1 NONAME ; class CBtConversationViewLauncher * CBtConversationViewLauncher::NewL(void) + ??1CBtConversationViewLauncher@@UAE@XZ @ 2 NONAME ; CBtConversationViewLauncher::~CBtConversationViewLauncher(void) + ?LaunchConversationViewL@CBtConversationViewLauncher@@QAEXXZ @ 3 NONAME ; void CBtConversationViewLauncher::LaunchConversationViewL(void) + diff -r 001a94c71129 -r 16e4b9007960 btobexprofiles/obexreceiveservices/btconversationviewlauncher/eabi/btconversationviewlauncheru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/btobexprofiles/obexreceiveservices/btconversationviewlauncher/eabi/btconversationviewlauncheru.def Wed Oct 13 13:15:31 2010 +0300 @@ -0,0 +1,7 @@ +EXPORTS + _ZN27CBtConversationViewLauncher23LaunchConversationViewLEv @ 1 NONAME + _ZN27CBtConversationViewLauncher4NewLEv @ 2 NONAME + _ZN27CBtConversationViewLauncherD0Ev @ 3 NONAME + _ZN27CBtConversationViewLauncherD1Ev @ 4 NONAME + _ZN27CBtConversationViewLauncherD2Ev @ 5 NONAME + diff -r 001a94c71129 -r 16e4b9007960 btobexprofiles/obexreceiveservices/btconversationviewlauncher/inc/btconversationviewlauncher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/btobexprofiles/obexreceiveservices/btconversationviewlauncher/inc/btconversationviewlauncher.h Wed Oct 13 13:15:31 2010 +0300 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include + +/** +This class is a utility class used by the BIP and OPP controllers to +launch the Messaging App's Bluetooth conversation view. +*/ +class CBtConversationViewLauncher : public CBase + { +public: + IMPORT_C static CBtConversationViewLauncher* NewL(); + IMPORT_C ~CBtConversationViewLauncher(); + IMPORT_C void LaunchConversationViewL(); + +private: + CBtConversationViewLauncher(); + }; diff -r 001a94c71129 -r 16e4b9007960 btobexprofiles/obexreceiveservices/btconversationviewlauncher/rom/btconversationviewlauncher.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/btobexprofiles/obexreceiveservices/btconversationviewlauncher/rom/btconversationviewlauncher.iby Wed Oct 13 13:15:31 2010 +0300 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __BTCONVERSATIONVIEWLAUNCHER_IBY__ +#define __BTCONVERSATIONVIEWLAUNCHER_IBY__ + +REM DLL +file=ABI_DIR\UREL\btconversationviewlauncher.dll SHARED_LIB_DIR\btconversationviewlauncher.dll +#endif \ No newline at end of file diff -r 001a94c71129 -r 16e4b9007960 btobexprofiles/obexreceiveservices/btconversationviewlauncher/src/btconversationviewlauncher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/btobexprofiles/obexreceiveservices/btconversationviewlauncher/src/btconversationviewlauncher.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include "btconversationviewlauncher.h" +#include +#include + +const qint64 KBluetoothMsgsConversationId = 0x01; + + +EXPORT_C CBtConversationViewLauncher* CBtConversationViewLauncher::NewL() + { + return (new(ELeave)CBtConversationViewLauncher); + } + +EXPORT_C CBtConversationViewLauncher::~CBtConversationViewLauncher() + { + + } + +/** +This API makes use of the QtHighway service provided by the Messaging Application +to open the Bluetooth conversation view. +*/ + +EXPORT_C void CBtConversationViewLauncher::LaunchConversationViewL() + { + QString service("com.nokia.services.hbserviceprovider"); + QString interface("conversationview"); + QString operation("open(qint64)"); + QList args; + XQAiwRequest* request; + XQApplicationManager appManager; + request = appManager.create(service, interface, operation, false); // not embedded + if ( request == NULL ) + { + //Could not create request because of the arguments passed to the create() API. + User::Leave(KErrArgument); + } + args << QVariant(KBluetoothMsgsConversationId); + request->setArguments(args); + TInt error = KErrNone; + if(!request->send()) + { + // The only likely Symbian error code that can be associated is KErrNotSupported + error = KErrNotSupported; + } + delete request; + User::LeaveIfError(error); + } + +CBtConversationViewLauncher::CBtConversationViewLauncher() + { + + } diff -r 001a94c71129 -r 16e4b9007960 btobexprofiles/obexreceiveservices/opp/group/obexserviceopp.mmp --- a/btobexprofiles/obexreceiveservices/opp/group/obexserviceopp.mmp Wed Sep 29 13:09:05 2010 +0300 +++ b/btobexprofiles/obexreceiveservices/opp/group/obexserviceopp.mmp Wed Oct 13 13:15:31 2010 +0300 @@ -36,6 +36,7 @@ USERINCLUDE ../inc +USERINCLUDE ../../btconversationviewlauncher/inc SYSTEMINCLUDE ../../../obexserviceman/utils/inc SYSTEMINCLUDE /epoc32/include/ecom MW_LAYER_SYSTEMINCLUDE @@ -65,5 +66,6 @@ LIBRARY btengconnman.lib //btengconnman.dll LIBRARY HbCore.lib LIBRARY HbWidgets.lib +LIBRARY btconversationviewlauncher.lib DEBUGLIBRARY flogger.lib diff -r 001a94c71129 -r 16e4b9007960 btobexprofiles/obexreceiveservices/opp/inc/oppcontroller.h --- a/btobexprofiles/obexreceiveservices/opp/inc/oppcontroller.h Wed Sep 29 13:09:05 2010 +0300 +++ b/btobexprofiles/obexreceiveservices/opp/inc/oppcontroller.h Wed Oct 13 13:15:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -34,6 +34,7 @@ #include #include +class CBtConversationViewLauncher; const TInt KBtStartReserveChannel = 9; @@ -161,6 +162,7 @@ CHbDeviceDialogSymbian* iRecvDoneDialog; TBool iShowRecvCompleteDialog; CHbDeviceDialogSymbian* iMemoryFullDailog; + CBtConversationViewLauncher* iBtCnvViewLauncher; }; #endif // OPPCONTROLLER_H diff -r 001a94c71129 -r 16e4b9007960 btobexprofiles/obexreceiveservices/opp/src/oppcontroller.cpp --- a/btobexprofiles/obexreceiveservices/opp/src/oppcontroller.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/btobexprofiles/obexreceiveservices/opp/src/oppcontroller.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -30,6 +30,7 @@ #include #include #include +#include "btconversationviewlauncher.h" // CONSTANTS @@ -68,6 +69,7 @@ TObexUtilsMessageHandler::GetCenRepKeyStringValueL(KCRUidBluetoothEngine, KLCReceiveFolder, iCenRepFolder); + iBtCnvViewLauncher = CBtConversationViewLauncher::NewL(); } COPPController::~COPPController() @@ -89,6 +91,7 @@ delete iFailureDialog; delete iRecvDoneDialog; delete iMemoryFullDailog; + delete iBtCnvViewLauncher; } // --------------------------------------------------------- @@ -1009,6 +1012,10 @@ }break; case TBluetoothDialogParams::EShow: + { + TRAP_IGNORE(iBtCnvViewLauncher->LaunchConversationViewL()); + } + //No break statement after the preview case since the receive dialog must be closed anyway case TBluetoothDialogParams::ECancelShow: { //In case of Show, the device dialog will handle the opening of conversation view. diff -r 001a94c71129 -r 16e4b9007960 btservices.pro --- a/btservices.pro Wed Sep 29 13:09:05 2010 +0300 +++ b/btservices.pro Wed Oct 13 13:15:31 2010 +0300 @@ -25,6 +25,7 @@ btobexprofiles/obexsendservices/obexhighway \ btobexprofiles/obexreceiveservices/btmsgviewer \ bluetoothengine/btxqservice \ - + btobexprofiles/obexreceiveservices/btconversationviewlauncher + CONFIG += ordered diff -r 001a94c71129 -r 16e4b9007960 cbsatplugin/atmisccmdplugin/src/atmisccmdplugin.cpp --- a/cbsatplugin/atmisccmdplugin/src/atmisccmdplugin.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/cbsatplugin/atmisccmdplugin/src/atmisccmdplugin.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -433,12 +433,15 @@ } else if (ret == KErrNone) { - aBuffer.Create( iReplyBuffer, partLength ); - iReplyBuffer.Delete( 0, partLength ); - if ( iReplyBuffer.Length() == 0 ) - { - iReplyBuffer.Close(); - } + + if((ret = aBuffer.Create( iReplyBuffer, partLength )) == KErrNone) + { + iReplyBuffer.Delete( 0, partLength ); + if ( iReplyBuffer.Length() == 0 ) + { + iReplyBuffer.Close(); + } + } } } @@ -477,35 +480,42 @@ Trace(KDebugPrintD, "iQuietMode: ", iQuietMode); if ( iQuietMode ) { - iReplyBuffer.Create( KNullDesC8 ); + aError = iReplyBuffer.Create( KNullDesC8 ); } else { - iReplyBuffer.Create( aSrcBuffer ); + aError = iReplyBuffer.Create( aSrcBuffer ); } - Trace(KDebugPrintD, "aReplyType: ", aReplyType); - switch ( aReplyType ) + if(aError == KErrNone) { - case EReplyTypeOther: - break; -#ifdef PROTOCOL_TDSCDMA - case EReplyTypeEditor: - CreateEditModeBuffer( iReplyBuffer ); - break; -#endif - case EReplyTypeOk: - CreateOkOrErrorReply( iReplyBuffer, ETrue ); - break; - case EReplyTypeError: - CreateOkOrErrorReply( iReplyBuffer, EFalse ); - break; - default: - TRACE_FUNC_EXIT - return KErrGeneral; + Trace(KDebugPrintD, "aReplyType: ", aReplyType); + switch ( aReplyType ) + { + case EReplyTypeOther: + break; + #ifdef PROTOCOL_TDSCDMA + case EReplyTypeEditor: + aError = CreateEditModeBuffer( iReplyBuffer ); + break; + #endif + case EReplyTypeOk: + aError = CreateOkOrErrorReply( iReplyBuffer, ETrue ); + break; + case EReplyTypeError: + aError = CreateOkOrErrorReply( iReplyBuffer, EFalse ); + break; + default: + TRACE_FUNC_EXIT + return KErrGeneral; + } + + if(aError == KErrNone) + { + CreatePartOfReply( *iHcReply ); + } } - CreatePartOfReply( *iHcReply ); - HandleCommandCompleted( KErrNone, aReplyType ); + HandleCommandCompleted( aError, aError ? EReplyTypeUndefined : aReplyType ); if ( EReplyTypeEditor != aReplyType ) { iHcCmd = NULL; @@ -513,7 +523,7 @@ iCurrentHandler = NULL; } TRACE_FUNC_EXIT - return KErrNone; + return aError; } /** @@ -528,6 +538,8 @@ _LIT8( KErrorReplyNumeric, "4" ); _LIT8( KOkReplyNumeric, "0" ); TBuf8 replyBuffer; + TInt ret = KErrNone; + if ( iVerboseMode ) { replyBuffer.Append( iCarriageReturn ); @@ -556,10 +568,14 @@ replyBuffer.Append( iCarriageReturn ); } - aReplyBuffer.ReAlloc(aReplyBuffer.Length() + replyBuffer.Length()); - aReplyBuffer.Append( replyBuffer ); + ret = aReplyBuffer.ReAlloc(aReplyBuffer.Length() + replyBuffer.Length()); + if(ret == KErrNone) + { + aReplyBuffer.Append( replyBuffer ); + } + TRACE_FUNC_EXIT - return KErrNone; + return ret; } /** @@ -648,7 +664,12 @@ { // return error code to AT client RBuf8 response; - response.Create(KDefaultCmdBufLength); + if (KErrNone != response.Create(KDefaultCmdBufLength)) + { + CreateReplyAndComplete(EReplyTypeError); + return; + } + response.Append(KCRLF); switch(aError) { diff -r 001a94c71129 -r 16e4b9007960 cbsatplugin/atmisccmdplugin/src/clckcommandhandler.cpp --- a/cbsatplugin/atmisccmdplugin/src/clckcommandhandler.cpp Wed Sep 29 13:09:05 2010 +0300 +++ b/cbsatplugin/atmisccmdplugin/src/clckcommandhandler.cpp Wed Oct 13 13:15:31 2010 +0300 @@ -560,7 +560,13 @@ return KErrArgument; } - iPassword.Create(tmpPwd); + ret = iPassword.Create(tmpPwd); + if (ret != KErrNone) + { + TRACE_FUNC_EXIT + return ret; + } + if (iPassword.Length() != 0) { ret = iATCmdParser.NextIntParam(iInfoClass);; diff -r 001a94c71129 -r 16e4b9007960 package_definition.xml --- a/package_definition.xml Wed Sep 29 13:09:05 2010 +0300 +++ b/package_definition.xml Wed Oct 13 13:15:31 2010 +0300 @@ -140,6 +140,9 @@ + + + @@ -167,6 +170,10 @@ + + + +