Пример #1
0
void KisShapeSelectionModel::add(KoShape *child)
{
    if (!m_shapeSelection) return;

    if (m_shapeMap.contains(child))
        return;

    child->setStroke(0);
    child->setBackground( QSharedPointer<KoShapeBackground>(0));
    m_shapeMap.insert(child, child->boundingRect());
    m_shapeSelection->shapeManager()->addShape(child);

    QRect updateRect = child->boundingRect().toAlignedRect();
    if (m_image.isValid()) {
        QTransform matrix;
        matrix.scale(m_image->xRes(), m_image->yRes());
        updateRect = matrix.mapRect(updateRect);
    }

    if (m_shapeMap.count() == 1) {
        // The shape is the first one, so the shape selection just got created
        // Pixel selection provides no longer the datamanager of the selection
        // so update the whole selection
        requestUpdate(QRect());
    } else {
        requestUpdate(updateRect);
    }
}
TransferMethodsModel::TransferMethodsModel(QObject* aParent):
    QAbstractListModel(aParent)
{
    iTransferEngine = new OrgNemoTransferEngine("org.nemo.transferengine",
        "/org/nemo/transferengine", QDBusConnection::sessionBus(), this);
    connect(iTransferEngine,
        SIGNAL(transferMethodListChanged()),
        SLOT(requestUpdate()));
    requestUpdate();
}
Пример #3
0
void DatapickerImage::setPlotImageType(const DatapickerImage::PlotImageType type) {
	d->plotImageType = type;
	if (d->plotImageType == DatapickerImage::ProcessedImage)
		d->discretize();

	emit requestUpdate();
}
Пример #4
0
// Multiple calls to showInstance("inspect_avatar", foo) will provide different
// LLSD for foo, which we will catch here.
//virtual
void LLInspectAvatar::onOpen(const LLSD& data)
{
    // Start open animation
    LLInspect::onOpen(data);

    // Extract appropriate avatar id
    mAvatarID = data["avatar_id"];

    // Position the inspector relative to the mouse cursor
    // Similar to how tooltips are positioned
    // See LLToolTipMgr::createToolTip
    if (data.has("pos"))
    {
        LLUI::positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger());
    }
    else
    {
        LLUI::positionViewNearMouse(this);
    }

    // Generate link to avatar profile.
    getChild<LLUICtrl>("avatar_profile_link")->setTextArg("[LINK]", LLSLURL("agent", mAvatarID, "about").getSLURLString());

    // can't call from constructor as widgets are not built yet
    requestUpdate();

    updateVolumeSlider();
}
void MotionPlayerClient::updateMotion(motionfile::Motion motion)
{
    if(motion.frames.size() < 1)
        return;

    requestUpdate(motion, TYPE_UPDATE_MOTION);
}
Пример #6
0
void Player::use()
{
	Tile* curr = nullptr;
    switch (dir) {
        case kLeft:
            curr = tileAt(worldPos.x, worldPos.y, tileLeft().x, tileLeft().y);
            break;
        case kRight:
            curr = tileAt(worldPos.x, worldPos.y, tileRight().x, tileRight().y);
            break;
        case kDown:
            curr = tileAt(worldPos.x, worldPos.y, tileDown().x, tileDown().y);
            break;
        case kUp:
            curr = tileAt(worldPos.x, worldPos.y, tileUp().x, tileUp().y);
            break;
        default:
            break;
    }
	if (curr != nullptr)
    {
        if (curr->canUse())
        {
            if (curr->use())
            {
                requestUpdate(delegate);
            }
        }
    }
}
Пример #7
0
// currently we don't have a possibility to configure disableDecoration
// if we have an old config this value can be true which is... bad.
// so we upgrade the core stored bufferViewConfig.
// This can be removed with the next release
void ClientBufferViewConfig::ensureDecoration()
{
    if (!disableDecoration())
        return;
    setDisableDecoration(false);
    requestUpdate(toVariantMap());
}
void* InputDeviceAdapterTrackd::spinPollThreadMethod(void)
	{
	Threads::Thread::setCancelState(Threads::Thread::CANCEL_ENABLE);
	Misc::UInt32 lastSensorTime[2]={0U,0U};
	Misc::UInt32 lastControllerTime[2]={0U,0U};
	while(runSpinPollThread)
		{
		/* Spin until the next time the sensor data or controller data time stamps change: */
		while(runSpinPollThread
		      &&sensorHeader->dataTimeStamp[0]==lastControllerTime[0]&&sensorHeader->dataTimeStamp[1]==lastSensorTime[1]
		      &&controllerHeader->dataTimeStamp[0]==lastControllerTime[0]&&controllerHeader->dataTimeStamp[1]==lastControllerTime[1])
			;
		
		/* Trigger a new Vrui frame: */
		requestUpdate();
		
		/* Update the data time stamps: */
		lastSensorTime[0]=sensorHeader->dataTimeStamp[0];
		lastSensorTime[1]=sensorHeader->dataTimeStamp[1];
		lastControllerTime[0]=controllerHeader->dataTimeStamp[0];
		lastControllerTime[1]=controllerHeader->dataTimeStamp[1];
		}
	
	return 0;
	}
