596 |
596 |
597 mDeviceList=0; |
597 mDeviceList=0; |
598 mDeviceList = qobject_cast<HbGridView *>( mLoader->findWidget( "deviceList" ) ); |
598 mDeviceList = qobject_cast<HbGridView *>( mLoader->findWidget( "deviceList" ) ); |
599 BTUI_ASSERT_X( mDeviceList != 0, "bt-main-view", "Device List (grid view) not found" ); |
599 BTUI_ASSERT_X( mDeviceList != 0, "bt-main-view", "Device List (grid view) not found" ); |
600 |
600 |
601 ret = connect(mDeviceList, SIGNAL(activated(QModelIndex)), this, SLOT(deviceSelected(QModelIndex))); |
601 ret = connect(mDeviceList, SIGNAL(activated(QModelIndex)), this, SLOT(openDeviceView(QModelIndex))); |
602 BTUI_ASSERT_X( ret, "bt-main-view", "deviceSelected can't connect" ); |
602 BTUI_ASSERT_X( ret, "bt-main-view", "openDeviceView can't connect" ); |
603 |
603 |
604 ret = connect(mDeviceList, |
604 ret = connect(mDeviceList, |
605 SIGNAL(longPressed(HbAbstractViewItem*, QPointF)), this, |
605 SIGNAL(longPressed(HbAbstractViewItem*, QPointF)), this, |
606 SLOT(showContextMenu(HbAbstractViewItem*, QPointF))); |
606 SLOT(showContextMenu(HbAbstractViewItem*, QPointF))); |
607 BTUI_ASSERT_X( ret, "bt-main-view", "deviceSelected can't connect" ); |
607 BTUI_ASSERT_X( ret, "bt-main-view", "showContextMenu can't connect" ); |
608 |
608 |
609 mOrientation = mMainWindow->orientation(); |
609 mOrientation = mMainWindow->orientation(); |
610 |
610 |
611 mDeviceList->setSwapDimensionsOnOrientationChange(false); |
611 mDeviceList->setSwapDimensionsOnOrientationChange(false); |
612 |
612 |
640 |
640 |
641 mVisibilityMode=0; |
641 mVisibilityMode=0; |
642 mVisibilityMode = qobject_cast<HbComboBox *>( mLoader->findWidget( "visibilityMode" ) ); |
642 mVisibilityMode = qobject_cast<HbComboBox *>( mLoader->findWidget( "visibilityMode" ) ); |
643 BTUI_ASSERT_X( mVisibilityMode != 0, "bt-main-view", "visibility combobox not found" ); |
643 BTUI_ASSERT_X( mVisibilityMode != 0, "bt-main-view", "visibility combobox not found" ); |
644 // add new item for temporary visibility |
644 // add new item for temporary visibility |
645 // NOTE: translation (at least default english) gives string "(p)Visible for 5 min", |
|
646 // if setting 1 min --> "(s)Visible for 1 min", ie p=plural, s=singular, but these should |
|
647 // not be shown to the user! |
|
648 // ToDo: change this to use translation once it starts working |
645 // ToDo: change this to use translation once it starts working |
649 QString tempVis(hbTrId("txt_bt_setlabel_visibility_val_visible_for_l1_min", 5)); |
646 QString tempVis(hbTrId("txt_bt_setlabel_visibility_val_visible_for_l1_min", 5)); |
650 //QString tempVis(hbTrId("Visible for 5 min")); |
647 //QString tempVis(hbTrId("Visible for 5 min")); |
651 mVisibilityMode->addItem(tempVis, Qt::DisplayRole); |
648 mVisibilityMode->addItem(tempVis, Qt::DisplayRole); |
652 |
649 |
769 return uiRow; |
766 return uiRow; |
770 } |
767 } |
771 |
768 |
772 void BtcpuiMainView::createContextMenuActions(int majorRole) |
769 void BtcpuiMainView::createContextMenuActions(int majorRole) |
773 { |
770 { |
|
771 BOstraceFunctionEntry1( DUMMY_DEVLIST, this ); |
774 if (majorRole & BtuiDevProperty::Connected) { |
772 if (majorRole & BtuiDevProperty::Connected) { |
775 mContextMenu->addAction(hbTrId("txt_bt_menu_disconnect")); |
773 mContextMenu->addAction(hbTrId("txt_bt_menu_disconnect")); |
776 } |
774 } |
777 else { |
775 else { |
778 mContextMenu->addAction(hbTrId("txt_bt_menu_connect")); |
776 mContextMenu->addAction(hbTrId("txt_bt_menu_connect")); |
779 } |
777 } |
780 } |
778 BOstraceFunctionExit0(DUMMY_DEVLIST); |
|
779 } |
|
780 |
|
781 |
|
782 |