Пример #1
0
void IpAddressLineEdit::slotChanged(const QString &t)
{
    Utils::BaseValidatingLineEdit::slotChanged(t);
    if (isValid())
        emit validAddressChanged(t);
    else
        emit invalidAddressChanged();
}
Пример #2
0
void IpAddressLineEdit::handleChanged(const QString &t)
{
    Utils::FancyLineEdit::handleChanged(t);
    if (isValid())
        emit validAddressChanged(t);
    else
        emit invalidAddressChanged();
}
Пример #3
0
QWidget *S60DeployConfigurationWidget::createCommunicationChannel()
{
    m_serialPortsCombo->setSizeAdjustPolicy(QComboBox::AdjustToContents);
    connect(m_serialPortsCombo, SIGNAL(activated(int)), this, SLOT(setSerialPort(int)));
    connect(m_serialRadioButton, SIGNAL(clicked()), this, SLOT(updateCommunicationChannel()));
    connect(m_wlanRadioButton, SIGNAL(clicked()), this, SLOT(updateCommunicationChannel()));
    connect(m_ipAddress, SIGNAL(validAddressChanged(QString)), this, SLOT(updateWlanAddress(QString)));
    connect(m_ipAddress, SIGNAL(invalidAddressChanged()), this, SLOT(cleanWlanAddress()));

    QHBoxLayout *serialPortHBoxLayout = new QHBoxLayout;
    serialPortHBoxLayout->addWidget(new QLabel(tr("Serial port:")));
    serialPortHBoxLayout->addWidget(m_serialPortsCombo);
    serialPortHBoxLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));

#if !defined(Q_OS_WIN) && !defined(Q_OS_MACX)
    // Update device list: only needed on linux.
    QToolButton *updateSerialDevicesButton(new QToolButton);
    updateSerialDevicesButton->setIcon(qApp->style()->standardIcon(QStyle::SP_BrowserReload));
    connect(updateSerialDevicesButton, SIGNAL(clicked()),
            SymbianUtils::SymbianDeviceManager::instance(), SLOT(update()));
    serialPortHBoxLayout->addWidget(updateSerialDevicesButton);
#endif

    QGroupBox *communicationChannelGroupBox = new QGroupBox(tr("Communication Channel"));
    QGridLayout *communicationChannelGridLayout = new QGridLayout;
    communicationChannelGridLayout->addWidget(m_serialRadioButton, 0, 0);
    communicationChannelGridLayout->addWidget(m_wlanRadioButton, 1, 0);

    m_ipAddress->setMinimumWidth(30);
    m_ipAddress->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored);

    if(!m_deployConfiguration->deviceAddress().isEmpty())
        m_ipAddress->setText(QString("%1:%2")
                             .arg(m_deployConfiguration->deviceAddress())
                             .arg(m_deployConfiguration->devicePort()));

    QHBoxLayout *wlanChannelLayout = new QHBoxLayout();
    wlanChannelLayout->addWidget(new QLabel(tr("Address:")));
    wlanChannelLayout->addWidget(m_ipAddress);
    wlanChannelLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));

    communicationChannelGridLayout->addLayout(serialPortHBoxLayout, 0, 1);
    communicationChannelGridLayout->addLayout(wlanChannelLayout, 1, 1);

    communicationChannelGroupBox->setLayout(communicationChannelGridLayout);

    updateCommunicationChannelUi();

    return communicationChannelGroupBox;
}