Пример #9
0
	void Widget::deleteChildren() {
		Vector_each(Widget*,it,mChildren)
			delete (*it);
		mChildren.clear();
		requestUpdate();
		requestRepaint();
	}
Пример #10
0
UAVObjectBrowserWidget::UAVObjectBrowserWidget(QWidget *parent) : QWidget(parent),
    updatePeriod(MAXIMUM_UPDATE_PERIOD)
{
    // Create browser and configuration GUIs
    m_browser = new Ui_UAVObjectBrowser();
    m_viewoptions = new Ui_viewoptions();
    m_viewoptionsDialog = new QDialog(this);
    m_viewoptions->setupUi(m_viewoptionsDialog);
    m_browser->setupUi(this);

    // Create data model
    m_model = new UAVObjectTreeModel(this);

    // Create tree view and add to layout
    treeView = new UAVOBrowserTreeView(MAXIMUM_UPDATE_PERIOD);
    treeView->setObjectName(QString::fromUtf8("treeView"));
    m_browser->verticalLayout->addWidget(treeView);

    connect(m_browser->saveSDButton, SIGNAL(clicked()), this, SLOT(saveObject()));
    connect(m_browser->readSDButton, SIGNAL(clicked()), this, SLOT(loadObject()));
    connect(m_browser->eraseSDButton, SIGNAL(clicked()), this, SLOT(eraseObject()));
    connect(m_browser->sendButton, SIGNAL(clicked()), this, SLOT(sendUpdate()));
    connect(m_browser->requestButton, SIGNAL(clicked()), this, SLOT(requestUpdate()));
    connect(m_browser->viewSettingsButton,SIGNAL(clicked()),this,SLOT(viewSlot()));


    connect((QTreeView*) treeView, SIGNAL(collapsed(QModelIndex)), this, SLOT(onTreeItemCollapsed(QModelIndex) ));
    connect((QTreeView*) treeView, SIGNAL(expanded(QModelIndex)), this, SLOT(onTreeItemExpanded(QModelIndex) ));

    connect(m_browser->le_searchField, SIGNAL(textChanged(QString)), this, SLOT(searchTextChanged(QString)));
    connect(m_browser->bn_clearSearchField, SIGNAL(clicked()), this, SLOT(searchTextCleared()));

    // Set browser buttons to disabled
    enableUAVOBrowserButtons(false);
}
Пример #11
0
void DesktopDeviceTool::frame(void)
	{
	int aib=axisIndexBase*factory->numValuators;
	
	/* Convert translational axes into translation vector: */
	Vector translation=Vector::zero;
	for(int i=0;i<factory->numTranslationAxes;++i)
		if(factory->translationAxes[i].index>=aib&&factory->translationAxes[i].index<aib+factory->numValuators)
			translation+=factory->translationAxes[i].axis*getDeviceValuator(0,factory->translationAxes[i].index-aib);
	translation*=factory->translateFactor*getFrameTime();
	
	/* Convert rotational axes into rotation axis vector and rotation angle: */
	Vector scaledRotationAxis=Vector::zero;
	for(int i=0;i<factory->numRotationAxes;++i)
		if(factory->rotationAxes[i].index>=aib&&factory->rotationAxes[i].index<aib+factory->numValuators)
			scaledRotationAxis+=factory->rotationAxes[i].axis*getDeviceValuator(0,factory->rotationAxes[i].index-aib);
	scaledRotationAxis*=factory->rotateFactor*getFrameTime();
	
	/* Calculate an incremental transformation for the virtual input device: */
	ONTransform deltaT=ONTransform::translate(translation);
	Point pos=transformedDevice->getPosition();
	deltaT*=ONTransform::translateFromOriginTo(pos);
	deltaT*=ONTransform::rotate(ONTransform::Rotation::rotateScaledAxis(scaledRotationAxis));
	deltaT*=ONTransform::translateToOriginFrom(pos);
	
	/* Update the virtual input device's transformation: */
	deltaT*=transformedDevice->getTransformation();
	deltaT.renormalize();
	transformedDevice->setTransformation(deltaT);
		
	requestUpdate();
	}
