~ubuntu-sdk-team/qtcreator-plugin-remotelinux/trunk

« back to all changes in this revision

Viewing changes to src/qnx/bardescriptoreditorenvironmentwidget.cpp

  • Committer: CI bot
  • Author(s): Benjamin Zeller
  • Date: 2014-06-16 10:28:43 UTC
  • mfrom: (4.2.4 remotelinux)
  • Revision ID: ps-jenkins@lists.canonical.com-20140616102843-8juvmjvzwlzsboyw
Migrating to Qt5.3 and QtC 3.1 

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
 
44
44
    m_ui->environmentWidget->setBaseEnvironmentText(tr("Device Environment"));
45
45
 
46
 
    connect(m_ui->environmentWidget, SIGNAL(userChangesChanged()), this, SIGNAL(changed()));
 
46
    addSignalMapping(BarDescriptorDocument::env, m_ui->environmentWidget, SIGNAL(userChangesChanged()));
47
47
}
48
48
 
49
49
BarDescriptorEditorEnvironmentWidget::~BarDescriptorEditorEnvironmentWidget()
51
51
    delete m_ui;
52
52
}
53
53
 
54
 
void BarDescriptorEditorEnvironmentWidget::clear()
55
 
{
56
 
    disconnect(m_ui->environmentWidget, SIGNAL(userChangesChanged()), this, SIGNAL(changed()));
57
 
    m_ui->environmentWidget->setUserChanges(QList<Utils::EnvironmentItem>());
58
 
    connect(m_ui->environmentWidget, SIGNAL(userChangesChanged()), this, SIGNAL(changed()));
59
 
}
60
 
 
61
 
QList<Utils::EnvironmentItem> BarDescriptorEditorEnvironmentWidget::environment() const
62
 
{
63
 
    return m_ui->environmentWidget->userChanges();
64
 
}
65
 
 
66
 
void BarDescriptorEditorEnvironmentWidget::appendEnvironmentItem(const Utils::EnvironmentItem &envItem)
67
 
{
68
 
    disconnect(m_ui->environmentWidget, SIGNAL(userChangesChanged()), this, SIGNAL(changed()));
69
 
    QList<Utils::EnvironmentItem> items = m_ui->environmentWidget->userChanges();
70
 
    items.append(envItem);
71
 
    m_ui->environmentWidget->setUserChanges(items);
72
 
    connect(m_ui->environmentWidget, SIGNAL(userChangesChanged()), this, SIGNAL(changed()));
 
54
void BarDescriptorEditorEnvironmentWidget::updateWidgetValue(BarDescriptorDocument::Tag tag, const QVariant &value)
 
55
{
 
56
    if (tag != BarDescriptorDocument::env) {
 
57
        BarDescriptorEditorAbstractPanelWidget::updateWidgetValue(tag, value);
 
58
        return;
 
59
    }
 
60
 
 
61
    m_ui->environmentWidget->setUserChanges(value.value<QList<Utils::EnvironmentItem> >());
 
62
}
 
63
 
 
64
void BarDescriptorEditorEnvironmentWidget::emitChanged(BarDescriptorDocument::Tag tag)
 
65
{
 
66
    if (tag != BarDescriptorDocument::env) {
 
67
        BarDescriptorEditorAbstractPanelWidget::emitChanged(tag);
 
68
        return;
 
69
    }
 
70
 
 
71
    QVariant var;
 
72
    var.setValue(m_ui->environmentWidget->userChanges());
 
73
    emit changed(tag, var);
73
74
}