Merge branch '1025' into 'dbus-interface'
bug#86797 See merge request kylin-desktop/kylin-nm!360
This commit is contained in:
commit
bda9da0968
|
@ -32,6 +32,7 @@ LanListItem::LanListItem(QWidget *parent) : ListItem(parent)
|
||||||
{
|
{
|
||||||
m_isActive = false;
|
m_isActive = false;
|
||||||
m_netButton->setButtonIcon(QIcon::fromTheme("network-offline-symbolic"));
|
m_netButton->setButtonIcon(QIcon::fromTheme("network-offline-symbolic"));
|
||||||
|
m_netButton->setDefaultPixmap();
|
||||||
const QString str=tr("Not connected");
|
const QString str=tr("Not connected");
|
||||||
m_nameLabel->setText(str);
|
m_nameLabel->setText(str);
|
||||||
this->m_infoButton->hide();
|
this->m_infoButton->hide();
|
||||||
|
|
|
@ -31,6 +31,7 @@ WlanListItem::WlanListItem(QWidget *parent) : ListItem(parent)
|
||||||
qDebug()<<"[WlanPage] wlan list item is created." << m_wirelessNetItem.m_NetSsid;
|
qDebug()<<"[WlanPage] wlan list item is created." << m_wirelessNetItem.m_NetSsid;
|
||||||
|
|
||||||
m_netButton->setButtonIcon(QIcon::fromTheme("network-wireless-signal-none-symbolic"));
|
m_netButton->setButtonIcon(QIcon::fromTheme("network-wireless-signal-none-symbolic"));
|
||||||
|
m_netButton->setDefaultPixmap();
|
||||||
const QString name = tr("Not connected");
|
const QString name = tr("Not connected");
|
||||||
setExpanded(false);
|
setExpanded(false);
|
||||||
this->setName(name);
|
this->setName(name);
|
||||||
|
@ -303,6 +304,7 @@ void WlanListItem::refreshIcon()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_netButton->setActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WlanListItem::onInfoButtonClicked()
|
void WlanListItem::onInfoButtonClicked()
|
||||||
|
|
|
@ -25,7 +25,6 @@ RadioItemButton::RadioItemButton(QWidget *parent) : QPushButton(parent)
|
||||||
m_iconLabel->setFixedSize(BUTTON_SIZE);
|
m_iconLabel->setFixedSize(BUTTON_SIZE);
|
||||||
m_iconLabel->setAlignment(Qt::AlignCenter);
|
m_iconLabel->setAlignment(Qt::AlignCenter);
|
||||||
|
|
||||||
|
|
||||||
setActive(false);
|
setActive(false);
|
||||||
//JXJ_TODO loading动画
|
//JXJ_TODO loading动画
|
||||||
connect(this, &RadioItemButton::requestStartLoading, this, &RadioItemButton::onLoadingStarted);
|
connect(this, &RadioItemButton::requestStartLoading, this, &RadioItemButton::onLoadingStarted);
|
||||||
|
@ -47,16 +46,21 @@ void RadioItemButton::stopLoading()
|
||||||
{
|
{
|
||||||
emit this->requestStopLoading();
|
emit this->requestStopLoading();
|
||||||
}
|
}
|
||||||
|
//设置图标
|
||||||
void RadioItemButton::setButtonIcon(const QIcon &icon)
|
void RadioItemButton::setButtonIcon(const QIcon &icon)
|
||||||
{
|
{
|
||||||
if (icon.isNull()) {
|
if (icon.isNull()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_pixmap = icon.pixmap(ICON_SIZE);
|
m_pixmap = icon.pixmap(ICON_SIZE);
|
||||||
|
// m_iconLabel->setPixmap(m_pixmap);
|
||||||
|
}
|
||||||
|
//显示默认图标
|
||||||
|
void RadioItemButton::setDefaultPixmap()
|
||||||
|
{
|
||||||
m_iconLabel->setPixmap(m_pixmap);
|
m_iconLabel->setPixmap(m_pixmap);
|
||||||
}
|
}
|
||||||
|
//根据连接状态更改图标颜色
|
||||||
void RadioItemButton::setActive(const bool &isActive)
|
void RadioItemButton::setActive(const bool &isActive)
|
||||||
{
|
{
|
||||||
m_isActivated = isActive;
|
m_isActivated = isActive;
|
||||||
|
|
|
@ -18,6 +18,7 @@ public:
|
||||||
void startLoading();
|
void startLoading();
|
||||||
void stopLoading();
|
void stopLoading();
|
||||||
void setButtonIcon(const QIcon &icon);
|
void setButtonIcon(const QIcon &icon);
|
||||||
|
void setDefaultPixmap();
|
||||||
void setActive(const bool &isActive);
|
void setActive(const bool &isActive);
|
||||||
enum PixmapColor {
|
enum PixmapColor {
|
||||||
WHITE = 0,
|
WHITE = 0,
|
||||||
|
|
Loading…
Reference in New Issue