// Multiple calls to showInstance("inspect_avatar", foo) will provide different
// LLSD for foo, which we will catch here.
//virtual
void LLInspectAvatar::onOpen(const LLSD& data)
{
	// Start open animation
	LLInspect::onOpen(data);

	// Extract appropriate avatar id
	mAvatarID = data["avatar_id"];

	BOOL self = mAvatarID == gAgent.getID();
	
	getChild<LLUICtrl>("gear_self_btn")->setVisible(self);
	getChild<LLUICtrl>("gear_btn")->setVisible(!self);

	// Position the inspector relative to the mouse cursor
	// Similar to how tooltips are positioned
	// See LLToolTipMgr::createToolTip
	if (data.has("pos"))
	{
		LLUI::positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger());
	}
	else
	{
		LLUI::positionViewNearMouse(this);
	}

	// can't call from constructor as widgets are not built yet
	requestUpdate();

	updateVolumeSlider();

	updateModeratorPanel();
}
UAVObjectBrowserWidget::UAVObjectBrowserWidget(QWidget *parent) : QWidget(parent)
{
    m_browser     = new Ui_UAVObjectBrowser();
    m_viewoptions = new Ui_viewoptions();
    m_viewoptionsDialog = new QDialog(this);
    m_viewoptions->setupUi(m_viewoptionsDialog);
    m_browser->setupUi(this);
    m_model = new UAVObjectTreeModel();
    m_browser->treeView->setModel(m_model);
    m_browser->treeView->setColumnWidth(0, 300);
    // m_browser->treeView->expandAll();
    BrowserItemDelegate *m_delegate = new BrowserItemDelegate();
    m_browser->treeView->setItemDelegate(m_delegate);
    m_browser->treeView->setEditTriggers(QAbstractItemView::AllEditTriggers);
    m_browser->treeView->setSelectionBehavior(QAbstractItemView::SelectItems);
    showMetaData(m_viewoptions->cbMetaData->isChecked());
    connect(m_browser->treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(currentChanged(QModelIndex, QModelIndex)), Qt::UniqueConnection);
    connect(m_viewoptions->cbMetaData, SIGNAL(toggled(bool)), this, SLOT(showMetaData(bool)));
    connect(m_viewoptions->cbCategorized, SIGNAL(toggled(bool)), this, SLOT(categorize(bool)));
    connect(m_browser->saveSDButton, SIGNAL(clicked()), this, SLOT(saveObject()));
    connect(m_browser->readSDButton, SIGNAL(clicked()), this, SLOT(loadObject()));
    connect(m_browser->eraseSDButton, SIGNAL(clicked()), this, SLOT(eraseObject()));
    connect(m_browser->sendButton, SIGNAL(clicked()), this, SLOT(sendUpdate()));
    connect(m_browser->requestButton, SIGNAL(clicked()), this, SLOT(requestUpdate()));
    connect(m_browser->tbView, SIGNAL(clicked()), this, SLOT(viewSlot()));
    connect(m_viewoptions->cbScientific, SIGNAL(toggled(bool)), this, SLOT(useScientificNotation(bool)));
    connect(m_viewoptions->cbScientific, SIGNAL(toggled(bool)), this, SLOT(viewOptionsChangedSlot()));
    connect(m_viewoptions->cbMetaData, SIGNAL(toggled(bool)), this, SLOT(viewOptionsChangedSlot()));
    connect(m_viewoptions->cbCategorized, SIGNAL(toggled(bool)), this, SLOT(viewOptionsChangedSlot()));
    enableSendRequest(false);
}
Пример #14
0
void CoreHighlightSettingsPage::save()
{
    if (!hasChanged())
        return;

    if (!_initialized)
        return;

    auto ruleManager = Client::highlightRuleManager();
    if (ruleManager == nullptr)
        return;

    auto clonedManager = HighlightRuleManager();
    clonedManager.fromVariantMap(ruleManager->toVariantMap());
    clonedManager.clear();

    for (auto &rule : highlightList) {
        clonedManager.addHighlightRule(rule.id, rule.name, rule.isRegEx, rule.isCaseSensitive, rule.isEnabled, false,
                                       rule.sender, rule.chanName);
    }

    for (auto &rule : ignoredList) {
        clonedManager.addHighlightRule(rule.id, rule.name, rule.isRegEx, rule.isCaseSensitive, rule.isEnabled, true,
                                       rule.sender, rule.chanName);
    }

    auto highlightNickType = ui.highlightNicksComboBox->itemData(ui.highlightNicksComboBox->currentIndex()).value<int>();

    clonedManager.setHighlightNick(HighlightRuleManager::HighlightNickType(highlightNickType));
    clonedManager.setNicksCaseSensitive(ui.nicksCaseSensitive->isChecked());

    ruleManager->requestUpdate(clonedManager.toVariantMap());
    setChangedState(false);
    load();
}
Пример #15
0
//slot of the update button click envent
void EvaDetailsWindow::slotUpdateClick()
{
	if(!frd) return;
	if( m_IsMemoPage ){		//if the user is in Memo page and the id is set
		//if the auto uplad checkbutton selected
		m_Memo.name = codec->fromUnicode(leMemoName->text()).data();
		m_Memo.mobile = codec->fromUnicode(leMemoMobile->text()).data();
		m_Memo.telephone = codec->fromUnicode(leMemoTelephone->text()).data();
		m_Memo.address = codec->fromUnicode(leMemoAddress->text()).data();
		m_Memo.email = codec->fromUnicode(leMemoEmail->text()).data();
		m_Memo.zipcode = codec->fromUnicode(leMemoZipCode->text()).data();
		m_Memo.note = codec->fromUnicode(teMemoNote->text()).data();
		if(chbAutoUploadMemo->isChecked()){
			emit memoChanged(frd->getQQ(), m_Memo);
			emit requestUploadMemo(frd->getQQ(), m_Memo);
		}
		else{
			//save memo to local file
			
			emit memoChanged(frd->getQQ(), m_Memo);
			QMessageBox::information(this, i18n( "Store Memo"), i18n( "Store memo successfully"));
		}	
		
	}
	else{
		emit requestUpdate(id);
	}
}
Пример #16
0
	void TwitterPage::recvdAuth (const QString& token, const QString& tokenSecret)
	{
		Settings_->setValue ("token", token);
		Settings_->setValue ("tokenSecret", tokenSecret);
		requestUpdate ();
		TwitterTimer_->start ();
	}
