bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicedialogrecvquerywidget.cpp
equal
deleted
inserted
replaced
51 |
51 |
52 void BTRecvQueryDialogWidget::closeDeviceDialog(bool byClient) |
52 void BTRecvQueryDialogWidget::closeDeviceDialog(bool byClient) |
53 { |
53 { |
54 Q_UNUSED(byClient); |
54 Q_UNUSED(byClient); |
55 mDialog->close(); |
55 mDialog->close(); |
|
56 emit deviceDialogClosed(); |
56 } |
57 } |
57 |
58 |
58 HbPopup* BTRecvQueryDialogWidget::deviceDialogWidget() const |
59 HbPopup* BTRecvQueryDialogWidget::deviceDialogWidget() const |
59 { |
60 { |
60 return mDialog; |
61 return mDialog; |
71 bool ok = false; |
72 bool ok = false; |
72 |
73 |
73 mLoader->load(DOCML_BT_RECV_QUERY_DIALOG, &ok); |
74 mLoader->load(DOCML_BT_RECV_QUERY_DIALOG, &ok); |
74 if(ok) |
75 if(ok) |
75 { |
76 { |
76 mDialog = qobject_cast<HbDialog*>(mLoader->findWidget("senddialog")); |
77 mDialog = qobject_cast<HbDialog*>(mLoader->findWidget("receiveAuthorizationDialog")); |
77 mHeading = qobject_cast<HbLabel*>(mLoader->findWidget("heading")); |
78 mHeading = qobject_cast<HbLabel*>(mLoader->findWidget("receiveAuthorizationHeading")); |
78 |
79 |
79 mDeviceName = qobject_cast<HbLabel*>(mLoader->findWidget("deviceName")); |
80 mDeviceName = qobject_cast<HbLabel*>(mLoader->findWidget("deviceName")); |
80 mDeviceType = qobject_cast<HbLabel*>(mLoader->findWidget("deviceType")); |
81 mDeviceType = qobject_cast<HbLabel*>(mLoader->findWidget("deviceType")); |
81 mDeviceIcon = qobject_cast<HbLabel*>(mLoader->findWidget("deviceIcon")); |
82 mDeviceIcon = qobject_cast<HbLabel*>(mLoader->findWidget("deviceIcon")); |
82 |
83 |
85 mDeviceIcon->setIcon(icon); |
86 mDeviceIcon->setIcon(icon); |
86 |
87 |
87 mDeviceName->setPlainText(parameters.value(QString::number(TBluetoothDeviceDialog::EDeviceName)).toString()); |
88 mDeviceName->setPlainText(parameters.value(QString::number(TBluetoothDeviceDialog::EDeviceName)).toString()); |
88 mDeviceType->setPlainText(getDeviceTypeString(classOfDevice)); |
89 mDeviceType->setPlainText(getDeviceTypeString(classOfDevice)); |
89 |
90 |
90 mYes = qobject_cast<HbAction*>(mLoader->findObject("yesaction")); |
91 mYesAction = qobject_cast<HbAction*>(mLoader->findObject("yesAction")); |
91 mNo = qobject_cast<HbAction*>(mLoader->findObject("noaction")); |
92 mNoAction = qobject_cast<HbAction*>(mLoader->findObject("noAction")); |
92 |
93 |
93 mCheckBox = qobject_cast<HbCheckBox*>(mLoader->findWidget("checkbox")); |
94 mAuthorizeUser = qobject_cast<HbCheckBox*>(mLoader->findWidget("authorizeUser")); |
94 |
95 |
95 int dialogType = parameters.value(QString::number(TBluetoothDialogParams::EDialogTitle)).toInt(); |
96 int dialogType = parameters.value(QString::number(TBluetoothDialogParams::EDialogTitle)).toInt(); |
96 switch(dialogType) |
97 switch(dialogType) |
97 { |
98 { |
98 case TBluetoothDialogParams::EReceive: |
99 case TBluetoothDialogParams::EReceive: |
101 }break; |
102 }break; |
102 |
103 |
103 case TBluetoothDialogParams::EReceiveFromPairedDevice: |
104 case TBluetoothDialogParams::EReceiveFromPairedDevice: |
104 { |
105 { |
105 mHeading->setPlainText(hbTrId("txt_bt_title_receive_messages_from_paired_device")); |
106 mHeading->setPlainText(hbTrId("txt_bt_title_receive_messages_from_paired_device")); |
106 mCheckBox->setCheckState(Qt::Checked); |
107 mAuthorizeUser->setCheckState(Qt::Checked); |
107 }break; |
108 }break; |
108 |
109 |
109 case TBluetoothDialogParams::EConnect: |
110 case TBluetoothDialogParams::EConnect: |
110 { |
111 { |
111 mHeading->setPlainText(hbTrId("txt_bt_title_connect_to")); |
112 mHeading->setPlainText(hbTrId("txt_bt_title_connect_to")); |
112 mCheckBox->setCheckState(Qt::Checked); |
113 mAuthorizeUser->setCheckState(Qt::Checked); |
113 }break; |
114 }break; |
114 case TBluetoothDialogParams::EPairingRequest: |
115 case TBluetoothDialogParams::EPairingRequest: |
115 mHeading->setPlainText(hbTrId("txt_bt_title_pair_with")); |
116 mHeading->setPlainText(hbTrId("txt_bt_title_pair_with")); |
116 mCheckBox->setCheckState(Qt::Checked); |
117 mAuthorizeUser->setCheckState(Qt::Checked); |
117 break; |
118 break; |
118 default: |
119 default: |
119 break; |
120 break; |
120 |
121 |
121 } |
122 } |
124 |
125 |
125 mDialog->setBackgroundFaded(false); |
126 mDialog->setBackgroundFaded(false); |
126 mDialog->setDismissPolicy(HbPopup::NoDismiss); |
127 mDialog->setDismissPolicy(HbPopup::NoDismiss); |
127 mDialog->setTimeout(HbPopup::NoTimeout); |
128 mDialog->setTimeout(HbPopup::NoTimeout); |
128 |
129 |
129 connect(mYes, SIGNAL(triggered()), this, SLOT(yesClicked())); |
130 connect(mYesAction, SIGNAL(triggered()), this, SLOT(yesClicked())); |
130 connect(mNo, SIGNAL(triggered()), this, SLOT(noClicked())); |
131 connect(mNoAction, SIGNAL(triggered()), this, SLOT(noClicked())); |
131 connect(mCheckBox, SIGNAL(clicked(bool)), this, SLOT(checkBoxStateChanged(bool))); |
132 connect(mAuthorizeUser, SIGNAL(clicked(bool)), this, SLOT(checkBoxStateChanged(bool))); |
132 |
133 |
133 return true; |
134 return true; |
134 } |
135 } |
135 |
136 |
136 void BTRecvQueryDialogWidget::yesClicked() |
137 void BTRecvQueryDialogWidget::yesClicked() |