Beispiel #1
0
status_t BnMediaPlayer::onTransact(
    uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
    switch(code) {
        case DISCONNECT: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            disconnect();
            return NO_ERROR;
        } break;
        case SET_VIDEO_SURFACE: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            sp<ISurface> surface = interface_cast<ISurface>(data.readStrongBinder());
            reply->writeInt32(setVideoSurface(surface));
            return NO_ERROR;
        } break;
        case PREPARE_ASYNC: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            reply->writeInt32(prepareAsync());
            return NO_ERROR;
        } break;
        case START: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            reply->writeInt32(start());
            return NO_ERROR;
        } break;
        case STOP: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            reply->writeInt32(stop());
            return NO_ERROR;
        } break;
        case IS_PLAYING: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            bool state;
            status_t ret = isPlaying(&state);
            reply->writeInt32(state);
            reply->writeInt32(ret);
            return NO_ERROR;
        } break;
        case PAUSE: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            reply->writeInt32(pause());
            return NO_ERROR;
        } break;
        case SEEK_TO: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            reply->writeInt32(seekTo(data.readInt32()));
            return NO_ERROR;
        } break;
        case GET_CURRENT_POSITION: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            int msec;
            status_t ret = getCurrentPosition(&msec);
            reply->writeInt32(msec);
            reply->writeInt32(ret);
            return NO_ERROR;
        } break;
        case GET_DURATION: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            int msec;
            status_t ret = getDuration(&msec);
            reply->writeInt32(msec);
            reply->writeInt32(ret);
            return NO_ERROR;
        } break;
        case RESET: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            reply->writeInt32(reset());
            return NO_ERROR;
        } break;
        case SET_AUDIO_STREAM_TYPE: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            reply->writeInt32(setAudioStreamType(data.readInt32()));
            return NO_ERROR;
        } break;
        case SET_LOOPING: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            reply->writeInt32(setLooping(data.readInt32()));
            return NO_ERROR;
        } break;
        case SET_VOLUME: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            reply->writeInt32(setVolume(data.readFloat(), data.readFloat()));
            return NO_ERROR;
        } break;
        case INVOKE: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            invoke(data, reply);
            return NO_ERROR;
        } break;
        case SET_METADATA_FILTER: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            reply->writeInt32(setMetadataFilter(data));
            return NO_ERROR;
        } break;
        case SUSPEND: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            reply->writeInt32(suspend());
            return NO_ERROR;
        } break;
        case RESUME: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            reply->writeInt32(resume());
            return NO_ERROR;
        } break;
        case GET_METADATA: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            const status_t retcode = getMetadata(data.readInt32(), data.readInt32(), reply);
            reply->setDataPosition(0);
            reply->writeInt32(retcode);
            reply->setDataPosition(0);
            return NO_ERROR;
        } break;
        case SET_AUX_EFFECT_SEND_LEVEL: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            reply->writeInt32(setAuxEffectSendLevel(data.readFloat()));
            return NO_ERROR;
        } break;
        case ATTACH_AUX_EFFECT: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            reply->writeInt32(attachAuxEffect(data.readInt32()));
            return NO_ERROR;
	}break;
        case SET_PARAMETERS: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            reply->writeInt32(setParameters(data.readString8()));
            return NO_ERROR;
        } break;
        default:
            return BBinder::onTransact(code, data, reply, flags);
    }
}
Beispiel #2
0
void CMainWindow::connectSignals()
{
    CChatManager *Manager = CChatManager::instance();
    CNetworkClient *Network = CNetworkClient::instance();
    CBattleManager *BattleManager = CBattleManager::instance();

    connect(ui->ChatTabWidget->tabBar(), SIGNAL(tabCloseRequested(int)), Manager, SLOT(closeChannel(int)));
    connect(ui->ChatTabWidget->tabBar(), SIGNAL(currentChanged(int)), Manager, SLOT(changeCurrentChannel(int)));
    connect(ui->ChatTabWidget->tabBar(), SIGNAL(tabMoved(int,int)), Manager, SLOT(moveChannel(int,int)));
    connect(Manager, SIGNAL(joined(CChannel*)), this, SLOT(createTab(CChannel*)));
    connect(Manager, SIGNAL(closeTab(int)), this, SLOT(removeTab(int)));
    connect(Manager, SIGNAL(currentChanged(CChannel*)), ui->ChatTabWidget->chatView(), SLOT(loadChannel(CChannel*)));
    connect(ui->ChannelsView, SIGNAL(doubleClicked(QModelIndex)), CChatManager::instance(), SLOT(doubleClicked(QModelIndex)));
    connect(ui->ChannelUserView, SIGNAL(doubleClicked(QModelIndex)),
            CUserManager::instance()->chatModel(), SLOT(doubleClicked(QModelIndex)));
    connect(ui->actionChatSend, SIGNAL(triggered()), this, SLOT(sendChat()));
    connect(ui->actionBattleSend, SIGNAL(triggered()), this, SLOT(sendBattle()));
    connect(Manager, SIGNAL(currentChanged(int)), ui->ChatTabWidget->tabBar(), SLOT(setCurrentIndex(int)));
    connect(ui->BattleListView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
            CBattleManager::instance(), SLOT(battleSelected(QModelIndex)));
    connect(ui->BattleListView, SIGNAL(doubleClicked(QModelIndex)), CBattleManager::instance(), SLOT(doubleClicked(QModelIndex)));
    connect(ui->BattlePreviewView, SIGNAL(doubleClicked(QModelIndex)),
            CBattleManager::instance()->battlePreviewModel(), SLOT(doubleClicked(QModelIndex)));
    connect(ui->actionConnect, SIGNAL(triggered()), this, SLOT(showConnectDialog()));
    connect(&ConnectDialog, SIGNAL(connect(QString,int,QString,QString)), Network, SLOT(connectToServer(QString,int,QString,QString)));
    connect(Network, SIGNAL(disconnected()), this, SLOT(networkDisconnected()));
    connect(Network, SIGNAL(connected()), this, SLOT(networkConnected()));
    connect(Network, SIGNAL(multiplayerDisabled()), this, SLOT(disableMultiplayerGUI()));
    connect(Network, SIGNAL(multiplayerEnabled()), this, SLOT(enableMultiplayerGUI()));
    connect(ui->actionDisconnect, SIGNAL(triggered()), Network, SLOT(disconnect()));
    connect(CBattleManager::instance(), SIGNAL(currentMapChanged(CMap*)), ui->MapInfo, SLOT(setMap(CMap*)));
    connect(CBattleroomManager::instance(), SIGNAL(mapChanged(CMap*)), ui->BattleMapInfo, SLOT(setMap(CMap*)));
    connect(CBattleroomManager::instance(), SIGNAL(updateChat(CChannel*)), ui->BattleChatText, SLOT(loadChannel(CChannel*)));
    connect(CBattleroomManager::instance(), SIGNAL(error(int,QString)), this, SLOT(error(int,QString)));
    connect(ui->LeaveBattleButton, SIGNAL(clicked()), CBattleroomManager::instance(), SLOT(leaveBattle()));
    connect(ui->DownloadButton, SIGNAL(clicked()), this, SLOT(execDownload()));

    connect(ui->actionDeleteDownload, SIGNAL(triggered()), this, SLOT(removeDownload()));

    connect(ui->actionDownloadMap, SIGNAL(triggered()), BattleManager, SLOT(downloadMapForBattle()));
    connect(ui->actionDownloadMod, SIGNAL(triggered()), BattleManager, SLOT(downloadModForBattle()));

    connect(ui->DownloadView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showDownloadContextMenu(QPoint)));
    connect(ui->BattleListView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showBattleContextMenu(QPoint)));

    connect(Network, SIGNAL(error(int,QString)), this, SLOT(error(int,QString)));
    connect(CDownloadManager::instance(), SIGNAL(error(int,QString)), this, SLOT(error(int,QString)));
    connect(Manager, SIGNAL(error(int,QString)), this, SLOT(error(int,QString)));
    connect(CDownloadManager::instance(), SIGNAL(error(int,QString)), this, SLOT(error(int,QString)));
    connect(Network, SIGNAL(agreement(QString)), this, SLOT(showAgreement(QString)));

    connect(ui->actionReloadUnitSync, SIGNAL(triggered()), CUnitSync::instance(), SLOT(reload()));
    connect(CUnitSync::instance(), SIGNAL(error(int,QString)), this, SLOT(error(int,QString)));
    connect(CUserManager::instance(), SIGNAL(lobbyUserBattleStatusChanged(CBattleStatus*)),
            this, SLOT(updateBattleStatus(CBattleStatus*)));

    connect(CUnitSync::instance(), SIGNAL(loaded()), this, SLOT(unitsyncLoaded()));
    connect(CUnitSync::instance(), SIGNAL(unloaded()), this, SLOT(unitsyncUnloaded()));

    connect(ui->actionUpdateStatus, SIGNAL(triggered()), this, SLOT(changeBattleStatus()));

    connect(CBattleroomManager::instance(), SIGNAL(battleJoined(CBattle*)), this, SLOT(enableBattleroom(CBattle*)));
    connect(CBattleroomManager::instance(), SIGNAL(battleClosed()), this, SLOT(disableBattleroom()));
    connect(CBattleroomManager::instance(), SIGNAL(gameStarted()), this, SLOT(lockBattleroom()));
    connect(CBattleroomManager::instance(), SIGNAL(gameEnded()), this, SLOT(unlockBattleroom()));
    connect(CBattleroomManager::instance(), SIGNAL(battleStarted()), this, SLOT(onBattleStarted()));
    connect(CBattleroomManager::instance(), SIGNAL(battleEnded()), this, SLOT(onBattleEnded()));
    connect(ui->SelectColorButton, SIGNAL(clicked()), this, SLOT(selectColor()));
    connect(ui->StartBattleButton, SIGNAL(clicked()), CBattleroomManager::instance(), SLOT(startGame()));

    connect(&ColorDialog, SIGNAL(colorSelected(QColor)), this, SLOT(colorSelected(QColor)));
}
VisualDebugger::~VisualDebugger()
{
	disconnect();
}
void stringListEntryWidget::setAllWidgets(QList<stringListEntryWidget*> widgets)
{
	disconnect(0, 0, this, SLOT(verify())) ;
	newValue->setValidator(new stringListEntryValidator(widgets, this)) ;
}
Beispiel #5
0
/*
 * Establish connection for tip
 *
 * If DU is true, we should dial an ACU whose type is AT.
 * The phone numbers are in PN, and the call unit is in CU.
 *
 * If the PN is an '@', then we consult the PHONES file for
 *   the phone numbers.  This file is /etc/phones, unless overriden
 *   by an exported shell variable.
 *
 * The data base files must be in the format:
 *	host-name[ \t]*phone-number
 *   with the possibility of multiple phone numbers
 *   for a single host acting as a rotary (in the order
 *   found in the file).
 */
