예제 #1
0
void BooleanReply::parseData(const QByteArray& data)
{    
    if((QString(data) == "TRUE")){
        emit requestDone(true, false);
    }
    else{
        emit requestDone(false, false);
    }   
}
예제 #2
0
CSVWorld::TableBottomBox::TableBottomBox (const CreatorFactoryBase& creatorFactory, 
                                          CSMDoc::Document& document, 
                                          const CSMWorld::UniversalId& id, 
                                          QWidget *parent)
: QWidget (parent), mShowStatusBar (false), mEditMode(EditMode_None), mHasPosition(false), mRow(0), mColumn(0)
{
    for (int i=0; i<4; ++i)
        mStatusCount[i] = 0;

    setVisible (false);

    mLayout = new QStackedLayout;
    mLayout->setContentsMargins (0, 0, 0, 0);
    connect (mLayout, SIGNAL (currentChanged (int)), this, SLOT (currentWidgetChanged (int)));

    mStatus = new QLabel;

    mStatusBar = new QStatusBar;

    mStatusBar->addWidget (mStatus);

    mLayout->addWidget (mStatusBar);

    setLayout (mLayout);

    mCreator = creatorFactory.makeCreator (document, id);

    if (mCreator)
    {
        mCreator->installEventFilter(this);
        mLayout->addWidget (mCreator);

        connect (mCreator, SIGNAL (done()), this, SLOT (requestDone()));

        connect (mCreator, SIGNAL (requestFocus (const std::string&)),
            this, SIGNAL (requestFocus (const std::string&)));
    }

    mExtendedConfigurator = new ExtendedCommandConfigurator (document, id, this);
    mExtendedConfigurator->installEventFilter(this);
    mLayout->addWidget (mExtendedConfigurator);
    connect (mExtendedConfigurator, SIGNAL (done()), this, SLOT (requestDone()));

    updateSize();
}
예제 #3
0
bool CSVWorld::TableBottomBox::eventFilter(QObject *object, QEvent *event)
{
    if (event->type() == QEvent::KeyPress)
    {
        QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
        if (keyEvent->key() == Qt::Key_Escape)
        {
            requestDone();
            return true;
        }
    }
    return QWidget::eventFilter(object, event);
}
예제 #4
0
void SeriesCache::nextRequest()
{
    if ( !m_requestInProcess &&
         !m_requests.isEmpty() ) {
        m_currentRequest = m_requests.dequeue();
        if ( m_series.contains( m_currentRequest.query ) ) {
            kDebug() << "Reusing from cache:" << m_currentRequest.query;
            emit requestDone( m_currentRequest.id, m_series[m_currentRequest.query] );
            QMetaObject::invokeMethod( this, "nextRequest", Qt::QueuedConnection );
        }
        else {
            kDebug() << "Starting query:" << m_currentRequest.query;
            m_requestInProcess = true;
            m_tvdbClient->getSeriesByName( m_currentRequest.query );
        }
    }
}
PacketContainer* 
CoordinateOnItemObject::getNextPacket() {
   if ( requestDone() ) {
      return NULL;
   }

   PacketContainer* retPacketCont = m_packetsReadyToSend.getMin();
   if (retPacketCont != NULL) {
      m_packetsReadyToSend.remove( retPacketCont );
   }

   switch( m_state ) {
      case ADDING_ITEMS:
         // Create request packets
         createCoordinatePackets();
         // Return the first packet
         retPacketCont = m_packetsReadyToSend.getMin();
         if (retPacketCont != NULL) {
            m_state = SENDING_COORDINATE_REQUEST;
            m_packetsReadyToSend.remove( retPacketCont );
         } else {
            mc2log << error << "CoordinateOnItemObject::getNextPacket "
               "createCoordinatePackets created no packets, going to "
               "ERROR state." << endl;
            m_state = ERROR;
         }
         break;
      case SENDING_COORDINATE_REQUEST:
         if ( retPacketCont == NULL ) {
            m_state = AWAITING_COORDINATE_REPLY;
         }
         break;

      case AWAITING_COORDINATE_REPLY:
         break;

      case DONE:
         break;

      case ERROR:
         mc2log << error << "CoordinateOnItemObject::getNextPacket "
            "called in ERROR state." << endl;
         break;
   }
   return retPacketCont;
}
예제 #6
0
void SeriesCache::slotFinished( const Tvdb::Series& series )
{
    kDebug() << m_currentRequest.query;

    // reset state
    m_requestInProcess = false;

    // build the cache value
    if ( series.isValid() )
        m_series[m_currentRequest.query].append( series );

    // in case there is a sub request left handle that
    if ( m_currentRequest.subRequests.isEmpty() ) {
        emit requestDone( m_currentRequest.id, m_series[m_currentRequest.query] );
        QMetaObject::invokeMethod( this, "nextRequest", Qt::QueuedConnection );
    }
    else {
        QMetaObject::invokeMethod( this, "nextSubRequest", Qt::QueuedConnection );
    }
}
예제 #7
0
void BooleanReply::networkError()
{
    emit requestDone(false, true);
}
/*!
  CpDivertPluginGroup::CpDivertPluginGroup.
 */
