Controller::Controller(QObject *parent) : QObject(parent) { ps = new PersistantService; connect(ps,SIGNAL(bridgeFound(QString)),this,SLOT(bridgeFound(QString))); connect(ps,SIGNAL(portFound(QString,QString)),this,SLOT(portFound(QString,QString))); connect(ps, SIGNAL(interfaceFound(QString,QString,QString)),this,SLOT(interfaceFound(QString,QString,QString))); connect(ps, SIGNAL(interfaceTypeFound(QString,QString,QString,QString)), this, SLOT(interfaceTypeFound(QString,QString,QString,QString))); connect(ps, SIGNAL(interfaceAttrFound(QString,QString,QString,QString,QString)), this, SLOT(interfaceAttrFound(QString,QString,QString,QString,QString))); connect(ps, SIGNAL(execErrorFound(QString)), this, SLOT(execErrorFound(QString))); connect(ps,SIGNAL(needRefresh()),this,SLOT(refreshOvs())); connect(ps, SIGNAL(ovsStarted()),this,SLOT(refreshOvs())); ps->startOvs(); }
void SideBarTask::submitTask() { // On sauvegarde l'index courant // car mis à -1 après un model->select() int oldIndex = mapper->currentIndex(); mapper->submit(); model->submitAll(); mapper->setCurrentIndex(oldIndex); if(Task::getInstance()->needRefreshView){ emit needRefresh(); Task::getInstance()->needRefreshView = false; } else { emit isUpdated(); } }
TKeyResponse CSymellaSearchContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType) { if (aType == EEventKey) { switch (aKeyEvent.iCode) { case EKeyUpArrow: case EKeyDownArrow: return iListBox->OfferKeyEventL(aKeyEvent, aType); case EKeyDevice3: //EKeyOk { if (CurrentItemIndex() >= 0) { HBufC* info = CTR->DlManager()->CreateHitInfoL(CurrentItemIndex()); CleanupStack::PushL(info); /*CAknNoteDialog* note = new (ELeave) CAknNoteDialog; CleanupStack::PushL(note); note->SetTextL(*info); CleanupStack::Pop(); note->PrepareLC(R_HIT_INFO_NOTE); note->RunLD();*/ CAknMessageQueryDialog* dlg = new (ELeave)CAknMessageQueryDialog(); dlg->PrepareLC( R_MESSAGE_QUERY ); dlg->SetMessageTextL(info->Des()); dlg->QueryHeading()->SetTextL(_L("Hit info")); dlg->RunLD(); CleanupStack::PopAndDestroy(); } } break; case EKeyLeftArrow: case EKeyRightArrow: { // Empty FindBox Search Text _LIT(KBlank, ""); FindBox()->SetSearchTextL(KBlank); // Press Backspace on Empty FindBox to Close it TBool refresh = false; TKeyEvent key; key.iCode = 8; key.iScanCode = 1; key.iRepeats = 1; key.iModifiers = 0; AknFind::HandleFindOfferKeyEventL(key, EEventKey, this, ListBox(), FindBox(), ETrue, refresh); } break; default: { if (iFindBox) { TBool needRefresh( EFalse ); TBool flagsOfPopup( EFalse ); if ( AknFind::HandleFindOfferKeyEventL( aKeyEvent, aType, this, iListBox, iFindBox, ETrue, needRefresh ) == EKeyWasConsumed ) { if ( needRefresh ) { SizeChanged(); DrawNow(); } return EKeyWasConsumed; } } } break; } } return EKeyWasNotConsumed; }
TKeyResponse CManualSmsListContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType) { // See if we have a selection TInt code = aKeyEvent.iCode; TInt active = iTabGroup->ActiveTabIndex(); TInt count = iTabGroup->TabCount(); switch(code) { // is navigator button pressed case EKeyLeftArrow: if ( active > 0 ) { active--; iTabGroup->SetActiveTabById(0); if( iPhotosAppUi->iStoragePath == SMS_SENTITEMS) iPhotosAppUi->iStoragePath = SMS_INBOX; if(iReadSmsAO != NULL) { iReadSmsAO->iInboxFlag = 0; iReadSmsAO->iSentItemFlag = 1; iReadSmsAO->ReleaseMtm(); iReadSmsAO->PrepareMtm(SMS_INBOX); } TBuf<20> searchtext; searchtext.Copy(_L("")); iFindBox->SetSearchTextL(searchtext); SizeChanged(); iCursorPos = 0; SetFileList(1); //iListBox->SetCurrentItemIndex(iCursorPos); } break; case EKeyRightArrow: if( (active + 1) < count ) { active++; iTabGroup->SetActiveTabById(1); if( iPhotosAppUi->iStoragePath == SMS_INBOX) iPhotosAppUi->iStoragePath = SMS_SENTITEMS; if(iReadSmsAO != NULL) { iReadSmsAO->iInboxFlag = 1; iReadSmsAO->iSentItemFlag = 0; iReadSmsAO->ReleaseMtm(); iReadSmsAO->PrepareMtm(SMS_SENTITEMS); } TBuf<20> searchtext; searchtext.Copy(_L("")); iFindBox->SetSearchTextL(searchtext); SizeChanged(); iCursorPos = 0; SetFileList(1); //iListBox->SetCurrentItemIndex(iCursorPos); } break; case EKeyUpArrow: if(iCursorPos >= 0) iCursorPos--; if( iPhotosAppUi->iStoragePath == SMS_INBOX) { if(iCursorPos == -1) iCursorPos = iInboxCount-1; } else if( iPhotosAppUi->iStoragePath == SMS_SENTITEMS) { if(iCursorPos == -1) iCursorPos = iSentItemCount-1; } //iCursorPos = iListBox->CurrentItemIndex(); return iListBox->OfferKeyEventL(aKeyEvent, aType); break; case EKeyDownArrow: if( iPhotosAppUi->iStoragePath == SMS_INBOX) { if(iCursorPos < iInboxCount) iCursorPos++; if(iCursorPos == iInboxCount) iCursorPos = 0; } else if( iPhotosAppUi->iStoragePath == SMS_SENTITEMS) { if(iCursorPos < iSentItemCount) iCursorPos++; if(iCursorPos == iSentItemCount) iCursorPos = 0; } //iCursorPos = iListBox->CurrentItemIndex(); return iListBox->OfferKeyEventL(aKeyEvent, aType); break; case 63557: { TInt count=0; if( iPhotosAppUi->iStoragePath == SMS_INBOX) { count = iInboxCount; } else if( iPhotosAppUi->iStoragePath == SMS_SENTITEMS) { count = iSentItemCount; } if(count > 0) MarkUnMarkSelectedItem(); } //return iListBox->OfferKeyEventL(aKeyEvent, aType); break; default: // Let Listbox take care of its key handling //return iListBox->OfferKeyEventL(aKeyEvent, aType); break; } if ( iListBox ) { if ( iFindBox ) { TBool needRefresh( EFalse ); TBool flagsOfPopup( EFalse ); // Offers the key event to find box. if ( AknFind::HandleFindOfferKeyEventL( aKeyEvent, aType, this, iListBox, iFindBox, flagsOfPopup, needRefresh ) ==EKeyWasConsumed ) { if ( needRefresh ) { SizeChangedForFindBox(); DrawNow(); } } //return iListBox->OfferKeyEventL( aKeyEvent, aType ); } //return iListBox->OfferKeyEventL( aKeyEvent, aType ); } return (TKeyResponse)0; }