~ubuntu-branches/ubuntu/precise/networkmanagement/precise-updates

« back to all changes in this revision

Viewing changes to applet/wirelessnetworkitem.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl, Modestas Vainius, Michael Biebl
  • Date: 2011-05-27 12:18:25 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110527121825-vfufwquq3vy0k3zn
Tags: 0.1+git20110526.911025d-1
[ Modestas Vainius ]
* Use official KDE branding in the package descriptions.

[ Michael Biebl ]
* New upstream Git snapshot 911025d81fdfbe09b64705e94e5411f521c38e3e.
* debian/control
  - Bump Build-Depends on kdelibs5-dev and kdebase-workspace-dev to
    (>= 4:4.6.0).
  - Bump Build-Depends on network-manager-dev and libnm-util-dev to
    (>= 0.8.1).
  - Bump Depends on network-manager to (>= 0.8.1).

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
    */
76
76
    m_layout = new QGraphicsGridLayout(this);
77
77
    // First, third and fourth colunm are fixed width for the icons
78
 
    m_layout->setColumnPreferredWidth(0, 160);
 
78
    m_layout->setColumnPreferredWidth(0, 150);
79
79
    m_layout->setColumnFixedWidth(1, 60);
80
80
    m_layout->setColumnFixedWidth(2, rowHeight);
81
81
    m_layout->setColumnSpacing(1, spacing);
91
91
    } else {
92
92
        m_connectButton->setText(m_wirelessStatus->ssid());
93
93
    }
94
 
    m_connectButton->setMinimumWidth(160);
95
94
    m_connectButton->setOrientation(Qt::Horizontal);
96
95
    m_connectButton->setTextBackgroundColor(QColor(Qt::transparent));
97
96
    //m_connectButton->setToolTip(i18nc("icon to connect to wireless network", "Connect to wireless network %1", ssid));
98
97
    m_layout->addItem(m_connectButton, 0, 0, 1, 1 );
99
98
 
100
 
    if (m_remote->strength() >= 0)
 
99
    if (m_remote->strength()>=0)
101
100
    {
102
101
        m_strengthMeter = new Plasma::Meter(this);
103
102
        m_strengthMeter->setMinimum(0);
104
103
        m_strengthMeter->setMaximum(100);
105
104
        m_strengthMeter->setValue(m_wirelessStatus->strength());
106
105
        m_strengthMeter->setMeterType(Plasma::Meter::BarMeterHorizontal);
107
 
        m_strengthMeter->setPreferredSize(QSizeF(60, rowHeight/2));
108
 
        m_strengthMeter->setMaximumHeight(rowHeight/2);
 
106
        m_strengthMeter->setPreferredSize(QSizeF(60, 12));
 
107
        m_strengthMeter->setMaximumHeight(12);
109
108
        m_strengthMeter->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
110
109
        m_layout->addItem(m_strengthMeter, 0, 1, 1, 1, Qt::AlignCenter);
111
110
    }
 
111
    else
 
112
    {
 
113
        QGraphicsWidget *widget = new QGraphicsWidget(this);
 
114
        widget->setPreferredSize(QSizeF(60, 12));
 
115
        widget->setMaximumHeight(12);
 
116
        widget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
 
117
        m_layout->addItem(widget, 0, 1, 1, 1, Qt::AlignCenter);
 
118
    }
112
119
 
113
120
    m_securityIcon = new Plasma::Label(this);
114
121
    m_securityIcon->nativeWidget()->setPixmap(KIcon(m_wirelessStatus->securityIcon()).pixmap(22,22));
175
182
void WirelessNetworkItem::update()
176
183
{
177
184
    //kDebug() << "updating" << m_wirelessStatus->ssid() << wirelessNetworkItem()->strength();
178
 
    setStrength((static_cast<RemoteWirelessNetwork*>(m_activatable))->strength());
 
185
    if (m_activatable) {
 
186
        setStrength((static_cast<RemoteWirelessNetwork*>(m_activatable))->strength());
 
187
    }
 
188
 
179
189
    return;
180
190
}
181
191