Ejemplo n.º 1
0
void QOfonoRadioSettings::setModemPath(const QString &path)
{
    if (path == d_ptr->modemPath ||
            path.isEmpty())
        return;

    QStringList removedProperties = d_ptr->properties.keys();

    delete d_ptr->radioSettings;
    d_ptr->radioSettings = new OfonoRadioSettings("org.ofono", path, QDBusConnection::systemBus(),this);

    if (d_ptr->radioSettings->isValid()) {
        d_ptr->modemPath = path;

        connect(d_ptr->radioSettings,SIGNAL(PropertyChanged(QString,QDBusVariant)),
                this,SLOT(propertyChanged(QString,QDBusVariant)));

        QVariantMap properties = d_ptr->radioSettings->GetProperties().value();
        for (QVariantMap::ConstIterator it = properties.constBegin();
             it != properties.constEnd(); ++it) {
            updateProperty(it.key(), it.value());
            removedProperties.removeOne(it.key());
        }

        Q_EMIT modemPathChanged(path);
    }

    foreach (const QString &p, removedProperties)
        updateProperty(p, QVariant());
}
Ejemplo n.º 2
0
void SystemTrayMenu::init()
{
    mVKListMenu = new QMenu(gettext("Virtual Keyboard"), this);
    mSkinMenu = new QMenu(gettext("Skin"), this);
    mMozcHiraganaMenu = new QMenu(gettext("Mozc Edit mode"), this);
    mMozcToolMenu = new QMenu(gettext("Mozc Tool"), this);
    QObject::connect(this, SIGNAL(aboutToHide()), this,
        SLOT(clearMenu()));

    QObject::connect(this, SIGNAL(aboutToShow()), this,
        SLOT(triggerUpdateVKListMenu()));

    QObject::connect(this, SIGNAL(aboutToShow()), this,
        SLOT(truggerUpdateMozcHiraganaMenu()));

    QObject::connect(this, SIGNAL(aboutToShow()), this,
        SLOT(truggerUpdateMozcToolMenu()));

    QObject::connect(this, SIGNAL(aboutToShow()), this,
        SLOT(triggerUpdateIMListMenu()));

    QObject::connect(this, SIGNAL(triggered(QAction*)), this,
        SLOT(menuItemOnClick(QAction *)));

    QObject::connect(mAgent, SIGNAL(execMenu(const QList<KimpanelProperty>)),
        this, SLOT(execMenu(const QList<KimpanelProperty>)));

    QObject::connect(mAgent, SIGNAL(registerProperties(const QList<KimpanelProperty>)),
        this, SLOT(registerProperties(const QList<KimpanelProperty>)));

    QObject::connect(mAgent, SIGNAL(updateProperty(KimpanelProperty)), this,
        SLOT(updateProperty(KimpanelProperty)));
      updateMainMenu();
}
Ejemplo n.º 3
0
bool DoubleDialogEditor::eventFilter(QObject *obj, QEvent *evt) {
  if (evt->type() == QEvent::FocusOut) {
    if (obj == m_editor) {
      if (!m_button->hasFocus()) {
        updateProperty();
        emit closeEditor();
      }
    } else if (obj == m_button) {
      if (!m_editor->hasFocus()) {
        updateProperty();
        emit closeEditor();
      }
    }
  }
  return QWidget::eventFilter(obj, evt);
}
Ejemplo n.º 4
0
void QOfonoMessageWaiting::connectOfono()
{
    bool wasReady = isReady();
    // FIXME: Clearing properties here results in false *Changed signal
    // emissions. Ideally ready() should not be derived from
    // properties.isEmpty(). Also compare with QOfonoSimManager.
    if (d_ptr->messageWaiting) {
        delete d_ptr->messageWaiting;
        d_ptr->messageWaiting = 0;
        d_ptr->properties.clear();
    }

    d_ptr->messageWaiting = new OfonoMessageWaiting("org.ofono", d_ptr->modemPath, QDBusConnection::systemBus(),this);

    if (d_ptr->messageWaiting->isValid()) {
        connect(d_ptr->messageWaiting,SIGNAL(PropertyChanged(QString,QDBusVariant)),
                this,SLOT(propertyChanged(QString,QDBusVariant)));

        QDBusPendingReply<QVariantMap> reply;
        reply = d_ptr->messageWaiting->GetProperties();
        reply.waitForFinished();
        if (reply.isError()) {
            Q_EMIT getPropertiesFailed();
        } else {
            QVariantMap properties = reply.value();
            for (QVariantMap::ConstIterator it = properties.constBegin();
                    it != properties.constEnd(); ++it) {
                updateProperty(it.key(), it.value());
            }
        }
    }

    if (wasReady != isReady())
        Q_EMIT readyChanged();
}
Ejemplo n.º 5
0
void updateTrackProperty() {
  GVariant * metadata = updateProperty(mpris_data->player, "Metadata");
  if (metadata == NULL) {
    return;
  }

  trackChanged(metadata);
  g_variant_unref(metadata);
}
Ejemplo n.º 6
0
void updatePlaybackProperty() {
  GVariant * playback = updateProperty(mpris_data->player, "PlaybackStatus");
  if (playback == NULL) {
    return;
  }

  playbackChanged(g_variant_dup_string(playback, NULL));
  g_variant_unref(playback);
}
Ejemplo n.º 7
0
void updateVolumeProperty() {
  GVariant * volume = updateProperty(mpris_data->player, "Volume");
  if (volume == NULL) {
    return;
  }

  volumeChanged(g_variant_get_double(volume));
  g_variant_unref(volume);
}
Ejemplo n.º 8
0
StringEditor::StringEditor(QtProperty *property, QWidget *parent)
    : QLineEdit(parent), m_property(property) {
  connect(this, SIGNAL(editingFinished()), this, SLOT(updateProperty()));
  QtStringPropertyManager *mgr =
      dynamic_cast<QtStringPropertyManager *>(property->propertyManager());
  if (mgr) {
    setText(mgr->value(property));
  }
}
Ejemplo n.º 9
0
	void PropertyControl::setProperty(PropertyPtr _value)
	{
		unadvice();
		mProperty = _value;
		advice();

		updateCaption();
		updateProperty();
	}
