int QBtSingleDeviceSelectorUI::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: discoveryCompleted((*reinterpret_cast< const QBtDevice(*)>(_a[1]))); break;
        case 1: discoveryStarted(); break;
        case 2: userCanceled(); break;
        case 3: show(); break;
        default: ;
        }
        _id -= 4;
    }
    return _id;
}
Пример #2
0
void NotificationLayout::addNotification(uint id, const QString &application,
                                        const QString &summary, const QString &body,
                                        const QString &icon, int timeout,
                                        const QStringList& actions, const QVariantMap& hints)
{
//    qDebug() << "NotificationLayout::addNotification" << id << application << summary << body << icon << timeout;
    if (m_notifications.contains(id))
    {
        // TODO/FIXME: it can be deleted by timer in this block. Locking?
        Notification *n = m_notifications[id];
        n->setValues(application, summary, body, icon, timeout, actions, hints);
    }
    else
    {
        Notification *n = new Notification(application, summary, body, icon, timeout, actions, hints, this);

        // NOTE: it's hard to use == operator for Notification* in QList...
        QHashIterator<uint, Notification*> it(m_notifications);
        while (it.hasNext())
        {
            it.next();
            if (it.value()->application() == application
                    && it.value()->summary() == summary
                    && it.value()->body() == body)
            {
                qDebug() << "Notification app" << application << "summary" << summary << "is already registered but this request is not an update. Broken app?";
                delete n;
                return;
            }
        }

        connect(n, SIGNAL(timeout()), this, SLOT(removeNotificationTimeout()));
        connect(n, SIGNAL(userCanceled()), this, SLOT(removeNotificationUser()));
        connect(n, SIGNAL(actionTriggered(QString)),
                this, SLOT(notificationActionCalled(QString)));
        m_notifications[id] = n;
        m_layout->addWidget(n);
        n->show();
    }

    emit notificationAvailable();
    checkHeight();
}
Пример #3
0
void Notification::closeButton_clicked()
{
    if (m_timer)
        m_timer->stop();
    emit userCanceled();
}
Пример #4
0
/* Slots */
void NetworkConnection::slot_cancelConnecting(void)
{
	userCanceled();
    connectingDialog->deleteLater();
    connectingDialog = 0;
}