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..b6642bcc 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 { @@ -93,9 +95,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/list-items/wlanlistitem.cpp b/src/frontend/list-items/wlanlistitem.cpp index 977ee5dc..68fc54ff 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() @@ -276,6 +277,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,9 +372,15 @@ 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; } + + 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; @@ -413,6 +424,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/tab-pages/lanpage.cpp b/src/frontend/tab-pages/lanpage.cpp index c0bfca1a..3a77c360 100644 --- a/src/frontend/tab-pages/lanpage.cpp +++ b/src/frontend/tab-pages/lanpage.cpp @@ -7,41 +7,41 @@ #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_wiredConnectOperation = new KyWiredConnectOperation(this); - - initDeviceState(); + m_deviceResource = new KyNetworkDeviceResourse(this); initUI(); initNetSwitch(); + initLanDevice(); 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() @@ -49,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<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 +110,27 @@ 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; - - 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); + if (m_wiredSwitch) { + for (int index = 0; index < m_enableDeviceList.size(); ++index) { + qDebug()<<"[LanPage] open wired device "<< m_enableDeviceList.at(index); + wiredOperation.openWiredNetworkWithDevice(m_enableDeviceList.at(index)); } } 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); + for (int index = 0; index < m_enableDeviceList.size(); ++index) { + qDebug()<<"[LanPage] close wired device "<< m_enableDeviceList.at(index); + wiredOperation.closeWiredNetworkWithDevice(m_enableDeviceList.at(index)); } } + initDeviceCombox(); - m_netSwitch->setSwitchStatus(isOn); + initLanArea(); + + m_netSwitch->setSwitchStatus(m_wiredSwitch); + m_netSwitch->blockSignals(false); } } @@ -123,143 +146,350 @@ 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; - - if (!m_switchGsettings) { - qDebug() << "[LanPage]:m_switchGsettings is null" << Q_FUNC_INFO << __LINE__; - return; - } + disconnect(m_deviceComboBox, QOverload::of(&QComboBox::currentIndexChanged), + this, &LanPage::onDeviceComboxIndexChanged); 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(m_enableDeviceList.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)); + 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); + } } - qDebug() << "[LanPage]Current device:" << m_deviceComboBox->currentText(); - m_deviceName = m_deviceComboBox->currentText(); - initList(m_deviceName); + } else if (enableDeviceCount == 1) { + m_deviceFrame->hide(); + + if (m_currentDeviceName != m_enableDeviceList.at(0)) { + m_currentDeviceName = m_enableDeviceList.at(0); + setDefaultDevice(WIRED, m_currentDeviceName); + } + } else { + m_deviceFrame->show(); + m_deviceComboBox->hide(); + m_tipsLabel->show(); + m_currentDeviceName = ""; + } + } else { + m_deviceFrame->hide(); + m_currentDeviceName = ""; + } + + connect(m_deviceComboBox, QOverload::of(&QComboBox::currentIndexChanged), + this, &LanPage::onDeviceComboxIndexChanged); + 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_activatedNetDivider->hide(); + m_activatedNetFrame->hide(); + + m_inactivatedNetFrame->hide(); + } else { + m_activatedNetDivider->show(); + m_activatedNetFrame->show(); + constructActiveConnectionArea(); + + m_inactivatedNetFrame->show(); + 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) { + if (1 == m_enableDeviceList.count()) { + //1、从无到有添加第一块有线网卡 + //2、有多快网卡,但是没有使能 + m_deviceFrame->hide(); + m_currentDeviceName = deviceName; + } else if (2 == m_enableDeviceList.count()) { + //3、现在有且只有一块网卡,并已使能 + //4、有多快网卡,且使能了其中一块 + m_deviceComboBox->addItem(m_currentDeviceName); + m_deviceComboBox->addItem(deviceName); + + m_deviceFrame->show(); + m_tipsLabel->hide(); + m_deviceComboBox->show(); + } else if (m_enableDeviceList.count() > 2) { + //5、有多快网卡且使能了多块网卡 + m_deviceComboBox->addItem(deviceName); + } + } + + connect(m_deviceComboBox, QOverload::of(&QComboBox::currentIndexChanged), + this, &LanPage::onDeviceComboxIndexChanged); return; } @@ -269,69 +499,149 @@ 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; + saveDeviceEnableState(deviceName, true); + m_enableDeviceList<::of(&QComboBox::currentIndexChanged), + this, &LanPage::onDeviceComboxIndexChanged); + + if (m_wiredSwitch) { + if (0 == m_enableDeviceList.count()) { + //1、没有使能任何网卡 + goto l_out; + } else if (1 == m_enableDeviceList.count()) { + //2、使能了一个网卡,且当前网卡是要删除的网卡 + if (m_currentDeviceName == deviceName) { + m_deviceFrame->show(); + m_deviceComboBox->hide(); + m_tipsLabel->show(); + m_currentDeviceName = ""; + } + } else if (2 == m_enableDeviceList.count()) { + //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); + + 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; + 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(); - 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); - if (m_devList.contains(oldName)) { - m_devList.removeOne(oldName); - m_devList.append(newName); - qDebug() << "[LanPage] emit deviceNameUpdate " << oldName << newName; + if (m_enableDeviceList.contains(oldName)) { + m_enableDeviceList.removeOne(oldName); + m_enableDeviceList.append(newName); + } + qDebug() << "[LanPage] emit deviceNameUpdate " << oldName << newName; - emit deviceNameChanged(oldName, newName); - initDeviceCombox(); - } + updateDeviceCombox(oldName, newName); + if (m_currentDeviceName == newName) { + setDefaultDevice(WIRED, m_currentDeviceName); + initLanArea(); + } + + 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::showControlCenter() +void LanPage::onShowControlCenter() { QProcess process; process.startDetached("ukui-control-center --wiredconnect"); @@ -372,189 +682,125 @@ 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) { - qDebug() << "initList"; - 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_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); + //发送通知给控制面板 + emit lanActiveConnectionStateChanged(p_newItem->m_ifaceName, uuid, p_newItem->m_connectState); - m_deactiveMap.insert(deactiveItemData, 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; } - } - 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); - emit this->lanConnectChanged(); - } else { - addNewItem(activeItemData, m_inactivatedLanListWidget); - m_deactiveMap.insert(activeItemData, m_listWidgetItem); - } - } + qDebug()<<"[LanPage]update active connection item"<m_connectName; + QListWidgetItem *p_listWidgetItem = addNewItem(p_newItem, m_activatedLanListWidget); + m_activeMap.insert(p_newItem, p_listWidgetItem); } else { - addNewItem(nullptr, m_activatedLanListWidget); //显示一个未激活任何连接的item + //释放内存 + delete p_newItem; + p_newItem = nullptr; } + + 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); + + 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; + 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__ ; - emit this->lanConnectChanged(); - } else { - m_isLanConnected = false; - qDebug() << "[lanpage]lanIsConnected status : " << m_isLanConnected << Q_FUNC_INFO << __LINE__ ; - emit this->lanConnectChanged(); - } - 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()); - 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); - this->showDesktopNotify(tr("LAN Disconnected Successfully")); - 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); - this->showDesktopNotify(tr("LAN Connected Successfully")); - 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; } @@ -581,105 +827,170 @@ 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; +} + +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, bool &needDeleteItem) +{ + bool inCurrentMap = false; - 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; 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) { + inCurrentMap = true; + 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); + needDeleteItem = false; } } + 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; +} + +void LanPage::updateActiveConnectionProperty(KyConnectItem *p_connectItem, bool &needDeleteItem) +{ 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); + needDeleteItem = false; } } + break; } } + + return; +} + +void LanPage::onUpdateConnection(QString uuid) +{ + + if (!m_connectResourse->isWiredConnection(uuid)) { + return; + } + + 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) { + qWarning()<<"[LanPage] get item failed, when update activate connection." + <<"connection uuid" << uuid; + return; + } + + sendLanUpdateSignal(p_newItem); + updateActiveConnectionProperty(p_newItem, needDeleteNewItem); + } else { + p_newItem = m_connectResourse->getConnectionItemByUuid(uuid); + if (nullptr == p_newItem) { + qWarning()<<"[LanPage] get item failed, when update connection." + <<"connection uuid"<type() == QEvent::MouseButtonPress) { - showControlCenter(); + onShowControlCenter(); } } return QWidget::eventFilter(watched, event); @@ -708,51 +1038,42 @@ bool LanPage::eventFilter(QObject *watched, QEvent *event) void LanPage::activateWired(const QString& devName, const QString& connUuid) { - qDebug() << "activateWired" << devName << connUuid; + qDebug() << "[LanPage] activateWired" << devName << connUuid; m_wiredConnectOperation->activateConnection(connUuid, devName); emit this->lanConnectChanged(); } 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 674403be..3abb0893 100644 --- a/src/frontend/tab-pages/lanpage.h +++ b/src/frontend/tab-pages/lanpage.h @@ -35,64 +35,88 @@ public: protected: bool eventFilter(QObject *watched, QEvent *event); +private: + void initLanDevice(); + 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, bool &needDeleteItem); + void updateConnectionProperty(KyConnectItem *p_connectItem, bool &needDeleteItem); + + 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); + + void onShowControlCenter(); 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; + QStringList m_enableDeviceList; -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 showControlCenter(); -// void onLanDataChange(QString uuid); + QGSettings *m_switchGsettings = nullptr; + + bool m_wiredSwitch = true; }; #endif // LANPAGE_H diff --git a/src/frontend/tab-pages/tabpage.cpp b/src/frontend/tab-pages/tabpage.cpp index cf071387..58dabf66 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); } @@ -128,6 +128,33 @@ void TabPage::showDesktopNotify(const QString &message) iface.callWithArgumentList(QDBus::AutoDetect,"Notify",args); } +QString getDefaultDeviceName(KyDeviceType deviceType) +{ + QString defaultDevice = ""; + + QString key; + switch (deviceType) { + case WIRED: + key = "wired"; + break; + case WIRELESS: + key = "wireless"; + break; + default: + return defaultDevice; + } + + QSettings * m_settings = new QSettings(CONFIG_FILE_PATH, QSettings::IniFormat); + m_settings->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; } @@ -188,6 +217,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..e0cca3d4 100644 --- a/src/frontend/tab-pages/tabpage.h +++ b/src/frontend/tab-pages/tabpage.h @@ -40,8 +40,10 @@ 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); void getDeviceEnableState(int type, QMap &map); class TabPage : public QWidget diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index e589c3df..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); @@ -138,6 +139,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()); @@ -389,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); @@ -682,8 +697,17 @@ 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) { + 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 +742,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; 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/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..ace9db26 100644 --- a/src/frontend/tools/radioitembutton.cpp +++ b/src/frontend/tools/radioitembutton.cpp @@ -101,7 +101,9 @@ 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(); + 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 dec3ec35..c5f225da 100644 Binary files a/translations/kylin-nm_tr.qm and b/translations/kylin-nm_tr.qm differ 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 3ad8ead2..65618262 100644 Binary files a/translations/kylin-nm_zh_CN.qm and b/translations/kylin-nm_zh_CN.qm differ diff --git a/translations/kylin-nm_zh_CN.ts b/translations/kylin-nm_zh_CN.ts index 5d1c3f26..45769660 100644 --- a/translations/kylin-nm_zh_CN.ts +++ b/translations/kylin-nm_zh_CN.ts @@ -1,50 +1,190 @@ + + 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 + + +