Ejemplo n.º 10
0
/**
 * Open a UserFunctionDialog. Update the property if a file was selected.
 */
void FormulaDialogEditor::runDialog()
{
    MantidQt::MantidWidgets::UserFunctionDialog *dlg = new MantidQt::MantidWidgets::UserFunctionDialog((QWidget*)parent(),getText());
    if (dlg->exec() == QDialog::Accepted)
    {
      setText(dlg->getFormula());
      updateProperty();
    }
}
Ejemplo n.º 11
0
void MainScene::ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent)
{
    if (m_bDragAndDrop) {
        CCPoint point = ccpSub(m_oldPoint, pTouch->getLocation());
        xSkill->setDragAndDropOffset(point);
        updateProperty(NULL);
    }
    
    m_bDragAndDrop = false;
}
void QSGPropertyAnimator::advance(qreal t)
{
    if ((!m_running || m_paused) && !m_runningToEnd)
        return;

    QSGAbstractAnimator::advance(t);

    if (!m_target)
        return;

    QStringList properties;
    if (!m_properties.isEmpty()) {
        properties = m_properties.split(",");
        for (int i = 0; i < properties.count(); i++)
            updateProperty(m_target, properties[i].trimmed());
    } else {
        updateProperty(m_target, m_property);
    }
}
Ejemplo n.º 13
0
bool    Properties::event( QEvent* e )
{
    if ( getTarget() == nullptr &&                      // Catch dynamic properties changes for this only if a target has not been set
         e->type( ) == QEvent::DynamicPropertyChange ) {
        QDynamicPropertyChangeEvent* propertyChangeEvent = static_cast< QDynamicPropertyChangeEvent* >( e );
        updateProperty( propertyChangeEvent->propertyName( ) );
        emit propertiesModified( propertyChangeEvent->propertyName( ) );
    }
    return QObject::event( e );
}
void StringDialogEditor::runDialog()
{
  QSettings settings;
  QString dir = settings.value("Mantid/FitBrowser/ResolutionDir").toString();
  QString StringDialog = QFileDialog::getOpenFileName(this, tr("Open File"),dir);
  if (!StringDialog.isEmpty())
  {
    m_lineEdit->setText(StringDialog);
    updateProperty();
  }
}
Ejemplo n.º 15
0
void PUrlEdit::select()
{
#ifdef PURE_QT
    QString path = m_url;
    if( m_mode == Directory )
	m_url = QFileDialog::getExistingDirectory( m_url,this);
    else
        m_url = QFileDialog::getOpenFileName(m_url, QString::null, this);
    updateProperty(m_url);
    m_edit->setText(m_url);
#endif
}
Ejemplo n.º 16
0
	void PropertyTexturesControl::notifyEndDialog(Dialog* _sender, bool _result)
	{
		mTextureBrowseControl->endModal();

		if (_result)
		{
			Property* proper = getProperty();
			if (proper != nullptr)
				proper->setValue(mTextureBrowseControl->getTextureName(), getTypeName());
			updateProperty();
		}
	}