Пример #17
0
 void Node::resetToInitialState()
 {
   mPosition = mInitialPosition;
   mOrientation = mInitialOrientation;
   mScale = mInitialScale;
   requestUpdate();
 }
Пример #18
0
void ButtonInputDeviceTool::frame(void)
	{
	if(isActive()&&numPressedNavButtons>0)
		{
		/* Calculate the current frame time step: */
		double frameTime=getApplicationTime();
		double timeStep=frameTime-lastFrameTime;
		lastFrameTime=frameTime;
		
		/* Update the input device transformation: */
		TrackerState ts=getGrabbedDevice()->getTransformation();
		if(transformationMode==TRANSLATING)
			{
			for(int i=0;i<6;++i)
				if(navButtonStates[i])
					ts.leftMultiply(TrackerState::translate(factory->translations[i]*timeStep));
			}
		else
			{
			Point p=ts.getOrigin();
			ts.leftMultiply(TrackerState::translateToOriginFrom(p));
			for(int i=0;i<6;++i)
				if(navButtonStates[i])
					ts.leftMultiply(TrackerState::rotate(Rotation::rotateScaledAxis(factory->rotations[i]*timeStep)));
			ts.leftMultiply(TrackerState::translateFromOriginTo(p));
			}
		getGrabbedDevice()->setTransformation(ts);
		requestUpdate();
		}
	}
Пример #19
0
void RectTool::onHandleMoved(const QPointF &pos, int handleFlags)
{
	if (d->selectedLayerInfos.size() != 1)
		return;
	
	auto rectLayer = d->selectedLayerInfos.at(0).rectLayer;
	
	if (!rectLayer)
		return;
	
	QPointSet keys;
	
	auto rect = rectLayer->rect();
	keys |= d->rectKeysWithHandleMargin(rect);
	
	auto scenePos = pos * canvas()->transforms()->windowToScene;
	
	double left = rect.left();
	double right = rect.right();
	double top = rect.top();
	double bottom = rect.bottom();
	
	if (handleFlags & Left)
		left = scenePos.x();
	
	if (handleFlags & Right)
		right = scenePos.x();
	
	if (handleFlags & Top)
		top = scenePos.y();
	
	if (handleFlags & Bottom)
		bottom = scenePos.y();
	
	if (right < left)
	{
		std::swap(left, right);
		
		for (RectHandleItem *handle : d->handles)
			handle->invertHandleFlagsLeftRight();
	}
	
	if (bottom < top)
	{
		std::swap(top, bottom);
		
		for (RectHandleItem *handle : d->handles)
			handle->invertHandleFlagsTopBottom();
	}
	
	rect.setCoords(left, top, right, bottom);
	keys |= d->rectKeysWithHandleMargin(rect);
	
	rectLayer->setRect(rect);
	
	emit requestUpdate(keys);
	
	updateGraphicsItems();
}
/**
  * Provides a rotation compensated roll of the device, based on the latest update retrieved from the accelerometer.
  *
  * @return The roll of the device, in radians.
  *
  * @code
  * accelerometer.getRollRadians();
  * @endcode
  */
