/*!
 * Uses Qt Highway to send 'addWidget' request to home screen application.
 * \a uri and \a preferences as in widget model.
 */
void HsHomescreenClient::doAddWidget(
    const QString &uri, 
    const QVariantHash &preferences)
{
    delete mAsyncRequest;
    mAsyncRequest = 0;
    mAsyncRequest = new XQServiceRequest(INTERFACE_NAME,
                       "addWidget(QString,QVariantHash)", false);
    
    XQRequestInfo requestInfo = mAsyncRequest->info();
    requestInfo.setBackground(true);
    mAsyncRequest->setInfo(requestInfo);
    
    *mAsyncRequest << uri;
    *mAsyncRequest << preferences;
    
    connect(mAsyncRequest, SIGNAL(requestCompleted(QVariant)), 
            SLOT(onRequestCompleted(QVariant)));
    connect(mAsyncRequest, SIGNAL(requestError(int)), 
            SLOT(onRequestError(int)));
       
    mRequestResult = false;
    if (!mAsyncRequest->send()) {
       emit requestFinished();
    }
}
Beispiel #2
0
void UpdateChecker::check(bool silent) {
	this->silent = silent;
	//connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(fileIsReady(QNetworkReply*)) );
	QNetworkReply *reply = networkManager->get(QNetworkRequest(QUrl("http://texstudio.sourceforge.net/update/txsUpdate.xml")));
	connect(reply, SIGNAL(finished()), this, SLOT(onRequestCompleted()));
	if (!silent)
		connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onRequestError()));
}
Beispiel #3
0
void preferencesDialog::on_getUpdate_clicked() {
   QNetworkRequest request;
   request.setUrl(QUrl("http://www.jocala.com/version.txt"));

   QNetworkAccessManager *m_networkManager = new QNetworkAccessManager();
   QNetworkReply *reply = m_networkManager->get(request);

   connect(reply, SIGNAL(finished()),
           this, SLOT(onRequestCompleted()));



}
/*!
    Constructor
 */
FacebookConnection::FacebookConnection(QObject *parent) :
    SocialConnection(parent),
    m_facebook(new Facebook(this)),
    m_manager(new FacebookDataManager(this)),
    m_apiCall(Undefined)
{
    connect(m_facebook, SIGNAL(requestCompleted(QVariant,QByteArray)),
            this, SLOT(onRequestCompleted(QVariant,QByteArray)));
    connect(m_facebook, SIGNAL(requestFailed(QVariant,QString)),
            this, SLOT(onRequestFailed(QVariant,QString)));
    connect(m_facebook, SIGNAL(clientIdChanged(QString)),
            this, SIGNAL(clientIdChanged(QString)));
    connect(m_facebook, SIGNAL(accessTokenChanged(QString)),
            this, SIGNAL(accessTokenChanged(QString)));
    connect(m_facebook, SIGNAL(authorizedChanged(bool)),
            this, SLOT(onAuthenticationChanged(bool)));
    connect(m_facebook, SIGNAL(screenNameChanged(QString)),
            this, SLOT(onNameChanged(QString)));
}
/*!
 * Uses Qt Highway to send 'setWallpaper' request to home screen application.
 * \a fileName full path to the image file.
 */
void HsHomescreenClient::doSetWallpaper(const QString &fileName)
{
    delete mAsyncRequest;
    mAsyncRequest = 0;
    mAsyncRequest = new XQServiceRequest(INTERFACE_NAME,
                        "setWallpaper(QString)", false);
    XQRequestInfo requestInfo = mAsyncRequest->info();
    requestInfo.setBackground(true);
    mAsyncRequest->setInfo(requestInfo);
    
    *mAsyncRequest << fileName;
    
    connect(mAsyncRequest, SIGNAL(requestCompleted(QVariant)), 
            SLOT(onRequestCompleted(QVariant)));
    connect(mAsyncRequest, SIGNAL(requestError(int)),
            SLOT(onRequestError(int)));
       
    mRequestResult = false;
    if (!mAsyncRequest->send()) {
       emit requestFinished();
    }    
}