Ejemplo n.º 17
0
/**
 * Updates the property widget to include the properties of the given property owner.
 */
void RPropertyEditor::updateEditor(RObject& object, bool doUpdateGui,
        RDocument* document) {
    QList<RPropertyTypeId> propertyTypeIds = object.getPropertyTypeIds().toList();
    qSort(propertyTypeIds);
    QList<RPropertyTypeId>::iterator it;
    for (it = propertyTypeIds.begin(); it != propertyTypeIds.end(); ++it) {
        updateProperty(*it, object, document);
    }
    if (doUpdateGui) {
        updateGui();
    }
}
Ejemplo n.º 18
0
void PColorButton::changeColor()
{
#ifdef PURE_QT
   m_color = QColorDialog::getColor(m_color,this);
   updateProperty(m_color);
   m_edit->setText(m_color.name());
   QPixmap px;
   px.resize(14,14);
   px.fill(m_color);
   m_edit->setIconSet(px);

#endif
}
Ejemplo n.º 19
0
bool    Properties::eventFilter( QObject *obj, QEvent* e )
{
    if ( getTarget() != nullptr &&
         getTarget() == obj &&
         e->type( ) == QEvent::DynamicPropertyChange ) {
        QDynamicPropertyChangeEvent* propertyChangeEvent = static_cast< QDynamicPropertyChangeEvent* >( e );
        updateProperty( propertyChangeEvent->propertyName( ) );
        emit propertiesModified( propertyChangeEvent->propertyName( ) );
        return false;
    } else
        return QObject::eventFilter( obj, e );
    return false;
}
Ejemplo n.º 20
0
DoubleEditor::DoubleEditor(QtProperty *property, QWidget *parent)
    : QLineEdit(parent), m_property(property) {
  auto mgr =
      dynamic_cast<QtDoublePropertyManager *>(property->propertyManager());
  if (!mgr) {
    throw std::runtime_error(
        "QtDoublePropertyManager expected as parent of DoubleEditor");
  }

  m_decimals = mgr->decimals(property);
  setValidator(new QDoubleValidator(mgr->minimum(property),
                                    mgr->maximum(property), 20, this));
  connect(this, SIGNAL(editingFinished()), this, SLOT(updateProperty()));
  // double val = mgr->value(property);
  setValue(mgr->value(property));
}
Ejemplo n.º 21
0
Bool MyDestroyICHandler (IMChangeICStruct * call_data)
{
    if (CurrentIC == (IC *) FindIC (call_data->icid)) {
        CloseInputWindow();
        if (!bUseDBus)
            XUnmapWindow (dpy, VKWindow);
    }

    DestroyIC (call_data);
    DestroyICID(call_data->icid);

#ifdef _ENABLE_DBUS
    if (bUseDBus) {
        strcpy(logo_prop.label, "Fcitx");
        updateProperty(&logo_prop);
    }
#endif

    return True;
}
StringDialogEditor::StringDialogEditor(QtProperty *property, QWidget *parent):QWidget(parent),m_property(property)
{
  QHBoxLayout *layout = new QHBoxLayout;
  m_lineEdit = new QLineEdit(this);
  layout->addWidget(m_lineEdit);
  setFocusProxy(m_lineEdit);
  connect(m_lineEdit,SIGNAL(editingFinished()),this,SLOT(updateProperty()));
  QtStringPropertyManager* mgr = dynamic_cast<QtStringPropertyManager*>(property->propertyManager());
  if (mgr)
  {
    m_lineEdit->setText(mgr->value(property));
  }

  QPushButton* button = new QPushButton("...",this);
  button->setMaximumSize(20,1000000);
  connect(button,SIGNAL(clicked()),this,SLOT(runDialog()));
  layout->addWidget(button);
  layout->setContentsMargins(0,0,0,0);
  layout->setSpacing(0);
  layout->setStretchFactor(button,0);
  this->setLayout(layout);
}
Ejemplo n.º 23
0
void updatePositionProperty() {
  const GVariantType * type;
  int64_t pos = 0;
  if (!mpris_data || !mpris_data->player) {
    return;
  }

  GVariant * position = updateProperty(mpris_data->player, "Position");
  if (position == NULL) {
    return;
  }

  type = g_variant_get_type(position);
  if (g_variant_is_of_type(position, G_VARIANT_TYPE_INT32) ||
      g_variant_is_of_type(position, G_VARIANT_TYPE_UINT32) ||
      g_variant_is_of_type(position, G_VARIANT_TYPE_INT64) ||
      g_variant_is_of_type(position, G_VARIANT_TYPE_UINT64)) {
    g_variant_get(position, (char *)type, &pos);
    positionChanged(pos);
  }

  g_variant_unref(position);
}
Ejemplo n.º 24
0
LRESULT CEvfAFMode::OnPropertyChanged(WPARAM wParam, LPARAM lParam)
{
	updateProperty(getCameraModel()->getEvfAFMode());
	return 0;
}
Ejemplo n.º 25
0
void QOfonoRadioSettings::propertyChanged(const QString& property, const QDBusVariant& dbusvalue)
{
    updateProperty(property, dbusvalue.variant());
}
Ejemplo n.º 26
0
//--------------------------------------------------------------
void Tween::update(int a_millis) {
	//cout << "Tween :: update : time= " << _time << " duration+delay= " << _duration + _delay << " running: " << running() << " complete: " << complete() << endl;
	
	if (_useSeconds) {
		if (_isRunning) _time = (float) a_millis - _startTime;
	}
	
	if (_time <= _duration + _delay) {
		//cout << "Tween :: update : time= " << _time << " duration+delay= " << _duration + _delay << " running: " << running() << endl;
		if (_isRunning) {
			if (_time >= _delay) {
				updateProperty();
			}
			if (!_useSeconds) _time += 1.f;
		}
	} else {
		// no events in ofxiPhone right now :( well, maybe now there is. :/
		//ofNotifyEvent(ON_COMPLETE, _event, this);
		
		bool bTweenIsComplete = false;
		// lets check on the repeat //
		if(_repeatTotal == 0) {
			bTweenIsComplete = true;
		} else if(_repeatCount >= _repeatTotal) {
			bTweenIsComplete = true;
		} else {
			_repeatCount++;
		}
		if (_repeatTotal == -1) { // run forever //
			bTweenIsComplete = false;
		}
		
		//cout << "Tween :: update : bTweenIsComplete= " << bTweenIsComplete << " _repeatCount= " << _repeatCount << endl;
		
		if(bTweenIsComplete) {
			_isComplete = true;
			_isRunning = false;
			// let's make sure we hit the initial values //
			if(_dir == 1) {
				*_propAdd = _initEnd;
			} else {
				*_propAdd = _initBegin;
			}
			
		} else {
			if (_useSeconds) {
				_startTime = a_millis;
			} else {
				_time = 0;
			}
			_delay = 0;
			if(_pingPong) {
				_dir = _dir == 1 ? -1 : 1;
			}
			// adjust for the proper direction of the tween //
			if(_dir == 1) {
				_begin		= _initBegin;
				_end		= _initEnd;
				_change		= _end - _begin;
			} else {
				_begin		= _initEnd;
				_end		= _initBegin;
				_change		= _end - _begin;
			}
		}
	}
	
}
Ejemplo n.º 27
0
	void PropertyControl::notifyChangeProperty(PropertyPtr _sender)
	{
		updateProperty();
	}
