Esempio n. 1
0
	void PubSubManager::ParseItems (QDomElement items, const QString& from)
	{
		while (!items.isNull ())
		{
			const QString& node = items.attribute ("node");
			if (!Node2Creator_.contains (node))
			{
				items = items.nextSiblingElement ("items");
				continue;
			}

			QDomElement item = items.firstChildElement ("item");
			while (!item.isNull ())
			{
				PEPEventBase *eventObj = Node2Creator_ [node] ();
				eventObj->Parse (item);

				emit gotEvent (from, eventObj);

				delete eventObj;

				item = item.nextSiblingElement ("item");
			}

			items = items.nextSiblingElement ("items");
		}
	}
Esempio n. 2
0
void ColladaViewerModule::serverProcess()
{
    isServer = true;

    // Listens if there are new added storages
    bool check = connect(assetAPI_, SIGNAL(AssetStorageAdded(AssetStoragePtr)), this, SLOT(storageAdded(AssetStoragePtr)),
                                    Qt::QueuedConnection);
    Q_ASSERT(check);

    // Setting up the remote storage
    if(remoteStorageUrl != ""){
        stringstream storageString;
        storageString << "type=HttpAssetStorage;name=colladaStorage;src=" <<
                         remoteStorageUrl << ";trusted=true;autodiscoverable=false;replicated=false;readonly=false;default=false;";

        assetAPI_->DeserializeAssetStorageFromString(QString::fromStdString(storageString.str()), true);

    }


    // Initializing the websocket port
    if(framework_->HasCommandLineParameter("--wsport"))
    {
        QStringList params = framework_->CommandLineParameters("--wsport");
        if(params.length() > 0)
            websocketPort = params.at(0).toUShort();
    }else{
        websocketPort = 9002;
    }


    // Starting websocket server
    websocketManager_ = new WebSocketManager(websocketPort);
    websocketManager_->startServer();

    // Listening for event signals from websocket manager
    check = connect(websocketManager_, SIGNAL(gotEvent(QString, QString, QString)),
                         SLOT(processEvent(QString, QString, QString)), Qt::QueuedConnection);
    Q_ASSERT(check);

    // Listening for storage refresh requests from tundra client
    check = connect(server_, SIGNAL(MessageReceived(UserConnection*,kNet::packet_id_t,kNet::message_id_t,const char*,size_t)),
                    SLOT(parseKnetMessage(UserConnection*,kNet::packet_id_t,kNet::message_id_t,const char*,size_t)));

    Q_ASSERT(check);

}
void EventWidget::closeEvent( QCloseEvent *event )
{
    emit gotEvent( tr("closeEvent") );
}
void EventWidget::keyReleaseEvent( QKeyEvent *event )
{
    emit gotEvent( tr("keyReleaseEvent") );
}
void EventWidget::keyPressEvent( QKeyEvent *event )
{
    emit gotEvent( tr("keyPressEvent") );
}
void EventWidget::hideEvent( QHideEvent *event )
{
    emit gotEvent( tr("hideEvent") );
}
void EventWidget::focusOutEvent( QFocusEvent *event )
{
    emit gotEvent( tr("focusOutEvent") );
}
void EventWidget::enterEvent( QEvent *event )
{
    emit gotEvent( tr("enterEvent") );
}
void EventWidget::contextMenuEvent( QContextMenuEvent *event )
{
    emit gotEvent( tr("contextMenuEvent") );
}