CpDivertPluginGroup::CpDivertPluginGroup(CpItemDataHelper &helper)
     : CpSettingFormItemData(HbDataFormModelItem::GroupItem, 
                             hbTrId("txt_phone_subhead_call_divert"),0),
       m_DataItemVoiceAllCalls(NULL),
       m_DataItemVoiceIfBusy(NULL),
       m_DataItemVoiceIfNotAnswered(NULL),
       m_DataItemVoiceIfOutOfReach(NULL),
       m_DataItemVoiceIfNotAvailable(NULL),
       m_DataItemVideoAllCalls(NULL),
       m_DataItemVideoIfBusy(NULL),
       m_DataItemVideoIfNotAnswered(NULL),
       m_DataItemVideoIfOutOfReach(NULL),
       m_DataItemVideoIfNotAvailable(NULL),
       m_activeNoteId(0),
       m_activeProgressNoteId(0),
       m_helper(helper),
       m_activateDivertPopUp(0)
{
    DPRINT << ": IN";
    
    // Registration needed, because PsCallDivertingCondition and PsServiceGroup
    // is used as a custom meta information for barring items.
    qRegisterMetaType<PsCallDivertingCondition>(
        "PsCallDivertingCondition");
    
    qRegisterMetaType<PsServiceGroup>(
        "PsServiceGroup");
    
    m_pSetWrapper = new PSetWrapper; 
    DPRINT << ": PSetWrapper created";
    
    m_ssSettingsWrapper = new SsSettingsWrapper; 
    DPRINT << ": SsSettingsWrapper created";
    
    m_callDivertingWrapper = &m_pSetWrapper->callDivertingWrapper();
    QObject::connect(
        m_callDivertingWrapper, 
        SIGNAL(handleDivertingChanged(const PSCallDivertingCommand&,bool)),
        this, 
        SLOT(handleDivertingChanged(const PSCallDivertingCommand&,bool)));
    QObject::connect(
        m_callDivertingWrapper, 
        SIGNAL(handleDivertingStatus(QList<PSCallDivertingStatus*>&, bool)),
        this, 
        SLOT(handleDivertingStatus(QList<PSCallDivertingStatus*>&, bool)));
    QObject::connect(
        m_callDivertingWrapper, 
        SIGNAL(handleDivertingError(int)),
        this, 
        SLOT(handleDivertingError(int)));
    
    QObject::connect(
        m_callDivertingWrapper, 
        SIGNAL(requestDone()),
        this,
        SLOT(divertRequestProcessed()));
    
    m_activateDivertPopUp = new CpDivertQuery(*m_callDivertingWrapper);
    QObject::connect(
        m_activateDivertPopUp, 
        SIGNAL(result(PSCallDivertingCommand &)),
        this,
        SLOT(divertQueryOk(PSCallDivertingCommand &)));
    
    QObject::connect(
        m_activateDivertPopUp, 
        SIGNAL(cancelled(PSCallDivertingCommand &)),
        this,
        SLOT(divertQueryCancelled(PSCallDivertingCommand &)));

    QObject::connect(
        m_activateDivertPopUp, 
        SIGNAL(handleDivertingError(int)),
        this, 
        SLOT(handleDivertingError(int)));
    
    // Listen form item visibility change
    m_helper.connectToForm(
            SIGNAL(itemShown(QModelIndex)), this, SLOT(itemShown(QModelIndex)));
    
    // Create grouped setting items
    createVoiceCallItems(this);
    createVideoCallItems(this);

    DPRINT << ": OUT";
}