From 2157b29004048c025c9b7bdbcb0f20fb84329d6a Mon Sep 17 00:00:00 2001 From: renpeijia Date: Mon, 27 Sep 2021 17:10:35 +0800 Subject: [PATCH 01/10] modify: Optimize code structure and process logic --- .../kylinactiveconnectresource.cpp | 25 + .../kylinactiveconnectresource.h | 1 + .../dbus-interface/kylinconnectitem.cpp | 5 + src/backend/dbus-interface/kylinconnectitem.h | 2 + .../dbus-interface/kylinconnectresource.cpp | 74 ++ .../dbus-interface/kylinconnectresource.h | 5 + .../kylinnetworkresourcemanager.cpp | 6 +- src/frontend/list-items/lanlistitem.cpp | 6 +- src/frontend/list-items/listitem.cpp | 13 +- src/frontend/tab-pages/lanpage.cpp | 1112 ++++++++++------- src/frontend/tab-pages/lanpage.h | 95 +- src/frontend/tab-pages/tabpage.cpp | 12 + src/frontend/tab-pages/tabpage.h | 1 + 13 files changed, 873 insertions(+), 484 deletions(-) diff --git a/src/backend/dbus-interface/kylinactiveconnectresource.cpp b/src/backend/dbus-interface/kylinactiveconnectresource.cpp index 7f1c604d..df31ff31 100644 --- a/src/backend/dbus-interface/kylinactiveconnectresource.cpp +++ b/src/backend/dbus-interface/kylinactiveconnectresource.cpp @@ -56,6 +56,31 @@ KyConnectItem *KyActiveConnectResourse::getActiveConnectionItem(NetworkManager:: return activeConnectItem; } +KyConnectItem *KyActiveConnectResourse::getActiveConnectionByUuid(QString connectUuid) +{ + NetworkManager::ActiveConnection::Ptr activeConnectPtr = + m_networkResourceInstance->getActiveConnect(connectUuid); + + if (nullptr == activeConnectPtr) { + qWarning()<< "[KyActiveConnectResourse]" <<"it can not find connect "<< connectUuid; + return nullptr; + } + + KyConnectItem *activeConnectItem = getActiveConnectionItem(activeConnectPtr); + if (nullptr == activeConnectItem) { + return nullptr; + } + + QStringList interfaces = activeConnectPtr->devices(); + QString ifaceUni = interfaces.at(0); + NetworkManager::Device:: Ptr devicePtr = + m_networkResourceInstance->findDeviceUni(ifaceUni); + activeConnectItem->m_ifaceName = devicePtr->interfaceName(); + activeConnectItem->m_itemType = activeConnectPtr->type(); + + return activeConnectItem; +} + KyConnectItem *KyActiveConnectResourse::getActiveConnectionByUuid(QString connectUuid, QString deviceName) { diff --git a/src/backend/dbus-interface/kylinactiveconnectresource.h b/src/backend/dbus-interface/kylinactiveconnectresource.h index b5d02054..93225d1b 100644 --- a/src/backend/dbus-interface/kylinactiveconnectresource.h +++ b/src/backend/dbus-interface/kylinactiveconnectresource.h @@ -17,6 +17,7 @@ public: ~KyActiveConnectResourse(); public: + KyConnectItem *getActiveConnectionByUuid(QString connectUuid); KyConnectItem *getActiveConnectionByUuid(QString connectUuid, QString deviceName); void getActiveConnectionList(QString deviceName, NetworkManager::ConnectionSettings::ConnectionType connectionType, diff --git a/src/backend/dbus-interface/kylinconnectitem.cpp b/src/backend/dbus-interface/kylinconnectitem.cpp index 5bc7857b..011dee63 100644 --- a/src/backend/dbus-interface/kylinconnectitem.cpp +++ b/src/backend/dbus-interface/kylinconnectitem.cpp @@ -18,6 +18,11 @@ KyConnectItem::~KyConnectItem() } +void KyConnectItem::setConnectUuid(QString uuid) +{ + m_connectUuid = uuid; +} + void KyConnectItem::dumpInfo() { qDebug()<<"wired connection item info:"; diff --git a/src/backend/dbus-interface/kylinconnectitem.h b/src/backend/dbus-interface/kylinconnectitem.h index d696b03e..4cdaa1ae 100644 --- a/src/backend/dbus-interface/kylinconnectitem.h +++ b/src/backend/dbus-interface/kylinconnectitem.h @@ -14,6 +14,8 @@ public: public: void dumpInfo(); + void setConnectUuid(QString uuid); + public: QString m_connectName; QString m_connectUuid; diff --git a/src/backend/dbus-interface/kylinconnectresource.cpp b/src/backend/dbus-interface/kylinconnectresource.cpp index dfec1ea8..a3b380ed 100644 --- a/src/backend/dbus-interface/kylinconnectresource.cpp +++ b/src/backend/dbus-interface/kylinconnectresource.cpp @@ -47,6 +47,30 @@ KyConnectItem *KyConnectResourse::getConnectionItem(NetworkManager::Connection:: return connectionItem; } +KyConnectItem * KyConnectResourse::getConnectionItemByUuid(QString connectUuid) +{ + NetworkManager::Connection::Ptr connectPtr = + m_networkResourceInstance->getConnect(connectUuid); + + if (nullptr == connectPtr) { + qWarning()<< "[KyConnectResourse]" <<"get connect failed, connect uuid"<isActiveConnection(connectPtr->uuid())) { + qDebug()<<"[KyConnectResourse]"<name()<<"is active connection"; + return nullptr; + } + + KyConnectItem *connectItem = getConnectionItem(connectPtr); + if (nullptr != connectItem) { + connectItem->dumpInfo(); + return connectItem; + } + + return nullptr; +} + KyConnectItem * KyConnectResourse::getConnectionItemByUuid(QString connectUuid, QString deviceName) { NetworkManager::Connection::Ptr connectPtr = @@ -552,3 +576,53 @@ void KyConnectResourse::getApConnections(QList &apConnectItem return; } + + +bool KyConnectResourse::isWiredConnection(QString uuid) +{ + NetworkManager::Connection::Ptr connectPtr = + m_networkResourceInstance->getConnect(uuid); + + if (connectPtr->isValid()) { + NetworkManager::ConnectionSettings::Ptr connectSettingPtr = connectPtr->settings(); + + if (connectSettingPtr.isNull()) { + qWarning()<<"[KyConnectResourse]"<<"get connect setting failed, connect uuid"<settings()->connectionType()) { + return true; + } + } + + return false; +} + +bool KyConnectResourse::isWirelessConnection(QString uuid) +{ + NetworkManager::Connection::Ptr connectPtr = + m_networkResourceInstance->getConnect(uuid); + + if (connectPtr->isValid()) { + NetworkManager::ConnectionSettings::Ptr connectSettingPtr = connectPtr->settings(); + + if (connectSettingPtr.isNull()) { + qWarning()<<"[KyConnectResourse]"<<"get connect setting failed, connect uuid"<settings()->connectionType()) { + return true; + } + } + + return false; +} + +bool KyConnectResourse::isActivatedConnection(QString uuid) +{ + return m_networkResourceInstance->isActiveConnection(uuid); +} diff --git a/src/backend/dbus-interface/kylinconnectresource.h b/src/backend/dbus-interface/kylinconnectresource.h index 2634c502..58798bb0 100644 --- a/src/backend/dbus-interface/kylinconnectresource.h +++ b/src/backend/dbus-interface/kylinconnectresource.h @@ -18,6 +18,7 @@ public: ~KyConnectResourse(); public: + KyConnectItem *getConnectionItemByUuid(QString connectUuid); KyConnectItem *getConnectionItemByUuid(QString connectUuid, QString deviceName); void getConnectionList(QString deviceName, NetworkManager::ConnectionSettings::ConnectionType connectionType, @@ -30,6 +31,10 @@ public: bool getInterfaceByUuid(QString &deviceName, NetworkManager::ConnectionSettings::ConnectionType &type, const QString connUuid); void getConnectivity(NetworkManager::Connectivity &connectivity); + bool isWiredConnection(QString uuid); + bool isWirelessConnection(QString uuid); + bool isActivatedConnection(QString uuid); + private: KyConnectItem *getConnectionItem(NetworkManager::Connection::Ptr connectPtr); void getConnectIp(NetworkManager::ConnectionSettings::Ptr settingPtr, diff --git a/src/backend/dbus-interface/kylinnetworkresourcemanager.cpp b/src/backend/dbus-interface/kylinnetworkresourcemanager.cpp index 76d7a71e..b1156588 100644 --- a/src/backend/dbus-interface/kylinnetworkresourcemanager.cpp +++ b/src/backend/dbus-interface/kylinnetworkresourcemanager.cpp @@ -166,7 +166,7 @@ void KyNetworkResourceManager::addActiveConnection(NetworkManager::ActiveConnect connect(conn.data(), &NetworkManager::ActiveConnection::typeChanged, this, &KyNetworkResourceManager::onActiveConnectionUpdated); connect(conn.data(), &NetworkManager::ActiveConnection::masterChanged, this, &KyNetworkResourceManager::onActiveConnectionUpdated); connect(conn.data(), &NetworkManager::ActiveConnection::specificObjectChanged, this, &KyNetworkResourceManager::onActiveConnectionUpdated); - connect(conn.data(), &NetworkManager::ActiveConnection::stateChangedReason, this, &KyNetworkResourceManager::onActiveConnectionChangedReason); + //connect(conn.data(), &NetworkManager::ActiveConnection::stateChangedReason, this, &KyNetworkResourceManager::onActiveConnectionChangedReason); connect(conn.data(), &NetworkManager::ActiveConnection::stateChanged, this, &KyNetworkResourceManager::onActiveConnectionChanged); connect(conn.data(), &NetworkManager::ActiveConnection::vpnChanged, this, &KyNetworkResourceManager::onActiveConnectionUpdated); connect(conn.data(), &NetworkManager::ActiveConnection::uuidChanged, this, &KyNetworkResourceManager::onActiveConnectionUpdated); @@ -556,6 +556,10 @@ void KyNetworkResourceManager::onActiveConnectionChanged( if (activeConnect->isValid()) { qDebug()<<"!New state change activate connect"<uuid(); qDebug()<<"!New the active connect state"<state() != state) { + qDebug()<<"connect real state"<state() <<"change state"<uuid(), state, NetworkManager::ActiveConnection::Reason::UknownReason); } else { diff --git a/src/frontend/list-items/lanlistitem.cpp b/src/frontend/list-items/lanlistitem.cpp index b5548eed..209ea67d 100644 --- a/src/frontend/list-items/lanlistitem.cpp +++ b/src/frontend/list-items/lanlistitem.cpp @@ -93,9 +93,11 @@ void LanListItem::onInfoButtonClicked() void LanListItem::onLanStatusChange(QString uuid, NetworkManager::ActiveConnection::State state, NetworkManager::ActiveConnection::Reason reason) { - qDebug() <<"[LanListItem]Connection State Change to:" << state; + qDebug() <<"[LanListItem] Connection State Change to:" << state << uuid; + if (m_data->m_connectUuid == uuid) { - if (state == NetworkManager::ActiveConnection::State::Activating || state == NetworkManager::ActiveConnection::State::Deactivating) { + if (state == NetworkManager::ActiveConnection::State::Activating + || state == NetworkManager::ActiveConnection::State::Deactivating) { qDebug() << "[LanListItem]Activating!Loading!" << state; m_netButton->startLoading(); } else { diff --git a/src/frontend/list-items/listitem.cpp b/src/frontend/list-items/listitem.cpp index c60d1afe..021402c0 100644 --- a/src/frontend/list-items/listitem.cpp +++ b/src/frontend/list-items/listitem.cpp @@ -21,11 +21,16 @@ ListItem::ListItem(QWidget *parent) : QFrame(parent) ListItem::~ListItem() { - delete m_netButton; - m_netButton = NULL; + if (nullptr != m_netButton) { + delete m_netButton; + m_netButton = nullptr; + } + + if (nullptr != m_infoButton) { + delete m_infoButton; + m_infoButton = nullptr; + } - delete m_infoButton; - m_infoButton = NULL; } void ListItem::setName(const QString &name) diff --git a/src/frontend/tab-pages/lanpage.cpp b/src/frontend/tab-pages/lanpage.cpp index ae0773e6..f69419fd 100644 --- a/src/frontend/tab-pages/lanpage.cpp +++ b/src/frontend/tab-pages/lanpage.cpp @@ -7,41 +7,45 @@ #define TITLE_LAYOUT_MARGINS 24,0,24,0 #define LAN_LIST_SPACING 2 #define TEXT_MARGINS 16,0,0,0 -//#define SCROLL_AREA_HEIGHT 200 #define SETTINGS_LAYOUT_MARGINS 24,16,24,16 #define TRANSPARENT_COLOR QColor(0,0,0,0) #define SWITCH_WIDTH 48 #define SWITCH_HEIGHT 24 #define ITEM_HEIGHT 48 +const QString INVALID_CONNECT_UUID = "emptyconnect"; + const QString WIRED_SWITCH = "wiredswitch"; LanPage::LanPage(QWidget *parent) : TabPage(parent) { m_activeResourse = new KyActiveConnectResourse(this); m_connectResourse = new KyConnectResourse(this); - m_device = new KyNetworkDeviceResourse(this); + m_deviceResource = new KyNetworkDeviceResourse(this); + + m_devList.clear(); + m_deviceResource->getNetworkDeviceList(NetworkManager::Device::Type::Ethernet, m_devList); initDeviceState(); - initUI(); initNetSwitch(); initDeviceCombox(); - initList(m_deviceName); + initLanArea(); - connect(m_activeResourse, &KyActiveConnectResourse::stateChangeReason, this, &LanPage::updateLanlist); + connect(m_activeResourse, &KyActiveConnectResourse::stateChangeReason, this, &LanPage::onUpdateLanlist); - connect(m_connectResourse, &KyConnectResourse::connectionAdd, this, &LanPage::addConnectionSlot); - connect(m_connectResourse, &KyConnectResourse::connectionRemove, this, &LanPage::removeConnectionSlot); - connect(m_connectResourse, &KyConnectResourse::connectionUpdate, this, &LanPage::connectionUpdateSlot); + connect(m_connectResourse, &KyConnectResourse::connectionAdd, this, &LanPage::onAddConnection); + connect(m_connectResourse, &KyConnectResourse::connectionRemove, this, &LanPage::onRemoveConnection); + connect(m_connectResourse, &KyConnectResourse::connectionUpdate, this, &LanPage::onUpdateConnection); - connect(m_device, &KyNetworkDeviceResourse::deviceAdd, this, &LanPage::onDeviceAdd); - connect(m_device, &KyNetworkDeviceResourse::deviceRemove, this, &LanPage::onDeviceRemove); - connect(m_device, &KyNetworkDeviceResourse::deviceNameUpdate, this, &LanPage::onDeviceNameUpdate); + connect(m_deviceResource, &KyNetworkDeviceResourse::deviceAdd, this, &LanPage::onDeviceAdd); + connect(m_deviceResource, &KyNetworkDeviceResourse::deviceRemove, this, &LanPage::onDeviceRemove); + connect(m_deviceResource, &KyNetworkDeviceResourse::deviceNameUpdate, this, &LanPage::onDeviceNameUpdate); connect(m_wiredConnectOperation, &KyWiredConnectOperation::activateConnectionError, this, &LanPage::activateFailed); connect(m_wiredConnectOperation, &KyWiredConnectOperation::deactivateConnectionError, this, &LanPage::deactivateFailed); + } LanPage::~LanPage() @@ -70,7 +74,8 @@ void LanPage::initNetSwitch() if (QGSettings::isSchemaInstalled(GSETTINGS_SCHEMA)) { m_switchGsettings = new QGSettings(GSETTINGS_SCHEMA); if (m_switchGsettings->keys().contains(WIRED_SWITCH)) { - m_netSwitch->setSwitchStatus(m_switchGsettings->get(WIRED_SWITCH).toBool()); + m_wiredSwitch = m_switchGsettings->get(WIRED_SWITCH).toBool(); + m_netSwitch->setSwitchStatus(m_wiredSwitch); connect(m_switchGsettings, &QGSettings::changed, this, &LanPage::onSwithGsettingsChanged); } connect(m_netSwitch, &SwitchButton::clicked, this, &LanPage::onLanSwitchClicked); @@ -84,30 +89,37 @@ void LanPage::onSwithGsettingsChanged(const QString &key) if (key == WIRED_SWITCH) { m_netSwitch->blockSignals(true); - qDebug()<<"[LanPage] SwitchButton statue changed to:" - << m_switchGsettings->get(WIRED_SWITCH).toBool(); + m_wiredSwitch = m_switchGsettings->get(WIRED_SWITCH).toBool(); + qDebug()<<"[LanPage] SwitchButton statue changed to:" << m_wiredSwitch; KyWiredConnectOperation wiredOperation; + if (m_wiredSwitch) { + QStringList disabledDevices; + disabledDevices.clear(); + getDisabledDevices(disabledDevices); - QStringList deviceList; - m_device->getNetworkDeviceList(NetworkManager::Device::Type::Ethernet, deviceList); - - bool isOn = m_switchGsettings->get(WIRED_SWITCH).toBool(); - if (isOn) { - for (int index = 0; index < deviceList.size(); ++index) { - qDebug()<<"[LanPage] open wired device "<< deviceList.at(index); - wiredOperation.openWiredNetworkWithDevice(deviceList.at(index)); - saveDeviceEnableState(deviceList.at(index), true); + for (int index = 0; index < disabledDevices.size(); ++index) { + qDebug()<<"[LanPage] open wired device "<< disabledDevices.at(index); + wiredOperation.openWiredNetworkWithDevice(disabledDevices.at(index)); + saveDeviceEnableState(disabledDevices.at(index), true); } } else { - for (int index = 0; index < deviceList.size(); ++index) { - qDebug()<<"[LanPage] close wired device "<< deviceList.at(index); - wiredOperation.closeWiredNetworkWithDevice(deviceList.at(index)); - saveDeviceEnableState(deviceList.at(index), false); + QStringList enableDevices; + enableDevices.clear(); + getEnabledDevice(enableDevices); + + for (int index = 0; index < enableDevices.size(); ++index) { + qDebug()<<"[LanPage] close wired device "<< enableDevices.at(index); + wiredOperation.closeWiredNetworkWithDevice(enableDevices.at(index)); + saveDeviceEnableState(enableDevices.at(index), false); } } + initDeviceCombox(); - m_netSwitch->setSwitchStatus(isOn); + initLanArea(); + + m_netSwitch->setSwitchStatus(m_wiredSwitch); + m_netSwitch->blockSignals(false); } } @@ -123,148 +135,339 @@ void LanPage::onLanSwitchClicked() } } -void LanPage::removeConnectionSlot(QString path) //删除时后端会自动断开激活,将其从未激活列表中删除 +void LanPage::getEnabledDevice(QStringList &enableDeviceList) { - //for dbus - qDebug() << "[LanPage] emit lanRemove because removeConnectionSlot " << path; - emit lanRemove(path); + int index = 0; + QMap deviceMap; - qDebug()<<"[LanPage] Removing a connection, path:"<::iterator iters; - for (iters = m_deactiveMap.begin(); iters != m_deactiveMap.end(); ++iters) { - KyConnectItem *item = iters.key(); - if (item->m_connectPath == path) { - qDebug()<<"[LanPage] Remove a connection from inactive list"; - m_inactivatedLanListWidget->removeItemWidget(iters.value()); - delete(iters.value()); - m_deactiveMap.erase(iters); - isLan = true; + if (m_devList.isEmpty()) { + qDebug()<<"[LanPage] there is not wired device."; + return; + } - break; + getDeviceEnableState(WIRED, deviceMap); + for (index = 0; index < m_devList.size(); ++index) { + if (deviceMap.contains(m_devList.at(index))) { + if (deviceMap[m_devList.at(index)]) { + enableDeviceList << m_devList.at(index); + } + } else { + saveDeviceEnableState(m_devList.at(index), true); + enableDeviceList << m_devList.at(index); } } + + return; } -void LanPage::addConnectionSlot(QString uuid) //新增一个有线连接,将其加入到激活列表 +void LanPage::getDisabledDevices(QStringList &disableDeviceList) { - QString devName; - NetworkManager::ConnectionSettings::ConnectionType type; - if(m_connectResourse->getInterfaceByUuid(devName, type, uuid)) { - if (type != NetworkManager::ConnectionSettings::ConnectionType::Wired) { - qDebug() << "[LanPage] addConnectionSlot but type is not Wired"; - return; - } - } else { - qDebug() << "[LanPage] addConnectionSlot but uuid is invalid"; + int index = 0; + QMap deviceMap; + + if (m_devList.isEmpty()) { + qDebug()<<"[LanPage] there is not wired device."; + return; } - //for dbus - KyConnectItem *item = nullptr; - item = m_connectResourse->getConnectionItemByUuid(uuid, devName); - if (nullptr != item) { - QStringList info; - info << item->m_connectName << uuid << item->m_connectPath; - qDebug() << "[LanPage] emit lanAdd because addConnection " << devName; - emit lanAdd(devName, info); + getDeviceEnableState(WIRED, deviceMap); + for (index = 0; index < m_devList.size(); ++index) { + if (deviceMap.contains(m_devList.at(index))) { + if (!deviceMap[m_devList.at(index)]) { + disableDeviceList << m_devList.at(index); + } + } } - KyConnectItem * newItem = m_connectResourse->getConnectionItemByUuid(uuid, m_deviceName); - if (newItem != nullptr) { - if (newItem->m_itemType == NetworkManager::ConnectionSettings::ConnectionType::Wired) { - qDebug()<<"[LanPage] Add a new connection, name:"<m_connectName; - addNewItem(newItem, m_inactivatedLanListWidget); - m_deactiveMap.insert(newItem, m_listWidgetItem); - } - } else { - qDebug()<<"[LanPage] GetConnectionItemByUuid is empty when add a new!"; - } + return; } void LanPage::initDeviceCombox() { //TODO 获取设备列表,单设备时隐藏下拉框,多设备时添加到下拉框;m_devList记录插入的所有设备,deviceMap记录设备状态 - QMap deviceMap; - getDeviceEnableState(0,deviceMap); - m_deviceComboBox->clear(); - m_devList.clear(); - enableDevice.clear(); - if (!m_switchGsettings) { - qDebug() << "[LanPage]:m_switchGsettings is null" << Q_FUNC_INFO << __LINE__; - return; - } + if (m_wiredSwitch) { + QStringList enableDevices; + enableDevices.clear(); + getEnabledDevice(enableDevices); - m_deviceComboBox->clear(); - m_devList.clear(); - enableDevice.clear(); - - getDeviceEnableState(WIRED, deviceMap); - - bool isOn = m_switchGsettings->get(WIRED_SWITCH).toBool(); - if (!isOn) { - m_deviceFrame->hide(); - m_activatedNetFrame->hide(); - m_inactivatedNetFrame->hide(); - m_activatedNetDivider->hide(); - m_inactivatedNetDivider->hide(); - m_deviceName = ""; - } else { - m_device->getNetworkDeviceList(NetworkManager::Device::Type::Ethernet, m_devList); - for (int i=0; i 1) { + for (int index = 0; index < enableDeviceCount; ++index) { + m_deviceComboBox->addItem(enableDevices.at(index)); } - } - qDebug() << "[LanPage]device num:" << enableDevice.count(); - if (enableDevice.count() == 0) { - m_deviceFrame->show(); - m_deviceComboBox->hide(); - m_tipsLabel->show(); - m_activatedNetFrame->hide(); - m_inactivatedNetFrame->hide(); - m_activatedNetDivider->hide(); - m_inactivatedNetDivider->hide(); - m_deviceName = ""; - return; - } - - m_activatedNetFrame->show(); - m_inactivatedNetFrame->show(); - m_activatedNetDivider->show(); - m_inactivatedNetDivider->show(); - - if (enableDevice.count() == 1) { - m_deviceFrame->hide(); - m_deviceName = enableDevice.at(0); - qDebug() << "[LanPage]Current device:" << m_deviceName; - initList(m_deviceName); - return; - } else { m_deviceFrame->show(); m_tipsLabel->hide(); m_deviceComboBox->show(); - for (int j=0; jaddItem(enableDevice.at(j)); - } + m_currentDeviceName = m_deviceComboBox->currentText(); + } else if (enableDeviceCount == 1) { + m_deviceFrame->hide(); + m_currentDeviceName = enableDevices.at(0); + } else { + m_deviceFrame->show(); + m_deviceComboBox->hide(); + m_tipsLabel->show(); + m_currentDeviceName = ""; + } + } else { + m_deviceFrame->hide(); + m_currentDeviceName = ""; + } - qDebug() << "[LanPage]Current device:" << m_deviceComboBox->currentText(); - m_deviceName = m_deviceComboBox->currentText(); - initList(m_deviceName); + return; +} + +bool LanPage::connectionItemIsExist(QMap &connectMap, + QString uuid) +{ + QMap::iterator iter; + for (iter = connectMap.begin(); iter != connectMap.end(); ++iter) { //检查其是否已经在未激活列表中 + KyConnectItem *p_item = iter.key(); + if (p_item->m_connectUuid == uuid) { + return true; } } + return false; +} + +void LanPage::addEmptyConnectItem(QMap &connectMap, + QListWidget *lanListWidget) +{ + KyConnectItem *p_nullItem = new KyConnectItem(); + p_nullItem->setConnectUuid(INVALID_CONNECT_UUID); + QListWidgetItem *p_listWidgetItem = addNewItem(nullptr, lanListWidget); + connectMap.insert(p_nullItem, p_listWidgetItem); + + return; +} + + +void LanPage::deleteConnectionMapItem(QMap &connectMap, + QListWidget *lanListWidget, QString uuid) +{ + QMap::iterator iter; + + iter = connectMap.begin(); + while (iter != connectMap.end()) { + KyConnectItem *p_item = iter.key(); + if (p_item->m_connectUuid == uuid + || INVALID_CONNECT_UUID == p_item->m_connectUuid) { + qDebug()<<"[LanPage] delete connection map item" + << p_item->m_connectName << p_item->m_connectUuid; + QListWidgetItem *p_widgetItem = iter.value(); + LanListItem *p_lanItem = (LanListItem *)lanListWidget->itemWidget(p_widgetItem); + + lanListWidget->removeItemWidget(p_widgetItem); + + delete p_lanItem; + p_lanItem = nullptr; + + delete p_widgetItem; + p_widgetItem = nullptr; + + iter = connectMap.erase(iter); + + delete p_item; + p_item = nullptr; + + continue; + } + + iter++; + } + + return; +} + +void LanPage::clearConnectionMap(QMap &connectMap, + QListWidget *lanListWidget) +{ + QMap::iterator iter; + + iter = connectMap.begin(); + while (iter != connectMap.end()) { + KyConnectItem *p_connectItem = iter.key(); + QListWidgetItem *p_widgetItem = iter.value(); + + qDebug()<<"[LanPage] clear connection map item"<m_connectName; + + LanListItem *p_lanItem = (LanListItem *)lanListWidget->itemWidget(p_widgetItem); + lanListWidget->removeItemWidget(p_widgetItem); + + delete p_lanItem; + p_lanItem = nullptr; + + delete p_widgetItem; + p_widgetItem = nullptr; + + delete p_connectItem; + p_connectItem = nullptr; + + iter = connectMap.erase(iter); + } + + return; +} + +void LanPage::constructActiveConnectionArea() +{ + QList activedList; + + activedList.clear(); + clearConnectionMap(m_activeMap, m_activatedLanListWidget); + + m_activeResourse->getActiveConnectionList(m_currentDeviceName, + NetworkManager::ConnectionSettings::Wired, activedList); //激活列表的显示 + qDebug() << "[LanPage] construct active connection area get Active list size:" << activedList.size(); + if (!activedList.isEmpty()) { + for (int index = 0; index < activedList.size(); index++) { + KyConnectItem *activeItemData = activedList.at(index); + qDebug()<<"[LanPage] construct active connection area add active item"<m_connectName; + QListWidgetItem *p_listWidgetItem = addNewItem(activeItemData, m_activatedLanListWidget); + m_activeMap.insert(activeItemData, p_listWidgetItem); + } + } else { + qDebug()<<"[LanPage] there is not active"; + + addEmptyConnectItem(m_activeMap, m_activatedLanListWidget); + } + + return; +} + +void LanPage::constructConnectionArea() +{ + QList deactivedList; + + deactivedList.clear(); + clearConnectionMap(m_deactiveMap, m_inactivatedLanListWidget); + + m_connectResourse->getConnectionList(m_currentDeviceName, NetworkManager::ConnectionSettings::Wired, deactivedList); //未激活列表的显示 + qDebug() << "[LanPage]construct connection area get connection list size:" << deactivedList.size(); + if (!deactivedList.isEmpty()) { + for (int index = 0; index < deactivedList.size(); index++) { + KyConnectItem *deactiveItemData = deactivedList.at(index); + qDebug()<<"[LanPage] construct connection area add deactive item"<m_connectName; + QListWidgetItem *p_listWidgetItem = addNewItem(deactiveItemData, m_inactivatedLanListWidget); + m_deactiveMap.insert(deactiveItemData, p_listWidgetItem); + } + } + + return; +} + +void LanPage::initLanArea() +{ + if (!m_wiredSwitch || m_currentDeviceName.isEmpty()) { + m_activatedNetFrame->hide(); + m_inactivatedNetFrame->hide(); + m_activatedNetDivider->hide(); + m_inactivatedNetDivider->hide(); + } else { + m_activatedNetFrame->show(); + m_inactivatedNetFrame->show(); + m_activatedNetDivider->show(); + m_inactivatedNetDivider->show(); + constructActiveConnectionArea(); + constructConnectionArea(); + } + + return; +} + +void LanPage::onRemoveConnection(QString path) //删除时后端会自动断开激活,将其从未激活列表中删除 +{ + //for dbus + qDebug() << "[LanPage] emit lanRemove because onRemoveConnection " << path; + emit lanRemove(path); + + QEventLoop loop; + QTimer::singleShot(200, &loop, SLOT(quit())); + loop.exec(); + + QMap::iterator iters; + for (iters = m_deactiveMap.begin(); iters != m_deactiveMap.end(); ++iters) { + KyConnectItem *p_item = iters.key(); + if (p_item->m_connectPath == path) { + qDebug()<<"[LanPage] Remove a connection from inactive list"; + + LanListItem *p_lanItem = (LanListItem *)m_inactivatedLanListWidget->itemWidget(iters.value()); + + m_inactivatedLanListWidget->removeItemWidget(iters.value()); + + delete p_lanItem; + p_lanItem = nullptr; + + delete(iters.value()); + m_deactiveMap.erase(iters); + + delete p_item; + p_item = nullptr; + + break; + } + } + + return; +} + +void LanPage::onAddConnection(QString uuid) //新增一个有线连接,将其加入到激活列表 +{ + if (!m_connectResourse->isWiredConnection(uuid)) { + return; + } + + KyConnectItem *p_newItem = nullptr; + p_newItem = m_connectResourse->getConnectionItemByUuid(uuid); + if (nullptr != p_newItem) { + sendLanAddSignal(p_newItem); + } + + if (p_newItem->m_ifaceName == m_currentDeviceName || p_newItem->m_ifaceName == "") { + qDebug()<<"[LanPage] Add a new connection, name:"<m_connectName; + QListWidgetItem *p_listWidgetItem = addNewItem(p_newItem, m_inactivatedLanListWidget); + m_deactiveMap.insert(p_newItem, p_listWidgetItem); + } else { + delete p_newItem; + p_newItem = nullptr; + } + + return; +} + +void LanPage::addDeviceForCombox(QString deviceName) +{ + disconnect(m_deviceComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &LanPage::onDeviceComboxIndexChanged); + if (m_wiredSwitch) { + saveDeviceEnableState(deviceName, true); + if (m_currentDeviceName.isEmpty()) { + //1、从无到有添加第一块有线网卡 + //2、有多快网卡,但是没有使能 + m_deviceFrame->hide(); + m_currentDeviceName = deviceName; + } else if (m_deviceComboBox->count() == 0) { + //3、现在有且只有一块网卡,并已使能 + //4、有多快网卡,且使能了其中一块 + m_deviceComboBox->addItem(m_currentDeviceName); + m_deviceComboBox->addItem(deviceName); + + m_deviceFrame->show(); + m_tipsLabel->hide(); + m_deviceComboBox->show(); + } else if (m_deviceComboBox->count() > 0) { + //5、有多快网卡且使能了多块网卡 + m_deviceComboBox->addItem(deviceName); + } + } else { + saveDeviceEnableState(deviceName, false); + } + + connect(m_deviceComboBox, QOverload::of(&QComboBox::currentIndexChanged), + this, &LanPage::onDeviceComboxIndexChanged); return; } @@ -274,66 +477,131 @@ void LanPage::onDeviceAdd(QString deviceName, NetworkManager::Device::Type devic return; } + if (m_devList.contains(deviceName)) { + return; + } + qDebug() << "[LanPage] Begin add device:" << deviceName; m_devList << deviceName; - - if (getDefaultDevice().isEmpty()) { - updateDefaultDevice(deviceName); - setDefaultDevice(WIRED, deviceName); + addDeviceForCombox(deviceName); + if (m_currentDeviceName == deviceName) { + initLanArea(); } + emit deviceStatusChanged(); - initDeviceCombox(); + + return; +} + +void LanPage::deleteDeviceFromCombox(QString deviceName) +{ + disconnect(m_deviceComboBox, QOverload::of(&QComboBox::currentIndexChanged), + this, &LanPage::onDeviceComboxIndexChanged); + + if (m_wiredSwitch) { + if (m_currentDeviceName.isEmpty()) { + //1、没有使能任何网卡 + goto l_out; + } else if (m_deviceComboBox->count() == 0) { + //2、使能了一个网卡,且当前网卡是要删除的网卡 + if (m_currentDeviceName == deviceName) { + m_deviceFrame->show(); + m_deviceComboBox->hide(); + m_tipsLabel->show(); + m_currentDeviceName = ""; + } + } else if (m_deviceComboBox->count() == 2) { + //3、使能了两个网卡,且包括要删除的网卡,有可能是要删除的网卡 + if (m_deviceComboBox->findText(deviceName) != -1) { + for (int index = m_deviceComboBox->count() - 1; index >= 0; index--) { + if (m_currentDeviceName == deviceName + && m_deviceComboBox->itemText(index) != deviceName) { + m_currentDeviceName = m_deviceComboBox->itemText(index); + } + m_deviceComboBox->removeItem(index); + } + + m_tipsLabel->hide(); + m_deviceFrame->hide(); + m_deviceComboBox->hide(); + } + } else { + //4、使能了多个网卡,且包括要删除的网卡,有可能是正要删除的网卡 + int index = m_deviceComboBox->findText(deviceName); + if (index != -1) { + m_deviceComboBox->removeItem(index); + if (m_currentDeviceName == deviceName) { + m_currentDeviceName = m_deviceComboBox->currentText(); + } + } + } + } + +l_out: + connect(m_deviceComboBox, QOverload::of(&QComboBox::currentIndexChanged), + this, &LanPage::onDeviceComboxIndexChanged); + + deleteDeviceEnableState(deviceName); + + return; } void LanPage::onDeviceRemove(QString deviceName) { - qDebug() << "[LanPage] deviceRemove:" << deviceName; - if (getDefaultDevice() == deviceName) { - QStringList list; - QString newDefaultDevice = ""; - list.empty(); - m_device->getNetworkDeviceList(NetworkManager::Device::Type::Ethernet, list); - if (!list.isEmpty()) { - newDefaultDevice = list.at(0); - } - updateDefaultDevice(newDefaultDevice); - setDefaultDevice(WIRED, newDefaultDevice); + if (!m_devList.contains(deviceName)) { + return; } - if (m_devList.contains(deviceName)) { - m_devList.removeOne(deviceName); + qDebug() << "[LanPage] deviceRemove:" << deviceName; + + QString nowDevice = m_currentDeviceName; + + m_devList.removeOne(deviceName); + deleteDeviceFromCombox(deviceName); + + if (nowDevice == deviceName) { + initLanArea(); } emit deviceStatusChanged(); - initDeviceCombox(); + + return; +} + +void LanPage::updateDeviceCombox(QString oldDeviceName, QString newDeviceName) +{ + if (m_currentDeviceName == oldDeviceName) { + m_currentDeviceName = newDeviceName; + } + + int index = m_deviceComboBox->findText(oldDeviceName); + if (index != -1) { + m_deviceComboBox->setItemText(index, newDeviceName); + } + + return; } void LanPage::onDeviceNameUpdate(QString oldName, QString newName) { - if (getDefaultDevice() == oldName) { - updateDefaultDevice(newName); - setDefaultDevice(WIRED, newName); - } + if (m_devList.contains(oldName)) { + m_devList.removeOne(oldName); + m_devList.append(newName); + qDebug() << "[LanPage] emit deviceNameUpdate " << oldName << newName; - if (m_devList.contains(oldName)) { - m_devList.removeOne(oldName); - m_devList.append(newName); - qDebug() << "[LanPage] emit deviceNameUpdate " << oldName << newName; + updateDeviceCombox(oldName, newName); - emit deviceNameChanged(oldName, newName); - initDeviceCombox(); - } + emit deviceNameChanged(oldName, newName); + } } void LanPage::onDeviceComboxIndexChanged(int currentIndex) { //TODO 设备变更时更新设备和列表 - if (enableDevice.count() == m_deviceComboBox->count()) { - m_deviceName = m_deviceComboBox->currentText(); - qDebug() << "[LanPage]Current Device Changed to:" << m_deviceName; - initList(m_deviceName); - } + m_currentDeviceName = m_deviceComboBox->currentText(); + qDebug() << "[LanPage]Current Device Changed to:" << m_currentDeviceName; + initLanArea(); } void LanPage::initUI() @@ -370,206 +638,127 @@ void LanPage::initUI() // emit this->lanConnectChanged(); } -void LanPage::addNewItem(KyConnectItem *itemData, QListWidget *listWidget) +QListWidgetItem *LanPage::addNewItem(KyConnectItem *itemData, QListWidget *listWidget) { - m_listWidgetItem = new QListWidgetItem(listWidget); - m_listWidgetItem->setSizeHint(QSize(listWidget->width(),ITEM_HEIGHT)); - listWidget->addItem(m_listWidgetItem); + QListWidgetItem *p_listWidgetItem = new QListWidgetItem(listWidget); + p_listWidgetItem->setSizeHint(QSize(listWidget->width(),ITEM_HEIGHT)); + listWidget->addItem(p_listWidgetItem); LanListItem *p_lanItem = nullptr; if (itemData != nullptr) { - p_lanItem = new LanListItem(itemData, m_deviceName); - qDebug() << "[LanPage] addNewItem, connection: " << itemData->m_connectName << "deviceName: " << m_deviceName; + p_lanItem = new LanListItem(itemData, m_currentDeviceName); + qDebug() << "[LanPage] addNewItem, connection: " << itemData->m_connectName << "deviceName: " << m_currentDeviceName; } else { p_lanItem = new LanListItem(); qDebug() << "[LanPage] Add nullItem!"; } - listWidget->setItemWidget(m_listWidgetItem, p_lanItem); + + listWidget->setItemWidget(p_listWidgetItem, p_lanItem); + + return p_listWidgetItem; } -void LanPage::initList(QString m_deviceName) //程序拉起,初始化显示 +void LanPage::updateActivatedConnectionArea(QString uuid) { - m_activatedLanListWidget->clear(); - m_inactivatedLanListWidget->clear(); - m_activeMap.clear(); - m_deactiveMap.clear(); - m_activedList.clear(); - m_deactivedList.clear(); + KyConnectItem *p_newItem = nullptr; + p_newItem = m_activeResourse->getActiveConnectionByUuid(uuid); + if (nullptr == p_newItem) { + qWarning()<<"[LanPage] get active connection failed, connection uuid" << uuid; + return; + } - m_activeResourse->getActiveConnectionList(m_deviceName, - NetworkManager::ConnectionSettings::Wired, m_activedList); //激活列表的显示 - qDebug() << "[LanPage]init list! Active list:" << m_activedList.size() << "Deactive list:" << m_deactivedList.size(); - if (!m_activedList.isEmpty()) { - for (int i = 0; i < m_activedList.size(); i++) { - KyConnectItem *activeItemData = m_activedList.at(i); - addNewItem(activeItemData, m_activatedLanListWidget); - emit this->lanConnectChanged(); + //发送通知给控制面板 + emit lanActiveConnectionStateChanged(p_newItem->m_ifaceName, uuid, p_newItem->m_connectState); - m_activeMap.insert(activeItemData, m_listWidgetItem); + if (p_newItem->m_ifaceName == m_currentDeviceName) { + qDebug()<<"[LanPage] update active connection area delete connection item " + << p_newItem->m_connectName; + deleteConnectionMapItem(m_deactiveMap, m_inactivatedLanListWidget, uuid); + + deleteConnectionMapItem(m_activeMap, m_activatedLanListWidget, INVALID_CONNECT_UUID); + if (connectionItemIsExist(m_activeMap, uuid)) { + delete p_newItem; + p_newItem = nullptr; + return; } + + qDebug()<<"[LanPage]update active connection item"<m_connectName; + QListWidgetItem *p_listWidgetItem = addNewItem(p_newItem, m_activatedLanListWidget); + m_activeMap.insert(p_newItem, p_listWidgetItem); + } else { - m_nullItem = new QListWidgetItem(m_activatedLanListWidget); - m_nullItem->setSizeHint(QSize(m_activatedLanListWidget->width(),ITEM_HEIGHT)); - m_activatedLanListWidget->addItem(m_nullItem); - - m_nullLanItem = new LanListItem(); - m_activatedLanListWidget->setItemWidget(m_nullItem, m_nullLanItem); + //释放内存 + delete p_newItem; + p_newItem = nullptr; } - m_connectResourse->getConnectionList(m_deviceName, NetworkManager::ConnectionSettings::Wired, m_deactivedList); //未激活列表的显示 - if (!m_deactivedList.isEmpty()) { - for (int i = 0; i < m_deactivedList.size(); i++) { - KyConnectItem *deactiveItemData = m_deactivedList.at(i); - addNewItem(deactiveItemData, m_inactivatedLanListWidget); - - m_deactiveMap.insert(deactiveItemData, m_listWidgetItem); - } - } - - bool isCarriered = true; - if (!m_device->wiredDeviceCarriered(m_deviceName)) { - isCarriered = false; - } - - m_activeResourse->getActiveConnectionList(m_deviceName, NetworkManager::ConnectionSettings::Wired, m_activedList); //激活列表的显示 - qDebug() << "[LanPage]init list! Active list:" << m_activedList.size() << "Deactive list:" << m_deactivedList.size(); - if (!m_activedList.isEmpty()) { - for (int i = 0; i < m_activedList.size(); i++) { - KyConnectItem *activeItemData = m_activedList.at(i); - if (isCarriered) { - addNewItem(activeItemData, m_activatedLanListWidget); - m_activeMap.insert(activeItemData, m_listWidgetItem); - } else { - addNewItem(activeItemData, m_inactivatedLanListWidget); - m_deactiveMap.insert(activeItemData, m_listWidgetItem); - } - } - } else { - addNewItem(nullptr, m_activatedLanListWidget); //显示一个未激活任何连接的item - } - - + return; } -void LanPage::updateLanlist(QString uuid, NetworkManager::ActiveConnection::State state, NetworkManager::ActiveConnection::Reason reason) +void LanPage::updateConnectionArea(QString uuid) +{ + KyConnectItem *p_newItem = nullptr; + p_newItem = m_connectResourse->getConnectionItemByUuid(uuid); + if (nullptr == p_newItem) { + qWarning()<<"[LanPage] get active connection failed, connection uuid" << uuid; + return; + } + + emit lanActiveConnectionStateChanged(p_newItem->m_ifaceName, uuid, p_newItem->m_connectState); + + if (p_newItem->m_ifaceName == m_currentDeviceName || p_newItem->m_ifaceName == "") { + qDebug()<<"[LanPage] update connection area"<m_connectName; + + deleteConnectionMapItem(m_activeMap, m_activatedLanListWidget, uuid); + if (m_activeMap.count() <= 0) { + addEmptyConnectItem(m_activeMap, m_activatedLanListWidget); + } + + if (connectionItemIsExist(m_deactiveMap, uuid)) { + delete p_newItem; + p_newItem = nullptr; + return; + } + + qDebug()<<"[LanPage] update connection item"<m_connectName; + QListWidgetItem *p_listWidgetItem = addNewItem(p_newItem, m_inactivatedLanListWidget); + m_deactiveMap.insert(p_newItem, p_listWidgetItem); + + emit this->lanConnectChanged(); + } else { + delete p_newItem; + p_newItem = nullptr; + } + + return; +} + +void LanPage::onUpdateLanlist(QString uuid, + NetworkManager::ActiveConnection::State state, + NetworkManager::ActiveConnection::Reason reason) { //lanpage函数内持续监听连接状态的变化并记录供其他函数调用获取状态 - QString devName; - NetworkManager::ConnectionSettings::ConnectionType type; - if (m_connectResourse->getInterfaceByUuid(devName, type, uuid)) { - if (type != NetworkManager::ConnectionSettings::ConnectionType::Wired) { - return; - } - } - if (NetworkManager::ActiveConnection::State::Activated == state){ - m_isLanConnected = true; - qDebug() << "[lanpage]lanIsConnected status : " << m_isLanConnected << Q_FUNC_INFO << __LINE__ ; - } else { - m_isLanConnected = false; - qDebug() << "=[lanpage]lanIsConnected status : " << m_isLanConnected << Q_FUNC_INFO << __LINE__ ; - } - qDebug()<<"[LanPage] State change slot:"<getInterfaceByUuid(devName, type, uuid)) { - if (type != NetworkManager::ConnectionSettings::ConnectionType::Wired) { - qDebug() << "[LanPage] updateLanlist but type is not Wired"; - return; - } - } else { - qDebug() << "[LanPage] updateLanlist but uuid is invalid"; + if (!m_connectResourse->isWiredConnection(uuid)) { + return; } - QStringList devNameList; - if (m_activeResourse->isActiveConnection(uuid, devNameList)) { - for (int i = 0; i < devNameList.size(); ++i) { - KyConnectItem *item = nullptr; - item = m_activeResourse->getActiveConnectionByUuid(uuid, devNameList.at(i)); - if (nullptr != item) { - QStringList info; - info << item->m_connectName << uuid << item->m_connectPath; - emit lanActiveConnectionStateChanged(devNameList.at(i), uuid, state); - } - } - } else { - qDebug() << "emit lanActiveConnectionStateChanged" << devName << uuid << state; - emit lanActiveConnectionStateChanged(devName, uuid, state); + qDebug()<<"[LanPage] connection uuid"<< uuid + << "state change slot:"<< state; + + if (state == NetworkManager::ActiveConnection::State::Activated) { + updateActivatedConnectionArea(uuid); + } else if (state == NetworkManager::ActiveConnection::State::Deactivated) { + updateConnectionArea(uuid); } - qDebug() << "[LanPage] Update Device Name:" << m_deviceName; - - if (state == NetworkManager::ActiveConnection::State::Deactivated) { - qDebug()<<"Get a deactivate, begin to remove it from activeList"; - QMap::iterator i; - for (i = m_activeMap.begin(); i != m_activeMap.constEnd(); ++i) { //有新断开,若在激活列表里则删掉 - KyConnectItem *m_item = i.key(); - if (m_item->m_connectUuid == uuid) { - m_activatedLanListWidget->removeItemWidget(i.value()); - delete(i.value()); - emit this->lanConnectChanged(); - break; - } - } - - bool hasDeactiveNet = false; - QMap::iterator iter; - for (iter = m_deactiveMap.begin(); iter != m_deactiveMap.end(); ++iter) { //检查其是否已经在未激活列表中 - KyConnectItem *m_item = iter.key(); - if (m_item->m_connectUuid == uuid) { - hasDeactiveNet = true; - break; - } - } - qDebug()<<"The deactive has been in DeactiveNet:"<::iterator iters; - for (iters = m_activeMap.begin(); iters != m_activeMap.end(); ++iters) { //在未激活列表中增加一项连接 - KyConnectItem *m_item = iters.key(); - if (m_item->m_connectUuid == uuid && !hasDeactiveNet) { - qDebug()<<"Add a deactive connection to inactiveList:"<m_connectName; - m_item->m_connectState = state; - addNewItem(m_item, m_inactivatedLanListWidget); - - m_deactiveMap.insert(m_item, m_listWidgetItem); - m_activeMap.erase(iters); - break; - } - } - } else if (state == NetworkManager::ActiveConnection::State::Activated) { - qDebug()<<"Get an actived connection, begin to move it from deactive to avtive!"; - QMap::iterator iter; //在未激活列表里删除 - for (iter = m_deactiveMap.begin(); iter != m_deactiveMap.constEnd(); ++iter) { - KyConnectItem *m_item = iter.key(); - if (m_item->m_connectUuid == uuid) { - m_activatedLanListWidget->clear(); - qDebug()<<"Add an active connection to activeList:"<m_connectName; - m_item->m_connectState = state; - addNewItem(m_item, m_activatedLanListWidget); - - m_inactivatedLanListWidget->removeItemWidget(iter.value()); - delete(iter.value()); - - m_activeMap.insert(m_item, m_listWidgetItem); - m_deactiveMap.erase(iter); - break; - } - } - } else { - - } - - if (m_activeMap.count() <= 0) { - m_activatedLanListWidget->clear(); - addNewItem(nullptr, m_activatedLanListWidget); //显示一个未激活任何连接的item - } + return; } void LanPage::getWiredList(QMap > &map) { QStringList devlist; - m_device->getNetworkDeviceList(NetworkManager::Device::Type::Ethernet, devlist); + m_deviceResource->getNetworkDeviceList(NetworkManager::Device::Type::Ethernet, devlist); if (devlist.isEmpty()) { return; } @@ -596,105 +785,157 @@ void LanPage::getWiredList(QMap > &map) return; } -void LanPage::connectionUpdateSlot(QString uuid) +void LanPage::sendLanUpdateSignal(KyConnectItem *p_connectItem) { - QStringList devNameList; - bool isCurrentDevice = false; - KyConnectItem *item = nullptr; + QStringList info; + info << p_connectItem->m_connectName << p_connectItem->m_connectUuid << p_connectItem->m_connectPath; + emit lanUpdate(p_connectItem->m_ifaceName, info); - qDebug() << "[LanPage]:Connection Changed !" << Q_FUNC_INFO << __LINE__; + return; +} - if (m_activeResourse->isActiveConnection(uuid, devNameList)) { //从activeResourse里找 - for (int i = 0; i < devNameList.size(); ++i) { - item = m_activeResourse->getActiveConnectionByUuid(uuid, devNameList.at(i)); - if (nullptr != item) { - if (item->m_itemType != NetworkManager::ConnectionSettings::ConnectionType::Wired) { - return; - } - if (devNameList.at(i) == m_deviceName) { - qDebug() << "[LanPage]:Connection's device:" << devNameList.at(i) << Q_FUNC_INFO << __LINE__; - isCurrentDevice = true; - } - //for dbus - QStringList info; - info << item->m_connectName << uuid << item->m_connectPath; - emit lanUpdate(devNameList.at(i), info); - } - } - } else { - QString devName; - NetworkManager::ConnectionSettings::ConnectionType type; - if (!m_connectResourse->getInterfaceByUuid(devName, type, uuid)) { //从connectResourse里找 - return; - } - if (type != NetworkManager::ConnectionSettings::ConnectionType::Wired) { - return; - } - item = m_connectResourse->getConnectionItemByUuid(uuid, devName); - if (nullptr != item) { - if (devName == m_deviceName) { - qDebug() << "[LanPage]:Connection's device:" << devName << Q_FUNC_INFO << __LINE__; - isCurrentDevice = true; - } - //for dbus - QStringList info; - info << item->m_connectName << uuid << item->m_connectPath; - emit lanUpdate(devName, info); - } - } - qDebug() << "[LanPage]:Connection belong to current device:" << isCurrentDevice; +void LanPage::sendLanAddSignal(KyConnectItem *p_connectItem) +{ + QStringList info; + info << p_connectItem->m_connectName << p_connectItem->m_connectUuid << p_connectItem->m_connectPath; + qDebug() << "[LanPage] emit lanAdd because addConnection "; + emit lanAdd(p_connectItem->m_ifaceName, info); + + return; +} + +void LanPage::updateConnectionProperty(KyConnectItem *p_connectItem) +{ QMap::iterator iter; for (iter = m_deactiveMap.begin(); iter != m_deactiveMap.constEnd(); ++iter) { - KyConnectItem *m_item = iter.key(); - if (m_item->m_connectUuid == uuid) { - if (!isCurrentDevice) { //当前未激活连接的设备改变 + KyConnectItem *p_item = iter.key(); + if (p_item->m_connectUuid == p_connectItem->m_connectUuid) { + if (p_connectItem->m_ifaceName != "" + && m_currentDeviceName != p_connectItem->m_ifaceName) { //当前未激活连接的设备改变 + LanListItem *p_lanItem = (LanListItem *)m_inactivatedLanListWidget->itemWidget(iter.value()); + m_inactivatedLanListWidget->removeItemWidget(iter.value()); + + delete p_lanItem; + p_lanItem = nullptr; + delete iter.value(); m_deactiveMap.erase(iter); - qDebug() << "[LanPage]:Deactive Connection's device change, remove it" << Q_FUNC_INFO << __LINE__; - return; + + delete p_item; + p_item = nullptr; } else { - if (m_item->m_connectName != item->m_connectName || m_item->m_connectPath != item->m_connectPath) { //当前未激活连接的其他数据改变(除了激活状态外) - qDebug() << "[LanPage]:Deactive Connection's name or path changed." << Q_FUNC_INFO << __LINE__; - qDebug() << "new:" << item->m_connectUuid << item->m_connectName << item->m_connectPath << item->m_connectState << item->m_ifaceName; - qDebug() << "old:" << m_item->m_connectUuid << m_item->m_connectName << m_item->m_connectPath << m_item->m_connectState << m_item->m_ifaceName; + if (p_connectItem->m_connectName != p_item->m_connectName + || p_connectItem->m_connectPath != p_item->m_connectPath) { //当前未激活连接的其他数据改变(除了激活状态外) + LanListItem *p_lanItem = (LanListItem *)m_inactivatedLanListWidget->itemWidget(iter.value()); + m_inactivatedLanListWidget->removeItemWidget(iter.value()); + + delete p_lanItem; + p_lanItem = nullptr; + delete iter.value(); m_deactiveMap.erase(iter); - addNewItem(item, m_inactivatedLanListWidget); - m_deactiveMap.insert(item, m_listWidgetItem); - break; + delete p_item; + p_item = nullptr; + + QListWidgetItem *p_listWidgetItem = addNewItem(p_connectItem, m_inactivatedLanListWidget); + m_deactiveMap.insert(p_connectItem, p_listWidgetItem); + p_connectItem = nullptr; } } } + break; } + + return; +} + +void LanPage::updateActiveConnectionProperty(KyConnectItem *p_connectItem) +{ QMap::iterator iters; for (iters = m_activeMap.begin(); iters != m_activeMap.constEnd(); ++iters) { - KyConnectItem *m_item = iters.key(); - if (m_item->m_connectUuid == uuid) { - if (!isCurrentDevice) { //当前激活连接的设备改变 + KyConnectItem *p_item = iters.key(); + if (p_item->m_connectUuid == p_connectItem->m_connectUuid) { + if (m_currentDeviceName != p_connectItem->m_ifaceName) { //当前激活连接的设备改变 + LanListItem *p_lanItem = (LanListItem *)m_activatedLanListWidget->itemWidget(iters.value()); m_activatedLanListWidget->removeItemWidget(iters.value()); + + delete p_lanItem; + p_lanItem = nullptr; + delete iters.value(); m_activeMap.erase(iters); - qDebug() << "[LanPage]:Active Connection's device change, remove it" << Q_FUNC_INFO << __LINE__; - return; + + delete p_item; + p_item = nullptr; + } else { - if (m_item->m_connectName != item->m_connectName || m_item->m_connectPath != item->m_connectPath) { //当前激活连接的其他数据改变(除了激活状态外) - qDebug() << "[LanPage]:Active Connection's name or path changed." << Q_FUNC_INFO << __LINE__; - qDebug() << "new:" << item->m_connectUuid << item->m_connectName << item->m_connectPath << item->m_connectState << item->m_ifaceName; - qDebug() << "old:" << m_item->m_connectUuid << m_item->m_connectName << m_item->m_connectPath << m_item->m_connectState << m_item->m_ifaceName; + if (p_item->m_connectName != p_connectItem->m_connectName + || p_item->m_connectPath != p_connectItem->m_connectPath) { //当前激活连接的其他数据改变(除了激活状态外) + LanListItem *p_lanItem = (LanListItem *)m_activatedLanListWidget->itemWidget(iters.value()); m_activatedLanListWidget->removeItemWidget(iters.value()); + + delete p_lanItem; + p_lanItem = nullptr; + delete iters.value(); m_activeMap.erase(iters); - addNewItem(item, m_activatedLanListWidget); - m_activeMap.insert(item, m_listWidgetItem); - break; + delete p_item; + p_item = nullptr; + + QListWidgetItem *p_listWidgetItem = addNewItem(p_connectItem, m_activatedLanListWidget); + m_activeMap.insert(p_connectItem, p_listWidgetItem); + p_connectItem = nullptr; } } + break; } } + + return; +} + +void LanPage::onUpdateConnection(QString uuid) +{ + + if (!m_connectResourse->isWiredConnection(uuid)) { + return; + } + + qDebug() << "[LanPage]:Connection Changed !" << Q_FUNC_INFO << __LINE__; + + KyConnectItem *p_newItem = nullptr; + if (m_connectResourse->isActivatedConnection(uuid)) { + p_newItem = m_activeResourse->getActiveConnectionByUuid(uuid); + if (nullptr == p_newItem) { + qWarning()<<"[LanPage] get item failed, when update activate connection." + <<"connection uuid"<getConnectionItemByUuid(uuid); + if (nullptr == p_newItem) { + qWarning()<<"[LanPage] get item failed, when update connection." + <<"connection uuid"<activateConnection(connUuid, devName); } void LanPage::deactivateWired(const QString& devName, const QString& connUuid) { - qDebug() << "deactivateWired" << devName << connUuid; -// KyConnectItem *item = nullptr; -// item = m_activeResourse->getActiveConnectionByUuid(connUuid, devName); -// if (nullptr == item) { -// qDebug() << "not ActiveConnection"; -// item = m_connectResourse->getConnectionItemByUuid(connUuid, devName); -// if (nullptr == item) { -// QString errorMessage = tr("it can not find the activate connect" + tr("uuid") + connUuid; -// qWarning()<deactivateWiredConnection(name, connUuid); } void LanPage::showDetailPage(QString devName, QString uuid) { - KyConnectItem *item = nullptr; + KyConnectItem *p_item = nullptr; bool isActive = true; - item = m_activeResourse->getActiveConnectionByUuid(uuid, devName); - if (nullptr == item) { - item = m_connectResourse->getConnectionItemByUuid(uuid, devName); - if (nullptr == item) { - qWarning()<<"[LanPage] GetConnectionItemByUuid is empty when showDetailPage." - <<"device name"<isActivatedConnection(uuid)) { + p_item = m_activeResourse->getActiveConnectionByUuid(uuid); + isActive = true; + } else { + p_item = m_connectResourse->getConnectionItemByUuid(uuid); + isActive = false; } - NetDetail *netDetail = new NetDetail(devName, item->m_connectName, uuid, isActive, false, false, this); + if (nullptr == p_item) { + qWarning()<<"[LanPage] GetConnectionItemByUuid is empty when showDetailPage." + <<"device name"<m_connectName, uuid, isActive, false, false, this); netDetail->show(); - delete item; - item = nullptr; + delete p_item; + p_item = nullptr; } diff --git a/src/frontend/tab-pages/lanpage.h b/src/frontend/tab-pages/lanpage.h index 31e99f1d..0cf560ea 100644 --- a/src/frontend/tab-pages/lanpage.h +++ b/src/frontend/tab-pages/lanpage.h @@ -30,63 +30,84 @@ public: void showDetailPage(QString devName, QString uuid); void setWiredDeviceEnable(const QString& devName, bool enable); +private: + void initDeviceState(); + void initUI(); + void initLanArea(); + void initNetSwitch(); + + void initDeviceCombox(); + void updateDeviceCombox(QString oldDeviceName, QString newDeviceName); + void deleteDeviceFromCombox(QString deviceName); + void addDeviceForCombox(QString deviceName); + + QListWidgetItem *addNewItem(KyConnectItem *itemData, QListWidget *listWidget); + + void getEnabledDevice(QStringList &enableDeviceList); + void getDisabledDevices(QStringList &disableDeviceList); + + void constructConnectionArea(); + void constructActiveConnectionArea(); + + void updateConnectionArea(QString uuid); + void updateActivatedConnectionArea(QString uuid); + + void updateActiveConnectionProperty(KyConnectItem *p_connectItem); + void updateConnectionProperty(KyConnectItem *p_connectItem); + + void sendLanUpdateSignal(KyConnectItem *p_connectItem); + void sendLanAddSignal(KyConnectItem *p_connectItem); + + void addEmptyConnectItem(QMap &connectMap, + QListWidget *lanListWidget); + void clearConnectionMap(QMap &connectMap, + QListWidget *lanListWidget); + void deleteConnectionMapItem(QMap &connectMap, + QListWidget *lanListWidget, QString uuid); + bool connectionItemIsExist(QMap &connectMap, + QString uuid); + signals: void lanAdd(QString devName, QStringList info); void lanRemove(QString dbusPath); void lanUpdate(QString devName, QStringList info); + void lanActiveConnectionStateChanged(QString interface, QString uuid, int status); void lanConnectChanged(); -private: - void initDeviceState(); - void initDeviceCombox(); - void initUI(); - void initList(QString m_deviceName); - void addNewItem(KyConnectItem *itemData, QListWidget *listWidget); - void addNUllItem(QListWidget *listWidget); - void initNetSwitch(); +private slots: + void onUpdateLanlist(QString uuid, NetworkManager::ActiveConnection::State state, NetworkManager::ActiveConnection::Reason reason); + + void onAddConnection(QString uuid); + void onRemoveConnection(QString path); + void onUpdateConnection(QString uuid); + + void onSwithGsettingsChanged(const QString &key); + void onLanSwitchClicked(); + + void onDeviceAdd(QString deviceName, NetworkManager::Device::Type deviceType); + void onDeviceRemove(QString deviceName); + void onDeviceNameUpdate(QString oldName, QString newName); + + void onDeviceComboxIndexChanged(int currentIndex); private: QListWidget * m_activatedLanListWidget = nullptr; QListWidget * m_inactivatedLanListWidget = nullptr; - LanListItem * m_nullLanItem = nullptr; - QListWidgetItem *m_nullItem = nullptr; - QListWidgetItem *m_listWidgetItem = nullptr; - - KyNetworkDeviceResourse *m_device = nullptr; + KyNetworkDeviceResourse *m_deviceResource = nullptr; KyWiredConnectOperation *m_wiredConnectOperation = nullptr; KyActiveConnectResourse *m_activeResourse = nullptr; //激活的连接 - KyConnectResourse *m_connectResourse = nullptr; //未激活的连接 - - QList m_activedList; - QList m_deactivedList; - -// QMap > m_deviceMap; + KyConnectResourse *m_connectResourse = nullptr; //未激活的连接 QMap m_deactiveMap; QMap m_activeMap; -// QMap m_deactiveMap; -// QMap m_activeMap; - - QString m_deviceName; + QString m_currentDeviceName; QStringList m_devList; - QStringList enableDevice; - QGSettings * m_switchGsettings = nullptr; + QGSettings *m_switchGsettings = nullptr; -private slots: - void updateLanlist(QString uuid, NetworkManager::ActiveConnection::State state, NetworkManager::ActiveConnection::Reason reason); - void addConnectionSlot(QString uuid); - void removeConnectionSlot(QString path); - void connectionUpdateSlot(QString uuid); - void onSwithGsettingsChanged(const QString &key); - void onLanSwitchClicked(); - void onDeviceAdd(QString deviceName, NetworkManager::Device::Type deviceType); - void onDeviceRemove(QString deviceName); - void onDeviceNameUpdate(QString oldName, QString newName); - void onDeviceComboxIndexChanged(int currentIndex); -// void onLanDataChange(QString uuid); + bool m_wiredSwitch = true; }; #endif // LANPAGE_H diff --git a/src/frontend/tab-pages/tabpage.cpp b/src/frontend/tab-pages/tabpage.cpp index 7e5e9312..c35f3d71 100644 --- a/src/frontend/tab-pages/tabpage.cpp +++ b/src/frontend/tab-pages/tabpage.cpp @@ -187,6 +187,18 @@ void saveDeviceEnableState(QString deviceName, bool enable) return; } +void deleteDeviceEnableState(QString deviceName) +{ + QSettings * m_settings = new QSettings(CONFIG_FILE_PATH, QSettings::IniFormat); + m_settings->beginGroup("CARDEABLE"); + m_settings->remove(deviceName); + m_settings->endGroup(); + m_settings->sync(); + delete m_settings; + m_settings = nullptr; + return; +} + void getDeviceEnableState(int type, QMap &map) { map.clear(); diff --git a/src/frontend/tab-pages/tabpage.h b/src/frontend/tab-pages/tabpage.h index 7088fb8c..2d639906 100644 --- a/src/frontend/tab-pages/tabpage.h +++ b/src/frontend/tab-pages/tabpage.h @@ -42,6 +42,7 @@ const QString CONFIG_FILE_PATH = QDir::homePath() + "/.config/ukui/kylin-nm.c bool checkDeviceExist(KyDeviceType deviceType, QString deviceName); void setDefaultDevice(KyDeviceType deviceType, QString deviceName); void saveDeviceEnableState(QString deviceName, bool enable); +void deleteDeviceEnableState(QString deviceName); void getDeviceEnableState(int type, QMap &map); class TabPage : public QWidget From 24d5a98ff99a8cdb78a2049fde791b916d77b1f5 Mon Sep 17 00:00:00 2001 From: renpeijia Date: Wed, 29 Sep 2021 13:43:35 +0800 Subject: [PATCH 02/10] modify: modify wired network switch logic --- src/frontend/tab-pages/lanpage.cpp | 172 +++++++++++++++++++---------- src/frontend/tab-pages/lanpage.h | 4 +- src/frontend/tab-pages/tabpage.cpp | 31 +++++- src/frontend/tab-pages/tabpage.h | 1 + 4 files changed, 148 insertions(+), 60 deletions(-) diff --git a/src/frontend/tab-pages/lanpage.cpp b/src/frontend/tab-pages/lanpage.cpp index ca845212..de0699f5 100644 --- a/src/frontend/tab-pages/lanpage.cpp +++ b/src/frontend/tab-pages/lanpage.cpp @@ -23,13 +23,9 @@ LanPage::LanPage(QWidget *parent) : TabPage(parent) m_connectResourse = new KyConnectResourse(this); m_deviceResource = new KyNetworkDeviceResourse(this); - m_devList.clear(); - m_deviceResource->getNetworkDeviceList(NetworkManager::Device::Type::Ethernet, m_devList); - - initDeviceState(); - initUI(); initNetSwitch(); + initLanDevice(); initDeviceCombox(); initLanArea(); @@ -53,20 +49,45 @@ LanPage::~LanPage() } -void LanPage::initDeviceState() +void LanPage::initLanDevice() { - QMap deviceStateMap; + m_devList.clear(); + m_deviceResource->getNetworkDeviceList(NetworkManager::Device::Type::Ethernet, m_devList); + m_currentDeviceName = getDefaultDeviceName(WIRED); + + QMap deviceStateMap; getDeviceEnableState(WIRED, deviceStateMap); - KyWiredConnectOperation wiredOperation; - QMap::iterator iter = deviceStateMap.begin(); - while (iter != deviceStateMap.end()) { - if (!iter.value()) { - wiredOperation.closeWiredNetworkWithDevice(iter.key()); + QStringList disableDeviceList; + disableDeviceList.clear(); + m_enableDeviceList.clear(); + for (int index = 0; index < m_devList.count(); ++index) { + QString deviceName = m_devList.at(index); + if (deviceStateMap.contains(deviceName)) { + if (deviceStateMap[deviceName]) { + m_enableDeviceList<::of(&QComboBox::currentIndexChanged), + this, &LanPage::onDeviceComboxIndexChanged); + m_deviceComboBox->clear(); if (m_wiredSwitch) { - QStringList enableDevices; - enableDevices.clear(); - getEnabledDevice(enableDevices); - - int enableDeviceCount = enableDevices.count(); + int enableDeviceCount = m_enableDeviceList.count(); if (enableDeviceCount > 1) { for (int index = 0; index < enableDeviceCount; ++index) { - m_deviceComboBox->addItem(enableDevices.at(index)); + m_deviceComboBox->addItem(m_enableDeviceList.at(index)); } m_deviceFrame->show(); m_tipsLabel->hide(); m_deviceComboBox->show(); - m_currentDeviceName = m_deviceComboBox->currentText(); + if (m_currentDeviceName != m_deviceComboBox->currentText()) { + if (m_enableDeviceList.contains(m_currentDeviceName)) { + m_deviceComboBox->setCurrentText(m_currentDeviceName); + } else { + m_currentDeviceName = m_deviceComboBox->currentText(); + setDefaultDevice(WIRED, m_currentDeviceName); + } + } + } else if (enableDeviceCount == 1) { m_deviceFrame->hide(); - m_currentDeviceName = enableDevices.at(0); + + if (m_currentDeviceName != m_enableDeviceList.at(0)) { + m_currentDeviceName = m_enableDeviceList.at(0); + setDefaultDevice(WIRED, m_currentDeviceName); + } } else { m_deviceFrame->show(); m_deviceComboBox->hide(); @@ -217,6 +239,8 @@ void LanPage::initDeviceCombox() m_currentDeviceName = ""; } + connect(m_deviceComboBox, QOverload::of(&QComboBox::currentIndexChanged), + this, &LanPage::onDeviceComboxIndexChanged); return; } @@ -363,16 +387,18 @@ void LanPage::constructConnectionArea() void LanPage::initLanArea() { if (!m_wiredSwitch || m_currentDeviceName.isEmpty()) { - m_activatedNetFrame->hide(); - m_inactivatedNetFrame->hide(); m_activatedNetDivider->hide(); + m_activatedNetFrame->hide(); + m_inactivatedNetDivider->hide(); + m_inactivatedNetFrame->hide(); } else { - m_activatedNetFrame->show(); - m_inactivatedNetFrame->show(); m_activatedNetDivider->show(); - m_inactivatedNetDivider->show(); + m_activatedNetFrame->show(); constructActiveConnectionArea(); + + m_inactivatedNetDivider->show(); + m_inactivatedNetFrame->show(); constructConnectionArea(); } @@ -441,15 +467,16 @@ void LanPage::onAddConnection(QString uuid) //新增一个有线 void LanPage::addDeviceForCombox(QString deviceName) { - disconnect(m_deviceComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &LanPage::onDeviceComboxIndexChanged); + disconnect(m_deviceComboBox, QOverload::of(&QComboBox::currentIndexChanged), + this, &LanPage::onDeviceComboxIndexChanged); + if (m_wiredSwitch) { - saveDeviceEnableState(deviceName, true); - if (m_currentDeviceName.isEmpty()) { + if (1 == m_enableDeviceList.count()) { //1、从无到有添加第一块有线网卡 //2、有多快网卡,但是没有使能 m_deviceFrame->hide(); m_currentDeviceName = deviceName; - } else if (m_deviceComboBox->count() == 0) { + } else if (2 == m_enableDeviceList.count()) { //3、现在有且只有一块网卡,并已使能 //4、有多快网卡,且使能了其中一块 m_deviceComboBox->addItem(m_currentDeviceName); @@ -458,12 +485,10 @@ void LanPage::addDeviceForCombox(QString deviceName) m_deviceFrame->show(); m_tipsLabel->hide(); m_deviceComboBox->show(); - } else if (m_deviceComboBox->count() > 0) { + } else if (m_enableDeviceList.count() > 2) { //5、有多快网卡且使能了多块网卡 m_deviceComboBox->addItem(deviceName); } - } else { - saveDeviceEnableState(deviceName, false); } connect(m_deviceComboBox, QOverload::of(&QComboBox::currentIndexChanged), @@ -484,8 +509,12 @@ void LanPage::onDeviceAdd(QString deviceName, NetworkManager::Device::Type devic qDebug() << "[LanPage] Begin add device:" << deviceName; m_devList << deviceName; + saveDeviceEnableState(deviceName, true); + m_enableDeviceList<count() == 0) { + } else if (1 == m_enableDeviceList.count()) { //2、使能了一个网卡,且当前网卡是要删除的网卡 if (m_currentDeviceName == deviceName) { m_deviceFrame->show(); @@ -511,7 +540,7 @@ void LanPage::deleteDeviceFromCombox(QString deviceName) m_tipsLabel->show(); m_currentDeviceName = ""; } - } else if (m_deviceComboBox->count() == 2) { + } else if (2 == m_enableDeviceList.count()) { //3、使能了两个网卡,且包括要删除的网卡,有可能是要删除的网卡 if (m_deviceComboBox->findText(deviceName) != -1) { for (int index = m_deviceComboBox->count() - 1; index >= 0; index--) { @@ -542,8 +571,6 @@ l_out: connect(m_deviceComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &LanPage::onDeviceComboxIndexChanged); - deleteDeviceEnableState(deviceName); - return; } @@ -556,14 +583,18 @@ void LanPage::onDeviceRemove(QString deviceName) qDebug() << "[LanPage] deviceRemove:" << deviceName; QString nowDevice = m_currentDeviceName; - - m_devList.removeOne(deviceName); deleteDeviceFromCombox(deviceName); - if (nowDevice == deviceName) { + setDefaultDevice(WIRED, m_currentDeviceName); initLanArea(); } + m_devList.removeOne(deviceName); + if (m_enableDeviceList.contains(deviceName)) { + m_enableDeviceList.removeOne(deviceName); + } + deleteDeviceEnableState(deviceName); + emit deviceStatusChanged(); return; @@ -573,6 +604,7 @@ void LanPage::updateDeviceCombox(QString oldDeviceName, QString newDeviceName) { if (m_currentDeviceName == oldDeviceName) { m_currentDeviceName = newDeviceName; + setDefaultDevice(WIRED, m_currentDeviceName); } int index = m_deviceComboBox->findText(oldDeviceName); @@ -588,6 +620,11 @@ void LanPage::onDeviceNameUpdate(QString oldName, QString newName) if (m_devList.contains(oldName)) { m_devList.removeOne(oldName); m_devList.append(newName); + + if (m_enableDeviceList.contains(oldName)) { + m_enableDeviceList.removeOne(oldName); + m_enableDeviceList.append(newName); + } qDebug() << "[LanPage] emit deviceNameUpdate " << oldName << newName; updateDeviceCombox(oldName, newName); @@ -952,11 +989,30 @@ void LanPage::setWiredDeviceEnable(const QString& devName, bool enable) KyWiredConnectOperation wiredOperation; if (enable) { wiredOperation.openWiredNetworkWithDevice(devName); + + m_enableDeviceList<beginGroup("DEFAULTCARD"); + defaultDevice = m_settings->value(key).toString(); + m_settings->endGroup(); + + delete m_settings; + m_settings = nullptr; + + return defaultDevice; +} + void setDefaultDevice(KyDeviceType deviceType, QString deviceName) { QString key; @@ -140,15 +167,17 @@ void setDefaultDevice(KyDeviceType deviceType, QString deviceName) break; default: return; - break; } + QSettings * m_settings = new QSettings(CONFIG_FILE_PATH, QSettings::IniFormat); m_settings->beginGroup("DEFAULTCARD"); m_settings->setValue(key, deviceName); m_settings->endGroup(); m_settings->sync(); + delete m_settings; m_settings = nullptr; + return; } diff --git a/src/frontend/tab-pages/tabpage.h b/src/frontend/tab-pages/tabpage.h index 2d639906..e0cca3d4 100644 --- a/src/frontend/tab-pages/tabpage.h +++ b/src/frontend/tab-pages/tabpage.h @@ -40,6 +40,7 @@ enum KyDeviceType const QString CONFIG_FILE_PATH = QDir::homePath() + "/.config/ukui/kylin-nm.conf"; bool checkDeviceExist(KyDeviceType deviceType, QString deviceName); +QString getDefaultDeviceName(KyDeviceType deviceType); void setDefaultDevice(KyDeviceType deviceType, QString deviceName); void saveDeviceEnableState(QString deviceName, bool enable); void deleteDeviceEnableState(QString deviceName); From b883cb58968d3a417238d7125c9199d37169401d Mon Sep 17 00:00:00 2001 From: kangshuning Date: Wed, 29 Sep 2021 15:13:47 +0800 Subject: [PATCH 03/10] bug#83002#83284 --- src/frontend/list-items/lanlistitem.cpp | 4 +++- src/frontend/tab-pages/lanpage.cpp | 5 +---- src/frontend/tab-pages/tabpage.cpp | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/frontend/list-items/lanlistitem.cpp b/src/frontend/list-items/lanlistitem.cpp index b5548eed..b4c6a1f9 100644 --- a/src/frontend/list-items/lanlistitem.cpp +++ b/src/frontend/list-items/lanlistitem.cpp @@ -24,7 +24,6 @@ LanListItem::LanListItem(KyConnectItem *data, QString deviceName, QWidget *paren m_isActive = false; } } - m_netButton->setActive(m_isActive); m_itemFrame->installEventFilter(this); connect(this->m_infoButton, &InfoButton::clicked, this, &LanListItem::onInfoButtonClicked); connect(m_activeConnectResource, &KyActiveConnectResourse::stateChangeReason, this, &LanListItem::onLanStatusChange); @@ -43,8 +42,10 @@ void LanListItem::setIcon(bool isOn) { if (isOn) { m_netButton->setButtonIcon(QIcon::fromTheme("network-wired-connected-symbolic")); + m_netButton->setActive(true); //设置图标显示不同颜色 } else { m_netButton->setButtonIcon(QIcon::fromTheme("network-wired-disconnected-symbolic")); + m_netButton->setActive(false); } } @@ -63,6 +64,7 @@ void LanListItem::onNetButtonClicked() } else { qDebug() << "[LanListItem] Wired Device not carried"; + this->showDesktopNotify(tr("Wired Device not carried")); m_isActive = false; } } else { diff --git a/src/frontend/tab-pages/lanpage.cpp b/src/frontend/tab-pages/lanpage.cpp index c0bfca1a..cba4a7a7 100644 --- a/src/frontend/tab-pages/lanpage.cpp +++ b/src/frontend/tab-pages/lanpage.cpp @@ -195,7 +195,7 @@ void LanPage::initDeviceCombox() } m_deviceComboBox->clear(); - m_devList.clear(); + m_devList.clear(); //!!!! enableDevice.clear(); getDeviceEnableState(WIRED, deviceMap); @@ -206,7 +206,6 @@ void LanPage::initDeviceCombox() m_activatedNetFrame->hide(); m_inactivatedNetFrame->hide(); m_activatedNetDivider->hide(); - m_inactivatedNetDivider->hide(); m_deviceName = ""; } else { m_device->getNetworkDeviceList(NetworkManager::Device::Type::Ethernet, m_devList); @@ -229,7 +228,6 @@ void LanPage::initDeviceCombox() m_activatedNetFrame->hide(); m_inactivatedNetFrame->hide(); m_activatedNetDivider->hide(); - m_inactivatedNetDivider->hide(); m_deviceName = ""; return; } @@ -237,7 +235,6 @@ void LanPage::initDeviceCombox() m_activatedNetFrame->show(); m_inactivatedNetFrame->show(); m_activatedNetDivider->show(); - m_inactivatedNetDivider->show(); if (enableDevice.count() == 1) { m_deviceFrame->hide(); diff --git a/src/frontend/tab-pages/tabpage.cpp b/src/frontend/tab-pages/tabpage.cpp index cf071387..bfcc701f 100644 --- a/src/frontend/tab-pages/tabpage.cpp +++ b/src/frontend/tab-pages/tabpage.cpp @@ -93,8 +93,8 @@ void TabPage::initUI() m_mainLayout->addWidget(m_activatedNetFrame); m_mainLayout->addWidget(m_activatedNetDivider); m_mainLayout->addWidget(m_inactivatedNetFrame); - m_mainLayout->addWidget(m_inactivatedNetDivider); m_mainLayout->addStretch(); + m_mainLayout->addWidget(m_inactivatedNetDivider); m_mainLayout->addWidget(m_settingsFrame); } From ea55b6735e571a3f6787202b8314e9c14e53d4a0 Mon Sep 17 00:00:00 2001 From: zhangjiaping Date: Wed, 29 Sep 2021 15:19:10 +0800 Subject: [PATCH 04/10] Fix:#83335 #83336 #83709 --- src/frontend/list-items/wlanlistitem.cpp | 11 +++++++++++ src/frontend/tools/infobutton.cpp | 2 ++ src/frontend/tools/radioitembutton.cpp | 1 + 3 files changed, 14 insertions(+) diff --git a/src/frontend/list-items/wlanlistitem.cpp b/src/frontend/list-items/wlanlistitem.cpp index ac0a6110..4c2ade07 100644 --- a/src/frontend/list-items/wlanlistitem.cpp +++ b/src/frontend/list-items/wlanlistitem.cpp @@ -276,6 +276,10 @@ void WlanListItem::onNetButtonClicked() qDebug() << "On wlan clicked! But there is no wlan connect!" << Q_FUNC_INFO << __LINE__; return; } + if ((m_state == NetworkManager::ActiveConnection::State::Activating || m_state == NetworkManager::ActiveConnection::State::Deactivating)) { + qDebug() << "On wlan clicked! But there is nothing to do because it is already activating/deactivating!" << Q_FUNC_INFO << __LINE__; + return; + } //执行连接或断开 if (m_isActive) { @@ -367,6 +371,12 @@ void WlanListItem::onConnectButtonClicked() if (!m_connectButton->isEnabled() || !m_data) { return; } + + if ((m_state == NetworkManager::ActiveConnection::State::Activating || m_state == NetworkManager::ActiveConnection::State::Deactivating)) { + qDebug() << "On wlan clicked! But there is nothing to do because it is already activating/deactivating!" << Q_FUNC_INFO << __LINE__; + return; + } + KyWirelessConnectSetting settings; settings.m_connectName = m_data->m_NetSsid; settings.m_ssid = m_data->m_NetSsid; @@ -410,6 +420,7 @@ void WlanListItem::onWlanStatusChange(QString uuid, NetworkManager::ActiveConnec m_resource->getSsidByUuid(uuid, ssid, devName); if (m_data->m_NetSsid == ssid) { qDebug() << "[WlanPage] State changed to :" << state << Q_FUNC_INFO <<__LINE__; + m_state = state; if ((state == NetworkManager::ActiveConnection::State::Activating || state == NetworkManager::ActiveConnection::State::Deactivating) && devName == m_wlanDevice) { m_netButton->startLoading(); diff --git a/src/frontend/tools/infobutton.cpp b/src/frontend/tools/infobutton.cpp index 48059e57..3af96e09 100644 --- a/src/frontend/tools/infobutton.cpp +++ b/src/frontend/tools/infobutton.cpp @@ -61,6 +61,8 @@ void InfoButton::paintEvent(QPaintEvent *event) painter.fillPath(outerPath, pal.color(QPalette::Text)); painter.setPen(m_foregroundColor); + QFont font("Noto Sans CJK SC", 11, QFont::Normal, false); + painter.setFont(font); painter.drawText(TEXT_POS, "i"); } diff --git a/src/frontend/tools/radioitembutton.cpp b/src/frontend/tools/radioitembutton.cpp index 4d8cf9db..b399cf22 100644 --- a/src/frontend/tools/radioitembutton.cpp +++ b/src/frontend/tools/radioitembutton.cpp @@ -101,6 +101,7 @@ void RadioItemButton::onLoadingStopped() qWarning() << "Stop loading failed, m_animation is null pointer!" << Q_FUNC_INFO << __LINE__; return; } else { + m_iconLabel->setPixmap(m_pixmap); m_animation->stop(); } From 112572cc4d715131b1b0922c056891fd4f62f44e Mon Sep 17 00:00:00 2001 From: renpeijia Date: Thu, 30 Sep 2021 08:59:22 +0800 Subject: [PATCH 05/10] modify: it can not show connection list, when add wired device. --- src/frontend/tab-pages/lanpage.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frontend/tab-pages/lanpage.cpp b/src/frontend/tab-pages/lanpage.cpp index de0699f5..fcb101a5 100644 --- a/src/frontend/tab-pages/lanpage.cpp +++ b/src/frontend/tab-pages/lanpage.cpp @@ -604,7 +604,6 @@ void LanPage::updateDeviceCombox(QString oldDeviceName, QString newDeviceName) { if (m_currentDeviceName == oldDeviceName) { m_currentDeviceName = newDeviceName; - setDefaultDevice(WIRED, m_currentDeviceName); } int index = m_deviceComboBox->findText(oldDeviceName); @@ -628,6 +627,10 @@ void LanPage::onDeviceNameUpdate(QString oldName, QString newName) qDebug() << "[LanPage] emit deviceNameUpdate " << oldName << newName; updateDeviceCombox(oldName, newName); + if (m_currentDeviceName == newName) { + setDefaultDevice(WIRED, m_currentDeviceName); + initLanArea(); + } emit deviceNameChanged(oldName, newName); } From 9e5a79fcf31b970dfe2fc86bf50856525a87f003 Mon Sep 17 00:00:00 2001 From: renpeijia Date: Thu, 30 Sep 2021 14:48:42 +0800 Subject: [PATCH 06/10] fix:1)it will crash,when it's name is changed. 2)it will not change name, when it's name is cahnged. --- src/frontend/tab-pages/lanpage.cpp | 22 ++++++++++++---------- src/frontend/tab-pages/lanpage.h | 4 ++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/frontend/tab-pages/lanpage.cpp b/src/frontend/tab-pages/lanpage.cpp index fcb101a5..48b46b1e 100644 --- a/src/frontend/tab-pages/lanpage.cpp +++ b/src/frontend/tab-pages/lanpage.cpp @@ -851,7 +851,7 @@ void LanPage::sendLanAddSignal(KyConnectItem *p_connectItem) return; } -void LanPage::updateConnectionProperty(KyConnectItem *p_connectItem) +void LanPage::updateConnectionProperty(KyConnectItem *p_connectItem, bool &needDeleteItem) { QMap::iterator iter; for (iter = m_deactiveMap.begin(); iter != m_deactiveMap.constEnd(); ++iter) { @@ -889,17 +889,17 @@ void LanPage::updateConnectionProperty(KyConnectItem *p_connectItem) QListWidgetItem *p_listWidgetItem = addNewItem(p_connectItem, m_inactivatedLanListWidget); m_deactiveMap.insert(p_connectItem, p_listWidgetItem); - p_connectItem = nullptr; + needDeleteItem = false; } } - } - break; + break; + } } return; } -void LanPage::updateActiveConnectionProperty(KyConnectItem *p_connectItem) +void LanPage::updateActiveConnectionProperty(KyConnectItem *p_connectItem, bool &needDeleteItem) { QMap::iterator iters; for (iters = m_activeMap.begin(); iters != m_activeMap.constEnd(); ++iters) { @@ -935,7 +935,7 @@ void LanPage::updateActiveConnectionProperty(KyConnectItem *p_connectItem) QListWidgetItem *p_listWidgetItem = addNewItem(p_connectItem, m_activatedLanListWidget); m_activeMap.insert(p_connectItem, p_listWidgetItem); - p_connectItem = nullptr; + needDeleteItem = false; } } break; @@ -952,9 +952,10 @@ void LanPage::onUpdateConnection(QString uuid) return; } - qDebug() << "[LanPage]:Connection Changed !" << Q_FUNC_INFO << __LINE__; + qDebug() << "[LanPage]:Connection property Changed." << Q_FUNC_INFO << __LINE__; KyConnectItem *p_newItem = nullptr; + bool needDeleteNewItem = true; if (m_connectResourse->isActivatedConnection(uuid)) { p_newItem = m_activeResourse->getActiveConnectionByUuid(uuid); if (nullptr == p_newItem) { @@ -964,7 +965,7 @@ void LanPage::onUpdateConnection(QString uuid) } sendLanUpdateSignal(p_newItem); - updateActiveConnectionProperty(p_newItem); + updateActiveConnectionProperty(p_newItem, needDeleteNewItem); } else { p_newItem = m_connectResourse->getConnectionItemByUuid(uuid); if (nullptr == p_newItem) { @@ -974,10 +975,11 @@ void LanPage::onUpdateConnection(QString uuid) } sendLanUpdateSignal(p_newItem); - updateConnectionProperty(p_newItem); + updateConnectionProperty(p_newItem, needDeleteNewItem); } - if (p_newItem != nullptr) { + if (needDeleteNewItem) { + qDebug()<<"[LanPage] the new item is not used, so is deleted."; delete p_newItem; p_newItem = nullptr; } diff --git a/src/frontend/tab-pages/lanpage.h b/src/frontend/tab-pages/lanpage.h index af0d0426..8a8d39f2 100644 --- a/src/frontend/tab-pages/lanpage.h +++ b/src/frontend/tab-pages/lanpage.h @@ -55,8 +55,8 @@ private: void updateConnectionArea(QString uuid); void updateActivatedConnectionArea(QString uuid); - void updateActiveConnectionProperty(KyConnectItem *p_connectItem); - void updateConnectionProperty(KyConnectItem *p_connectItem); + void updateActiveConnectionProperty(KyConnectItem *p_connectItem, bool &needDeleteItem); + void updateConnectionProperty(KyConnectItem *p_connectItem, bool &needDeleteItem); void sendLanUpdateSignal(KyConnectItem *p_connectItem); void sendLanAddSignal(KyConnectItem *p_connectItem); From e497f99c1b311f28f0544bc675e35448872abe3c Mon Sep 17 00:00:00 2001 From: jinxujie Date: Thu, 30 Sep 2021 17:23:37 +0800 Subject: [PATCH 07/10] Fix:wlanpage refresh and close wifiswitchbutton --- src/frontend/tab-pages/wlanpage.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index e589c3df..e2f191bc 100644 --- a/src/frontend/tab-pages/wlanpage.cpp +++ b/src/frontend/tab-pages/wlanpage.cpp @@ -138,6 +138,19 @@ void WlanPage::initConnections() connect(m_switchGsettings, &QGSettings::changed, this, [ = ](const QString &key) { if (key == WIRELESS_SWITCH) { bool status = m_switchGsettings->get(WIRELESS_SWITCH).toBool(); + if (!status) { +// m_deviceFrame->hide(); + m_activatedNetFrame->hide(); + m_inactivatedNetFrame->hide(); + m_activatedNetDivider->hide(); + m_inactivatedNetDivider->hide(); + } else { +// m_deviceFrame->show(); + m_activatedNetFrame->show(); + m_inactivatedNetFrame->show(); + m_activatedNetDivider->show(); + m_inactivatedNetDivider->show(); + } m_wirelessConnectOpreation->setWirelessEnabled(status); m_netSwitch->setSwitchStatus(m_switchGsettings->get(WIRELESS_SWITCH).toBool()); onWlanSwitchStatusChanged(m_switchGsettings->get(WIRELESS_SWITCH).toBool()); @@ -684,6 +697,10 @@ void WlanPage::onWifiEnabledChanged(bool isWifiOn) void WlanPage::updateByStrength() { + if (m_expandedItem) { + qDebug() << "Has expanded item and forbid refresh wifi strength" << Q_FUNC_INFO << __LINE__; + return; + } qDebug() << "Will update Wlan list by strength." << Q_FUNC_INFO << __LINE__; QList wlanList; if (!m_resource->getDeviceWifiNetwork(m_defaultDevice, wlanList)) { @@ -718,6 +735,8 @@ void WlanPage::updateByStrength() } else {//找到了该位置的wifi而且与现在的排序不符,需要调整 KyWirelessNetItem *data = new KyWirelessNetItem(wlanList.at(i)); WlanListItem * currentWlan = new WlanListItem(m_resource, data, m_defaultDevice); + connect(currentWlan, &WlanListItem::itemHeightChanged, this, &WlanPage::onItemHeightChanged); + connect(currentWlan, &WlanListItem::connectButtonClicked, this, &WlanPage::onConnectButtonClicked); QPair newPair; newPair.first = m_itemsMap.value(lastWlan->getSsid()).first; newPair.second = currentWlan; From 360ee2a96e153a32a5212b69218c732152cbc003 Mon Sep 17 00:00:00 2001 From: renpeijia Date: Thu, 30 Sep 2021 19:32:03 +0800 Subject: [PATCH 08/10] fix:the lan area show error list, when change name of activate connection and disactivate the connection. --- src/frontend/tab-pages/lanpage.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/frontend/tab-pages/lanpage.cpp b/src/frontend/tab-pages/lanpage.cpp index 48b46b1e..eac32a74 100644 --- a/src/frontend/tab-pages/lanpage.cpp +++ b/src/frontend/tab-pages/lanpage.cpp @@ -753,15 +753,13 @@ void LanPage::updateConnectionArea(QString uuid) emit lanActiveConnectionStateChanged(p_newItem->m_ifaceName, uuid, p_newItem->m_connectState); + deleteConnectionMapItem(m_activeMap, m_activatedLanListWidget, uuid); + if (m_activeMap.count() <= 0) { + addEmptyConnectItem(m_activeMap, m_activatedLanListWidget); + } + if (p_newItem->m_ifaceName == m_currentDeviceName || p_newItem->m_ifaceName == "") { qDebug()<<"[LanPage] update connection area"<m_connectName; - - deleteConnectionMapItem(m_activeMap, m_activatedLanListWidget, uuid); - if (m_activeMap.count() <= 0) { - addEmptyConnectItem(m_activeMap, m_activatedLanListWidget); - } - - if (connectionItemIsExist(m_deactiveMap, uuid)) { delete p_newItem; p_newItem = nullptr; From 87f205b31be182f228f4d9da4d5a17dc226f5556 Mon Sep 17 00:00:00 2001 From: kangshuning Date: Fri, 8 Oct 2021 11:17:49 +0800 Subject: [PATCH 09/10] connection change to currentDevice --- src/frontend/tab-pages/lanpage.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/frontend/tab-pages/lanpage.cpp b/src/frontend/tab-pages/lanpage.cpp index eac32a74..b88fbe03 100644 --- a/src/frontend/tab-pages/lanpage.cpp +++ b/src/frontend/tab-pages/lanpage.cpp @@ -390,14 +390,12 @@ void LanPage::initLanArea() m_activatedNetDivider->hide(); m_activatedNetFrame->hide(); - m_inactivatedNetDivider->hide(); m_inactivatedNetFrame->hide(); } else { m_activatedNetDivider->show(); m_activatedNetFrame->show(); constructActiveConnectionArea(); - m_inactivatedNetDivider->show(); m_inactivatedNetFrame->show(); constructConnectionArea(); } @@ -851,10 +849,12 @@ void LanPage::sendLanAddSignal(KyConnectItem *p_connectItem) void LanPage::updateConnectionProperty(KyConnectItem *p_connectItem, bool &needDeleteItem) { + bool inCurrentMap = false; QMap::iterator iter; for (iter = m_deactiveMap.begin(); iter != m_deactiveMap.constEnd(); ++iter) { KyConnectItem *p_item = iter.key(); if (p_item->m_connectUuid == p_connectItem->m_connectUuid) { + inCurrentMap = true; if (p_connectItem->m_ifaceName != "" && m_currentDeviceName != p_connectItem->m_ifaceName) { LanListItem *p_lanItem = (LanListItem *)m_inactivatedLanListWidget->itemWidget(iter.value()); @@ -893,7 +893,13 @@ void LanPage::updateConnectionProperty(KyConnectItem *p_connectItem, bool &needD break; } } - + if (!inCurrentMap) { + if (p_connectItem->m_ifaceName == m_currentDeviceName) { + QListWidgetItem *p_listWidgetItem = addNewItem(p_connectItem, m_inactivatedLanListWidget); + m_deactiveMap.insert(p_connectItem, p_listWidgetItem); + needDeleteItem = false; + } + } return; } From 0b2d010bb890718a3358a6350ccc9222159d4384 Mon Sep 17 00:00:00 2001 From: jinxujie Date: Fri, 8 Oct 2021 21:01:15 +0800 Subject: [PATCH 10/10] bug#83877#83495#83487#83312 10-08 --- src/frontend/list-items/wlanlistitem.cpp | 3 +- src/frontend/new-mainwindow.cpp | 2 +- src/frontend/tab-pages/wlanpage.cpp | 7 + src/frontend/tab-pages/wlanpage.h | 1 + src/frontend/tools/radioitembutton.cpp | 1 + src/frontend/tools/radioitembutton.h | 1 + translations/kylin-nm_bo.ts | 1710 ++++++++++++------ translations/kylin-nm_tr.qm | Bin 21755 -> 21647 bytes translations/kylin-nm_tr.ts | 1838 ++++++++++++++----- translations/kylin-nm_zh_CN.qm | Bin 5815 -> 11355 bytes translations/kylin-nm_zh_CN.ts | 2037 ++++++++++++++++++++-- 11 files changed, 4516 insertions(+), 1084 deletions(-) diff --git a/src/frontend/list-items/wlanlistitem.cpp b/src/frontend/list-items/wlanlistitem.cpp index 977ee5dc..782a0c79 100644 --- a/src/frontend/list-items/wlanlistitem.cpp +++ b/src/frontend/list-items/wlanlistitem.cpp @@ -201,6 +201,7 @@ void WlanListItem::initWlanConnection() connect(m_resource, &KyWirelessNetResource::connectionRemove, this, &WlanListItem::onConnectionRemove); connect(this->m_infoButton, &InfoButton::clicked, this, &WlanListItem::onInfoButtonClicked); connect(m_connectResource, &KyActiveConnectResourse::stateChangeReason, this, &WlanListItem::onWlanStatusChange); + connect(m_netButton, &RadioItemButton::animationStoped, this, &WlanListItem::refreshIcon); } void WlanListItem::refreshIcon() @@ -367,7 +368,7 @@ void WlanListItem::onConnectButtonClicked() { if (m_data->m_secuType.isEmpty() || m_data->m_secuType == "") { qDebug() << "connect to no password wifi" << Q_FUNC_INFO << __LINE__; - } else if (!m_connectButton->isEnabled() || !m_data) { + } else if ((!m_connectButton->isEnabled()&&m_connectButton->isVisible()) || !m_data) { return; } KyWirelessConnectSetting settings; diff --git a/src/frontend/new-mainwindow.cpp b/src/frontend/new-mainwindow.cpp index 6a459370..7984a63f 100644 --- a/src/frontend/new-mainwindow.cpp +++ b/src/frontend/new-mainwindow.cpp @@ -357,7 +357,7 @@ void MainWindow::onRefreshTrayIcon() } else if (m_wlanWidget->m_wlanIsConnected == true && m_lanWidget->m_isLanConnected == false){ m_trayIcon->setIcon(QIcon::fromTheme("network-wireless-signal-excellent-symbolic")); } else if (m_wlanWidget->m_wlanIsConnected == false && m_lanWidget->m_isLanConnected == false){ - m_trayIcon->setIcon(QIcon::fromTheme("network-wired-signal-excellent-symbolic")); + m_trayIcon->setIcon(QIcon::fromTheme("network-wired-disconnected-symbolic")); } } diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index e2f191bc..53ee0770 100644 --- a/src/frontend/tab-pages/wlanpage.cpp +++ b/src/frontend/tab-pages/wlanpage.cpp @@ -32,6 +32,7 @@ WlanPage::WlanPage(QWidget *parent) : TabPage(parent) connect(m_wirelessConnectOpreation, &KyWirelessConnectOperation::activateConnectionError, this, &WlanPage::activateFailed); connect(m_wirelessConnectOpreation, &KyWirelessConnectOperation::addAndActivateConnectionError, this, &WlanPage::activateFailed); + connect(this, &WlanPage::activateFailed, this, &WlanPage::onActiveFailed); connect(m_wirelessConnectOpreation, &KyWirelessConnectOperation::deactivateConnectionError, this, &WlanPage::deactivateFailed); connect(this, &WlanPage::hiddenWlanClicked, this, &WlanPage::onHiddenWlanClicked); @@ -402,6 +403,7 @@ void WlanPage::onDeviceAdd(QString deviceName, NetworkManager::Device::Type devi m_devList << deviceName; if (getDefaultDevice().isEmpty()) { + m_devList.clear(); updateDefaultDevice(deviceName); setDefaultDevice(WIRELESS, deviceName); @@ -695,6 +697,11 @@ void WlanPage::onWifiEnabledChanged(bool isWifiOn) } } +void WlanPage::onActiveFailed(QString errorMessage) +{ + qDebug() << "active failed and the message is: " << errorMessage << Q_FUNC_INFO << __LINE__; +} + void WlanPage::updateByStrength() { if (m_expandedItem) { diff --git a/src/frontend/tab-pages/wlanpage.h b/src/frontend/tab-pages/wlanpage.h index f232e844..dd3c748f 100644 --- a/src/frontend/tab-pages/wlanpage.h +++ b/src/frontend/tab-pages/wlanpage.h @@ -123,6 +123,7 @@ private slots: void onHiddenWlanClicked(); void showControlCenter(); void onWifiEnabledChanged(bool isWifiOn); + void onActiveFailed(QString errorMessage); // void onRefreshIconTimer(); diff --git a/src/frontend/tools/radioitembutton.cpp b/src/frontend/tools/radioitembutton.cpp index 4d8cf9db..37c95bf1 100644 --- a/src/frontend/tools/radioitembutton.cpp +++ b/src/frontend/tools/radioitembutton.cpp @@ -102,6 +102,7 @@ void RadioItemButton::onLoadingStopped() return; } else { m_animation->stop(); + emit this->animationStoped(); } } diff --git a/src/frontend/tools/radioitembutton.h b/src/frontend/tools/radioitembutton.h index ccc37748..e7c3c526 100644 --- a/src/frontend/tools/radioitembutton.h +++ b/src/frontend/tools/radioitembutton.h @@ -30,6 +30,7 @@ public: signals: void requestStartLoading(); void requestStopLoading(); + void animationStoped(); protected: void paintEvent(QPaintEvent *event); diff --git a/translations/kylin-nm_bo.ts b/translations/kylin-nm_bo.ts index 8531e386..23a75a01 100644 --- a/translations/kylin-nm_bo.ts +++ b/translations/kylin-nm_bo.ts @@ -4,178 +4,315 @@ ConfForm - + edit network - + LAN name: - + + + Method: - + Address: - + Netmask: - + Gateway: - + DNS 1: - + DNS 2: - + + Ipv6 Address: + + + + Edit Conn - + Auto(DHCP) - + Manual - + Cancel - + Save - + Ok - - + Can not create new wired network for without wired card - + New network already created - + + Wireless card not exist + + + + + Can not save wired network for without wired card + + + + New network settings already finished - + + kylin-nm + + + + + kylin network applet desktop message + + + + Will check the IP address conflict - - IP address conflict, Please change IP + + IPV4 address conflict, Please change IP - + + IPV6 address conflict, Please change IP + + + + Edit Network - + Add Wired Network + + CreatNetPage + + + Connection Name + + + + + Ipv4Config + + + + + Address + + + + + Netmask + + + + + Default Gateway + + + + + Prefs DNS + + + + + Alternative DNS + + + + + Auto(DHCP) + + + + + Manual + + + + + DetailPage + + + Auto Connection + + + + + SSID: + + + + + Protocol: + + + + + Security Type: + + + + + Hz: + + + + + Chan: + + + + + BandWidth: + + + + + IPV6: + + + + + IPV4: + + + + + IPV4 Dns: + + + + + Mac: + + + DlgHideWifi - + Connect to Hidden WLAN Network - + Add Hidden WLAN - + Connection - + WLAN name - + WLAN security - + Cancel - + Connect - + C_reate… - + None - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise - - + + Conn WLAN Success - - + + Confirm your WLAN password or usable of wireless card @@ -183,133 +320,133 @@ DlgHideWifiEapFast - + Connect to Hidden WLAN Network - + Add hidden WLAN - + Connection - + Network name - + WLAN security - + Authentication - + Anonymous identity - + Allow automatic PAC pro_visioning - + PAC file - + Inner authentication - + Username - + Password - + Cancel - + Connect - + C_reate… - - + + None - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise - + WEP 40/128-bit Key (Hex or ASCII) - + WEP 128-bit Passphrase - + Dynamic WEP (802.1X) - + Tunneled TLS - + Protected EAP (PEAP) - + Anonymous - + Authenticated - + Both @@ -317,97 +454,97 @@ DlgHideWifiEapLeap - + Connect to Hidden WLAN Network - + Add hidden WLAN - + Connection - + Network name - + WLAN security - + Authentication - + Username - + Password - + Cancel - + Connect - + C_reate… - + None - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise - + WEP 40/128-bit Key (Hex or ASCII) - + WEP 128-bit Passphrase - + Dynamic WEP (802.1X) - + Tunneled TLS - + Protected EAP (PEAP) @@ -415,128 +552,128 @@ DlgHideWifiEapPeap - + Connect to Hidden WLAN Network - + Add hidden WLAN - + Connection - + Network name - + WLAN security - + Authentication - + Anonymous identity - + Domain - + CA certificate - + CA certificate password - + No CA certificate is required - + PEAP version - + Inner authentication - + Username - + Password - + Cancel - + Connect - - + + None - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise - + Protected EAP (PEAP) - + Choose from file - + Automatic - + Version 0 - + Version 1 @@ -544,97 +681,97 @@ DlgHideWifiEapPwd - + Connect to Hidden WLAN Network - + Add hidden WLAN - + Connection - + Network name - + WLAN security - + Authentication - + Username - + Password - + Cancel - + Connect - + C_reate… - + None - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise - + WEP 40/128-bit Key (Hex or ASCII) - + WEP 128-bit Passphrase - + Dynamic WEP (802.1X) - + Tunneled TLS - + Protected EAP (PEAP) @@ -642,261 +779,261 @@ DlgHideWifiEapTTLS - - Connect to Hidden WLAN Network - - - - + Add hidden WLAN - + Connection - + Network name - + WLAN security - + Authentication - + Anonymous identity - + Domain - + CA certificate - + CA certificate password - + No CA certificate is required - + Inner authentication - + Username - + Password - + Cancel - + Connect - + C_reate… - - + + None - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise - + WEP 40/128-bit Key (Hex or ASCII) - + WEP 128-bit Passphrase - + Dynamic WEP (802.1X) - + Tunneled TLS - + Protected EAP (PEAP) - + Choose from file + + + Connect to Hidden Wi-Fi Network + + DlgHideWifiEapTls - + Connect to Hidden WLAN Network - + Add hidden WLAN - + Connection - + Network name - + WLAN security - + Authentication - + Identity - + Domain - + CA certificate - + CA certificate password - + No CA certificate is required - + User certificate - + User certificate password - + User private key - + User key password - + Cancel - + Connect - + C_reate… - - - - + + + + None - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise - + Tunneled TLS - + Protected EAP (PEAP) - - - + + + Choose from file @@ -904,573 +1041,821 @@ DlgHideWifiLeap - - Connect to Hidden WLAN Network - - - - - Add hidden WLAN - - - - + Connection - + Network name - - WLAN security - - - - + Username - + Password - + Cancel - + Connect - + C_reate… - + None - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise - + WEP 40/128-bit Key (Hex or ASCII) - + + Add hidden Wi-Fi + + + + + Wi-Fi security + + + + WEP 128-bit Passphrase - + Dynamic WEP (802.1X) + + + Connect to Hidden Wi-Fi Network + + DlgHideWifiWep - - Connect to Hidden WLAN Network - - - - - Add hidden WLAN - - - - + Connection - + Network name - - WLAN security - - - - + Key - + WEP index - + Authentication - + Cancel - + Connect - + C_reate… - + None - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise - + WEP 40/128-bit Key (Hex or ASCII) - + + Add hidden Wi-Fi + + + + + Wi-Fi security + + + + WEP 128-bit Passphrase - + Dynamic WEP (802.1X) - + 1(default) - + Open System - + Shared Key + + + Connect to Hidden Wi-Fi Network + + DlgHideWifiWpa - - Connect to Hidden WLAN Network - - - - - Add Hidden WLAN - - - - + Connection - - WLAN name + + Add Hidden Wi-Fi - - WLAN security + + Wi-Fi name - + + Wi-Fi security + + + + Password - + Cancel - + Connect - + C_reate… - + None - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise - - - Conn WLAN Success + + + Conn Wifi Success - - - Confirm your WLAN password or usable of wireless card + + + Confirm your Wi-Fi password or usable of wireless card - - Selected WLAN has not been scanned. + + Connect to Hidden Wi-Fi Network - DlgHotspotCreate + EnterpriseWlanDialog - - Dialog + + Connect Enterprise WLAN - - Create Hotspot + + Close - - Network name - - - - - WLAN security - - - - - Password - - - - + Cancel - - Ok + + Connect + + + + + Ipv4Page + + + Ipv4Config - - None + + Address - - WPA and WPA2 Personal + + Netmask + + + + + Default Gateway + + + + + Prefs DNS + + + + + Alternative DNS + + + + + Auto(DHCP) + + + + + Manual + + + + + Ipv6Page + + + Ipv6Config + + + + + Address + + + + + Subnet prefix Length + + + + + Default Gateway + + + + + Prefs DNS + + + + + Alternative DNS + + + + + Auto(DHCP) + + + + + Manual + + + + + LanPage + + + LAN + + + + + Activated LAN + + + + + Inactivated LAN + + + + + LAN Disconnected Successfully + + + + + LAN Connected Successfully + + + + + ListItem + + + Kylin NM + + + + + kylin network applet desktop message MainWindow - - + + + kylin-nm - - - Advanced + + LAN - - - - Ethernet - - - - - New LAN - - - - - Hide WLAN - - - - - + WLAN - - HotSpot + + Settings - - FlyMode + + Show MainWindow + + + + + NetDetail + + + Kylin NM - - No wireless card detected + + kylin network desktop message - - - - - - - Not connected + + Detail - - - - - - - - - - - Disconnected + + Ipv4 - + + Ipv6 + + + + + Security + + + + + Close + + + + + Confirm + + + + + Cancel + + + + + Forget this network + + + + + Add Lan Connect + + + + + connect hiddin wlan + + + + + + + Auto + + + + + start check ipv4 address conflict + + + + + start check ipv6 address conflict + + + + + + + ipv4 address conflict! + + + + + + ipv6 address conflict! + + + + + OldMainWindow + + Ethernet Networks - + + New LAN + + + + WLAN Networks - + + Hide WLAN + + + + No usable network in the list - + + + + Ethernet + + + + + HotSpot + + + + + FlyMode + + + + + + Advanced + + + + + kylin-nm + + + + Show MainWindow - - NetOn,IfName: - - - - - No Other Wired Network Scheme - - - - - No Other Wireless Network Scheme - - - - - - - - Wired connection - - - - - - - - Ethernet connection - - - - - Without Lan Cable - - - - - MAC Address Mismatch - - - - - Connection Be Killed - - - - - Connect Wired Network Failed - - - - - Connect VPN Network Failed - - - - - IP configuration could not be reserved - - - - - Confirm your WLAN password or usable of wireless card - - - - - Confirm your WLAN password - - - - - - NetOn, - - - - + + Wired net is disconnected - + + No wireless card detected + + + + + + + + + Not connected + + + + + + + + + + + + + Disconnected + + + + + + NetOn, + + + + + NetOn,IfName: + + + + + No Other Wired Network Scheme + + + + + No Other Wireless Network Scheme + + + + + + + + Wired connection + + + + + + + + Ethernet connection + + + + WLAN is disconnected - + + Conn Ethernet Success - + + Without Lan Cable + + + + + IP configuration could not be reserved + + + + + MAC Address Mismatch + + + + + Connection Be Killed + + + + + Connect Bluetooth Network Failed + + + + + Carrier/link changed + + + + + Connect Wired Network Failed + + + + + Connect VPN Network Failed + + + + Conn WLAN Success + + + Confirm your WLAN password or usable of wireless card + + + + + Confirm your WLAN password + + + + + Selected WLAN has not been scanned. + + + + + Connect Hidden WLAN Success + + OneConnForm - + Form - - - - + + + + + + Connect - + + + Disconnect - + Cancel - - Connect to Hidden WLAN Network + + Property - + + Password Incorrect + + + + + + Forget + + + + Rate - + None - + WLAN Security: - + Signal: - + MAC: - + Conn WLAN Success - + Confirm your WLAN password or usable of wireless card @@ -1478,138 +1863,479 @@ OneLancForm - + Form - - + + Connect - + Disconnect - + Cancel - - - - + + Not connected + + + + + + Disconnected + + + + + + Ethernet + + + + + NetOn, + + + + + + No Configuration - + No IfName - + IPv4: - + IPv6: - + MAC: - + BandWidth: - Utils + SecurityPage - - kylin-nm + + Security - + + + Password + + + + + EAP type + + + + + Identity + + + + + Domain + + + + + CA certficate + + + + + no need for CA certificate + + + + + User certificate + + + + + User private key + + + + + User key password + + + + + Ineer authentication + + + + + Usename + + + + + Ask pwd each query + + + + + + + + + + + None + + + + + WPA&WPA2 Personal + + + + + WPA&WPA2 Enterprise + + + + + WPA3 Personal + + + + + + + Choose from file... + + + + + + + Choose a CA certificate + + + + + + + CA Files (*.pem *.der *.p12 *.crt *.cer *.pfx) + + + + + TabPage + + + Current Device + + + + + Devices Closed! + + + + + Settings + + + + + Kylin NM + + + + kylin network applet desktop message + + WiFiConfigDialog + + + Dialog + + + + + WLAN Authentication + + + + + Input WLAN Information Please + + + + + WLAN ID: + + + + + WLAN Name: + + + + + Password: + + + + + Cancl + + + + + Ok + + + + + WlanListItem + + + Not connected + + + + + + Disconnect + + + + + + + Connect + + + + + + Forget + + + + + Auto Connect + + + + + WlanPage + + + WLAN + + + + + Activated WLAN + + + + + Other WLAN + + + + + More... + + + + + WLAN Connected Successfully + + + + + WLAN Disconnected Successfully + + + WpaWifiDialog - + Dialog - + Connect WLAN - - Connection name - - - - + Security - + EAP type - - inner authentication + + Name - + + Inner auth + + + + Username - + Password - + Show password - + Ask pwd each query - + Cancel - + Connect - - WPA & WPA2 + + + + + + + + None + + + + + WPA and WPA2 Personal + + + + + WPA and WPA2 Enterprise + + + + + + + Choose from file... + + + + + + + Choose a CA certificate + + + + + + CA Files (*.pem *.der *.p12 *.crt *.cer *.pfx) + + + + + CA Files (*.pem *.der *.p12 *.crt *.key *.cer *.pfx) + + + + + Identity + + + + + Anonymous Identity + + + + + Domain + + + + + CA certificate + + + + + no need for CA certificate + + + + + User Certificate + + + + + User Private Key + + + + + User Private Key password diff --git a/translations/kylin-nm_tr.qm b/translations/kylin-nm_tr.qm index dec3ec3535a75a9cde04f8506a520cd8591dfb0b..c5f225daedd3a8a20609afeec2a3a0204b566a97 100644 GIT binary patch delta 2776 zcmZA2dr(yO6$kLM@7KM%f(r)ZrMw@D!0xgv2nJXlyUQvX)J&Zy8(qjMkF5bx#ki)D z78^~{-qx5pc1%UB#+tSp%{XI?w!R1^X(x#ZqIuQKgr-x;kaU_*ZO`(hZNeWrpYuC= z@9+M8_niIh)G^sJ$7Ii%!=DnV)(|NlfnFog@?oOVc2e$siDe^ z)xJx-&>xfP{92-lGtm1Q6~#TyWhJUfq>-U7h}18_#qYw} z#dPD3Y}`@X$RLn;omUxuh7yC8%Lmb zQh83#4X)h{g$ZSNIuZLh5(#Hv>T;NQ6k0N2i5c35p|e{#+{_a$8B@jQe}|iNK5Y0x zRkmguH{r)nbpe+9X8f(noB0?w?fNi+>IBU}n&P<3wT5Km}Ut1tha$e~helI*Ux#C^7s# zg6slVn5?O-I?pRVraAuH7Vg?yIOi=GUjmbh;le?f`%hRLuRZ=3?gisXXx72`*I-%z zX1@u;)+7YZF>T}ycdesAXV2paYOd()wjJCoztq|7QQy{ihM(k}-Gp%!aDfDKWzhO_ z=-8)wFy?D6$tm5Adxb>vpU@plnjlI##eU9C>V|8-0{5Y_wi zea4gA69N6e^%wb^ApND6`Au0~fbN-bQ?CB?3-@#BcIyB3tdh@*>#!l#V72{-=TR8S zUgNtJHHP(n;FEFQfMNGX;a1Kx8J;N zJ)#%2LHEOktG9RjQD&~3*UEJ-2e4T{#ASh=ROA$55UwfVb*8RatoIH zP7F`qSh`=lbd^`C*ec%bAK(*g9?U3!`E|y)gJ+25%osO>@q#IsyAj$5I_?_1$!qx^ zb;7tQsxAa$(qa4nOx_truy7RSd5l{t5{Vl6j9b@4J!QON+QmDw!nrn>D#5HwSh50^ zYK@<4`xzhUyNvff;%2Q@n1V+$xOaw3pNT{K25X`F)gYIBkAf6LDN@K|jwrOBDy9CG zEmEu2DGIfl1OA?+fu3f6dq5h|FPxRBt}KzZ)R-dKVt;BR&T`%$C0Z@g;l**%BhF3I zZDV5Oq4J01lB%*=+FN;7dL=DCVp;NMxinr`F0HN8NVjUNQj4op`pR`w3TgAS?ogj? z=27YY9|X0<(Lw1qzrmodWxGz>6nwPD-4p1Pp7iaMp7M%P;j-j(H7%na>eg~|keWZr z>fWAi4F@{jjVsXO4|YhS4FyVZS;q!R-PnepvvCZ8+r0_FDfc=AaUKtXR!=#C{T?3z zleYqa*K0*E$^91N*g^zk)j8@GO5v5^6hW_WXlnS2LkJRHwSyROus+9 zJx};%M!Hjrw3-(G!_!Y$E~LfGSskno)^>Nb1>0Rg ze@Az_^p6$gqOiKd-}S$e)%qN>GGo3poi=*S^gO(NqqsWcUma`<&P>7^n4OxaPceP_ HD%pPkJ}MnN delta 2700 zcmZwIdr(x@9S88=-6#8mRY1jE7J16k#bp;*Szuv-Wp}|>!Ay)A8ZcF;O9ZrH?2@VJ zrAB3{&v5e{t^4fp3lAK zocp`y{LZ;&cOR7|k4k$I!ygkVR}v|{2dkV!OUH;xe?f|UM~Jk8q`0_~sBr)WmXorz zj!1nT8tUMTahS3ST5DiVDl9TW`vO>&0mE)TE~?b9@fInc7$Nc}lXCwk4{VT>r&klz zeMPpUZA1-DYQH^ABvVoM)hn!*PHwOh)m!N7@IQDGZ^A|CuzDA4SVfnAbBV}s2hLm` zGfZ=nQDHp}b9TU@N+~=40?`7WwCrYpXIuz%PeIeuaCR%S+=7`WV1XSLk3;7OtauLk zK9WLzC=Ch={HE(nf)lSNDFZU36*2|rtAM#RGz=Z8E*~Nyr!F&xB>APW` z1v-w%J94iRRp-b%DnBEd^&ZT$!2HAVgAMJR`ZbFEjVFnuKB#;G>gGUG8l1HQTDHNA z3B~?!^uhdYR226^X9aZKhLtYGFH3pN=jdV9dRTBnaY}3Cr8xj~Q_wUGXOF?u)i5gu z7L34!EsAg~KxrZ>+&abB5)N29s!YzmpLhKc82Cn6w(?QlY=2e;vNrRQJf{rq({sNe zW$Rf^wPBO;)bJr*vXd&+Z+}fxwnU{iJ9uDI(ET&jgS!MT-9xIa$2jBqLvT(*7#G=b zs+$XWhC#PlYdBA2TmfgEfN4gU^H*5(f;u>f)(Yo4 zp?$BmZL);-fC~l;+KvDZRCNdHmO#@|INJ;@5t!Kz^Y6mqFpN_wPH13jby8 zCgXA5R5tDQi?8rGK-$q0oT9>c+7I8U<~9A1_SPN+Z?ea9_L8S~rh9Z{A8;>ujqag$ z`2(Rfyj8iT*=p&cD=1lE{6*B0#2z@U7XFiT& zvl+6(hZA|kZy74<#(Cyi!vXVmIKXwo!MiQIxm0k*Fr0G?T4gZ16Be$53%`b?6R`4( zVe||ST;6Y(+Pa+&uuPay4)aEh;iRFrh~k$SV>aUEyi+_?2h-x^)15<}! z)(BiEVCiz>_@jG?yx%uYf6klLdp&;L%bA?XuJ|tu!~Ey<-a4Wtlbmy$N?@||q z_}52iLS|>J{DumLNB(mIv;wR+;(GC%% zYlloq5&tfpEqo?Rta-4)6YKi8J5kuJRU+!yYL{5!?vBOe`^fLz|B{L6Vppv3j-f)d zc@jCUOKk9{h2CQqHGy+NRg);J!6mV_DvvYvaGU3C>k0~zhnjiBZPYFmlPiv=Ln{7h zRs=oG;+@LmXdKBbY^D_PN}eSaLGQ7yPw;j<>=SD({t&)%%wy2dYz3aMqr2ha_>haM4 diff --git a/translations/kylin-nm_tr.ts b/translations/kylin-nm_tr.ts index 85a89810..731a2500 100644 --- a/translations/kylin-nm_tr.ts +++ b/translations/kylin-nm_tr.ts @@ -11,108 +11,139 @@ ConfForm - + edit network Ağı düzenle - + LAN name: LAN adı: - + + + Method: Yöntem: - + Address: Adres: - + Netmask: Netmask: - + Gateway: - + DNS 1: DNS 1: - + DNS 2: DNS 2: - + + Ipv6 Address: + + + + Edit Conn Bağ. Düzenle - + Auto(DHCP) Oto(DHCP) - + Manual Elle - + Cancel İptal - + Save Kaydet - + Ok Tamam - - + Can not create new wired network for without wired card Kablolu kart olmadan yeni kablolu ağ oluşturulamıyor - + New network already created Yeni ağ zaten oluşturuldu - + + Wireless card not exist + + + + + Can not save wired network for without wired card + + + + New network settings already finished Yeni ağ ayarları zaten tamamlandı - + + kylin-nm + + + + + kylin network applet desktop message + Kylin ağ uygulaması masaüstü mesajı + + + Will check the IP address conflict - - IP address conflict, Please change IP + + IPV4 address conflict, Please change IP - + + IPV6 address conflict, Please change IP + + + + Edit Network Ağı Düzenle - + Add Wired Network Kablolu Ağ Ekle @@ -129,67 +160,173 @@ Yeni ayarlar zaten etkili + + CreatNetPage + + + Connection Name + + + + + Ipv4Config + + + + + Address + + + + + Netmask + + + + + Default Gateway + + + + + Prefs DNS + + + + + Alternative DNS + + + + + Auto(DHCP) + Oto(DHCP) + + + + Manual + Elle + + + + DetailPage + + + Auto Connection + + + + + SSID: + + + + + Protocol: + + + + + Security Type: + + + + + Hz: + + + + + Chan: + + + + + BandWidth: + + + + + IPV6: + + + + + IPV4: + + + + + IPV4 Dns: + + + + + Mac: + + + DlgHideWifi - + Add Hidden WLAN Gizli WLAN Ekle - + Connection Bağlantı - + WLAN name WLAN adı - + WLAN security WLAN güvenlik - + Cancel İptal - + Connect Bağlantı - + C_reate… Oluştur... - + None Yok - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise - - + + Conn WLAN Success WLAN Bağlantısı Başarılı - - + + Confirm your WLAN password or usable of wireless card Kablosuz şifrenizi veya kablosuz kart kullanılabilirliğini onaylayın @@ -214,7 +351,7 @@ WPA & WPA2 Enterprise - + Connect to Hidden WLAN Network Gizli WLAN Ağına Bağlan @@ -222,93 +359,93 @@ DlgHideWifiEapFast - + Connect to Hidden WLAN Network Gizli WLAN Ağına Bağlan - + Add hidden WLAN Gizli WLAN Ekle - + Connection Bağlantı: - + Network name Ağ adı - + WLAN security WLAN güvenliği - + Authentication Kimlik Doğrulama - + Anonymous identity Anonim kimlik - + Allow automatic PAC pro_visioning Otomatik PAC pro_visioning'e izin ver - + PAC file PAC dosyası - + Inner authentication İç kimlik doğrulama: - + Username Kullanıcı adı - + Password Parola - + Cancel İptal - + Connect Bağlan - + C_reate… Oluştur... - - + + None Yok - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise @@ -317,17 +454,17 @@ WPA & WPA2 Kişisel - + WEP 40/128-bit Key (Hex or ASCII) WEP 40/128-bit Key (Hex veya ASCII) - + WEP 128-bit Passphrase WEP 128-bit Passphrase - + Dynamic WEP (802.1X) Dinamik WEP (802.1x) @@ -336,27 +473,27 @@ WPA & WPA2 Enterprise - + Tunneled TLS Tünelli TLS - + Protected EAP (PEAP) Korumalı EAP (PEAP) - + Anonymous Anonim - + Authenticated Doğrulanmış - + Both Her ikisi de @@ -364,72 +501,72 @@ DlgHideWifiEapLeap - + Connect to Hidden WLAN Network Gizli WLAN ağına bağlan - + Add hidden WLAN Gizli WLAN ekle - + Connection Bağlantı: - + Network name Ağ adı: - + WLAN security WLAN güvenliği: - + Authentication Kimlik Doğrulama: - + Username Kullanıcı adı: - + Password Parola: - + Cancel 取消 - + Connect Bağlan - + C_reate… Oluştur... - + None Yok - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise @@ -438,17 +575,17 @@ WPA & WPA2 Kişisel - + WEP 40/128-bit Key (Hex or ASCII) WEP 40/128-bit Key (Hex veya ASCII) - + WEP 128-bit Passphrase WEP 128-bit Passphrase - + Dynamic WEP (802.1X) Dinamik WEP (802.1x) @@ -457,12 +594,12 @@ WPA & WPA2 Enterprise - + Tunneled TLS Tünelli TLS - + Protected EAP (PEAP) Korumalı EAP (PEAP) @@ -470,103 +607,103 @@ DlgHideWifiEapPeap - + Connect to Hidden WLAN Network Gizli WLAN Ağına Bağlan - + Add hidden WLAN Gizli WLAN ekle - + Connection Bağlantı: - + Network name Ağ adı: - + WLAN security WLAN güvenliği: - + Authentication Kimlik Doğrulama: - + Anonymous identity Anonim kimlik: - + Domain Domain: - + CA certificate CA sertifikası: - + CA certificate password CA sertifika şifresi: - + No CA certificate is required CA sertifikası gerekmez - + PEAP version PEAP sürümü: - + Inner authentication İç kimlik doğrulama: - + Username Kullanıcı adı: - + Password Parola: - + Cancel İptal - + Connect Bağlan - - + + None Yok - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise @@ -595,27 +732,27 @@ Tünelli TLS - + Protected EAP (PEAP) Korumalı EAP (PEAP) - + Choose from file Dosyadan seçin... - + Automatic Otomatik - + Version 0 Sürüm 0 - + Version 1 Sürüm 1 @@ -623,72 +760,72 @@ DlgHideWifiEapPwd - + Connect to Hidden WLAN Network Gizli WLAN Ağına Bağlan - + Add hidden WLAN Gizli WLAN ekle - + Connection Bağlantı: - + Network name Ağ adı: - + WLAN security WLAN güvenliği: - + Authentication Kimlik Doğrulama: - + Username Kullanıcı adı: - + Password Parola: - + Cancel İptal - + Connect Bağlan - + C_reate… Oluştur... - + None Yok - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise @@ -697,17 +834,17 @@ WPA & WPA2 Kişisel - + WEP 40/128-bit Key (Hex or ASCII) WEP 40/128-bit Key (Hex veya ASCII) - + WEP 128-bit Passphrase WEP 128-bit Passphrase - + Dynamic WEP (802.1X) Dinamik WEP (802.1x) @@ -716,12 +853,12 @@ WPA & WPA2 Enterprise - + Tunneled TLS Tünelli TLS - + Protected EAP (PEAP) Korumalı EAP (PEAP) @@ -729,103 +866,102 @@ DlgHideWifiEapTTLS - Connect to Hidden WLAN Network - Gizli WLAN Ağına Bağlan + Gizli WLAN Ağına Bağlan - + Add hidden WLAN Gizli WLAN ekle - + Connection Bağlantı: - + Network name Ağ adı: - + WLAN security WLAN Güvenliği: - + Authentication Kimlik Doğrulama: - + Anonymous identity Anonim kimlik: - + Domain Domain: - + CA certificate CA Sertifikası: - + CA certificate password CA sertifika şifresi: - + No CA certificate is required CA sertifikası gerekmez - + Inner authentication İç kimlik doğrulama: - + Username Kullanıcı adı: - + Password Parola: - + Cancel İptal - + Connect Bağlan - + C_reate… Oluştur... - - + + None Yok - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise @@ -834,17 +970,17 @@ WPA & WPA2 Kişisel - + WEP 40/128-bit Key (Hex or ASCII) WEP 40/128-bit Key (Hex veya ASCII) - + WEP 128-bit Passphrase WEP 128-bit Passphrase - + Dynamic WEP (802.1X) Dinamik WEP (802.1x) @@ -853,128 +989,133 @@ WPA & WPA2 Enterprise - + Tunneled TLS Tünelli TLS - + Protected EAP (PEAP) Korumalı EAP (PEAP) - + Choose from file Dosyadan seçiniz... + + + Connect to Hidden Wi-Fi Network + + DlgHideWifiEapTls - + Connect to Hidden WLAN Network Gizli WLAN Ağına Bağlan - + Add hidden WLAN Gizli WLAN ekle - + Connection Bağlantı: - + Network name Ağ adı: - + WLAN security WLAN güvenliği: - + Authentication Kimlik Doğrulama: - + Identity Kimlik: - + Domain Domain: - + CA certificate CA sertifikası: - + CA certificate password CA sertifika şifresi: - + No CA certificate is required CA sertifikası gerekmez - + User certificate Kullanıcı sertifikası: - + User certificate password Kullanıcı sertifikası şifresi: - + User private key Kullanıcı özel anahtarı: - + User key password Kullanıcı anahtarı şifresi: - + Cancel İptal - + Connect Bağlan - + C_reate… Oluştur... - - - - + + + + None Yok - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise @@ -999,19 +1140,19 @@ WPA & WPA2 Enterprise - + Tunneled TLS Tünelli TLS - + Protected EAP (PEAP) Korumalı EAP (PEAP) - - - + + + Choose from file Dosyadan seç... @@ -1019,67 +1160,74 @@ DlgHideWifiLeap - Connect to Hidden WLAN Network - Gizli WLAN Ağına Bağlan + Gizli WLAN Ağına Bağlan - Add hidden WLAN - Gizli WLAN Ekle + Gizli WLAN Ekle - + Connection Bağlantı - + Network name Ağ adı - WLAN security - WLAN Güvenlik + WLAN Güvenlik - + + Add hidden Wi-Fi + + + + + Wi-Fi security + + + + Username Kullanıcı adı - + Password Parola - + Cancel İptal - + Connect Bağlan - + C_reate… Oluştur... - + None Yok - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise @@ -1088,17 +1236,17 @@ WPA & WPA2 Kişisel - + WEP 40/128-bit Key (Hex or ASCII) WEP 40/128-bit Key (Hex veya ASCII) - + WEP 128-bit Passphrase WEP 128-bit Passphrase - + Dynamic WEP (802.1X) Dinamik WEP (802.1X) @@ -1106,76 +1254,88 @@ WPA & WPA2 Enterprise WPA & WPA2 Enterprise + + + Connect to Hidden Wi-Fi Network + + DlgHideWifiWep - Connect to Hidden WLAN Network - Gizli WLAN Ağına Bağlan + Gizli WLAN Ağına Bağlan - Add hidden WLAN - Gizli WLAN Ekle + Gizli WLAN Ekle - + Connection Bağlantı: - + Network name Ağ adı: - WLAN security - WLAN Güvenliği: + WLAN Güvenliği: - + + Add hidden Wi-Fi + + + + + Wi-Fi security + + + + Key Anahtar - + WEP index WEP index - + Authentication Kimlik Doğrulama: - + Cancel İptal - + Connect Bağlan - + C_reate… Oluştur... - + None Yok - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise @@ -1184,17 +1344,17 @@ WPA & WPA2 Kişisel - + WEP 40/128-bit Key (Hex or ASCII) WEP 40/128-bit Key (Hex veya ASCII) - + WEP 128-bit Passphrase WEP 128-bit Passphrase - + Dynamic WEP (802.1X) Dinamik WEP (802.1x) @@ -1203,100 +1363,119 @@ WPA & WPA2 Enterprise - + 1(default) 1(default) - + Open System Sistemi aç - + Shared Key Paylaşılan Anahtar + + + Connect to Hidden Wi-Fi Network + + DlgHideWifiWpa - Connect to Hidden WLAN Network - Gizli WLAN Ağına Bağlan + Gizli WLAN Ağına Bağlan - Add Hidden WLAN - Gizli WLAN Ekle + Gizli WLAN Ekle - + Connection Bağlantı: - WLAN name - WLAN adı: + WLAN adı: - WLAN security - WLAN güvenlik: + WLAN güvenlik: - + + Add Hidden Wi-Fi + + + + + Wi-Fi name + + + + + Wi-Fi security + + + + Password Parola: - + Cancel İptal - + Connect Bağlan - + C_reate… Oluştur... - + None Yok - + WPA and WPA2 Personal - + WPA and WPA2 Enterprise - - - Conn WLAN Success - WLAN Bağlantısı Başarılı - - - - - Confirm your WLAN password or usable of wireless card - Kablosuz şifrenizi veya kablosuz kart kullanılabilirliğini onaylayın - - - - Selected WLAN has not been scanned. + + + Conn Wifi Success + + + + Confirm your Wi-Fi password or usable of wireless card + + + + Conn WLAN Success + WLAN Bağlantısı Başarılı + + + Confirm your WLAN password or usable of wireless card + Kablosuz şifrenizi veya kablosuz kart kullanılabilirliğini onaylayın + WPA & WPA2 Personal WPA & WPA2 Kişisel @@ -1313,59 +1492,156 @@ Dynamic WEP (802.1X) Dinamik WEP (802.1x) + + + Connect to Hidden Wi-Fi Network + + DlgHotspotCreate - - Dialog - - - - Create Hotspot - Etkin Nokta Oluştur + Etkin Nokta Oluştur - Network name - Ağ adı: + Ağ adı: - WLAN security - WLAN Güvenlik: + WLAN Güvenlik: - Password - Parola: + Parola: - Cancel - İptal + İptal - Ok - Tamam + Tamam - None - Yok - - - - WPA and WPA2 Personal - + Yok WPA & WPA2 Personal WPA & WPA2 Kişisel + + EnterpriseWlanDialog + + + Connect Enterprise WLAN + + + + + Close + + + + + Cancel + + + + + Connect + + + + + Ipv4Page + + + Ipv4Config + + + + + Address + + + + + Netmask + + + + + Default Gateway + + + + + Prefs DNS + + + + + Alternative DNS + + + + + Auto(DHCP) + Oto(DHCP) + + + + Manual + Elle + + + + Ipv6Page + + + Ipv6Config + + + + + Address + + + + + Subnet prefix Length + + + + + Default Gateway + + + + + Prefs DNS + + + + + Alternative DNS + + + + + Auto(DHCP) + Oto(DHCP) + + + + Manual + Elle + + KylinDBus @@ -1373,11 +1649,53 @@ Kylin ağ uygulaması masaüstü mesajı + + LanPage + + + LAN + + + + + Activated LAN + + + + + Inactivated LAN + + + + + LAN Disconnected Successfully + + + + + LAN Connected Successfully + + + + + ListItem + + + Kylin NM + + + + + kylin network applet desktop message + Kylin ağ uygulaması masaüstü mesajı + + MainWindow - - + + + kylin-nm @@ -1386,28 +1704,32 @@ - - Advanced - Gelişmiş + Gelişmiş - - - Ethernet - Kablolu Ağ + Kablolu Ağ Connect Hide Network Gizli Ağı Bağlan - - + + LAN + + + + WLAN WLAN + + + Settings + + Enabled Aktif @@ -1417,160 +1739,65 @@ Pasif - HotSpot - HotSpot + HotSpot - - FlyMode - - - - + Show MainWindow Ana Pencereyi Göster - - No wireless card detected - - - - - - - - - Not connected - Bağlanamadı + Bağlanamadı - - - - - - - - - - Disconnected - Bağlantı Kesildi + Bağlantı Kesildi - - NetOn,IfName: - - - - No Other Wired Network Scheme - Başka Kablolu Ağ Düzeni Yok + Başka Kablolu Ağ Düzeni Yok - No Other Wireless Network Scheme - Başka Kablosuz Ağ Düzeni Yok + Başka Kablosuz Ağ Düzeni Yok - - - - - Wired connection - - - - - - - - Ethernet connection - - - - Wired net is disconnected - Kablolu ağ bağlantısı kesildi + Kablolu ağ bağlantısı kesildi - WLAN is disconnected - Kablosuz bağlantı kesildi + Kablosuz bağlantı kesildi - - Without Lan Cable - - - - - MAC Address Mismatch - - - - - Connection Be Killed - - - - - Connect Wired Network Failed - - - - - Connect VPN Network Failed - - - - - IP configuration could not be reserved - - - - Confirm your WLAN password or usable of wireless card - Kablosuz şifrenizi veya kablosuz kart kullanılabilirliğini onaylayın + Kablosuz şifrenizi veya kablosuz kart kullanılabilirliğini onaylayın - Confirm your WLAN password - WLAN parolasını doğrula + WLAN parolasını doğrula - Ethernet Networks - Ethernet Ağları + Ethernet Ağları - New LAN - Yeni LAN + Yeni LAN - Hide WLAN - Gizli WLAN + Gizli WLAN - No usable network in the list - Listede kullanılabilir ağ yok + Listede kullanılabilir ağ yok - - - NetOn, - - - - WLAN Networks - WLAN Ağları + WLAN Ağları None @@ -1597,18 +1824,109 @@ Kablosuz listesini şimdi güncelle - Conn Ethernet Success - Ethernet Bağlantısı Başarılı + Ethernet Bağlantısı Başarılı Conn Ethernet Fail Ethernet Bağlantısı Hatası - Conn WLAN Success - WLAN Bağlantısı Başarılı + WLAN Bağlantısı Başarılı + + + + NetDetail + + + Kylin NM + + + + + kylin network desktop message + + + + + Detail + + + + + Ipv4 + + + + + Ipv6 + + + + + Security + + + + + Close + + + + + Confirm + + + + + Cancel + + + + + Forget this network + + + + + Add Lan Connect + + + + + connect hiddin wlan + + + + + + + Auto + Oto + + + + start check ipv4 address conflict + + + + + start check ipv6 address conflict + + + + + + + ipv4 address conflict! + + + + + + ipv6 address conflict! + @@ -1618,10 +1936,217 @@ -- + + OldMainWindow + + + Ethernet Networks + Ethernet Ağları + + + + New LAN + Yeni LAN + + + + WLAN Networks + WLAN Ağları + + + + Hide WLAN + Gizli WLAN + + + + No usable network in the list + Listede kullanılabilir ağ yok + + + + + + Ethernet + Kablolu Ağ + + + + HotSpot + HotSpot + + + + FlyMode + + + + + + Advanced + Gelişmiş + + + + kylin-nm + + + + + Show MainWindow + Ana Pencereyi Göster + + + + + Wired net is disconnected + Kablolu ağ bağlantısı kesildi + + + + No wireless card detected + + + + + + + + + Not connected + Bağlanamadı + + + + + + + + + + + + Disconnected + Bağlantı Kesildi + + + + + NetOn, + + + + + NetOn,IfName: + + + + + No Other Wired Network Scheme + Başka Kablolu Ağ Düzeni Yok + + + + No Other Wireless Network Scheme + Başka Kablosuz Ağ Düzeni Yok + + + + + + + Wired connection + + + + + + + + Ethernet connection + + + + + WLAN is disconnected + Kablosuz bağlantı kesildi + + + + + Conn Ethernet Success + Ethernet Bağlantısı Başarılı + + + + Without Lan Cable + + + + + IP configuration could not be reserved + + + + + MAC Address Mismatch + + + + + Connection Be Killed + + + + + Connect Bluetooth Network Failed + + + + + Carrier/link changed + + + + + Connect Wired Network Failed + + + + + Connect VPN Network Failed + + + + + Conn WLAN Success + WLAN Bağlantısı Başarılı + + + + Confirm your WLAN password or usable of wireless card + Kablosuz şifrenizi veya kablosuz kart kullanılabilirliğini onaylayın + + + + Confirm your WLAN password + WLAN parolasını doğrula + + + + Selected WLAN has not been scanned. + + + + + Connect Hidden WLAN Success + + + OneConnForm - + Form -- @@ -1634,15 +2159,19 @@ Ayar - - - - + + + + + + Connect Bağlan - + + + Disconnect Bağlantıyı Kes @@ -1651,12 +2180,11 @@ Parola gir... - Connect to Hidden WLAN Network - Gizli WLAN Ağına Bağlan + Gizli WLAN Ağına Bağlan - + Signal: @@ -1669,22 +2197,38 @@ Güvenli - + Cancel - + + Property + + + + + Password Incorrect + + + + + + Forget + + + + Rate Oran - + None Yok - + WLAN Security: WLAN güvenliği: @@ -1693,17 +2237,17 @@ Sinyal gücü: - + MAC: Fiziksel adres: - + Conn WLAN Success WLAN Bağlantısı Başarılı - + Confirm your WLAN password or usable of wireless card Kablosuz şifrenizi veya kablosuz kart kullanılabilirliğini onaylayın @@ -1715,7 +2259,7 @@ OneLancForm - + Form -- @@ -1724,51 +2268,72 @@ Ayar - - + + Connect Bağlan - + Disconnect Bağlantıyı Kes - + Cancel - - - - + + Not connected + Bağlanamadı + + + + + Disconnected + Bağlantı Kesildi + + + + + Ethernet + Kablolu Ağ + + + + NetOn, + + + + + + No Configuration Yapılandırma Yok - + No IfName - + IPv4: IPv4 adresi: - + IPv6: IPv6 adresi: - + BandWidth: Bant genişliği: - + MAC: Fiziksel adres: @@ -1778,88 +2343,411 @@ - Utils + SecurityPage - - kylin-nm + + Security - + + + Password + + + + + EAP type + + + + + Identity + Kimlik: + + + + Domain + Domain: + + + + CA certficate + + + + + no need for CA certificate + + + + + User certificate + Kullanıcı sertifikası: + + + + User private key + Kullanıcı özel anahtarı: + + + + User key password + Kullanıcı anahtarı şifresi: + + + + Ineer authentication + + + + + Usename + + + + + Ask pwd each query + + + + + + + + + + + None + Yok + + + + WPA&WPA2 Personal + + + + + WPA&WPA2 Enterprise + + + + + WPA3 Personal + + + + + + + Choose from file... + + + + + + + Choose a CA certificate + + + + + + + CA Files (*.pem *.der *.p12 *.crt *.cer *.pfx) + + + + + TabPage + + + Current Device + + + + + Devices Closed! + + + + + Settings + + + + + Kylin NM + + + + kylin network applet desktop message Kylin ağ uygulaması masaüstü mesajı - WpaWifiDialog + Utils - + kylin network applet desktop message + Kylin ağ uygulaması masaüstü mesajı + + + + WiFiConfigDialog + + Dialog - - Connect WLAN + + WLAN Authentication - - Connection name + + Input WLAN Information Please - - Security + + WLAN ID: - - EAP type + + WLAN Name: - - inner authentication + + Password: - - Username + + Cancl - - Password - + + Ok + Tamam + + + + WlanListItem + + + Not connected + Bağlanamadı - - Show password - + + + Disconnect + Bağlantıyı Kes - - Ask pwd each query - - - - - Cancel - - - - + + + Connect - - WPA & WPA2 + + + Forget + + Auto Connect + + + + + WlanPage + + + WLAN + WLAN + + + + Activated WLAN + + + + + Other WLAN + + + + + More... + + + + + WLAN Connected Successfully + + + + + WLAN Disconnected Successfully + + + + + WpaWifiDialog + + + Dialog + + + + + Connect WLAN + + + + + Security + + + + + EAP type + + + + + Name + + + + + Inner auth + + + + + Username + + + + + Password + + + + + Show password + + + + + Ask pwd each query + + + + + Cancel + + + + + Connect + + + + + WPA and WPA2 Personal + + + + + WPA and WPA2 Enterprise + + + + + + + Choose from file... + + + + + + + Choose a CA certificate + + + + + + CA Files (*.pem *.der *.p12 *.crt *.cer *.pfx) + + + + + CA Files (*.pem *.der *.p12 *.crt *.key *.cer *.pfx) + + + + + Identity + Kimlik: + + + + Anonymous Identity + + + + + Domain + Domain: + + + + CA certificate + + + + + no need for CA certificate + + + + + User Certificate + + + + + User Private Key + + + + + User Private Key password + + + + + + + + + + None - Yok + Yok diff --git a/translations/kylin-nm_zh_CN.qm b/translations/kylin-nm_zh_CN.qm index 3ad8ead205bcc02cceee4bafae3a59f7ced960b4..656182620e487b1e3405e7bef3c1f2bc6dd708fc 100644 GIT binary patch literal 11355 zcmd5>dvp}l8NY#j%ue=^7q3Xd1W7=uDIx~7zG4<+OS0KyBP&H7lik_PG@IG&?t~B( zBCWP~0yaJXwHE6UtDsfuqt*w49v`*VM|*^Nszof;H|p_Fwc0|zyLb2Q&d#0P1^+2I z$!~V~{l5F%?>@h8&i;L9@*h9FW%El7Q+KbrZP(u~K*;R0=f)kGr z6#CJe32PB5dw}4Ca|lkk2zlPGh5k-M-*4HBkZX+KgfEeI>80@f!+pavJc7Quekc6@&N9nyhY=e01i^|Cf|Z|_`R)SyzmN-3AF@IY#)Cp0CAeSj^K~iSN zM+C=zhhW9K1gn;s7dH+eRI`uZl*#5u-4ux1Qi3OLG~aYRjL*~-f-_cFW*&sP2-S63@7{P2#_u3O*B1mUWzK%Zl`vi#xp~fufN$b% zTO5J$Jxs9TL2l>4cVOLoOwjrcL0dUN9uX{WBL4g9xGBgjo6Xgil6KbK(n#RMIP2{s({nxe>mpcD zPq6Y@Ui@YrLQ@V9tbLSVgUW|qeF?_1o|hKmewC+j6G7`$1i7^YZMPHTw-PMhMbObt z(CJU(UkSRNCOG9`g0adrzEw^9vk$=@W}iy1uAX4yQ2D~Gk0NxUxjeK3 z_MvHy6Kwi!`RzA83;cBi>(42_XY)z0Ugi+2J5at?co5?8Q-YOe60Ewye*T9~!g`9> zZ&@V4dUDwxFH6Gwx|5*r3;W(hFM!>n1nVDi)SbKy_Km5Ix=R474mr-9J_hskCyots zfmf|MHuM8d-{sh!`hKS4-=;yBpGTbbX>UMWV@|Tq{nGit*AU-^YS+CNybOLl=K9F7 z9ol(_ZO<^W zjRbTVYJtD!p|zTJT8^t7Q}5#LyQm#Yho}sSjIP%72LrSE_6#h}b&JZT2jplJdLsq< z1+@=%Nau^bhxU=Kb#De=9X@Md!>SlHHKTtxDl38_sY9_uzaYlrQArg-QnFu-#f1R~ zqZpAG#=b1{FEHV8qeN>f86wQHws!UFKY9h#Flcn zH$9Hw%&lTVR?svJ`UuQ-s3g5Ftf+v}s-N4mO_S)E%7i-S>BxKLE3A#s@9o*j8m z9IZz4uI(66sFwG{SI@(fUXHM3hVzHv*)rcqS8&IgGHTrlQ63PJ{cO|xOwVWDR@E-__>8+^Gt8d)TVq<|cjQ)}O(nM~I7 zJi@a=M;#{}pfkwijVY-Gs$&^8U6s@H0x`Z&OsYjZFj6obF(R9mJ$FNPwQxQ$nS`A; zgnMWtu?)`Yo!{f2o#ie{;;oSENJgSk``s>y@nh>ZRg}_iN-n+MRB|l+rlL~&?K|dv zQ^mNzTXZZe?%04RD~#dG(pmE~Z`dfg^e|D$v4n|=48v5ZT^7EfP?6bTAYe`o18#v% z8z>6)*+661<-D=z>1p>D>9didw3$I0V8+PEc7Y%nNeV{ENMsnMys-8}lSQIrATS7$ z0h{xm*W0m&4oZ=u_S>ZJ`2hutHEusBkO=;TBh* zB|BE*J$>18IXA7!l!bn2ScvCr@P!;0ek$i!AP&S6@@i;Y05b&~FdQ#e&PvX1kA~+f zlg^AIlUZPTGWiAPCR1V9QD;s^15&ZmjKyYllSM4ehqzc|WoS&N*~NXxm^HpZuRVsp+6r zWx|;W?L%Jrr=^yb!f7=nrEgk^Vd|!(aRt*hEw^~ersW%F;h5KQTp`b@iiSK(Ej{E} zO(x_mx{SFcn=xzqQ846L%cX@e%eUhp>h2gpn@3jsn$EEr|6niFQG__8%<>wcT~Z=y zAKtjNK3SH39@{hUJt}jwLWu$I^C6+V)rG&eLz-1v7ywqm?{yCKABUl;rx=S z%1R`OeaxrZd;Kesu14na_r->UtYwyxmkzAkeaZQOw??{XOih9GDC(MFM=!S&r;`kP z)BP(va++P+1w}alre0?3v1c}@7?I))IT$pXstK2RSS+J*ZoV~xV>CaQB=oV^_U`0;nCeA}`fdr~SF2gKrIZ4j?QQ(yDg-aTj@Ip zOU#~Dx%&b`Wq4aG?^GmMdJ26TQ=n3(qiRkEK6^6Ye(MagmZya*PbQyvan@Na*fH4k zf+coLOD)zh4ZHXpz+P)4_WoD;8%F=J`4dfcS=E~C7ve)9K@x*~!jA@}1bNAj*$C+6 zVF|niX+;7~Zeg{}LbFjbtYrxez$g41g6Bl~IgU<6bJNd3_*SLQxtuUslk--kxvf=L zC`YBFFl%;mTpAE&H-{i|hUZh~!rvgQKKM(%39lhctS^Amx3v3NS0zcG?>a?A3A~qm|p`Xpo z&3FpxZ5Y%v^h6#lfD!RYk4E>>X1E2dK0$@rIoo!T3W&Z9uIs9?_eZynK1Exo@hB3E zf;b3o3!!uZB@K9~#cqwcn)GcHNcZ(*3qG$_&7|&VPAmpJuikBiVoIjmt!I~5zR?Sh zrE;TJrVU7c34Z4a+5DV6R18br+1|%!m@BCz zpOi?(6!M~3?~ya@$!SQ?=pCRxO(>%EI<}&#*Xx#GtrCN46x{s7u|!F$kXz}8jH=5o zQum#0gNX!8SHUfFqVeJun>E_0dKDpG2uaHN}sK!OONg-9U2&L`~8c_+CEe*fO zonOQKmT8H`mj1=6J@>_GYC_jlLRJBB7NHFjoG<4pF$ z;f`ddK=|;|+PqEM+7U}+Hfk-~)V12Xk4_c76E?$yU|_gV2Bx)|N~AFz=M$Pl`UGq{ zlT9&_V67cH9*~S3>ScY(M)t;3+|04u7#xAPh+nyha&hgKGtYS@d4P&=k2?Fci$o0fSfIcEDg4d=^TA;P2qy;LrOChii8caTuyOB7^}Jk1QhsL`|lC0s>W$*taqw@X47W!1e2X%q+?mh z719B9thPOpjHIz9+Y4G?f^|MvqhvDJ(}ZxR`*i$b=s*oA5qa6 zY;Nio!^xsJ#b#Z>YCLT)taE%CrcI-Cg?8#=^5`}ONIP|dk8NbAOrO^H90<(UJKE{r zFb3&cn+9oKgTAvq8gS_){$SXn9}D-AvsO;=0H;(b?_YRD5%4o%SiQFeRDVZ)# z<8OH^{T)TGD3+MJwD)$!l1r49mC86eSC=c5rNqEs + + ConfForm + + + edit network + + + + + LAN name: + + + + + + + Method: + + + + + Address: + + + + + Netmask: + + + + + Gateway: + + + + + DNS 1: + + + + + DNS 2: + + + + + Ipv6 Address: + + + + + Edit Conn + + + + + Auto(DHCP) + + + + + Manual + 手动 + + + + Cancel + 取消 + + + + Save + + + + + Ok + + + + + Can not create new wired network for without wired card + + + + + New network already created + + + + + Wireless card not exist + + + + + Can not save wired network for without wired card + + + + + New network settings already finished + + + + + kylin-nm + 麒麟网络工具 + + + + kylin network applet desktop message + 网络提示消息 + + + + Will check the IP address conflict + 正在检测ip地址冲突 + + + + IPV4 address conflict, Please change IP + ip地址冲突,请更改ip + + + + IPV6 address conflict, Please change IP + ip地址冲突,请更改ip {6 ?} + + + + Edit Network + + + + + Add Wired Network + + + CreatNetPage - + Connection Name 网络名称 - + Ipv4Config Ipv4配置 - + Address 地址 - + Netmask 子网掩码 - + Default Gateway 默认网关 - + Prefs DNS 首选DNS - + Alternative DNS 备选DNS - + Auto(DHCP) 自动(DHCP) - + Manual 手动 @@ -52,100 +192,1175 @@ DetailPage - + Auto Connection 自动连接 - + SSID: SSID: - + Protocol: 协议: - + Security Type: 安全类型: - + Hz: 网络频带: - + Chan: 带宽: - + BandWidth: 带宽: - + IPV6: 本地链接Ipv6地址: - + IPV4: Ipv4地址: - + IPV4 Dns: Ipv4 DNS服务器: - + Mac: 物理地址: + + DlgHideWifi + + + Connect to Hidden WLAN Network + + + + + Add Hidden WLAN + + + + + Connection + + + + + WLAN name + + + + + WLAN security + + + + + Cancel + 取消 + + + + Connect + 连接 + + + + C_reate… + + + + + None + + + + + WPA and WPA2 Personal + + + + + WPA and WPA2 Enterprise + + + + + + Conn WLAN Success + + + + + + Confirm your WLAN password or usable of wireless card + + + + + DlgHideWifiEapFast + + + Connect to Hidden WLAN Network + + + + + Add hidden WLAN + + + + + Connection + + + + + Network name + + + + + WLAN security + + + + + Authentication + + + + + Anonymous identity + + + + + Allow automatic PAC pro_visioning + + + + + PAC file + + + + + Inner authentication + + + + + Username + 用户名 + + + + Password + 密钥 + + + + Cancel + 取消 + + + + Connect + 连接 + + + + C_reate… + + + + + + None + + + + + WPA and WPA2 Personal + + + + + WEP 40/128-bit Key (Hex or ASCII) + + + + + WEP 128-bit Passphrase + + + + + Dynamic WEP (802.1X) + + + + + WPA and WPA2 Enterprise + + + + + Tunneled TLS + + + + + Protected EAP (PEAP) + + + + + Anonymous + + + + + Authenticated + + + + + Both + + + + + DlgHideWifiEapLeap + + + Connect to Hidden WLAN Network + + + + + Add hidden WLAN + + + + + Connection + + + + + Network name + + + + + WLAN security + + + + + Authentication + + + + + Username + 用户名 + + + + Password + 密钥 + + + + Cancel + 取消 + + + + Connect + 连接 + + + + C_reate… + + + + + None + + + + + WPA and WPA2 Personal + + + + + WEP 40/128-bit Key (Hex or ASCII) + + + + + WEP 128-bit Passphrase + + + + + Dynamic WEP (802.1X) + + + + + WPA and WPA2 Enterprise + + + + + Tunneled TLS + + + + + Protected EAP (PEAP) + + + + + DlgHideWifiEapPeap + + + Connect to Hidden WLAN Network + + + + + Add hidden WLAN + + + + + Connection + + + + + Network name + + + + + WLAN security + + + + + Authentication + + + + + Anonymous identity + + + + + Domain + + + + + CA certificate + + + + + CA certificate password + + + + + No CA certificate is required + + + + + PEAP version + + + + + Inner authentication + + + + + Username + 用户名 + + + + Password + 密钥 + + + + Cancel + 取消 + + + + Connect + 连接 + + + + + None + + + + + WPA and WPA2 Personal + + + + + WPA and WPA2 Enterprise + + + + + Protected EAP (PEAP) + + + + + Choose from file + + + + + Automatic + + + + + Version 0 + + + + + Version 1 + + + + + DlgHideWifiEapPwd + + + Connect to Hidden WLAN Network + + + + + Add hidden WLAN + + + + + Connection + + + + + Network name + + + + + WLAN security + + + + + Authentication + + + + + Username + 用户名 + + + + Password + 密钥 + + + + Cancel + 取消 + + + + Connect + 连接 + + + + C_reate… + + + + + None + + + + + WPA and WPA2 Personal + + + + + WEP 40/128-bit Key (Hex or ASCII) + + + + + WEP 128-bit Passphrase + + + + + Dynamic WEP (802.1X) + + + + + WPA and WPA2 Enterprise + + + + + Tunneled TLS + + + + + Protected EAP (PEAP) + + + + + DlgHideWifiEapTTLS + + + Connect to Hidden Wi-Fi Network + + + + + Add hidden WLAN + + + + + Connection + + + + + Network name + + + + + WLAN security + + + + + Authentication + + + + + Anonymous identity + + + + + Domain + + + + + CA certificate + + + + + CA certificate password + + + + + No CA certificate is required + + + + + Inner authentication + + + + + Username + 用户名 + + + + Password + 密钥 + + + + Cancel + 取消 + + + + Connect + 连接 + + + + C_reate… + + + + + + None + + + + + WPA and WPA2 Personal + + + + + WEP 40/128-bit Key (Hex or ASCII) + + + + + WEP 128-bit Passphrase + + + + + Dynamic WEP (802.1X) + + + + + WPA and WPA2 Enterprise + + + + + Tunneled TLS + + + + + Protected EAP (PEAP) + + + + + Choose from file + + + + + DlgHideWifiEapTls + + + Connect to Hidden WLAN Network + + + + + Add hidden WLAN + + + + + Connection + + + + + Network name + + + + + WLAN security + + + + + Authentication + + + + + Identity + 匿名身份 + + + + Domain + + + + + CA certificate + + + + + CA certificate password + + + + + No CA certificate is required + + + + + User certificate + 用户证书 + + + + User certificate password + + + + + User private key + 用户私钥 + + + + User key password + 用户密钥密码 + + + + Cancel + 取消 + + + + Connect + 连接 + + + + C_reate… + + + + + + + + None + + + + + WPA and WPA2 Personal + + + + + WPA and WPA2 Enterprise + + + + + Tunneled TLS + + + + + Protected EAP (PEAP) + + + + + + + Choose from file + + + + + DlgHideWifiLeap + + + Connect to Hidden Wi-Fi Network + + + + + Add hidden Wi-Fi + + + + + Connection + + + + + Network name + + + + + Wi-Fi security + + + + + Username + 用户名 + + + + Password + 密钥 + + + + Cancel + 取消 + + + + Connect + 连接 + + + + C_reate… + + + + + None + + + + + WPA and WPA2 Personal + + + + + WEP 40/128-bit Key (Hex or ASCII) + + + + + WEP 128-bit Passphrase + + + + + Dynamic WEP (802.1X) + + + + + WPA and WPA2 Enterprise + + + + + DlgHideWifiWep + + + Connect to Hidden Wi-Fi Network + + + + + Add hidden Wi-Fi + + + + + Connection + + + + + Network name + + + + + Wi-Fi security + + + + + Key + + + + + WEP index + + + + + Authentication + + + + + Cancel + 取消 + + + + Connect + 连接 + + + + C_reate… + + + + + None + + + + + WPA and WPA2 Personal + + + + + WEP 40/128-bit Key (Hex or ASCII) + + + + + WEP 128-bit Passphrase + + + + + Dynamic WEP (802.1X) + + + + + WPA and WPA2 Enterprise + + + + + 1(default) + + + + + Open System + + + + + Shared Key + + + + + DlgHideWifiWpa + + + Connect to Hidden Wi-Fi Network + + + + + Add Hidden Wi-Fi + + + + + Connection + + + + + Wi-Fi name + + + + + Wi-Fi security + + + + + Password + 密钥 + + + + Cancel + 取消 + + + + Connect + 连接 + + + + C_reate… + + + + + None + + + + + WPA and WPA2 Personal + + + + + WPA and WPA2 Enterprise + + + + + + Conn Wifi Success + + + + + + Confirm your Wi-Fi password or usable of wireless card + + + + + EnterpriseWlanDialog + + + Connect Enterprise WLAN + + + + + Close + 关闭 + + + + Cancel + 取消 + + + + Connect + 连接 + + Ipv4Page - + Ipv4Config Ipv4配置 - + Address 地址 - + Netmask 子网掩码 - + Default Gateway 默认网关 - + Prefs DNS 首选DNS - + Alternative DNS 备选DNS - + Auto(DHCP) 自动 - + Manual 手动 @@ -153,42 +1368,42 @@ Ipv6Page - + Ipv6Config Ipv6配置 - + Address 地址 - + Subnet prefix Length 子网前缀长度 - + Default Gateway 默认网关 - + Prefs DNS 首选DNS - + Alternative DNS 备选DNS - + Auto(DHCP) 自动 - + Manual 手动 @@ -196,27 +1411,27 @@ LanPage - + LAN 有线网络 - + Activated LAN 已激活 - + Inactivated LAN 未激活 - + LAN Disconnected Successfully 有线网络断开 - + LAN Connected Successfully 连接有线网络成功 @@ -224,12 +1439,12 @@ ListItem - + Kylin NM 麒麟网络工具 - + kylin network applet desktop message 网络提示消息 @@ -237,30 +1452,31 @@ MainWindow - - + + + kylin-nm 麒麟网络工具 - + LAN 有线网络 有线网络 - + WLAN 无线局域网 无线局域网 - + Show MainWindow 打开网络工具 - + Settings 网络设置 网络设置 @@ -269,123 +1485,522 @@ NetDetail - + + Kylin NM + 麒麟网络工具 + + + + kylin network desktop message + + + + Detail 详情 - + Ipv4 Ipv4 - + Ipv6 Ipv6 - + Security 安全 - + Close 关闭 - + Confirm 确定 - + Cancel 取消 - + Forget this network 忘记此网络 - + Add Lan Connect 添加有线连接 - + connect hiddin wlan 连接到隐藏WLAN - - - + + + Auto 自动 + + + start check ipv4 address conflict + 开始检测ipv4地址冲突 + + + + start check ipv6 address conflict + 开始检测ipv6地址冲突 + + + + + + ipv4 address conflict! + ipv4地址冲突! + + + + + ipv6 address conflict! + ipv4地址冲突! {6 ?} + + + + OldMainWindow + + + Ethernet Networks + + + + + New LAN + + + + + WLAN Networks + + + + + Hide WLAN + + + + + No usable network in the list + + + + + + + Ethernet + + + + + HotSpot + + + + + FlyMode + + + + + + Advanced + + + + + kylin-nm + 麒麟网络工具 + + + + Show MainWindow + 打开网络工具 + + + + + Wired net is disconnected + + + + + No wireless card detected + + + + + + + + + Not connected + 未连接 + + + + + + + + + + + + Disconnected + + + + + + NetOn, + + + + + NetOn,IfName: + + + + + No Other Wired Network Scheme + + + + + No Other Wireless Network Scheme + + + + + + + + Wired connection + + + + + + + + Ethernet connection + + + + + WLAN is disconnected + + + + + + Conn Ethernet Success + + + + + Without Lan Cable + + + + + IP configuration could not be reserved + + + + + MAC Address Mismatch + + + + + Connection Be Killed + + + + + Connect Bluetooth Network Failed + + + + + Carrier/link changed + + + + + Connect Wired Network Failed + + + + + Connect VPN Network Failed + + + + + Conn WLAN Success + + + + + Confirm your WLAN password or usable of wireless card + + + + + Confirm your WLAN password + + + + + Selected WLAN has not been scanned. + + + + + Connect Hidden WLAN Success + + + + + OneConnForm + + + Form + + + + + + + + + + Connect + 连接 + + + + + + Disconnect + 断开 + + + + Cancel + 取消 + + + + Property + + + + + Password Incorrect + + + + + + Forget + 忘记此网络 + + + + Rate + + + + + None + + + + + WLAN Security: + + + + + Signal: + + + + + MAC: + + + + + Conn WLAN Success + + + + + Confirm your WLAN password or usable of wireless card + + + + + OneLancForm + + + Form + + + + + + Connect + 连接 + + + + Disconnect + 断开 + + + + Cancel + 取消 + + + + Not connected + 未连接 + + + + + Disconnected + + + + + + Ethernet + + + + + NetOn, + + + + + + + No Configuration + + + + + No IfName + + + + + IPv4: + + + + + IPv6: + + + + + BandWidth: + + + + + MAC: + + SecurityPage - + Security 安全性 - - + + Password 密钥 - + EAP type EAP方法 - + Identity 匿名身份 - + Domain - + CA certficate CA 证书 - + no need for CA certificate 不需要CA证书 - + User certificate 用户证书 - + User private key 用户私钥 - + User key password 用户密钥密码 - + Ineer authentication 内部认证 - + Usename 用户名 @@ -395,54 +2010,54 @@ 用户名 - + Ask pwd each query 每次询问密码 - - - - - - - + + + + + + + None - + WPA&WPA2 Personal WPA&WPA2 个人 - + WPA&WPA2 Enterprise WPA&WPA2 企业 - + WPA3 Personal WPA3 个人 - - - + + + Choose from file... 从文件选择... - - - + + + Choose a CA certificate 选择一个CA证书 - - - + + + CA Files (*.pem *.der *.p12 *.crt *.cer *.pfx) CA 证书 (*.pem *.der *.p12 *.crt *.cer *.pfx) @@ -450,59 +2065,102 @@ TabPage - + Current Device 当前网卡 - + Devices Closed! 设备关闭! - + Settings 网络设置 - + Kylin NM 麒麟网络工具 - + kylin network applet desktop message 网络提示消息 + + WiFiConfigDialog + + + Dialog + + + + + WLAN Authentication + + + + + Input WLAN Information Please + + + + + WLAN ID: + + + + + WLAN Name: + + + + + Password: + + + + + Cancl + + + + + Ok + + + WlanListItem - + Not connected 未连接 - - + + Disconnect 断开 - - - + + + Connect 连接 - - + + Forget 忘记此网络 - + Auto Connect 自动连接 @@ -510,34 +2168,183 @@ WlanPage - + WLAN 无线局域网 - + Activated WLAN 已激活 - + Other WLAN 其他 - + More... 更多... - + WLAN Connected Successfully 连接无线网络成功 - + WLAN Disconnected Successfully 断开无线网络 + + WpaWifiDialog + + + Dialog + + + + + Connect WLAN + + + + + Name + + + + + Security + + + + + EAP type + EAP方法 + + + + Inner auth + + + + + Username + 用户名 + + + + Password + 密钥 + + + + Show password + + + + + Ask pwd each query + 每次询问密码 + + + + Cancel + 取消 + + + + Connect + 连接 + + + + + + + + + + None + + + + + WPA and WPA2 Personal + + + + + WPA and WPA2 Enterprise + + + + + + + Choose from file... + 从文件选择... + + + + + + Choose a CA certificate + 选择一个CA证书 + + + + + CA Files (*.pem *.der *.p12 *.crt *.cer *.pfx) + CA 证书 (*.pem *.der *.p12 *.crt *.cer *.pfx) + + + + CA Files (*.pem *.der *.p12 *.crt *.key *.cer *.pfx) + + + + + Identity + 匿名身份 + + + + Anonymous Identity + + + + + Domain + + + + + CA certificate + + + + + no need for CA certificate + 不需要CA证书 + + + + User Certificate + + + + + User Private Key + + + + + User Private Key password + + +