Ejemplo n.º 28
0
LRESULT CImageQuality::OnPropertyChanged(WPARAM wParam, LPARAM lParam)
{
	updateProperty(getCameraModel()->getImageQuality());
	return 0;
}
Ejemplo n.º 29
0
void MainController::init()
{
    loadCfg();
    qDebug()<<"MainController::init()";
    qmlRegisterType<CandidateWord>();

    mTopLevel = new TopLevel;
    mView = new QDeclarativeView;
    mModel = MainModel::self();
    mModel->setIsHorizontal(mIsHorizontal);

    mSkinBase = new SkinBase;

    mTopLevel->setCenterWidget(mView);

    mView->setContentsMargins(0, 0, 0, 0);
    mView->setResizeMode(QDeclarativeView::SizeViewToRootObject);
    mView->setResizeAnchor(QGraphicsView::AnchorViewCenter);
    mView->viewport()->setAutoFillBackground(false);
    mView->rootContext()->setContextProperty("mainCtrl", this);
    mView->rootContext()->setContextProperty("mainModel", mModel);
    mView->rootContext()->setContextProperty("mainSkin", mSkinBase);
    mView->rootContext()->setContextProperty("mainWidget", mTopLevel);
    mView->setSource(QUrl("qrc:/qml/main.qml"));

    mAgent = new PanelAgent(this);
    mSystemTray = new QSystemTrayIcon(QIcon::fromTheme("fcitx"), this);
    mTrayMenu = new SystemTrayMenu(mAgent);

    mAgent->created();
    mTrayMenu->init();

    mSystemTray->setContextMenu(mTrayMenu);
    mSystemTray->setToolTip("fcitx-qimpanel");
    mSystemTray->show();

    QObject::connect(mAgent,
        SIGNAL(updateProperty(KimpanelProperty)), this,
        SLOT(updateProperty(KimpanelProperty)));

    QObject::connect(mAgent,
        SIGNAL(updatePreeditText(QString, QList<TextAttribute>)),
        this, SLOT(updatePreeditText(QString, QList<TextAttribute>)));

    QObject::connect(mAgent,
        SIGNAL(updateLookupTable(KimpanelLookupTable)),
        this, SLOT(updateLookupTable(KimpanelLookupTable)));

    QObject::connect(mAgent,
        SIGNAL(updateLookupTableFull(KimpanelLookupTable, int, int)),
        this, SLOT(updateLookupTableFull(KimpanelLookupTable, int, int)));

    QObject::connect(mAgent,
        SIGNAL(updateSpotLocation(int, int)),
        this, SLOT(updateSpotLocation(int, int)));

    QObject::connect(mAgent,
        SIGNAL(updateSpotRect(int, int, int, int)),
        this, SLOT(updateSpotRect(int, int, int, int)));

    QObject::connect(mAgent,
        SIGNAL(showPreedit(bool)),
        this, SLOT(showPreedit(bool)));

    QObject::connect(mAgent,
        SIGNAL(showAux(bool)),
        this, SLOT(showAux(bool)));

    QObject::connect(mAgent,
        SIGNAL(updateAux(QString, QList<TextAttribute>)),
        this, SLOT(updateAux(QString, QList<TextAttribute>)));

    QObject::connect(mAgent,
        SIGNAL(showLookupTable(bool)),
        this, SLOT(showLookupTable(bool)));

    QObject::connect(mAgent,
        SIGNAL(updateLookupTableCursor(int)),
        this, SLOT(updateLookupTableCursor(int)));

    QObject::connect(mAgent,
        SIGNAL(updatePreeditCaret(int)),
        this, SLOT(updatePreeditCaret(int)));

//    socketpair(AF_UNIX, SOCK_STREAM, 0, mSigFd);
//    mSocketNotifier = new QSocketNotifier(mSigFd[1], QSocketNotifier::Read, this);
//    connect(mSocketNotifier, SIGNAL(activated(int)), this, SLOT(handleSig()));
    creatDBusService();//创建DBus服务
}
Ejemplo n.º 30
0
void FGameWidget::setActive(bool state)
{
    updateProperty(ui->fgwDialog_Background, "gameSelected", state);
 //   ui->fgwDialog_launchButton->setVisible(state);
}