예제 #1
0
bool CShareEditDialog::eventFilter(QObject *object, QEvent *event)
{
	if(event->type() == QEvent::KeyPress)
	{
		QKeyEvent *ke = static_cast<QKeyEvent *>(event);
		switch(ke->key())
		{
		case Qt::Key_Return:
			if(object == labelButton){
				saveShare();
				return true;
			}

			if(object == ui->sharetype){
				QKeyEvent dropdown_event(QEvent::KeyPress, Qt::Key_Space, Qt::NoModifier);
				ui->sharetype->event(&dropdown_event);
				break;
			}
#ifndef QT_TEST
			CScreenKeyboardDialog::run(this, static_cast<QLineEdit *>(this->focusWidget()));
			if(object == ui->password)
				ui->password->setEchoMode(QLineEdit::PasswordEchoOnEdit);
#endif
			break;

		case Qt::Key_Down:
			this->focusNextChild();
			if(this->focusWidget() == ui->sharetype)
				ui->sharetype->setStyleSheet(ui->sharetype->styleSheet() + "QComboBox {border:2px solid #004d79;}");
			 else
				ui->sharetype->setStyleSheet(ui->sharetype->styleSheet() + "QComboBox {border:2px solid #000000;}");
			return true;
			break;

		case Qt::Key_Up:
			this->focusPreviousChild();
			if(this->focusWidget() == ui->sharetype)
				ui->sharetype->setStyleSheet(ui->sharetype->styleSheet() + "QComboBox {border:2px solid #004d79;}");
			else
				ui->sharetype->setStyleSheet(ui->sharetype->styleSheet() + "QComboBox {border:2px solid #000000;}");
			return true;
			break;

		case Qt::Key_Dead_Diaeresis:
			if(object == ui->sharetype)
				break;
#ifndef QT_TEST
			CScreenKeyboardDialog::run(this, static_cast<QLineEdit *>(this->focusWidget()));
#endif
			break;
case Qt::Key_Escape:
			break;
		default:
			break;
		}
	}
	return false;
}
예제 #2
0
/*!
    Completes either saving or sharing of access point by 
    making the move in commsdat.
 */
void CpIapItem::queryDialogClosed()
{
    OstTraceFunctionEntry0(CPIAPITEM_QUERYDIALOGCLOSED_ENTRY);
    if (mMoveOngoing) {
        saveMove(mDestinationList[mList->selected()]);
    } else {
        saveShare(mDestinationList[mList->selected()]);
    }
    OstTraceFunctionExit0(CPIAPITEM_QUERYDIALOGCLOSED_EXIT);
}