示例#1
0
void MainWindow::search() {
    SearchDialog dialog(this);
    
    if (dialog.exec() == QDialog::Accepted) {
        if (dialog.service() == Resources::SOUNDCLOUD) {
            SoundCloudTracksPage *page = new SoundCloudTracksPage(m_tabWidget);
            m_tabWidget->addTab(page, tr("Search '%1'").arg(dialog.query()));
            m_tabWidget->setCurrentWidget(page);
            connect(page, SIGNAL(statusChanged(Page::Status)), this, SLOT(onTabStatusChanged()));
            connect(page, SIGNAL(statusTextChanged(QString)), statusBar(), SLOT(showMessage(QString)));
            connect(page, SIGNAL(windowTitleChanged(QString)), this, SLOT(updateTabText(QString)));
            
            QVariantMap filters;
            filters["q"] = dialog.query();
            filters["limit"] = MAX_RESULTS;
            page->get("/tracks", filters);
        }
        else {
            PluginTracksPage *page = new PluginTracksPage(dialog.service(), m_tabWidget);
            m_tabWidget->addTab(page, tr("Search '%1'").arg(dialog.query()));
            m_tabWidget->setCurrentWidget(page);
            connect(page, SIGNAL(statusChanged(Page::Status)), this, SLOT(onTabStatusChanged()));
            connect(page, SIGNAL(statusTextChanged(QString)), statusBar(), SLOT(showMessage(QString)));
            connect(page, SIGNAL(windowTitleChanged(QString)), this, SLOT(updateTabText(QString)));
            page->search(dialog.query(), dialog.order());
        }
        
        m_reloadAction->setEnabled(true);
        m_closeAction->setEnabled(true);
    }
}
示例#2
0
void JSKitXMLHttpRequest::handleReplyFinished()
{
    if (!_reply) {
        qCDebug(l) << "reply finished too late";
        return;
    }

    _response = _reply->readAll();
    qCDebug(l) << "reply finished, reply text:" << QString::fromUtf8(_response);

    emit readyStateChanged();
    emit statusChanged();
    emit statusTextChanged();
    emit responseChanged();
    emit responseTextChanged();

    if (_onload.isCallable()) {
        qCDebug(l) << "going to call onload handler:" << _onload.toString();
        QJSValue result = _onload.callWithInstance(_mgr->engine()->newQObject(this));
        if (result.isError()) {
            qCWarning(l) << "JS error on onload handler:" << JSKitManager::describeError(result);
        }
    } else {
        qCDebug(l) << "No onload set";
    }
}
void RegistrationHandler::setStatusText(const QString statusText)
{
  if (mStatusText.compare(statusText) != 0)
  {
    mStatusText = statusText;
    emit statusTextChanged(mStatusText);
  }
}
示例#4
0
void MyXmppClient::setMyPresence( StatusXmpp status, QString textStatus ) { //Q_INVOKABLE
    qDebug() << "MyXmppClient:: setMyPresence() called";
    if( textStatus != m_statusText ) {
        m_statusText =textStatus;
        emit statusTextChanged();
    }

    setStatus( status );
    setStatusText( textStatus );
}
示例#5
0
void MyXmppClient::setStatusText( const QString &__statusText )
{
    if( __statusText != m_statusText ) {
        m_statusText=__statusText;

        QXmppPresence myPresence = xmppClient->clientPresence();
        myPresence.setStatusText( __statusText );
        xmppClient->setClientPresence( myPresence );

        emit statusTextChanged();
    }
}
//! [5]
//! [6]
void HttpDownloader::httpFinished()
{
    // All data have been written to the file, so close it
    m_file->flush();
    m_file->close();
    const QVariant redirectionTarget = m_reply->attribute(QNetworkRequest::RedirectionTargetAttribute);

    if (m_reply->error()) {
        // If there was an error, show an error message in a message box
        m_messageBoxController.exec(tr("HTTP"), tr("Download failed: %1.").arg(m_reply->errorString()), tr("Ok"), QString());

        setStartDownloadPossible(true);
    } else if (!redirectionTarget.isNull()) {
        // If we got a redirect response (3XX), retrieve the redirect URL ...
        const QUrl newUrl = m_url.resolved(redirectionTarget.toUrl());

        // ... and ask the user whether the redirected page should be downloaded instead
        const MessageBoxController::Result result = m_messageBoxController.exec(tr("HTTP"), tr("Redirect to %1 ?").arg(newUrl.toString()), tr("Yes"), tr("No"));

        if (result == MessageBoxController::Button1) {
            // If the redirected page should be downloaded, reset the URL ...
            m_url = newUrl;

            // ... delete the old network reply object ...
            m_reply->deleteLater();

            // ... reset the target file ...
            m_file->open(QIODevice::WriteOnly);
            m_file->resize(0);

            // ... and trigger a new download request with the new URL.
            startRequest();
            return;
        } else {
            setStartDownloadPossible(true);
        }
    } else {
        // If the download was successful, update the status message
        const QFileInfo actualDir(*m_file);
        m_statusText = tr("Downloaded %1 to %2.").arg(m_fileName).arg(actualDir.absolutePath());
        emit statusTextChanged();
        setStartDownloadPossible(true);
    }

    // Delete the network reply object
    m_reply->deleteLater();
    m_reply = 0;

    // Clean up the target file object
    delete m_file;
    m_file = 0;
}
void AMActionRunnerBottomBarCurrentView3::onCurrentActionChanged(AMAction3 *action)
{
	AMActionRunnerCurrentViewBase::onCurrentActionChanged(action);

	if (action && !action->parentAction() && qobject_cast<AMLoopAction3 *>(action)){

		rootLoopAction_ = qobject_cast<AMLoopAction3 *>(action);
		increaseIterations_->setEnabled(true);
		increaseIterations_->setVisible(true);
		decreaseIterations_->setEnabled(true);
		decreaseIterations_->setVisible(true);
		connect(rootLoopAction_, SIGNAL(currentIterationChanged(int)), this, SLOT(onLoopIterationUpdate(int)));
		connect(rootLoopAction_, SIGNAL(currentSubActionChanged(int)), this, SLOT(onRootLoopSubActionChanged(int)));
		connect(rootLoopAction_, SIGNAL(statusTextChanged(QString)), this, SLOT(onStatusTextChanged(QString)));
		connect(rootLoopAction_->info(), SIGNAL(infoChanged()), this, SLOT(onRootLoopActionLoopCountChanged()));
	}
示例#8
0
void ChartWidget::setStatusBar(QStatusBar* statusbar)
{
	if (m_lblStatus != NULL)
	{
		delete m_lblStatus;
		m_lblStatus = NULL;
	}

	m_statusbar = statusbar;

	if (m_statusbar != NULL)
	{
		m_lblStatus = new QLabel();
		m_statusbar->insertPermanentWidget(0, m_lblStatus);
		connect(m_chartS, SIGNAL(statusTextChanged(QString)), m_lblStatus, SLOT(setText(QString)));
	}
}
    void BucketBBMManager::registerApp()
    {
        if (mRegistrationHandler == 0) {
            // If no registration handler exist when trying register, create one
            // and connect to its signals, so that updates can be relayed via this
            // objects properties.
            mRegistrationHandler = new RegistrationHandler(this);

            bool connectResult;
            Q_UNUSED(connectResult);

            connectResult = connect(mRegistrationHandler, SIGNAL(statusTextChanged(QString)), SLOT(onStatusTextChanged(QString)));
            Q_ASSERT(connectResult);

            connectResult = connect(mRegistrationHandler, SIGNAL(registeredChanged(bool)), SLOT(onRegisteredChanged(bool)));
            Q_ASSERT(connectResult);
        }
示例#10
0
WaitForHardwareDialog::WaitForHardwareDialog(IdacProxy* idac, bool /*bCloseOnAvailable*/, QObject* parent)
	: QObject(parent)
{
	m_idac = idac;
	m_loop = NULL;
	//m_bCloseOnAvailable = bCloseOnAvailable;

	m_bAccepted = false;

	//connect(m_idac, SIGNAL(stateChanged(IdacState)), this, SLOT(updateRetryEnabled()));
	connect(m_idac, SIGNAL(statusTextChanged(QString)), this, SLOT(updateStatus()));
	connect(m_idac, SIGNAL(statusErrorChanged(QString)), this, SLOT(on_idac_statusErrorChanged(QString)));
	connect(m_idac, SIGNAL(isAvailableChanged(bool)), this, SLOT(on_idac_isAvailableChanged(bool)));

	m_idac->setup();

	updateStatus();
}
示例#11
0
void MainWindow::showTransfers() {
    for (int i = 0; i < m_tabWidget->count(); i++) {
        if (qobject_cast<TransfersPage*>(m_tabWidget->widget(i))) {
            m_tabWidget->setCurrentIndex(i);
            m_reloadAction->setEnabled(true);
            m_closeAction->setEnabled(true);
            return;
        }
    }
    
    TransfersPage *page = new TransfersPage(m_tabWidget);
    m_tabWidget->addTab(page, page->windowTitle());
    m_tabWidget->setCurrentIndex(m_tabWidget->count() - 1);
    connect(page, SIGNAL(statusChanged(Page::Status)), this, SLOT(onTabStatusChanged()));
    connect(page, SIGNAL(statusTextChanged(QString)), statusBar(), SLOT(showMessage(QString)));
    connect(page, SIGNAL(windowTitleChanged(QString)), this, SLOT(updateTabText(QString)));
    m_reloadAction->setEnabled(true);
    m_closeAction->setEnabled(true);
}
示例#12
0
void statusTextWidget::statusTextChanged_menuClick()
{
    QAction* action = qobject_cast<QAction*>(sender());
    if(action)
    {
        int i = 0;
        while(i < m_statusTextActionList.size() && action != m_statusTextActionList.at(i))
        {
            ++i;
        }

        if(action == m_statusTextActionList.at(i))
        {
            m_statusTextActionList.removeAt(i);
            m_statusTextActionList.append(action);
        }
        m_statusLineEdit->setText(action->data().toString());
        emit statusTextChanged(action->data().toString());
    }
}
示例#13
0
void JSKitXMLHttpRequest::handleReplyError(QNetworkReply::NetworkError code)
{
    if (!_reply) {
        qCDebug(l) << "reply error too late";
        return;
    }

    qCDebug(l) << "reply error" << code;

    emit readyStateChanged();
    emit statusChanged();
    emit statusTextChanged();

    if (_onerror.isCallable()) {
        qCDebug(l) << "going to call onerror handler:" << _onload.toString();
        QJSValue result = _onerror.callWithInstance(_mgr->engine()->newQObject(this));
        if (result.isError()) {
            qCWarning(l) << "JS error on onerror handler:" << JSKitManager::describeError(result);
        }
    }
}
示例#14
0
statusWidget::statusWidget(QWidget* parent)
    : QWidget(parent)
{
    bool check;
    Q_UNUSED(check);

    setupUi(this);

    QMenu* menu = new QMenu(this);
    menu->addAction(actionAvailable);
    menu->addAction(actionBusy);
    menu->addAction(actionAway);
//    menu->addAction(actionInvisible);
    menu->addSeparator();
    menu->addAction(actionSign_out);
    toolButton_userName->setMenu(menu);

    check = connect(statusTextWidgetObject, SIGNAL(statusTextChanged(QString)), SIGNAL(statusTextChanged(QString)));
    Q_ASSERT(check);

    check = connect(actionAvailable, SIGNAL(triggered()), SLOT(presenceMenuTriggered()));
    Q_ASSERT(check);

    check = connect(actionBusy, SIGNAL(triggered()), SLOT(presenceMenuTriggered()));
    Q_ASSERT(check);

    check = connect(actionAway, SIGNAL(triggered()), SLOT(presenceMenuTriggered()));
    Q_ASSERT(check);

//    check = connect(actionInvisible, SIGNAL(triggered()), SLOT(presenceMenuTriggered()));
//    Q_ASSERT(check);

    check = connect(actionSign_out, SIGNAL(triggered()), SLOT(presenceMenuTriggered()));
    Q_ASSERT(check);

    check = connect(pushButton_avatar, SIGNAL(clicked()), SLOT(avatarSelection()));
    Q_ASSERT(check);
}
void JSKitXMLHttpRequest::handleReplyFinished()
{
    if (!m_reply) {
        qCDebug(l) << "reply finished too late";
        return;
    }

    m_response = m_reply->readAll();
    qCDebug(l) << "reply finished, reply text:" << QString::fromUtf8(m_response) << "status:" << status();

    emit readyStateChanged();
    emit statusChanged();
    emit statusTextChanged();
    emit responseChanged();
    emit responseTextChanged();

    if (m_onload.isCallable()) {
        qCDebug(l) << "going to call onload handler:" << m_onload.toString();

        QJSValue result = m_onload.callWithInstance(m_engine->newQObject(this));
        if (result.isError()) {
            qCWarning(l) << "JS error on onload handler:" << JSKitManager::describeError(result);
        }
    } else {
        qCDebug(l) << "No onload set";
    }
    invokeCallbacks("load", QJSValueList({m_engine->newQObject(this)}));

    if (m_onreadystatechange.isCallable()) {
        qCDebug(l) << "going to call onreadystatechange handler:" << m_onreadystatechange.toString();
        QJSValue result = m_onreadystatechange.callWithInstance(m_engine->newQObject(this));
        if (result.isError()) {
            qCWarning(l) << "JS error on onreadystatechange handler:" << JSKitManager::describeError(result);
        }
    }
    invokeCallbacks("readystatechange", QJSValueList({m_engine->newQObject(this)}));
}
示例#16
0
Xmpp_client::Xmpp_client(QString a_login, QString a_password, int a_xmpp_client_port, QObject *parent) : m_login(a_login), m_password(a_password), m_xmpp_client_port(a_xmpp_client_port), QXmppClient(parent)
{
    bool check;
    Q_UNUSED(check);

    m_capabilitiesCache = new capabilitiesCache(this);
    m_vCardCache = new vCardCache(this);

    qDebug() << "Xmpp_client::Xmpp_client !!!";

    QXmppLogger::getLogger()->setLoggingType(QXmppLogger::SignalLogging);


    transfer_manager = new QXmppTransferManager;
    this->addExtension (transfer_manager);


    // uncomment one of the following if you only want to use a specific transfer method:
    //
     //transfer_manager->setSupportedMethods(QXmppTransferJob::InBandMethod);
    // manager->setSupportedMethods(QXmppTransferJob::SocksMethod);
     transfer_manager->setProxy("proxy.nodecast.net");
     transfer_manager->setSupportedMethods(QXmppTransferJob::InBandMethod);

     muc_manager = new QXmppMucManager;
     this->addExtension(muc_manager);



     check = connect(&this->rosterManager(),
                          SIGNAL(rosterReceived()),
                          this, SLOT(rosterReceived()));
     Q_ASSERT(check);


     check = connect(&this->rosterManager(),
                          SIGNAL(itemChanged(QString)),
                          this, SLOT(rosterChanged(QString)));
     Q_ASSERT(check);


     check = connect(&this->rosterManager(), SIGNAL(presenceChanged(QString,QString)),
                     this, SLOT(presenceChanged(QString,QString)));                
     Q_ASSERT(check);


     check = connect(this, SIGNAL(messageReceived(const QXmppMessage&)),
           SLOT(messageReceived(const QXmppMessage&)));
       Q_ASSERT(check);
       Q_UNUSED(check);

    check = connect(this, SIGNAL(presenceReceived(const QXmppPresence&)),
                    SLOT(presenceReceived(const QXmppPresence&)));



    check = connect(this, SIGNAL(connected()), SLOT(updateStatusWidget()));
    Q_ASSERT(check);


   // check = connect(&m_xmppClient, SIGNAL(connected()), SLOT(addAccountToCache()));
  //  Q_ASSERT(check);


    check = connect(this, SIGNAL(connected()),
                    SLOT(connectedToServer()));
    Q_ASSERT(check);


    check = connect(this, SIGNAL(disconnected()),
                    SLOT(disconnectedToServer()));
    Q_ASSERT(check);


    check = connect(this, SIGNAL(error(QXmppClient::Error)),
                    SLOT(connectedError()));
    Q_ASSERT(check);



    check = connect(transfer_manager, SIGNAL(fileReceived(QXmppTransferJob*)),
                             SLOT(file_received(QXmppTransferJob*)));
    Q_ASSERT(check);


    check = connect(transfer_manager, SIGNAL(jobFinished(QXmppTransferJob*)),
                             SLOT(job_finished(QXmppTransferJob*)));
    Q_ASSERT(check);


    check = connect(&this->vCardManager(),
                    SIGNAL(vCardReceived(QXmppVCardIq)), m_vCardCache,
                    SLOT(vCardReceived(QXmppVCardIq)));
    Q_ASSERT(check);

    check = connect(m_vCardCache,
                    SIGNAL(vCardReadyToUse(QString)),
                    SLOT(updateVCard(QString)));
    Q_ASSERT(check);




    check = connect(QXmppLogger::getLogger(),
            SIGNAL(message(QXmppLogger::MessageType,QString)),
            &m_consoleDlg,
            SLOT(message(QXmppLogger::MessageType,QString)));
    Q_ASSERT(check);




    //this->logger()->setLoggingType(QXmppLogger::StdoutLogging);

    //this->logger()->setLoggingType(QXmppLogger::FileLogging);


    m_rosterItemSortFilterModel = new rosterItemSortFilterProxyModel(this);
    m_rosterItemModel = new rosterItemModel(this);
    roster = new Ui::Roster;
    roster_widget= new QWidget;
    roster->setupUi(roster_widget);
    layoutRoster = new QVBoxLayout;
    layoutRoster->addWidget(&m_statusWidget);
    layoutRoster->addWidget(roster_widget);

    m_stacked_tab_chat = new QStackedWidget;

    vRosterSplitter = new QSplitter(Qt::Horizontal);
    groupBoxContact = new QGroupBox;
    groupBoxContact->setLayout(layoutRoster);

    vRosterSplitter->addWidget(groupBoxContact);
    vRosterSplitter->addWidget(m_stacked_tab_chat);

    check = connect(roster->lineEdit_filter, SIGNAL(textChanged(QString)),
                    this, SLOT(filterChanged(QString)));
    Q_ASSERT(check);


    m_rosterItemSortFilterModel->setSourceModel(m_rosterItemModel);
    roster->listView->setModel(m_rosterItemSortFilterModel);
    m_rosterItemSortFilterModel->sort(0);


    connect(roster->listView->selectionModel(),
            SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
            this, SLOT(rosterItemSelectionChanged(QItemSelection)));




    rosterItemDelegate *delegate = new rosterItemDelegate();
    roster->listView->setItemDelegate(delegate);
    roster->verticalLayout->insertWidget(0, &m_statusWidget);


    check = connect(&m_statusWidget, SIGNAL(statusTextChanged(QString)),
                    SLOT(statusTextChanged(QString)));
    Q_ASSERT(check);
    check = connect(&m_statusWidget, SIGNAL(presenceTypeChanged(QXmppPresence::Type)),
                    SLOT(presenceTypeChanged(QXmppPresence::Type)));
    Q_ASSERT(check);
    check = connect(&m_statusWidget,
                    SIGNAL(presenceStatusTypeChanged(QXmppPresence::AvailableStatusType)),
                    SLOT(presenceStatusTypeChanged(QXmppPresence::AvailableStatusType)));
    Q_ASSERT(check);
    check = connect(&m_statusWidget,
                    SIGNAL(avatarChanged(QImage)),
                    SLOT(avatarChanged(QImage)));
    Q_ASSERT(check);


    check = connect(roster->listView, SIGNAL(showProfile(QString)),
                    this, SLOT(showProfile(QString)));
    Q_ASSERT(check);

    check = connect(roster->listView, SIGNAL(removeContact(QString)),
                    this, SLOT(action_removeContact(QString)));
    Q_ASSERT(check);

    check = connect(roster->pushButton_addContact, SIGNAL(clicked()), SLOT(action_addContact()));
    Q_ASSERT(check);


    this->configuration().setPort(m_xmpp_client_port);
    this->configuration().setJid(m_login);
    this->configuration().setPassword(m_password);
    this->configuration().setResource("nodecast");
    this->configuration().setStreamSecurityMode(QXmppConfiguration::StreamSecurityMode::TLSRequired);

    this->connectToServer(this->configuration());
}
示例#17
0
void FileTestItem::onStatusChanged_(TestRunner::Status /*status*/)
{
    emit statusTextChanged(this);
}
示例#18
0
void statusTextWidget::statusTextChanged_helper()
{
    addStatusTextToList(m_statusLineEdit->text());
    emit statusTextChanged(m_statusLineEdit->text());
    parentWidget()->setFocus();
}
示例#19
0
//**********************************************************************************************************************
void SimpleTerminal::setStatusText(const QString &text)
{
    _statusText = text;
    emit statusTextChanged();
}
示例#20
0
void KoToolBase::setStatusText(const QString &statusText)
{
    emit statusTextChanged(statusText);
}
示例#21
0
/*!
    \qmlproperty string WebView::statusText

    This property is the current status suggested by the current web page. In a web browser,
    such status is often shown in some kind of status bar.
*/
void QDeclarativeWebView::setStatusText(const QString& text)
{
    d->statusText = text;
    emit statusTextChanged();
}
示例#22
0
void statusTextWidget::clearStatusTextHistory()
{
    emit statusTextChanged("");
}
示例#23
0
void Subscriptions::setStatusText(const QString &t) {
    if (t != statusText()) {
        m_statusText = t;
        emit statusTextChanged(t);
    }
}