Beispiel #1
0
void InputWidget::currentChanged(const QModelIndex &current, const QModelIndex &previous)
{
    BufferId currentBufferId = current.data(NetworkModel::BufferIdRole).value<BufferId>();
    BufferId previousBufferId = previous.data(NetworkModel::BufferIdRole).value<BufferId>();

    if (_perChatHistory) {
        //backup
        historyMap[previousBufferId].history = inputLine()->history();
        historyMap[previousBufferId].tempHistory = inputLine()->tempHistory();
        historyMap[previousBufferId].idx = inputLine()->idx();
        historyMap[previousBufferId].inputLine = inputLine()->html();

        //restore
        inputLine()->setHistory(historyMap[currentBufferId].history);
        inputLine()->setTempHistory(historyMap[currentBufferId].tempHistory);
        inputLine()->setIdx(historyMap[currentBufferId].idx);
        inputLine()->setHtml(historyMap[currentBufferId].inputLine);
        inputLine()->moveCursor(QTextCursor::End, QTextCursor::MoveAnchor);

        // FIXME this really should be in MultiLineEdit (and the const int on top removed)
        QTextBlockFormat format = inputLine()->textCursor().blockFormat();
        format.setLeftMargin(leftMargin); // we want a little space between the frame and the contents
        inputLine()->textCursor().setBlockFormat(format);
    }

    NetworkId networkId = current.data(NetworkModel::NetworkIdRole).value<NetworkId>();
    if (networkId == _networkId)
        return;

    setNetwork(networkId);
    updateNickSelector();
    updateEnabledState();
}
Beispiel #2
0
STDMETHODIMP NATNetworkWrap::COMSETTER(Network)(IN_BSTR aNetwork)
{
    LogRelFlow(("{%p} %s: enter aNetwork=%ls\n", this, "NATNetwork::setNetwork", aNetwork));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = setNetwork(BSTRInConverter(aNetwork).str());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave hrc=%Rhrc\n", this, "NATNetwork::setNetwork", hrc));
    return hrc;
}
Beispiel #3
0
void ViTrainer::clear()
{
	setNetwork(NULL);
	setLearningRate(DEFAULT_LEARNING_RATE);
	setIterationLimit(0); //Unlimited
	setErrorLimit(0);
	mCurrentIteration = -1;
	mCurrentError = 1;
	viDeleteAll(mErrorFunctions);
}
Beispiel #4
0
// when API-information is loaded, values are extracted
void TvShow::onShowInfoFilled()
{
    setTitle(info->showInfo->value("Show Name"));
    setStarted(info->showInfo->value("Started"));
    setStatus(info->showInfo->value("Status"));
    setAirtime(info->showInfo->value("Airtime"));
    setNetwork(info->showInfo->value("Network"));
    setGenre(info->showInfo->value("Genres"));
    setLatestEpisode(info->showInfo->value("Latest Episode"));
    setNextEpisode(info->showInfo->value("Next Episode"));
    setImageUrl(info->showInfo->value("Image Url"));

    // All data is loaded, now show can be added to QList
    emit allDataLoaded(this);
}
Beispiel #5
0
void InputWidget::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end)
{
    NetworkId networkId;
    QModelIndex child;
    for (int row = start; row <= end; row++) {
        child = model()->index(row, 0, parent);
        if (NetworkModel::NetworkItemType != child.data(NetworkModel::ItemTypeRole).toInt())
            continue;
        networkId = child.data(NetworkModel::NetworkIdRole).value<NetworkId>();
        if (networkId == _networkId) {
            setNetwork(0);
            updateNickSelector();
            return;
        }
    }
}
Beispiel #6
0
void Wpp::onNetworkOnlineStateChanged(bool isOnline)
{
	qDebug() << "Wpp::onNetworkOnlineStateChanged(" << isOnline << ")";
	if ( !isOnline )
	{
		setHasNetwork(false);

		setNetwork("");
		setIsSlowNetwork(true);
	}
	else
	{
		setHasNetwork(true);

		QNetworkConfiguration networkConfig = networkConfigurationManager.defaultConfiguration();
		QNetworkConfiguration::BearerType bearerType = networkConfig.bearerType();
		qDebug() << "Wpp::onNetworkOnlineStateChanged():default:" << networkConfig.bearerTypeName();
		setNetwork( networkConfig.bearerTypeName() );
		switch ( bearerType )
		{
		case QNetworkConfiguration::BearerUnknown:
			qDebug() << "QNetworkConfiguration::BearerUnknown";
			setIsSlowNetwork(true);
		break;
		case QNetworkConfiguration::BearerEthernet:
			qDebug() << "QNetworkConfiguration::BearerEthernet";
			setIsSlowNetwork(false);
		break;
		case QNetworkConfiguration::BearerWLAN:
			qDebug() << "QNetworkConfiguration::BearerWLAN";
			setIsSlowNetwork(false);
		break;
		case QNetworkConfiguration::Bearer2G:
			qDebug() << "QNetworkConfiguration::Bearer2G";
			setIsSlowNetwork(true);
		break;
		case QNetworkConfiguration::BearerCDMA2000:
			qDebug() << "QNetworkConfiguration::BearerCDMA2000";
			setIsSlowNetwork(true);
		break;
		case QNetworkConfiguration::BearerWCDMA:
			qDebug() << "QNetworkConfiguration::BearerWCDMA";
			setIsSlowNetwork(true);
		break;
		case QNetworkConfiguration::BearerHSPA:
			qDebug() << "QNetworkConfiguration::BearerHSPA";
			setIsSlowNetwork(true);
		break;
		case QNetworkConfiguration::BearerBluetooth:
			qDebug() << "QNetworkConfiguration::BearerBluetooth";
			setIsSlowNetwork(true);
		break;
		case QNetworkConfiguration::BearerWiMAX:
			qDebug() << "QNetworkConfiguration::BearerWiMAX";
			setIsSlowNetwork(true);
		break;
		default:
			qDebug() << "QNetworkConfiguration::default...";
			setIsSlowNetwork(true);

		}
	}
}
Beispiel #7
0
void PDM::remove(){
    QNetworkAccessManager *mgr=new QNetworkAccessManager(this);
    connect(mgr,SIGNAL(finished(QNetworkReply*)),this,SLOT(reply(QNetworkReply*)));
    mgr->post(setNetwork("RemovePDM.php"),setUrl("IdPDM",QString::number(getIdPDM())));

}
Beispiel #8
0
void PDM::add(){
    QNetworkAccessManager *mgr=new QNetworkAccessManager(this);
    connect(mgr,SIGNAL(finished(QNetworkReply*)),this,SLOT(reply(QNetworkReply*)));
    mgr->post(setNetwork("AddPDM.php"),setUrl("IdPDM",QString::number(getIdPDM()), "NomPDM",getNomPDM(),"PrenomPDM",getPrenomPDM()));
}
Beispiel #9
0
void PDM::getPDM(QString i){
        QNetworkAccessManager *mgr=new QNetworkAccessManager(this);
        connect(mgr,SIGNAL(finished(QNetworkReply*)),this,SLOT(parse(QNetworkReply*)));
        mgr->post(setNetwork("GetPDM.php"),setUrl("IdPDM",i));
}
void TrackingAndDetection::getNetwork()
{
    emit(setNetwork(this->network));
}
Beispiel #11
0
void ViTrainer::trainSingle(ViNeuralNetwork *network)
{
	setNetwork(network);
	trainSingle();
}