Exemple #1
0
AddressEditWidget::AddressEditWidget(DeviceExplorerModel* model, QWidget* parent):
    QWidget{parent},
    m_model{model}
{
    setAcceptDrops(true);
    auto lay = new iscore::MarginLess<QHBoxLayout>{this};

    m_lineEdit = new AddressLineEdit{this};

    connect(m_lineEdit, &QLineEdit::editingFinished,
            [&]() {
        m_address = State::Address::fromString(m_lineEdit->text());
        emit addressChanged(m_address);
    });

    m_lineEdit->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(m_lineEdit, &QLineEdit::customContextMenuRequested,
            this, &AddressEditWidget::customContextMenuEvent);
    if(model)
    {
        // LineEdit completion
        m_lineEdit->setCompleter(new DeviceCompleter {model, this});
    }

    lay->addWidget(m_lineEdit);
}
Exemple #2
0
void TcpSocket::setAddress(QString a)
{
    if(address != a){
        address = a;
        Q_EMIT addressChanged(a);
    }
}
Exemple #3
0
void FoursquareItem::setAddress(const QString& address)
{
    if( address != m_address ) {
        m_address = address;
        emit addressChanged();
    }
}
shipTo::shipTo(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  connect(_shipToNumber, SIGNAL(editingFinished()), this, SLOT(sPopulateNumber()));
  connect(_save, SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_salesRep, SIGNAL(newID(int)), this, SLOT(sPopulateCommission(int)));
  connect(_address, SIGNAL(addressChanged(QString,QString,QString,QString,QString,QString, QString)),
          _contact, SLOT(setNewAddr(QString,QString,QString,QString,QString,QString, QString)));

  _shipZone->populate( "SELECT shipzone_id, shipzone_name "
                       "FROM shipzone "
                       "ORDER BY shipzone_name;" );

  _commission->setValidator(omfgThis->percentVal());

  _shiptoid = -1;
  
  //If not multi-warehouse hide whs control
  if (!_metrics->boolean("MultiWhs"))
  {
    _sellingWarehouseLit->hide();
    _sellingWarehouse->hide();
  }
  else
    _sellingWarehouse->setId(_preferences->value("PreferredWarehouse").toInt());
}
Exemple #5
0
void Marker::setAddress(QGeoAddress addr)
{
    if (d->address != addr) {
        d->address = addr;
        emit addressChanged(d->address);
    }
}
Exemple #6
0
warehouse::warehouse(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
    : XDialog(parent, name, modal, fl),
    _mode(cView),
    _warehousid(-1)
{
  setupUi(this);

  connect(_code,       SIGNAL(editingFinished()), this, SLOT(sCheck()));
  connect(_delete,       SIGNAL(clicked()), this, SLOT(sDeleteZone()));
  connect(_edit,         SIGNAL(clicked()), this, SLOT(sEditZone()));
  connect(_new,          SIGNAL(clicked()), this, SLOT(sNewZone()));
  connect(_save,         SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_standard, SIGNAL(toggled(bool)), this, SLOT(sHandleWhsType()));
  connect(_transit,  SIGNAL(toggled(bool)), this, SLOT(sHandleWhsType()));

  connect(_address, SIGNAL(addressChanged(QString,QString,QString,QString,QString,QString, QString)),
          _contact, SLOT(setNewAddr(QString,QString,QString,QString,QString,QString, QString)));

  _whsezone->addColumn(tr("Name"), _itemColumn, Qt::AlignCenter, true, "whsezone_name");
  _whsezone->addColumn(tr("Description"),   -1, Qt::AlignLeft,   true, "whsezone_descrip");

  if (!_metrics->boolean("MultiWhs"))
  {
    _active->setChecked(true);
    _active->hide();
  }

  _standard->setVisible(_metrics->boolean("MultiWhs"));
  _transit->setVisible(_metrics->boolean("MultiWhs"));
}
void QDeclarativeGeoPlace::setAddress(QDeclarativeGeoAddress* address)
{
    if (m_declarativeAddress.address() == address->address())
        return;
    m_declarativeAddress.setAddress(address->address());
    emit addressChanged();
}
void Customer::setAddress(const QString &newAddress) {
    if (m_address != newAddress) {
        QString oldAddress = m_address;
        m_address=newAddress;
        addressChanged(newAddress);
    }   
}
Exemple #9
0
void Transfer::setAddress(const QHostAddress &address)
{
    if (_address != address) {
        _address = address;
        SYNC(ARG(address));
        emit addressChanged(address);
    }
}
Exemple #10
0
void NetNode::setAddress(raw_address addr, bool emitSignal){
	localAddress = addr;
	localAddress.updateBuffer();

	qDebug() << "NetNode::setAddress - Name=" << name <<" address set to " << localAddress.toString().c_str();

	if(emitSignal){
		emit addressChanged();
	}
}
/*!
    \qmlproperty Address QtPositioning::Location::address

    This property holds the address of the location which can be use to retrieve address details of the location.
*/
void QDeclarativeGeoLocation::setAddress(QDeclarativeGeoAddress *address)
{
    if (m_address == address)
        return;

    if (m_address && m_address->parent() == this)
        delete m_address;

    m_address = address;
    emit addressChanged();
}
Exemple #12
0
void ProcessModel::setAddress(const ::State::Address &arg)
{
    if(m_address == arg)
    {
        return;
    }

    m_address = arg;
    emit addressChanged(arg);
    emit m_curve->changed();
}
void AddressCluster::emitAddressChanged()
{
  emit addressChanged(
      _addr1->text(),
      _addr2->text(),
      _addr3->text(),
      _city->text(),
      _state->currentText(),
      _postalcode->text(),
      _country->currentText());
}
Exemple #14
0
void Server::setAddress(QString arg)
{
    if (m_address == arg) return;

    bool wasRunning = m_running;
    if (m_running) this->stop();

    m_address = arg;
    emit addressChanged(arg);

    if (wasRunning) this->start();
}
void QDeclarativeGeocodeModel::setAddress(QDeclarativeGeoAddress *address)
{
    if (address_.address() == address->address())
        return;

    address_.setAddress(address->address());

    emit addressChanged(&address_);

    if (complete_)
        update();
}
/*!
    \qmlproperty QGeoLocation QtPositioning::Location::location

    For details on how to use this property to interface between C++ and QML see
    "\l {positioning-cpp-qml.html#location} {Interfaces between C++ and QML Code}".
*/
void QDeclarativeGeoLocation::setLocation(const QGeoLocation &src)
{
    if (m_address && m_address->parent() == this) {
        m_address->setAddress(src.address());
    } else if (!m_address || m_address->parent() != this) {
        m_address = new QDeclarativeGeoAddress(src.address(), this);
        emit addressChanged();
    }

    setCoordinate(src.coordinate());
    setBoundingBox(src.boundingBox());
}
Exemple #17
0
bool MClient::setAddress(const QString &addr){
    /*  se l'indirizzo è diverso da quello precedente                                               */
    if(m_addr != addr){
        /*  cambio l'indirizzo                                                                      */
        m_addr = addr;
        /*  ed emetto il segnale                                                                    */
        emit addressChanged(addr);
        /*  ritorno true                                                                            */
        return true;
    }
    /*  altrimenti ritorno false                                                                    */
    return false;
}
Exemple #18
0
void ProcessModel::init()
{
  outlet->setCustomData("Out");
  m_outlets.push_back(outlet.get());
  connect(
      outlet.get(),
      &Process::Port::addressChanged,
      this,
      [=](const State::AddressAccessor& arg) {
        addressChanged(arg);
        prettyNameChanged();
        unitChanged(arg.qualifiers.get().unit);
      });
}
Exemple #19
0
void AddressEditWidget::customContextMenuEvent(const QPoint& p)
{
    auto device_menu = new QMenuView{m_lineEdit};
    device_menu->setModel(reinterpret_cast<QAbstractItemModel*>(m_model));
    connect(device_menu, &QMenuView::triggered,
            this, [&](const QModelIndex & m)
    {
        auto addr = Device::address(m_model->nodeFromModelIndex(m));
        setAddress(addr);
        emit addressChanged(addr);
    });

    device_menu->exec(m_lineEdit->mapToGlobal(p));
    delete device_menu;
}
Exemple #20
0
void HostModel::addHost(Host *host)
{
    Q_ASSERT(host);

    beginInsertRows(QModelIndex(), m_hosts.count(), m_hosts.count());
    m_hosts.append(host);
    connect(host, SIGNAL(nameChanged(QString)), this, SLOT(onHostChanged()));
    connect(host, SIGNAL(addressChanged(QString)), this, SLOT(onHostChanged()));
    connect(host, SIGNAL(portChanged(int)), this, SLOT(onHostChanged()));
    connect(host, SIGNAL(followTreeSelectionChanged(bool)), this, SLOT(onHostChanged()));
    connect(host, SIGNAL(currentFileChanged(QString)), this, SLOT(onHostChanged()));
    connect(host, SIGNAL(xOffsetChanged(int)), this, SLOT(onHostChanged()));
    connect(host, SIGNAL(yOffsetChanged(int)), this, SLOT(onHostChanged()));
    connect(host, SIGNAL(rotationChanged(int)), this, SLOT(onHostChanged()));
    connect(host, SIGNAL(onlineChanged(bool)), this, SLOT(onHostChanged()));

    endInsertRows();
}
Exemple #21
0
MarkerDialog::MarkerDialog(Marker *marker) :
    marker(marker)
{
    QVBoxLayout *vbox = new QVBoxLayout;

    QFormLayout *fm = new QFormLayout;

    nameEdit = new QLineEdit;
    nameEdit->setText(marker->name());
    connect(marker, SIGNAL(nameChanged(QString)),
            nameEdit, SLOT(setText(QString)));
    fm->addRow("Name", nameEdit);

    addressLabel = new QLabel;
    setAddressLabel(marker->address());
    connect(marker, SIGNAL(addressChanged(QGeoAddress)),
            this, SLOT(setAddressLabel(QGeoAddress)));
    fm->addRow("Address", addressLabel);

    lonSpin = new QDoubleSpinBox;
    lonSpin->setMinimum(-180.0);
    lonSpin->setMaximum(180.0);
    lonSpin->setDecimals(7);
    lonSpin->setValue(marker->coordinate().longitude());
    fm->addRow("Longitude", lonSpin);

    latSpin = new QDoubleSpinBox;
    latSpin->setMinimum(-90.0);
    latSpin->setMaximum(90.0);
    latSpin->setDecimals(7);
    latSpin->setValue(marker->coordinate().latitude());
    fm->addRow("Latitude", latSpin);

    QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Save |
                                                QDialogButtonBox::Close,
                                                Qt::Horizontal);
    connect(bb, SIGNAL(accepted()), this, SLOT(accept()));
    connect(bb, SIGNAL(rejected()), this, SLOT(reject()));

    vbox->addLayout(fm);
    vbox->addWidget(bb);
    setLayout(vbox);
    setWindowTitle("Edit marker");
}
Exemple #22
0
void Enigma1ScreenShot::setAddress(const QString &a) {
    if (a != address()) {
        m_address = a;
        emit addressChanged();
    }
}
GotoOffsetView::GotoOffsetView( GotoOffsetTool* tool, QWidget* parent )
  : AbstractToolWidget( parent ),
    mTool( tool )
{
    QHBoxLayout* baseLayout = new QHBoxLayout( this );
    baseLayout->setMargin( 0 );

    // offset
    QHBoxLayout* offsetLayout = new QHBoxLayout();
    offsetLayout->setMargin( 0 );

    QLabel* label = new QLabel( i18nc("@label:listbox","O&ffset:"), this );
    mAddressEdit = new Okteta::AddressComboBox( this );
    connect( mAddressEdit, SIGNAL(addressChanged(Okteta::Address)),
             mTool, SLOT(setTargetOffset(Okteta::Address)) );
    connect( mAddressEdit, SIGNAL(formatChanged(int)),
             SLOT(onFormatChanged(int)) );
    connect( mAddressEdit, SIGNAL(addressTypeChanged(int)),
             SLOT(onAddressTypeChanged(int)) );
    label->setBuddy( mAddressEdit );
    const QString inputWhatsThis =
        i18nc( "@info:whatsthis","Enter an offset to go to, or select a previous offset from the list." );
    label->setWhatsThis( inputWhatsThis );
    mAddressEdit->setWhatsThis( inputWhatsThis );

    offsetLayout->addWidget( label );
    offsetLayout->addWidget( mAddressEdit, 1 );

    baseLayout->addLayout( offsetLayout, 1 );
    baseLayout->setAlignment( offsetLayout, Qt::AlignTop );

    setFocusProxy( mAddressEdit ); // TODO: see how KDialog does it, e.g. see if there is already a focuswidget as child

    // options
    QVBoxLayout* optionsLayout = new QVBoxLayout();
    optionsLayout->setMargin( 0 );

    mAtCursorCheckBox = new QCheckBox( i18nc("@option:check","From c&ursor"), this );
    mAtCursorCheckBox->setWhatsThis(
        i18nc("@info:whatsthis","Go relative from the current cursor location and not absolute.") );
    connect( mAtCursorCheckBox, SIGNAL(toggled(bool)),
             mTool, SLOT(setIsRelative(bool)) );
    mExtendSelectionCheckBox = new QCheckBox( i18nc("@option:check","&Extend selection"), this );
    mExtendSelectionCheckBox->setWhatsThis(
        i18nc("@info:whatsthis","Extend the selection by the cursor move.") );
    connect( mExtendSelectionCheckBox, SIGNAL(toggled(bool)),
             mTool, SLOT(setIsSelectionToExtent(bool)) );
    mBackwardsCheckBox = new QCheckBox( i18nc("@option:check","&Backwards"), this );
    mBackwardsCheckBox->setWhatsThis(
        i18nc("@info:whatsthis","Go backwards from the end or the current cursor location.") );
    connect( mBackwardsCheckBox, SIGNAL(toggled(bool)), mTool, SLOT(setIsBackwards(bool)) );

    QHBoxLayout* upperOptionsLayout = new QHBoxLayout();
    upperOptionsLayout->setMargin( 0 );
    upperOptionsLayout->addWidget( mAtCursorCheckBox );
    upperOptionsLayout->addWidget( mBackwardsCheckBox );

    optionsLayout->addLayout( upperOptionsLayout );
    optionsLayout->addWidget( mExtendSelectionCheckBox );

    baseLayout->addLayout( optionsLayout );

    // Goto button
    const KGuiItem gotoGuiItem =
        KGuiItem( i18nc("@action:button","&Go"),
                  QLatin1String("go-jump"),
                  i18nc("@info:tooltip",
                        "Go to the Offset"),
                  i18nc("@info:whatsthis",
                        "If you press the <interface>Go</interface> "
                        "button, the cursor will be moved in the document to or, "
                        "on your option, by the offset you entered above.") );
    mGotoButton = new KPushButton( gotoGuiItem, this );
    connect( mGotoButton, SIGNAL(clicked(bool)), SLOT(onGotoButtonClicked()) );
    addButton( mGotoButton, AbstractToolWidget::Default );
    baseLayout->addWidget( mGotoButton );
    baseLayout->setAlignment( mGotoButton, Qt::AlignTop );

    setTabOrder( mAddressEdit, mAtCursorCheckBox );
    setTabOrder( mAtCursorCheckBox, mBackwardsCheckBox );
    setTabOrder( mBackwardsCheckBox, mExtendSelectionCheckBox );
    setTabOrder( mExtendSelectionCheckBox, mGotoButton );

    connect( mTool, SIGNAL(isApplyableChanged(bool)),
             SLOT(onApplyableChanged(bool)) );

    onApplyableChanged( mTool->isApplyable() );
}
Exemple #24
0
vendor::vendor(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  connect(_save, SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_printAddresses, SIGNAL(clicked()), this, SLOT(sPrintAddresses()));
  connect(_newAddress, SIGNAL(clicked()), this, SLOT(sNewAddress()));
  connect(_editAddress, SIGNAL(clicked()), this, SLOT(sEditAddress()));
  connect(_viewAddress, SIGNAL(clicked()), this, SLOT(sViewAddress()));
  connect(_deleteAddress, SIGNAL(clicked()), this, SLOT(sDeleteAddress()));
  connect(_deleteTaxreg, SIGNAL(clicked()), this, SLOT(sDeleteTaxreg()));
  connect(_editTaxreg,   SIGNAL(clicked()), this, SLOT(sEditTaxreg()));
  connect(_newTaxreg,    SIGNAL(clicked()), this, SLOT(sNewTaxreg()));
  connect(_viewTaxreg,   SIGNAL(clicked()), this, SLOT(sViewTaxreg()));
  connect(_next, SIGNAL(clicked()), this, SLOT(sNext()));
  connect(_previous, SIGNAL(clicked()), this, SLOT(sPrevious()));
  connect(_mainButton, SIGNAL(clicked()), this, SLOT(sHandleButtons()));
  connect(_altButton, SIGNAL(clicked()), this, SLOT(sHandleButtons()));
  connect(_checksButton, SIGNAL(clicked()), this, SLOT(sHandleButtons()));
  connect(_number, SIGNAL(textEdited(const QString&)), this, SLOT(sNumberEdited()));
  connect(_number, SIGNAL(lostFocus()), this, SLOT(sCheck()));

  connect(_address, SIGNAL(addressChanged(QString,QString,QString,QString,QString,QString, QString)),
          _contact2, SLOT(setNewAddr(QString,QString,QString,QString,QString,QString, QString)));

  connect(_address, SIGNAL(addressChanged(QString,QString,QString,QString,QString,QString, QString)),
          _contact1, SLOT(setNewAddr(QString,QString,QString,QString,QString,QString, QString)));

  _defaultCurr->setLabel(_defaultCurrLit);

  QRegExp tmpregex = QRegExp(_metrics->value("EFTAccountRegex"));
  _accountValidator = new QRegExpValidator (tmpregex, this);
  tmpregex = QRegExp(_metrics->value("EFTRoutingRegex"));
  _routingValidator = new QRegExpValidator(tmpregex, this);

  _routingNumber->setValidator(_routingValidator);
  _achAccountNumber->setValidator(_accountValidator);

  _vendaddr->addColumn(tr("Number"), 70, Qt::AlignLeft, true, "vendaddr_code");
  _vendaddr->addColumn(tr("Name"),   50, Qt::AlignLeft, true, "vendaddr_name");
  _vendaddr->addColumn(tr("City"),   -1, Qt::AlignLeft, true, "vendaddr_city");
  _vendaddr->addColumn(tr("State"),  -1, Qt::AlignLeft, true, "vendaddr_state");
  _vendaddr->addColumn(tr("Country"),-1, Qt::AlignLeft, true, "vendaddr_country");
  _vendaddr->addColumn(tr("Postal Code"),-1, Qt::AlignLeft, true, "vendaddr_zipcode");

  _taxreg->addColumn(tr("Tax Authority"), 100, Qt::AlignLeft, true, "taxauth_code");
  _taxreg->addColumn(tr("Tax Zone"),      100, Qt::AlignLeft, true, "taxzone_code");
  _taxreg->addColumn(tr("Registration #"), -1, Qt::AlignLeft, true, "taxreg_number");

  _accountType->append(0, "Checking", "K");
  _accountType->append(1, "Savings",  "C");

  _crmacctid = -1;
  _ignoreClose = false;
  _NumberGen = -1;
  
  if (_metrics->boolean("EnableBatchManager") &&
      ! _metrics->boolean("ACHEnabled"))
  {
    _checksButton->hide();
  }
  else if (! _metrics->boolean("EnableBatchManager") &&
           _metrics->boolean("ACHEnabled"))
  {
    _checksButton->hide();
    _transmitStack->setCurrentIndex(1);
  }
  else if (! _metrics->boolean("EnableBatchManager") &&
           ! _metrics->boolean("ACHEnabled"))
    ediTab->setVisible(false);
  // else defaults are OK

  if (_metrics->boolean("ACHEnabled") && omfgThis->_key.isEmpty())
    _checksButton->setEnabled(false);

  _vendid = -1;
}