char *
connect(void)
{
	char *cp = PN;
	char *phnum, string[256];
	FILE *fd;
	int tried = 0;

	if (!DU) {		/* regular connect message */
		if (CM != NULL)
			xpwrite(FD, CM, size(CM));
		logent(value(HOST), "", DV, "call completed");
		return (NULL);
	}
	/*
	 * @ =>'s use data base in PHONES environment variable
	 *        otherwise, use /etc/phones
	 */
	signal(SIGINT, acuabort);
	signal(SIGQUIT, acuabort);
	if (setjmp(jmpbuf)) {
		signal(SIGINT, SIG_IGN);
		signal(SIGQUIT, SIG_IGN);
		printf("\ncall aborted\n");
		logent(value(HOST), "", "", "call aborted");
		if (acu != NULL) {
			boolean(value(VERBOSE)) = FALSE;
			if (conflag)
				disconnect(NULL);
			else
				(*acu->acu_abort)();
		}
		return ("interrupt");
	}
	if ((acu = acutype(AT)) == NULL)
		return ("unknown ACU type");
	if (*cp != '@') {
		while (*cp) {
			for (phnum = cp; *cp && *cp != ','; cp++)
				;
			if (*cp)
				*cp++ = '\0';

			if ((conflag = (*acu->acu_dialer)(phnum, CU))) {
				if (CM != NULL)
					xpwrite(FD, CM, size(CM));
				logent(value(HOST), phnum, acu->acu_name,
					"call completed");
				return (NULL);
			} else
				logent(value(HOST), phnum, acu->acu_name,
					"call failed");
			tried++;
		}
	} else {
		if ((fd = fopen(PH, "r")) == NULL) {
			printf("%s: ", PH);
			return ("can't open phone number file");
		}
		while (fgets(string, sizeof(string), fd) != NULL) {
			for (cp = string; !any(*cp, " \t\n"); cp++)
				;
			if (*cp == '\n') {
				fclose(fd);
				return ("unrecognizable host name");
			}
			*cp++ = '\0';
			if (strcmp(string, value(HOST)))
				continue;
			while (any(*cp, " \t"))
				cp++;
			if (*cp == '\n') {
				fclose(fd);
				return ("missing phone number");
			}
			for (phnum = cp; *cp && *cp != ',' && *cp != '\n'; cp++)
				;
			if (*cp)
				*cp++ = '\0';

			if ((conflag = (*acu->acu_dialer)(phnum, CU))) {
				fclose(fd);
				if (CM != NULL)
					xpwrite(FD, CM, size(CM));
				logent(value(HOST), phnum, acu->acu_name,
					"call completed");
				return (NULL);
			} else
				logent(value(HOST), phnum, acu->acu_name,
					"call failed");
			tried++;
		}
		fclose(fd);
	}
	if (!tried)
		logent(value(HOST), "", acu->acu_name, "missing phone number");
	else
		(*acu->acu_abort)();
	return (tried ? "call failed" : "missing phone number");
}
Beispiel #6
0
void QQuickAnimatorProxyJob::sceneGraphInitialized()
{
    readyToAnimate();
    disconnect(this, SLOT(sceneGraphInitialized()));
}
QtConnectionOwner::~QtConnectionOwner() {
	disconnect();
}
void FormJoinGame::hide()
{
    disconnect(TcpGameConnectionClient::instance(), &TcpGameConnectionClient::notifyError, this, &FormJoinGame::gameJoinError);
    Form::hide();
}
Beispiel #9
0
void PureMaid::changeSelfMode(int mode)
{
    for(int i = 0;i < cardNum;i++)
    {
        for(int j = 0;j < cardNum;j++)
        {
            if(i != j)
            {
                connect(cardButton[i],SIGNAL(changeClicked()),cardButton[j],SLOT(cancelX()));
            }
        }
        for(int j = 0;j < 6;j++)
        {
            if(paintStructX->gameCharacter[5]->color != paintStructX->gameCharacter[j]->color)
            {
                connect(cardButton[i],SIGNAL(changeClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(recoverClick()));
                connect(cardButton[i],SIGNAL(notClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(cancelClick()));
            }
        }
    }
    for(int i = 0;i < 6;i++)
    {
        connect(paintStructX->gameCharacter[i]->characterPic,SIGNAL(changeClicked()),ensure,SLOT(recoverClick()));
        connect(paintStructX->gameCharacter[i]->characterPic,SIGNAL(notClicked()),ensure,SLOT(cancelClick()));
        for(int j = 0;j < 6;j ++)
        {
            if(i != j)
            {
                connect(paintStructX->gameCharacter[i]->characterPic,SIGNAL(changeClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(cancelX()));
            }
        }
    }
    cancel->canBeClicked = true;
    switch(mode)
    {
        case 4://治疗术响应阶段
        {
            cancel->canBeClicked = false;
            //system("pause");
            //system("pause");
            for(int i = 0;i < cardNum;i++)
            {
                if(cardList->getSkillOne(card[i]) == 61)
                {
                    cardButton[i]->canBeClicked = true;
                }
            }
            for(int i = 0;i < cardNum;i++)
            {
                for(int j = 0;j < 6;j++)
                {
                    if(paintStructX->gameCharacter[5]->color != paintStructX->gameCharacter[j]->color)
                    {
                        disconnect(cardButton[i],SIGNAL(changeClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(recoverClick()));
                        disconnect(cardButton[i],SIGNAL(notClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(cancelClick()));
                    }
                    connect(cardButton[i],SIGNAL(changeClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(recoverClick()));
                    connect(cardButton[i],SIGNAL(notClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(cancelClick()));
               }
            }
            //disconnect(ensure,SIGNAL(changeClicked()),this,SLOT(selfReset()));
            break;
        }
        case 5://治愈之光响应阶段
        {
            cancel->canBeClicked = false;
            for(int i = 0;i < 6;i++)
            {
                disconnect(paintStructX->gameCharacter[i]->characterPic,SIGNAL(changeClicked()),ensure,SLOT(recoverClick()));
                disconnect(paintStructX->gameCharacter[i]->characterPic,SIGNAL(notClicked()),ensure,SLOT(cancelClick()));
                for(int j = 0;j < 6;j ++)
                {
                    if(i != j)
                    {
                        disconnect(paintStructX->gameCharacter[i]->characterPic,SIGNAL(changeClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(cancelX()));
                    }
                }
            }
            for(int i = 0;i < cardNum;i++)
            {
                if(cardList->getSkillOne(card[i]) == 62)
                {
                    cardButton[i]->canBeClicked = true;
                }
            }
            for(int i = 0;i < 6;i++)
            {
                connect(paintStructX->gameCharacter[i]->characterPic,SIGNAL(changeClicked()),this,SLOT(countPlus()));
                connect(paintStructX->gameCharacter[i]->characterPic,SIGNAL(notClicked()),this,SLOT(countMinus()));
            }
            for(int i = 0;i < cardNum;i++)
            {
                for(int j = 0;j < 6;j++)
                {
                    if(paintStructX->gameCharacter[5]->color != paintStructX->gameCharacter[j]->color)
                    {
                        disconnect(cardButton[i],SIGNAL(changeClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(recoverClick()));
                        disconnect(cardButton[i],SIGNAL(notClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(cancelClick()));
                    }
                    connect(cardButton[i],SIGNAL(changeClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(recoverClick()));
                    connect(cardButton[i],SIGNAL(notClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(cancelClick()));
                }
            }
            break;
        }
        case 7://圣疗响应阶段
        {
            //system("pause");
            cancel->canBeClicked = false;
            for(int i = 0;i < 6;i++)
            {
                paintStructX->gameCharacter[i]->characterPic->canBeClicked = true;
            }
            connect(ensure,SIGNAL(changeClicked()),this,SLOT(pureCurePlus()));
            //system("pause");
            disconnect(ensure,SIGNAL(changeClicked()),this,SLOT(reset()));
            frame = true;
            //system("pause");
            break;
        }
        case 8://冰霜祷言响应阶段
        {
            cancel->canBeClicked  = false;
            for(int i = 0;i < 6;i++)
            {
                paintStructX->gameCharacter[i]->characterPic->canBeClicked = true;
            }
            break;
        }
    }
}
StreamAdapter::~StreamAdapter() {
    disconnect();
}
void QgsMapToolAdvancedDigitizing::deactivate()
{
    QgsMapToolEdit::deactivate();
    disconnect( mCadDockWidget, SIGNAL( pointChanged( QgsPoint ) ), this, SLOT( cadPointChanged( QgsPoint ) ) );
    mCadDockWidget->disable();
}
WebSocketsClient::~WebSocketsClient() {
    disconnect();
}
WorkerThreadableWebSocketChannel::Bridge::~Bridge()
{
    disconnect();
}
Beispiel #14
0
LBMUIMFlowDialog::LBMUIMFlowDialog(QWidget * parent, capture_file * cfile) :
    QDialog(parent),
    m_ui(new Ui::LBMUIMFlowDialog),
    m_capture_file(cfile),
    m_num_items(0),
    m_packet_num(0),
    m_node_label_width(20)
{
    m_ui->setupUi(this);
    QCustomPlot * sp = m_ui->sequencePlot;

    m_sequence_diagram = new SequenceDiagram(sp->yAxis, sp->xAxis2, sp->yAxis2);
    sp->addPlottable(m_sequence_diagram);
    sp->axisRect()->setRangeDragAxes(sp->xAxis2, sp->yAxis);

    sp->xAxis->setVisible(false);
    sp->xAxis->setPadding(0);
    sp->xAxis->setLabelPadding(0);
    sp->xAxis->setTickLabelPadding(0);
    sp->xAxis2->setVisible(true);
    sp->yAxis2->setVisible(true);

    m_one_em = QFontMetrics(sp->yAxis->labelFont()).height();
    m_ui->horizontalScrollBar->setSingleStep(100 / m_one_em);
    m_ui->verticalScrollBar->setSingleStep(100 / m_one_em);

    sp->setInteractions(QCP::iRangeDrag);

    m_ui->gridLayout->setSpacing(0);
    connect(sp->yAxis, SIGNAL(rangeChanged(QCPRange)), sp->yAxis2, SLOT(setRange(QCPRange)));

    m_context_menu.addAction(m_ui->actionReset);
    m_context_menu.addSeparator();
    m_context_menu.addAction(m_ui->actionMoveRight10);
    m_context_menu.addAction(m_ui->actionMoveLeft10);
    m_context_menu.addAction(m_ui->actionMoveUp10);
    m_context_menu.addAction(m_ui->actionMoveDown10);
    m_context_menu.addAction(m_ui->actionMoveRight1);
    m_context_menu.addAction(m_ui->actionMoveLeft1);
    m_context_menu.addAction(m_ui->actionMoveUp1);
    m_context_menu.addAction(m_ui->actionMoveDown1);
    m_context_menu.addSeparator();
    m_context_menu.addAction(m_ui->actionGoToPacket);

    memset(&m_sequence_analysis, 0, sizeof(m_sequence_analysis));

    m_ui->showComboBox->blockSignals(true);
    m_ui->showComboBox->setCurrentIndex(0);
    m_ui->showComboBox->blockSignals(false);
    m_sequence_analysis.all_packets = TRUE;
    m_sequence_analysis.any_addr = TRUE;

    QPushButton * save_bt = m_ui->buttonBox->button(QDialogButtonBox::Save);
    save_bt->setText(tr("Save As..."));

    // XXX Use recent settings instead
    if (parent)
    {
        resize(parent->width(), parent->height() * 4 / 5);
    }

    connect(m_ui->horizontalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(hScrollBarChanged(int)));
    connect(m_ui->verticalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(vScrollBarChanged(int)));
    connect(sp->xAxis2, SIGNAL(rangeChanged(QCPRange)), this, SLOT(xAxisChanged(QCPRange)));
    connect(sp->yAxis, SIGNAL(rangeChanged(QCPRange)), this, SLOT(yAxisChanged(QCPRange)));
    connect(sp, SIGNAL(mousePress(QMouseEvent*)), this, SLOT(diagramClicked(QMouseEvent*)));
    connect(sp, SIGNAL(mouseMove(QMouseEvent*)), this, SLOT(mouseMoved(QMouseEvent*)));
    connect(sp, SIGNAL(mouseRelease(QMouseEvent*)), this, SLOT(mouseReleased(QMouseEvent*)));
    connect(this, SIGNAL(goToPacket(int)), m_sequence_diagram, SLOT(setSelectedPacket(int)));

    disconnect(m_ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));

    fillDiagram();
}
Beispiel #15
0
 void base_lco::disconnect_nonvirt(naming::id_type const & id)
 {
     disconnect(id);
 }
TelemetryDataRF::~TelemetryDataRF()
{
	disconnect();
}
Beispiel #17
0
/**
 * Update all the MetaData and art on an "item-changed" event
 **/
void MetaPanel::update( input_item_t *p_item )
{
    if( !p_item )
    {
        clear();
        return;
    }

    /* Don't update if you are in edit mode */
    if( b_inEditMode ) return;
    p_input = p_item;

    char *psz_meta;
#define UPDATE_META( meta, widget ) {                                   \
    psz_meta = input_item_Get##meta( p_item );                          \
    widget->setText( !EMPTY_STR( psz_meta ) ? qfu( psz_meta ) : "" );   \
    free( psz_meta ); }

#define UPDATE_META_INT( meta, widget ) {           \
    psz_meta = input_item_Get##meta( p_item );      \
    if( !EMPTY_STR( psz_meta ) )                    \
        widget->setValue( atoi( psz_meta ) ); }     \
    free( psz_meta );

    /* Name / Title */
    psz_meta = input_item_GetTitleFbName( p_item );
    if( psz_meta )
    {
        title_text->setText( qfu( psz_meta ) );
        free( psz_meta );
    }
    else
        title_text->setText( "" );

    /* URL / URI */
    psz_meta = input_item_GetURI( p_item );
    if( !EMPTY_STR( psz_meta ) )
        emit uriSet( qfu( psz_meta ) );
    fingerprintButton->setVisible( Chromaprint::isSupported( QString( psz_meta ) ) );
    free( psz_meta );

    /* Other classic though */
    UPDATE_META( Artist, artist_text );
    UPDATE_META( Genre, genre_text );
    UPDATE_META( Copyright, copyright_text );
    UPDATE_META( Album, collection_text );
    disconnect( description_text, SIGNAL(textChanged()), this,
                SLOT(enterEditMode()) );
    UPDATE_META( Description, description_text );
    CONNECT( description_text, textChanged(), this, enterEditMode() );
    UPDATE_META( Language, language_text );
    UPDATE_META( NowPlaying, nowplaying_text );
    UPDATE_META( Publisher, publisher_text );
    UPDATE_META( EncodedBy, encodedby_text );

    UPDATE_META( Date, date_text );
    UPDATE_META( TrackNum, seqnum_text );
    UPDATE_META( TrackTotal, seqtot_text );
//    UPDATE_META( Setting, setting_text );
//    UPDATE_META_INT( Rating, rating_text );

    /* URL */
    psz_meta = input_item_GetURL( p_item );
    if( !EMPTY_STR( psz_meta ) )
    {
        QString newURL = qfu(psz_meta);
        if( currentURL != newURL )
        {
            currentURL = newURL;
            lblURL->setText( "<a href='" + currentURL + "'>" +
                             currentURL.remove( QRegExp( ".*://") ) + "</a>" );
        }
    }
    free( psz_meta );
#undef UPDATE_META_INT
#undef UPDATE_META

    // If a artURL is available as a local file, directly display it !

    QString file;
    char *psz_art = input_item_GetArtURL( p_item );
    if( psz_art )
    {
        char *psz = vlc_uri2path( psz_art );
        free( psz_art );
        file = qfu( psz );
        free( psz );
    }

    art_cover->showArtUpdate( file );
    art_cover->setItem( p_item );
}
Beispiel #18
0
DictClient::~DictClient()
{
	disconnect();
}
QtConnectionOwner &QtConnectionOwner::operator=(QtConnectionOwner &&other) {
	disconnect();
	_data = base::take(other._data);
	return *this;
}
Beispiel #20
0
bool DictClient::parse(gchar *line, int status_code)
{
	g_debug("get %s\n", line);

	if (!cmd_.get()) {
		if (status_code == STATUS_CONNECT)
			is_connected_ = true;
		else if (status_code == STATUS_SERVER_DOWN ||
			 status_code == STATUS_SHUTDOWN) {
			gchar *mes =
				g_strdup_printf("Unable to connect to the "
						"dictionary server at '%s:%d'. "
						"The server replied with code"
						" %d (server down)",
						host_.c_str(), port_,
						status_code);
			on_error_.emit(mes);
			g_free(mes);
			return true;
		} else {
			gchar *mes =
				g_strdup_printf("Unable to parse the dictionary"
						" server reply: '%s'", line);
			on_error_.emit(mes);
			g_free(mes);
			return false;
		}
	}

	bool success = false;

	switch (status_code) {
	case STATUS_BAD_PARAMETERS:
	{
		gchar *mes = g_strdup_printf("Bad parameters for command '%s'",
					     cmd_->query().c_str());
		on_error_.emit(mes);
		g_free(mes);
		cmd_->state_ = DICT::Cmd::FINISH;
		break;
	}
	case STATUS_BAD_COMMAND:
	{
		gchar *mes = g_strdup_printf("Bad command '%s'",
					     cmd_->query().c_str());
		on_error_.emit(mes);
		g_free(mes);
		cmd_->state_ = DICT::Cmd::FINISH;
		break;
	}
	default:
		success = true;
		break;
	}

	if (cmd_->state_ == DICT::Cmd::START) {
		GError *err = NULL;
		cmd_->send(channel_, err);
		if (err) {
			on_error_.emit(err->message);
			g_error_free(err);
			return false;
		}
		return true;
	}

	if (status_code == STATUS_OK || cmd_->state_ == DICT::Cmd::FINISH ||
	    status_code == STATUS_NO_MATCH ||
	    status_code == STATUS_BAD_DATABASE ||
	    status_code == STATUS_BAD_STRATEGY ||
	    status_code == STATUS_NO_DATABASES_PRESENT ||
	    status_code == STATUS_NO_STRATEGIES_PRESENT) {
		defmap_.clear();
		const DICT::DefList& res = cmd_->result();
		if (simple_lookup_) {
			IndexList ilist(res.size());
			for (size_t i = 0; i < res.size(); ++i) {
				ilist[i] = last_index_;
				defmap_.insert(std::make_pair(last_index_++, res[i]));
			}
			last_index_ = 0;
			cmd_.reset(0);
			disconnect();
			on_simple_lookup_end_.emit(ilist);
		} else {
			StringList slist;
			for (size_t i = 0; i < res.size(); ++i)
				slist.push_back(res[i].word_);
			last_index_ = 0;
			cmd_.reset(0);
			disconnect();
			on_complex_lookup_end_.emit(slist);
		}

		return success;
	}

	if (!cmd_->parse(line, status_code))
		return false;


	return true;
}
void ThreadedGLWidgetWrapper::stopTriggerTimer()
{
	tTriggerTimer.stop();
	disconnect(&tTriggerTimer, SIGNAL(timeout()), this, SLOT(incrementTriggerCount()));
}
void CloseEventFilter::cancelStopApplication()
{
    disconnect(m_downloadManager, &DownloadManager::allTransfersCompleted,
               this, &CloseEventFilter::stopApplication);
    m_shutdownWatchdog.stop();
}
bool SourceViewerWidget::findText(const QString &text, WebWidget::FindFlags flags)
{
	const bool isTheSame = (text == m_findText);

	m_findText = text;
	m_findFlags = flags;

	if (!text.isEmpty())
	{
		QTextDocument::FindFlags nativeFlags;

		if (flags.testFlag(WebWidget::BackwardFind))
		{
			nativeFlags |= QTextDocument::FindBackward;
		}

		if (flags.testFlag(WebWidget::CaseSensitiveFind))
		{
			nativeFlags |= QTextDocument::FindCaseSensitively;
		}

		QTextCursor findTextCursor = m_findTextAnchor;

		if (!isTheSame)
		{
			findTextCursor = textCursor();
		}
		else if (!flags.testFlag(WebWidget::BackwardFind))
		{
			findTextCursor.setPosition(findTextCursor.selectionEnd(), QTextCursor::MoveAnchor);
		}

		m_findTextAnchor = document()->find(text, findTextCursor, nativeFlags);

		if (m_findTextAnchor.isNull())
		{
			m_findTextAnchor = textCursor();
			m_findTextAnchor.setPosition((flags.testFlag(WebWidget::BackwardFind) ? (document()->characterCount() - 1) : 0), QTextCursor::MoveAnchor);
			m_findTextAnchor = document()->find(text, m_findTextAnchor, nativeFlags);
		}

		if (!m_findTextAnchor.isNull())
		{
			const QTextCursor currentTextCursor = textCursor();

			disconnect(this, SIGNAL(cursorPositionChanged()), this, SLOT(updateTextCursor()));

			setTextCursor(m_findTextAnchor);
			ensureCursorVisible();

			const QPoint position(horizontalScrollBar()->value(), verticalScrollBar()->value());

			setTextCursor(currentTextCursor);

			horizontalScrollBar()->setValue(position.x());
			verticalScrollBar()->setValue(position.y());

			connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(updateTextCursor()));
		}
	}

	m_findTextSelection = m_findTextAnchor;

	updateSelection();

	return !m_findTextAnchor.isNull();
}
Beispiel #24
0
QYoutubeChatEx::~QYoutubeChatEx()
{   
   //YoutubeApi y = new O2Facebook();
    disconnect();
}
Beispiel #25
0
void So2sdr::showDupesheet(int nr, int checkboxState)
{
    if (checkboxState == Qt::Unchecked) {
        // need to disconnect, otherwise signal will toggle checkbox again and
        // reopen the dupesheet
        disconnect(dupesheet[nr], SIGNAL(destroyed()), dupesheetCheckBox[nr], SLOT(toggle()));
        // save window position
        if (dupesheet[nr]) {
            switch (nr) {
            case 0: settings->beginGroup("DupeSheetWindow1"); break;
            case 1: settings->beginGroup("DupeSheetWindow2"); break;
            }
            settings->setValue("size",dupesheet[nr]->size());
            settings->setValue("pos", dupesheet[nr]->pos());
            settings->endGroup();
        }
        dupesheet[nr]->close();
        dupesheet[nr]=0;
        nDupesheet--;
        // if we still have one dupesheet open, repopulate it
        if (nDupesheet==1) populateDupesheet();
    } else {
        if (!dupesheet[nr]) {
            dupesheet[nr] = new DupeSheet(this);
            dupesheet[nr]->setWindowIcon(QIcon(dataDirectory() + "/icon24x24.png"));
            dupesheet[nr]->installEventFilter(this);
            dupesheet[nr]->setAttribute(Qt::WA_DeleteOnClose);
            dupesheet[nr]->setFocusPolicy(Qt::NoFocus);
            dupesheet[nr]->Dupes0->setFocusPolicy(Qt::NoFocus);
            dupesheet[nr]->Dupes0->setLineWrapMode(QTextEdit::NoWrap);
            dupesheet[nr]->Dupes0->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
            dupesheet[nr]->Dupes1->setFocusPolicy(Qt::NoFocus);
            dupesheet[nr]->Dupes1->setLineWrapMode(QTextEdit::NoWrap);
            dupesheet[nr]->Dupes1->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
            dupesheet[nr]->Dupes2->setFocusPolicy(Qt::NoFocus);
            dupesheet[nr]->Dupes2->setLineWrapMode(QTextEdit::NoWrap);
            dupesheet[nr]->Dupes2->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
            dupesheet[nr]->Dupes3->setFocusPolicy(Qt::NoFocus);
            dupesheet[nr]->Dupes3->setLineWrapMode(QTextEdit::NoWrap);
            dupesheet[nr]->Dupes3->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
            dupesheet[nr]->Dupes4->setFocusPolicy(Qt::NoFocus);
            dupesheet[nr]->Dupes4->setLineWrapMode(QTextEdit::NoWrap);
            dupesheet[nr]->Dupes4->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
            dupesheet[nr]->Dupes5->setFocusPolicy(Qt::NoFocus);
            dupesheet[nr]->Dupes5->setLineWrapMode(QTextEdit::NoWrap);
            dupesheet[nr]->Dupes5->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
            dupesheet[nr]->Dupes6->setFocusPolicy(Qt::NoFocus);
            dupesheet[nr]->Dupes6->setLineWrapMode(QTextEdit::NoWrap);
            dupesheet[nr]->Dupes6->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
            dupesheet[nr]->Dupes7->setFocusPolicy(Qt::NoFocus);
            dupesheet[nr]->Dupes7->setLineWrapMode(QTextEdit::NoWrap);
            dupesheet[nr]->Dupes7->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
            dupesheet[nr]->Dupes8->setFocusPolicy(Qt::NoFocus);
            dupesheet[nr]->Dupes8->setLineWrapMode(QTextEdit::NoWrap);
            dupesheet[nr]->Dupes8->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
            dupesheet[nr]->Dupes9->setFocusPolicy(Qt::NoFocus);
            dupesheet[nr]->Dupes9->setLineWrapMode(QTextEdit::NoWrap);
            dupesheet[nr]->Dupes9->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

            // restore geometry
            switch (nr) {
            case 0: settings->beginGroup("DupeSheetWindow1"); break;
            case 1: settings->beginGroup("DupeSheetWindow2"); break;
            }
            dupesheet[nr]->resize(settings->value("size", QSize(750, 366)).toSize());
            dupesheet[nr]->move(settings->value("pos", QPoint(400, 400)).toPoint());
            settings->endGroup();
        }
        nDupesheet++;
        populateDupesheet();
        dupesheet[nr]->show();
        connect(dupesheet[nr], SIGNAL(destroyed()), dupesheetCheckBox[nr], SLOT(toggle()));
    }
}
Beispiel #26
0
/**
  * Camera listener - destructor
  */
CButCobDisplay::CNotifyCameraListener::~CNotifyCameraListener()
{
    disconnect();
}
Beispiel #27
0
/*virtual*/
void AbstractItemView::setModel(QAbstractItemModel *model, AbstractViewItem *prototype)
{    
    if( m_model == model || !model)
        return;

    if (m_model) {
        disconnect(m_model, SIGNAL(destroyed()),
                   this, SLOT(_q_modelDestroyed()));
        disconnect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
                   this, SLOT( dataChanged(QModelIndex,QModelIndex)));
        disconnect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)),
                   this, SLOT(rowsInserted(QModelIndex,int,int)));
        disconnect(m_model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
                   this, SLOT(rowsRemoved(QModelIndex,int,int)));
        disconnect(m_model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
                   this, SLOT(rowsAboutToBeRemoved(QModelIndex,int,int)));
        disconnect(m_model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
                   this, SLOT(rowsAboutToBeInserted(QModelIndex,int,int)));
        disconnect(m_model, SIGNAL(columnsInserted(QModelIndex,int,int)),
                   this, SLOT(columnsInserted(QModelIndex,int,int)));
        disconnect(m_model, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)),
                   this, SLOT(columnsAboutToBeInserted(QModelIndex,int,int)));
        disconnect(m_model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
                   this, SLOT(columnsRemoved(QModelIndex,int,int)));
        disconnect(m_model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)),
                   this, SLOT(columnsAboutToBeRemoved(QModelIndex,int,int)));
        disconnect(m_model, SIGNAL(modelReset()), this, SLOT(reset()));
        disconnect(m_model, SIGNAL(layoutChanged()), this, SLOT(_q_layoutChanged()));

        m_model = 0;
    }

    setSelectionModel(0);

    m_currentIndex = QModelIndex();
    m_rootIndex = QModelIndex();

    m_model = model;

    Q_ASSERT_X(m_model->index(0,0) == m_model->index(0,0),
               "AbstractItemView::setModel",
               "A model should return the exact same index "
               "(including its internal id/pointer) when asked for it twice in a row.");
    Q_ASSERT_X(m_model->index(0,0).parent() == QModelIndex(),
               "AbstractItemView::setModel",
               "The parent of a top level index should be invalid");


    connect(m_model, SIGNAL(destroyed()), this, SLOT(modelDestroyed()));
    connect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
            this, SLOT( dataChanged(QModelIndex,QModelIndex)));
    connect(m_model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
            this, SLOT(rowsAboutToBeInserted(QModelIndex,int,int)));
    connect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)),
            this, SLOT(rowsInserted(QModelIndex,int,int)));
    connect(m_model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
            this, SLOT(rowsAboutToBeRemoved(QModelIndex,int,int)));
    connect(m_model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
            this, SLOT(rowsRemoved(QModelIndex,int,int)));
    connect(m_model, SIGNAL(modelReset()), this, SLOT(reset()));
    connect(m_model, SIGNAL(layoutChanged()), this, SLOT(layoutChanged()));

    setSelectionModel(new QItemSelectionModel(m_model));

    if (prototype && m_container) {
        m_container->setItemPrototype(prototype);
        m_container->reset();
    }
}
Beispiel #28
0
HttpClient::~HttpClient()
{
	disconnect();
	g_free(buffer);
}
Beispiel #29
0
void ResultsTree::contextMenuEvent(QContextMenuEvent * e)
{
    QModelIndex index = indexAt(e->pos());
    if (index.isValid()) {
        bool multipleSelection = false;
        mSelectionModel = selectionModel();
        if (mSelectionModel->selectedRows().count() > 1)
            multipleSelection = true;

        mContextItem = mModel.itemFromIndex(index);

        //Create a new context menu
        QMenu menu(this);

        //Store all applications in a list
        QList<QAction*> actions;

        //Create a signal mapper so we don't have to store data to class
        //member variables
        QSignalMapper *signalMapper = new QSignalMapper(this);

        if (mContextItem && mApplications->GetApplicationCount() > 0 && mContextItem->parent()) {
            //Go through all applications and add them to the context menu
            for (int i = 0; i < mApplications->GetApplicationCount(); i++) {
                //Create an action for the application
                const Application app = mApplications->GetApplication(i);
                QAction *start = new QAction(app.getName(), &menu);
                if (multipleSelection)
                    start->setDisabled(true);

                //Add it to our list so we can disconnect later on
                actions << start;

                //Add it to context menu
                menu.addAction(start);

                //Connect the signal to signal mapper
                connect(start, SIGNAL(triggered()), signalMapper, SLOT(map()));

                //Add a new mapping
                signalMapper->setMapping(start, i);
            }

            connect(signalMapper, SIGNAL(mapped(int)),
                    this, SLOT(Context(int)));
        }

        // Add menuitems to copy full path/filename to clipboard
        if (mContextItem) {
            if (mApplications->GetApplicationCount() > 0) {
                menu.addSeparator();
            }

            //Create an action for the application
            QAction *copyfilename 	= new QAction(tr("Copy filename"), &menu);
            QAction *copypath 		= new QAction(tr("Copy full path"), &menu);
            QAction *copymessage 	= new QAction(tr("Copy message"), &menu);
            QAction *hide        	= new QAction(tr("Hide"), &menu);

            if (multipleSelection) {
                copyfilename->setDisabled(true);
                copypath->setDisabled(true);
                copymessage->setDisabled(true);
            }

            menu.addAction(copyfilename);
            menu.addAction(copypath);
            menu.addAction(copymessage);
            menu.addAction(hide);

            connect(copyfilename, SIGNAL(triggered()), this, SLOT(CopyFilename()));
            connect(copypath, SIGNAL(triggered()), this, SLOT(CopyFullPath()));
            connect(copymessage, SIGNAL(triggered()), this, SLOT(CopyMessage()));
            connect(hide, SIGNAL(triggered()), this, SLOT(HideResult()));
        }

        //Start the menu
        menu.exec(e->globalPos());

        if (mContextItem && mApplications->GetApplicationCount() > 0 && mContextItem->parent()) {
            //Disconnect all signals
            for (int i = 0; i < actions.size(); i++) {

                disconnect(actions[i], SIGNAL(triggered()), signalMapper, SLOT(map()));
            }

            disconnect(signalMapper, SIGNAL(mapped(int)),
                       this, SLOT(Context(int)));
            //And remove the signal mapper
            delete signalMapper;
        }

    }
Beispiel #30
0
UDPTransmit::UDPTransmit(Family family) : UDPSocket(family)
{
	disconnect();
	shutdown(so, 0);
	receiveBuffer(0);
}