float MicroBitAccelerometer::getRollRadians()
{
    requestUpdate();
    if (!(status & MICROBIT_ACCELEROMETER_IMU_DATA_VALID))
        recalculatePitchRoll();

    return roll;
}
/******************************************************************************
* Handles notification events generated by the selected object nodes.
******************************************************************************/
void ModificationListModel::onNodeEvent(RefTarget* source, ReferenceEvent* event)
{
	// Update the entire modification list if the ObjectNode has been assigned a new
	// data object, or if the list of display objects has changed.
	if(event->type() == ReferenceEvent::ReferenceChanged || event->type() == ReferenceEvent::ReferenceAdded || event->type() == ReferenceEvent::ReferenceRemoved) {
		requestUpdate();
	}
}
Пример #22
0
void RevolverTool::frame(void)
	{
	/* Call the base class method: */
	TransformTool::frame();
	
	/* Request a rendering update while the animation is going: */
	if(getApplicationTime()<showNumbersTime)
		requestUpdate();
	}
void InputDeviceAdapterDeviceDaemon::errorCallback(const VRDeviceClient::ProtocolError& error)
	{
	/* Log the error message and request a new Vrui frame to wake up the main thread: */
	{
	Threads::Spinlock::Lock errorMessageLock(errorMessageMutex);
	errorMessages.push_back(error.what());
	}
	requestUpdate();
	}
Пример #24
0
void SeasideCache::updateContacts()
{
    typedef QHash<QContactLocalId, SeasideCacheItem>::iterator iterator;
    for (iterator it = m_people.begin(); it != m_people.end(); ++it) {
        if (it->hasCompleteContact)
            m_changedContacts.append(it->contact.localId());
    }
    m_refreshRequired = true;
    requestUpdate();
}
Пример #25
0
void LayerMoveTool::tabletMoveEvent(CanvasTabletEvent *event)
{
	if (!_layerIsDragged) return;
	
	_offset = event->data.pos.toQPoint() - _dragStartPoint;
	
	auto keys = Surface::offsetKeys(_layer->tileKeys(), _offset);
	requestUpdate(keys | _lastKeys);
	_lastKeys = keys;
}
Пример #26
0
void LayerMoveTool::cursorMoveEvent(CanvasCursorEvent *event, int id)
{
	Q_UNUSED(id);
	if (!_layerIsDragged) return;
	
	_offset = event->data.pos.toQPoint() - _dragStartPoint;
	
	auto keys = Surface::offsetKeys(_layer->tileKeys(), _offset);
	requestUpdate(keys | _lastKeys);
	_lastKeys = keys;
}
Пример #27
0
	void Widget::setHeight(int height) {
		bool changed = height != mBounds.height;
		mBounds.height = height;
		updatePaddedBounds();
		requestRepaint();
		if(changed) {
			//fireBoundsChanged();
			ListenerSet_fire(WidgetListener, mWidgetListeners, boundsChanged(this, this->mBounds));
			requestUpdate();
		}
	}
Пример #28
0
	void Widget::setWidth(int width) {
		bool changed = width != mBounds.width;
		mBounds.width = width;
		updatePaddedBounds();
		requestRepaint();
		if(changed) {
			//fireBoundsChanged();
			ListenerSet_fire(WidgetListener, mWidgetListeners, boundsChanged(this, this->mBounds));
			requestUpdate();
		}
	}
Пример #29
0
void KeyframeModel::requestPlay()
{
	requestUpdate();
	motion_player::PlayMotion play;
	play.request.name = m_motion.motionName;

	m_cl_play.call(play);



}
void UAVObjectBrowserWidget::loadObject()
{
    // Load object
    ObjectTreeItem *objItem = findCurrentObjectTreeItem();
    Q_ASSERT(objItem);
    UAVObject *obj = objItem->object();
    Q_ASSERT(obj);
    updateObjectPersistance(ObjectPersistence::OPERATION_LOAD, obj);
    // Retrieve object so that latest value is displayed
    requestUpdate();
}