diff --git a/debian/control b/debian/control index 0dec5721..1041c26e 100644 --- a/debian/control +++ b/debian/control @@ -16,7 +16,7 @@ Build-Depends: debhelper (>=9), libx11-dev, libqt5svg5-dev, libkf5networkmanagerqt-dev (>= 5.36.0), - libnm-dev, + libnm-dev, libcap-dev, Standards-Version: 4.5.0 Rules-Requires-Root: no diff --git a/debian/rules b/debian/rules index 545fc119..2da18dca 100755 --- a/debian/rules +++ b/debian/rules @@ -28,3 +28,7 @@ override_dh_auto_clean: override_dh_auto_build: dh_auto_build -- $(MAKE_OPTS) + +override_dh_shlibdeps: + dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info + diff --git a/src/backend/dbus-interface/kylinactiveconnectresource.cpp b/src/backend/dbus-interface/kylinactiveconnectresource.cpp index df31ff31..3c94b975 100644 --- a/src/backend/dbus-interface/kylinactiveconnectresource.cpp +++ b/src/backend/dbus-interface/kylinactiveconnectresource.cpp @@ -560,3 +560,23 @@ bool KyActiveConnectResourse::isActiveConnection(QString uuid, QStringList &devN } } } + +QString KyActiveConnectResourse::getDeviceOfActivateConnect(QString conUuid) +{ + QString deviceName = ""; + + NetworkManager::ActiveConnection::Ptr activeConnectPtr = + m_networkResourceInstance->getActiveConnect(conUuid); + + if (nullptr == activeConnectPtr) { + qWarning()<< "[KyActiveConnectResourse]" <<"it can not find connect "<< conUuid; + return deviceName; + } + + QStringList interfaces = activeConnectPtr->devices(); + QString ifaceUni = interfaces.at(0); + NetworkManager::Device:: Ptr devicePtr = + m_networkResourceInstance->findDeviceUni(ifaceUni); + deviceName = devicePtr->interfaceName(); + return deviceName; +} diff --git a/src/backend/dbus-interface/kylinactiveconnectresource.h b/src/backend/dbus-interface/kylinactiveconnectresource.h index 93225d1b..4a291167 100644 --- a/src/backend/dbus-interface/kylinactiveconnectresource.h +++ b/src/backend/dbus-interface/kylinactiveconnectresource.h @@ -37,6 +37,8 @@ public: bool isActiveConnection(QString uuid, QStringList &devName); + QString getDeviceOfActivateConnect(QString conUuid); + private: void getActiveConnectIp(NetworkManager::ActiveConnection::Ptr activeConnectPtr, QString &ipv4Address, diff --git a/src/backend/dbus-interface/kylinagentinterface.c b/src/backend/dbus-interface/kylinagentinterface.c index 114a58f4..c00d26d1 100644 --- a/src/backend/dbus-interface/kylinagentinterface.c +++ b/src/backend/dbus-interface/kylinagentinterface.c @@ -81,6 +81,32 @@ free_wifi_info (SecretsRequest *req) } } + +void +applet_secrets_request_free (SecretsRequest *req) +{ + g_return_if_fail (req != NULL); + + if (req->free_func) + req->free_func (req); + + secrets_reqs = g_slist_remove (secrets_reqs, req); + + g_object_unref (req->connection); + g_free (req->setting_name); + g_strfreev (req->hints); + memset (req, 0, req->totsize); + g_free (req); +} + +void +applet_secrets_request_complete (SecretsRequest *req, + GVariant *settings, + GError *error) +{ + req->callback (req->agent, error ? NULL : settings, error, req->callback_data); +} + static void get_secrets_dialog_response_cb (GtkDialog *foo, gint response, @@ -230,24 +256,6 @@ l_out: //return 0; } - -void -applet_secrets_request_free (SecretsRequest *req) -{ - g_return_if_fail (req != NULL); - - if (req->free_func) - req->free_func (req); - - secrets_reqs = g_slist_remove (secrets_reqs, req); - - g_object_unref (req->connection); - g_free (req->setting_name); - g_strfreev (req->hints); - memset (req, 0, req->totsize); - g_free (req); -} - static SecretsRequest * applet_secrets_request_new (size_t totsize, NMConnection *connection, @@ -277,15 +285,6 @@ applet_secrets_request_new (size_t totsize, return req; } -void -applet_secrets_request_complete (SecretsRequest *req, - GVariant *settings, - GError *error) -{ - req->callback (req->agent, error ? NULL : settings, error, req->callback_data); -} - - static void get_existing_secrets_cb (NMSecretAgentOld *agent, NMConnection *connection, diff --git a/src/backend/dbus-interface/kylinapconnectitem.cpp b/src/backend/dbus-interface/kylinapconnectitem.cpp index 2a94b4aa..d7e4ea2e 100644 --- a/src/backend/dbus-interface/kylinapconnectitem.cpp +++ b/src/backend/dbus-interface/kylinapconnectitem.cpp @@ -7,6 +7,7 @@ KyApConnectItem::KyApConnectItem(QObject *parent) : QObject(parent) m_connectUuid = ""; m_ifaceName = ""; m_password = ""; + m_band = ""; m_isActivated = false; } diff --git a/src/backend/dbus-interface/kylinapconnectitem.h b/src/backend/dbus-interface/kylinapconnectitem.h index 9ead7b6d..76569b06 100644 --- a/src/backend/dbus-interface/kylinapconnectitem.h +++ b/src/backend/dbus-interface/kylinapconnectitem.h @@ -16,7 +16,9 @@ public: QString m_connectUuid; QString m_ifaceName; QString m_password; + QString m_band; bool m_isActivated; + }; #endif // KYLINAPCONNECTITEM_H diff --git a/src/backend/dbus-interface/kylinconnectoperation.cpp b/src/backend/dbus-interface/kylinconnectoperation.cpp index 4701df6b..7c4b1eeb 100644 --- a/src/backend/dbus-interface/kylinconnectoperation.cpp +++ b/src/backend/dbus-interface/kylinconnectoperation.cpp @@ -211,6 +211,7 @@ void KyConnectOperation::deactivateConnection(const QString activeConnectName, c NetworkManager::ActiveConnection::Ptr activateConnectPtr = nullptr; qDebug()<<"deactivetate connect name"<getActiveConnect(activeConnectUuid); if (nullptr == activateConnectPtr) { QString errorMessage = tr("it can not find the activate connect") diff --git a/src/backend/dbus-interface/kylinconnectresource.cpp b/src/backend/dbus-interface/kylinconnectresource.cpp index d8e99518..2e905bfd 100644 --- a/src/backend/dbus-interface/kylinconnectresource.cpp +++ b/src/backend/dbus-interface/kylinconnectresource.cpp @@ -8,6 +8,25 @@ #include #include +const QString str2GBand = "2.4Ghz"; +const QString str5GBand = "5Ghz"; + +static bool subLanListSort(const KyConnectItem* info1, const KyConnectItem* info2) +{ + QString name1 = info1->m_connectName; + QString name2 = info2->m_connectName; + bool result = true; + if (QString::compare(name1, name2, Qt::CaseInsensitive) > 0) { + result = false; + } + return result; +} + +static void lanListSort(QList &list) +{ + qSort(list.begin(), list.end(), subLanListSort); +} + KyConnectResourse::KyConnectResourse(QObject *parent) : QObject(parent) { m_networkResourceInstance = KyNetworkResourceManager::getInstance(); @@ -152,6 +171,9 @@ void KyConnectResourse::getConnectionList(QString deviceName, connectPtr = nullptr; } + if (connectItemList.size() > 1) { + lanListSort(connectItemList); + } return; } @@ -331,7 +353,7 @@ void KyConnectResourse::getConnectionSetting(QString connectUuid, KyConnectSetti return; } -bool KyConnectResourse::getInterfaceByUuid(QString &deviceName, NetworkManager::ConnectionSettings::ConnectionType &type, const QString connUuid) +bool KyConnectResourse::getInterfaceByUuid(QString &deviceName, const QString connUuid) { deviceName.clear(); NetworkManager::Connection::Ptr connectPtr = @@ -347,7 +369,7 @@ bool KyConnectResourse::getInterfaceByUuid(QString &deviceName, NetworkManager:: qWarning()<<"getInterfaceByUuid failed, connect uuid"<settings()->connectionType(); + deviceName = connectPtr->settings()->interfaceName(); qDebug() << "getInterfaceByUuid success " << deviceName; return true; @@ -530,6 +552,11 @@ KyApConnectItem *KyConnectResourse::getApConnectItem(NetworkManager::Connection: KyApConnectItem *apConnectItem = new KyApConnectItem(); apConnectItem->m_connectName = connectPtr->name(); apConnectItem->m_connectUuid = connectPtr->uuid(); + if (wirelessSetting->band() == NetworkManager::WirelessSetting::FrequencyBand::A) { + apConnectItem->m_band = str2GBand; + } else if (wirelessSetting->band() == NetworkManager::WirelessSetting::FrequencyBand::Bg) { + apConnectItem->m_band = str5GBand; + } apConnectItem->m_ifaceName = settingPtr->interfaceName(); apConnectItem->m_isActivated = m_networkResourceInstance->isActiveConnection(connectPtr->uuid()); @@ -606,7 +633,7 @@ bool KyConnectResourse::isWiredConnection(QString uuid) return false; } - if (connectPtr->isValid()) { + if (!connectPtr.isNull()) { NetworkManager::ConnectionSettings::Ptr connectSettingPtr = connectPtr->settings(); if (connectSettingPtr.isNull()) { diff --git a/src/backend/dbus-interface/kylinconnectresource.h b/src/backend/dbus-interface/kylinconnectresource.h index d33ea8f5..caa86b64 100644 --- a/src/backend/dbus-interface/kylinconnectresource.h +++ b/src/backend/dbus-interface/kylinconnectresource.h @@ -30,7 +30,7 @@ public: KyApConnectItem *getApConnectionByUuid(QString connectUuid); void getConnectionSetting(QString connectUuid, KyConnectSetting &connectSetting); - bool getInterfaceByUuid(QString &deviceName, NetworkManager::ConnectionSettings::ConnectionType &type, const QString connUuid); + bool getInterfaceByUuid(QString &deviceName, const QString connUuid); void getConnectivity(NetworkManager::Connectivity &connectivity); bool isWiredConnection(QString uuid); diff --git a/src/backend/dbus-interface/kylinnetworkdeviceresource.cpp b/src/backend/dbus-interface/kylinnetworkdeviceresource.cpp index c41dd93f..c95b7ec9 100644 --- a/src/backend/dbus-interface/kylinnetworkdeviceresource.cpp +++ b/src/backend/dbus-interface/kylinnetworkdeviceresource.cpp @@ -202,6 +202,33 @@ void KyNetworkDeviceResourse::getDeviceActiveAPInfo(const QString devName, QStri } } +int KyNetworkDeviceResourse::getWirelessDeviceCapability(const QString deviceName) +{ + NetworkManager::Device::Ptr connectDevice = + m_networkResourceInstance->findDeviceInterface(deviceName); + if (connectDevice->isValid() + && NetworkManager::Device::Type::Wifi == connectDevice->type()) { + NetworkManager::WirelessDevice *wirelessDevicePtr = + qobject_cast(connectDevice.data()); + + int cap = 0; + if (wirelessDevicePtr->wirelessCapabilities() & NetworkManager::WirelessDevice::ApCap) { + cap = cap | 0x01; + } + if (wirelessDevicePtr->wirelessCapabilities() & NetworkManager::WirelessDevice::Freq2Ghz) { + cap = cap | 0x02; + } + if (wirelessDevicePtr->wirelessCapabilities() & NetworkManager::WirelessDevice::Freq5Ghz) { + cap = cap | 0x04; + } + return cap; + } else { + qWarning()<<"[KyNetworkDeviceResourse]"<(sender()); if (activeConnect->isValid()) { - qDebug()<<"!New state change activate connect"<uuid(); - qDebug()<<"!New the active connect state"<uuid(); + qDebug()<< "[KyNetworkResourceManager]" <<"!New the active connect state"<state() != state) { qDebug()<<"connect real state"<state() <<"change state"<uuid(), state, NetworkManager::ActiveConnection::Reason::UknownReason); diff --git a/src/backend/dbus-interface/kywirelessconnectoperation.cpp b/src/backend/dbus-interface/kywirelessconnectoperation.cpp index d96c3d38..d8ec8eb2 100644 --- a/src/backend/dbus-interface/kywirelessconnectoperation.cpp +++ b/src/backend/dbus-interface/kywirelessconnectoperation.cpp @@ -654,16 +654,6 @@ void KyWirelessConnectOperation::addAndActiveWirelessEnterPriseTtlsConnect(KyEap void KyWirelessConnectOperation::setWirelessEnabled(bool enabled) { NetworkManager::setWirelessEnabled(enabled); -#if 0 - if (QGSettings::isSchemaInstalled(GSETTINGS_SCHEMA)) { - QGSettings *gsetting = new QGSettings(GSETTINGS_SCHEMA); - if (gsetting->get(WIRELESS_SWITCH).toBool() != enabled) { - gsetting->set(WIRELESS_SWITCH, enabled); - } - } else { - qDebug()<<"isSchemaInstalled false"; - } -#endif } bool KyWirelessConnectOperation::getWirelessEnabled() @@ -687,7 +677,10 @@ bool KyWirelessConnectOperation::getConnSecretFlags(QString &connUuid, NetworkMa } NetworkManager::ConnectionSettings::Ptr - KyWirelessConnectOperation::createWirelessApSetting(const QString apSsid, const QString apPassword, const QString apDevice) + KyWirelessConnectOperation::createWirelessApSetting(const QString apSsid, + const QString apPassword, + const QString apDevice, + const QString wirelessBand) { NetworkManager::ConnectionSettings::Ptr connectionSettings = NetworkManager::ConnectionSettings::Ptr(new NetworkManager::ConnectionSettings(NetworkManager::ConnectionSettings::Wireless)); @@ -713,6 +706,15 @@ NetworkManager::ConnectionSettings::Ptr wirelessSetting->setSsid(apSsid.toUtf8()); wirelessSetting->setMode(NetworkManager::WirelessSetting::NetworkMode::Ap); wirelessSetting->setSecurity("802-11-wireless-security"); + if (wirelessBand == WIFI_BAND_2_4GHZ) { + wirelessSetting->setBand(NetworkManager::WirelessSetting::FrequencyBand::Bg); + } else if (wirelessBand == WIFI_BAND_5GHZ) { + wirelessSetting->setBand(NetworkManager::WirelessSetting::FrequencyBand::A); + } else { + qWarning()<<"[KyWirelessConnectOperation] the band type undefined"<setBand(NetworkManager::WirelessSetting::FrequencyBand::Automatic); + } + NetworkManager::WirelessSecuritySetting::Ptr wirelessSecuritySetting = connectionSettings->setting(NetworkManager::Setting::WirelessSecurity).dynamicCast(); @@ -729,7 +731,9 @@ NetworkManager::ConnectionSettings::Ptr void KyWirelessConnectOperation::updateWirelessApSetting( NetworkManager::Connection::Ptr apConnectPtr, - const QString apName, const QString apPassword, const QString apDevice) + const QString apName, const QString apPassword, + const QString apDevice, const QString wirelessBand) + { NetworkManager::ConnectionSettings::Ptr apConnectSettingPtr = apConnectPtr->settings(); apConnectSettingPtr->setId(apName); @@ -740,6 +744,15 @@ void KyWirelessConnectOperation::updateWirelessApSetting( = apConnectSettingPtr->setting(NetworkManager::Setting::Wireless).dynamicCast(); wirelessSetting->setInitialized(true); wirelessSetting->setSsid(apName.toUtf8()); + if (wirelessBand == WIFI_BAND_2_4GHZ) { + wirelessSetting->setBand(NetworkManager::WirelessSetting::FrequencyBand::Bg); + } else if (wirelessBand == WIFI_BAND_5GHZ) { + wirelessSetting->setBand(NetworkManager::WirelessSetting::FrequencyBand::A); + } else { + qWarning()<<"[KyWirelessConnectOperation] the band type undefined"<setBand(NetworkManager::WirelessSetting::FrequencyBand::Automatic); + } + NetworkManager::WirelessSecuritySetting::Ptr wirelessSecuritySetting = apConnectSettingPtr->setting(NetworkManager::Setting::WirelessSecurity).dynamicCast(); @@ -755,8 +768,11 @@ void KyWirelessConnectOperation::updateWirelessApSetting( } void KyWirelessConnectOperation::activeWirelessAp(const QString apUuid, const QString apName, - const QString apPassword, const QString apDevice) + const QString apPassword, const QString apDevice, + const QString wirelessBand) + { + qDebug() << "activeWirelessAp]" << apUuid << apName << apPassword << apDevice << wirelessBand; //1、检查连接是否存在 NetworkManager::Connection::Ptr connectPtr = m_networkResourceInstance->getConnect(apUuid); if (nullptr == connectPtr) { @@ -771,7 +787,7 @@ void KyWirelessConnectOperation::activeWirelessAp(const QString apUuid, const QS QString deviceIdentifier = devicePtr->uni(); NetworkManager::ConnectionSettings::Ptr apConnectSettingPtr = - createWirelessApSetting(apName, apPassword, apDevice); + createWirelessApSetting(apName, apPassword, apDevice, wirelessBand); QString specificObject = ""; QDBusPendingCallWatcher * watcher; watcher = new QDBusPendingCallWatcher{NetworkManager::addAndActivateConnection(apConnectSettingPtr->toMap(), deviceIdentifier, specificObject), this}; @@ -784,7 +800,7 @@ void KyWirelessConnectOperation::activeWirelessAp(const QString apUuid, const QS watcher->deleteLater(); }); } else { - updateWirelessApSetting(connectPtr, apName, apPassword, apDevice); + updateWirelessApSetting(connectPtr, apName, apPassword, apDevice, wirelessBand); QTimer::singleShot(500, this, [=](){ activateApConnectionByUuid(apUuid, apDevice); }); diff --git a/src/backend/dbus-interface/kywirelessconnectoperation.h b/src/backend/dbus-interface/kywirelessconnectoperation.h index acbc3299..1663fc2b 100644 --- a/src/backend/dbus-interface/kywirelessconnectoperation.h +++ b/src/backend/dbus-interface/kywirelessconnectoperation.h @@ -9,7 +9,10 @@ #include "kyenterpricesettinginfo.h" const QByteArray GSETTINGS_SCHEMA = "org.ukui.kylin-nm.switch"; -const QString WIRELESS_SWITCH = "wirelessswitch"; +const QString WIRELESS_SWITCH = "wirelessswitch"; + +const QString WIFI_BAND_2_4GHZ = "2.4Ghz"; +const QString WIFI_BAND_5GHZ = "5Ghz"; enum KySecuType { NONE = 0, @@ -105,13 +108,22 @@ public: //申请扫描 void requestWirelessScan(); - void activeWirelessAp(const QString apUuid, const QString apName, const QString apPassword, const QString apDevice); + void activeWirelessAp(const QString apUuid, const QString apName, + const QString apPassword, const QString apDevice, + const QString wirelessBand); void deactiveWirelessAp(const QString apName, const QString apUuid); private: - NetworkManager::ConnectionSettings::Ptr createWirelessApSetting(const QString apSsid, const QString apPassword, const QString apDevice); + NetworkManager::ConnectionSettings::Ptr createWirelessApSetting(const QString apSsid, + const QString apPassword, + const QString apDevice, + const QString wirelessBand); void updateWirelessApSetting(NetworkManager::Connection::Ptr apConnectPtr, - const QString apName, const QString apPassword, const QString apDevice); + const QString apName, + const QString apPassword, + const QString apDevice, + const QString wirelessBand); + diff --git a/src/backend/dbus-interface/kywirelessnetresource.cpp b/src/backend/dbus-interface/kywirelessnetresource.cpp index 7c3fc631..ab596bdf 100644 --- a/src/backend/dbus-interface/kywirelessnetresource.cpp +++ b/src/backend/dbus-interface/kywirelessnetresource.cpp @@ -33,6 +33,10 @@ KyWirelessNetResource::KyWirelessNetResource(QObject *parent) connect(m_connectResource, &KyConnectResourse::connectionRemove, this, &KyWirelessNetResource::onConnectionRemove); connect(m_connectResource, &KyConnectResourse::connectionUpdate, this, &KyWirelessNetResource::onConnectionUpdate); + connect(m_device, &KyNetworkDeviceResourse::deviceAdd, this, &KyWirelessNetResource::onDeviceAdd); + connect(m_device, &KyNetworkDeviceResourse::deviceRemove, this, &KyWirelessNetResource::onDeviceRemove); + connect(m_device, &KyNetworkDeviceResourse::deviceNameUpdate, this, &KyWirelessNetResource::onDeviceNameUpdate); + } KyWirelessNetResource::~KyWirelessNetResource() @@ -616,3 +620,34 @@ void KyWirelessNetResource::onConnectionUpdate(QString uuid) kyWirelessNetItemListInit(); emit wifiNetworkUpdate(); } + + +void KyWirelessNetResource::onDeviceAdd(QString deviceName, NetworkManager::Device::Type deviceType) +{ + if(deviceType == NetworkManager::Device::Type::Wifi) { + if (!m_WifiNetworkList.contains(deviceName)) { + m_WifiNetworkList.insert(deviceName,QList()); + } + } +} + +void KyWirelessNetResource::onDeviceRemove(QString deviceName) +{ + if (m_WifiNetworkList.contains(deviceName)) { + m_WifiNetworkList.remove(deviceName); + } +} + +void KyWirelessNetResource::onDeviceNameUpdate(QString oldName, QString newName) +{ + if (!m_WifiNetworkList.contains(oldName)) { + return; + } + + QMap > newWifiNetworkList(m_WifiNetworkList); + QList list = m_WifiNetworkList[oldName]; + newWifiNetworkList.remove(oldName); + newWifiNetworkList.insert(newName,list); + m_WifiNetworkList = newWifiNetworkList; + +} diff --git a/src/backend/dbus-interface/kywirelessnetresource.h b/src/backend/dbus-interface/kywirelessnetresource.h index 110bd355..d49c0dc2 100644 --- a/src/backend/dbus-interface/kywirelessnetresource.h +++ b/src/backend/dbus-interface/kywirelessnetresource.h @@ -7,6 +7,7 @@ #include "kyenterpricesettinginfo.h" #include "kylinconnectresource.h" #include "kywirelessconnectoperation.h" +#include "kylinnetworkdeviceresource.h" //class KyWirelessNetItem; @@ -50,6 +51,10 @@ public slots: void onConnectionUpdate(QString uuid); void onConnectionRemove(QString); + void onDeviceAdd(QString deviceName, NetworkManager::Device::Type deviceType); + void onDeviceRemove(QString deviceName); + void onDeviceNameUpdate(QString oldName, QString newName); + signals: void signalStrengthChange(QString, QString, int); void bssidChange(QString, QString, QString); @@ -64,6 +69,7 @@ private: KyNetworkResourceManager *m_networkResourceInstance = nullptr; KyConnectResourse *m_connectResource = nullptr; KyWirelessConnectOperation *m_operation = nullptr; + KyNetworkDeviceResourse *m_device = nullptr; QMap > m_WifiNetworkList; }; diff --git a/src/backend/dbusadaptor.cpp b/src/backend/dbusadaptor.cpp index 66e306e5..b5684d1a 100644 --- a/src/backend/dbusadaptor.cpp +++ b/src/backend/dbusadaptor.cpp @@ -30,6 +30,7 @@ DbusAdaptor::DbusAdaptor(MainWindow *parent) { // constructor qDBusRegisterMetaType >(); + qDBusRegisterMetaType >(); qDBusRegisterMetaType >(); qDBusRegisterMetaType >>(); //setAutoRelaySignals(true)后会自动转发mainwindow发出的同名信号,因此不必再额外写一个转发 @@ -77,16 +78,17 @@ void DbusAdaptor::setWiredSwitchEnable(bool enable) void DbusAdaptor::setWirelessSwitchEnable(bool enable) { //todo mainwindow调用backend 对开关 打开/关闭 - if (QGSettings::isSchemaInstalled(GSETTINGS_SCHEMA_KYLIN_NM)) { - QGSettings *gsetting = new QGSettings(GSETTINGS_SCHEMA_KYLIN_NM); - if (gsetting->get(KEY_WIRELESS_SWITCH).toBool() != enable) { - gsetting->set(KEY_WIRELESS_SWITCH, enable); - } - delete gsetting; - gsetting = nullptr; - } else { - qDebug()<<"isSchemaInstalled false"; - } +// if (QGSettings::isSchemaInstalled(GSETTINGS_SCHEMA_KYLIN_NM)) { +// QGSettings *gsetting = new QGSettings(GSETTINGS_SCHEMA_KYLIN_NM); +// if (gsetting->get(KEY_WIRELESS_SWITCH).toBool() != enable) { +// gsetting->set(KEY_WIRELESS_SWITCH, enable); +// } +// delete gsetting; +// gsetting = nullptr; +// } else { +// qDebug()<<"isSchemaInstalled false"; +// } + parent()->setWirelessSwitchEnable(enable); } //启用/禁用网卡 @@ -175,28 +177,38 @@ QMap DbusAdaptor::getDeviceListAndEnabled(int devType) return map; } +//获取无线设备能力 +QMap DbusAdaptor::getWirelessDeviceCap() +{ + QMap map; + parent()->getWirelessDeviceCap(map); + return map; +} + //唤起属性页 根据网卡类型 参数2 为ssid/uuid void DbusAdaptor::showPropertyWidget(QString devName, QString ssid) { + qDebug() << "showPropertyWidget"; parent()->showPropertyWidget(devName,ssid); } //唤起新建有线连接界面 void DbusAdaptor::showCreateWiredConnectWidget(QString devName) { + qDebug() << "showCreateWiredConnectWidget"; parent()->showCreateWiredConnectWidget(devName); } //开启热点 -void DbusAdaptor::activeWirelessAp(const QString apName, const QString apPassword, const QString apDevice) +void DbusAdaptor::activeWirelessAp(const QString apName, const QString apPassword, const QString band, const QString apDevice) { - parent()->activeWirelessAp(apName, apPassword, apDevice); + parent()->activeWirelessAp(apName, apPassword, band, apDevice); } //断开热点 -void DbusAdaptor::deactiveWirelessAp(const QString apName, const QString apPassword, const QString apDevice) +void DbusAdaptor::deactiveWirelessAp(const QString apName, const QString uuid) { - parent()->deactiveWirelessAp(apName, apPassword, apDevice); + parent()->deactiveWirelessAp(apName, uuid); } //获取热点 @@ -207,3 +219,18 @@ QStringList DbusAdaptor::getStoredApInfo() parent()->getStoredApInfo(list); return list; } + +QStringList DbusAdaptor::getApInfoBySsid(QString devName, QString ssid) +{ + QStringList list; + list.clear(); + parent()->getApInfoBySsid(devName, ssid, list); + return list; +} + + +//扫描 +void DbusAdaptor::reScan() +{ + parent()->rescan(); +} diff --git a/src/backend/dbusadaptor.h b/src/backend/dbusadaptor.h index bfbb471a..a96a674e 100644 --- a/src/backend/dbusadaptor.h +++ b/src/backend/dbusadaptor.h @@ -68,16 +68,21 @@ public Q_SLOTS: // METHODS Q_NOREPLY void deActivateConnect(int type, QString devName, QString ssid); //获取设备列表和启用/禁用状态 QMap getDeviceListAndEnabled(int devType); + //获取无线设备能力 + QMap getWirelessDeviceCap(); //唤起属性页 根据网卡类型 参数2 为ssid/uuid Q_NOREPLY void showPropertyWidget(QString devName, QString ssid); //唤起新建有线连接界面 Q_NOREPLY void showCreateWiredConnectWidget(QString devName); //开启热点 - void activeWirelessAp(const QString apName, const QString apPassword, const QString apDevice); + void activeWirelessAp(const QString apName, const QString apPassword, const QString band, const QString apDevice); //断开热点 - void deactiveWirelessAp(const QString apName, const QString apPassword, const QString apDevice); + void deactiveWirelessAp(const QString apName, const QString uuid); //获取热点 QStringList getStoredApInfo(); + QStringList getApInfoBySsid(QString devName, QString ssid); + //wifi扫描 + void reScan(); Q_SIGNALS: // SIGNALS // void wirelessActivating(QString devName, QString ssid); // void wiredActivating(QString devName, QString ssid); @@ -86,7 +91,7 @@ Q_SIGNALS: // SIGNALS void lanUpdate(QString devName, QStringList info); void wlanAdd(QString devName, QStringList info); void wlanRemove(QString devName,QString ssid); - void wlanactiveConnectionStateChanged(QString devName, QString ssid, int status); + void wlanactiveConnectionStateChanged(QString devName, QString ssid, QString uuid, int status); void lanActiveConnectionStateChanged(QString devName, QString uuid, int status); //仅失败,若成功直接发listUpdate void activateFailed(QString errorMessage); @@ -97,7 +102,7 @@ Q_SIGNALS: // SIGNALS //热点断开 void hotspotDeactivated(QString devName, QString ssid); //热点连接 - void hotspotActivated(QString devName, QString ssid); + void hotspotActivated(QString devName, QString ssid, QString uuid); //信号强度变化 void signalStrengthChange(QString devName, QString ssid, int strength); diff --git a/src/frontend/list-items/lanlistitem.cpp b/src/frontend/list-items/lanlistitem.cpp index b6642bcc..5f99d10f 100644 --- a/src/frontend/list-items/lanlistitem.cpp +++ b/src/frontend/list-items/lanlistitem.cpp @@ -32,8 +32,8 @@ LanListItem::LanListItem(KyConnectItem *data, QString deviceName, QWidget *paren LanListItem::LanListItem(QWidget *parent) : ListItem(parent) { m_isActive = false; - m_netButton->setButtonIcon(QIcon::fromTheme("network-wireless-signal-none-symbolic")); - const QString str="Not connected"; + m_netButton->setButtonIcon(QIcon::fromTheme("network-offline-symbolic")); + const QString str=tr("Not connected"); m_nameLabel->setText(str); this->m_infoButton->hide(); } @@ -82,11 +82,17 @@ void LanListItem::onRightButtonClicked() void LanListItem::onInfoButtonClicked() { + if(isDetailShow){ + qDebug() << "has show the detail page,and do not show again" << Q_FUNC_INFO << __LINE__; + return; + } if(m_data){ qDebug()<<"Net active or not:"<m_connectName, m_data->m_connectUuid, m_isActive,false, false, this); + connect(netDetail, &NetDetail::detailPageClose, this, &LanListItem::onDetailShow); netDetail->show(); + emit this->detailShow(true); } else{ qDebug() << "On lan info button clicked! But there is no wlan connect " ; diff --git a/src/frontend/list-items/listitem.cpp b/src/frontend/list-items/listitem.cpp index d3fdc249..9fe82169 100644 --- a/src/frontend/list-items/listitem.cpp +++ b/src/frontend/list-items/listitem.cpp @@ -14,9 +14,12 @@ ListItem::ListItem(QWidget *parent) : QFrame(parent) { m_connectState = UnknownState; + isDetailShow = false; initUI(); initConnection(); connect(qApp, &QApplication::paletteChanged, this, &ListItem::onPaletteChanged); + connect(this, &ListItem::detailShow, this, &ListItem::onDetailShow); +// m_itemFrame->installEventFilter(this); } ListItem::~ListItem() @@ -166,3 +169,8 @@ void ListItem::onPaletteChanged() pal.setColor(QPalette::Window, qApp->palette().base().color()); this->setPalette(pal); } + +void ListItem::onDetailShow(bool isShow) +{ + isDetailShow = isShow; +} diff --git a/src/frontend/list-items/listitem.h b/src/frontend/list-items/listitem.h index 55c72221..8ae950a1 100644 --- a/src/frontend/list-items/listitem.h +++ b/src/frontend/list-items/listitem.h @@ -49,6 +49,7 @@ protected: public: QVBoxLayout * m_mainLayout = nullptr; QHBoxLayout * m_hItemLayout = nullptr; + bool isDetailShow; private: void initUI(); void initConnection(); @@ -56,6 +57,10 @@ private: public slots: virtual void onNetButtonClicked() = 0; void onPaletteChanged(); + void onDetailShow(bool isShow); + +signals: + void detailShow(bool isShow); }; #endif // LISTITEM_H diff --git a/src/frontend/list-items/wlanlistitem.cpp b/src/frontend/list-items/wlanlistitem.cpp index f2096828..227a0680 100644 --- a/src/frontend/list-items/wlanlistitem.cpp +++ b/src/frontend/list-items/wlanlistitem.cpp @@ -4,12 +4,13 @@ #define EMPTY_SSID "EMPTY_SSID" #define LOG_FLAG "[WlanListItem]" -#define WAIT_US 70*1000 +#define WAIT_US 10*1000 WlanListItem::WlanListItem(KyWirelessNetItem &wirelessNetItem, QString device, QWidget *parent) : ListItem(parent) { m_wlanDevice = device; m_wirelessNetItem = wirelessNetItem; + m_forgetConnection = false; qDebug()<<"[WlanPage] wlan list item is created." << m_wirelessNetItem.m_NetSsid; @@ -27,7 +28,9 @@ WlanListItem::WlanListItem(KyWirelessNetItem &wirelessNetItem, QString device, Q WlanListItem::WlanListItem(QWidget *parent) : ListItem(parent) { m_wirelessNetItem.m_NetSsid = EMPTY_SSID; + qDebug()<<"[WlanPage] wlan list item is created." << m_wirelessNetItem.m_NetSsid; + m_netButton->setButtonIcon(QIcon::fromTheme("network-wireless-signal-none-symbolic")); const QString name = tr("Not connected"); setExpanded(false); @@ -304,6 +307,12 @@ void WlanListItem::refreshIcon() void WlanListItem::onInfoButtonClicked() { + //ZJP_TODO 呼出无线详情页 + if(isDetailShow){ + qDebug() << "has show the detail page,and do not show again" << Q_FUNC_INFO << __LINE__; + return; + } + qDebug() << LOG_FLAG << "Net active or not:"<< m_connectState; qDebug() << LOG_FLAG << "On wlan info button clicked! ssid = " << m_wirelessNetItem.m_NetSsid << "; name = " @@ -314,11 +323,13 @@ void WlanListItem::onInfoButtonClicked() if (Activated == m_connectState) { isActive = true; } + NetDetail *netDetail = new NetDetail(m_wlanDevice, m_wirelessNetItem.m_NetSsid, m_wirelessNetItem.m_connectUuid, isActive, true, !m_wirelessNetItem.m_isConfigured, this); + connect(netDetail, &NetDetail::detailPageClose, this, &WlanListItem::onDetailShow); netDetail->show(); - + emit this->detailShow(true); } void WlanListItem::onNetButtonClicked() @@ -457,23 +468,25 @@ void WlanListItem::onConnectButtonClicked() return; } -void WlanListItem::connectStateIsChanging() +ConnectState WlanListItem::getConnectionState() { - m_netButton->startLoading(); - - return; -} - -void WlanListItem::connectStateChanged() -{ - m_netButton->stopLoading(); - - return; + return m_connectState; } void WlanListItem::updateConnectState(ConnectState state) { m_connectState = state; + + if (m_forgetConnection) { + /* + * 如果是要删除链接而导致的状态变化的话,等断开连接后,删除该链接 + */ + if (state == Deactivated) { + m_wirelessConnectOperation->deleteWirelessConnect(m_wirelessNetItem.m_connectUuid); + m_forgetConnection = false; + } + } + if (Deactivated == state || Activated == state) { m_netButton->stopLoading(); } else { @@ -488,12 +501,15 @@ void WlanListItem::onMenuTriggered(QAction *action) if (action->text() == tr("Disconnect") || action->text() == tr("Connect")) { this->onNetButtonClicked(); } else if (action->text() == tr("Forget")) { + /* + *对于激活的链接,忘记密码时,需要先断开连接,然后再删除链接。 + */ if (Activated == m_connectState) { + m_forgetConnection = true; m_wirelessConnectOperation->deActivateWirelessConnection(m_wlanDevice, m_wirelessNetItem.m_connectUuid); - ::usleep(WAIT_US); + } else { + m_wirelessConnectOperation->deleteWirelessConnect(m_wirelessNetItem.m_connectUuid); } - - m_wirelessConnectOperation->deleteWirelessConnect(m_wirelessNetItem.m_connectUuid); } return; diff --git a/src/frontend/list-items/wlanlistitem.h b/src/frontend/list-items/wlanlistitem.h index 111afc6a..3a0d5670 100644 --- a/src/frontend/list-items/wlanlistitem.h +++ b/src/frontend/list-items/wlanlistitem.h @@ -33,10 +33,9 @@ public: void setWlanState(const int &state); void setExpanded(const bool &expanded); - void connectStateIsChanging(); - void connectStateChanged(); - + ConnectState getConnectionState(); void updateConnectState(ConnectState state); + void updateWirelessNetSecurity(QString ssid, QString securityType); void updateWirelessNetItem(KyWirelessNetItem &wirelessNetItem); @@ -81,6 +80,8 @@ private: bool m_focusIsOut = true; bool m_mouseIsOut = true; + bool m_forgetConnection = false; + protected slots: void onInfoButtonClicked(); diff --git a/src/frontend/mainwindow.cpp b/src/frontend/mainwindow.cpp index 751d821a..ca9bba4d 100644 --- a/src/frontend/mainwindow.cpp +++ b/src/frontend/mainwindow.cpp @@ -147,13 +147,14 @@ void MainWindow::initTrayIcon() m_trayIcon->setToolTip(QString(tr("kylin-nm"))); m_showSettingsAction->setIcon(QIcon::fromTheme("document-page-setup-symbolic", QIcon(":/res/x/setup.png")) ); - m_trayIconMenu->addAction(m_showMainwindowAction); +// m_trayIconMenu->addAction(m_showMainwindowAction); m_trayIconMenu->addAction(m_showSettingsAction); m_trayIcon->setContextMenu(m_trayIconMenu); m_trayIcon->setIcon(QIcon::fromTheme("network-wired-signal-excellent-symbolic")); + onRefreshTrayIcon(); connect(m_trayIcon, &QSystemTrayIcon::activated, this, &MainWindow::onTrayIconActivated); - connect(m_showMainwindowAction, &QAction::triggered, this, &MainWindow::onShowMainwindowActionTriggled); +// connect(m_showMainwindowAction, &QAction::triggered, this, &MainWindow::onShowMainwindowActionTriggled); connect(m_showSettingsAction, &QAction::triggered, this, &MainWindow::onShowSettingsActionTriggled); m_trayIcon->show(); } @@ -419,29 +420,39 @@ void MainWindow::getWiredList(QMap> &map) * @param apPassword * @param apDevice */ -void MainWindow::activeWirelessAp(const QString apName, const QString apPassword, const QString apDevice) +void MainWindow::activeWirelessAp(const QString apName, const QString apPassword, const QString band, const QString apDevice) { - m_wlanWidget->activeWirelessAp(apName, apPassword, apDevice); + m_wlanWidget->activeWirelessAp(apName, apPassword, band, apDevice); } /** * @brief MainWindow::activeWirelessAp 断开热点,供dbus调用 * @param apName */ -void MainWindow::deactiveWirelessAp(const QString apName, const QString apPassword, const QString apDevice) +void MainWindow::deactiveWirelessAp(const QString apName, const QString uuid) { - m_wlanWidget->deactiveWirelessAp(apName, apPassword, apDevice); + m_wlanWidget->deactiveWirelessAp(apName, uuid); } /** * @brief MainWindow::activeWirelessAp 获取热点,供dbus调用 * @param list */ +void MainWindow::getApInfoBySsid(QString devName, QString ssid, QStringList &list) +{ + m_wlanWidget->getApInfoBySsid(devName, ssid, list); +} + void MainWindow::getStoredApInfo(QStringList &list) { m_wlanWidget->getStoredApInfo(list); } +//无线开关 +void MainWindow::setWirelessSwitchEnable(bool enable) +{ + m_wlanWidget->setWirelessSwitchEnable(enable); +} void MainWindow::setWiredDeviceEnable(const QString& devName, bool enable) { @@ -484,6 +495,11 @@ void MainWindow::showCreateWiredConnectWidget(const QString devName) netDetail->show(); } +void MainWindow::getWirelessDeviceCap(QMap &map) +{ + m_wlanWidget->getWirelessDeviceCap(map); +} + //有线连接断开 void MainWindow::activateWired(const QString& devName, const QString& connUuid) { @@ -504,3 +520,8 @@ void MainWindow::deactivateWireless(const QString& devName, const QString& ssid) { m_wlanWidget->deactivateWirelessConnection(devName, ssid); } + +void MainWindow::rescan() +{ + m_wlanWidget->requestScan(); +} diff --git a/src/frontend/mainwindow.h b/src/frontend/mainwindow.h index 065a7db0..da632ee5 100644 --- a/src/frontend/mainwindow.h +++ b/src/frontend/mainwindow.h @@ -30,17 +30,20 @@ public: void getWirelessList(QMap > &map); void getWiredList(QMap> &map); //开启热点 - void activeWirelessAp(const QString apName, const QString apPassword, const QString apDevice); + void activeWirelessAp(const QString apName, const QString apPassword, const QString wirelessBand, const QString apDevice); //断开热点 - void deactiveWirelessAp(const QString apName, const QString apPassword, const QString apDevice); + void deactiveWirelessAp(const QString apName, const QString uuid); //获取热点 void getStoredApInfo(QStringList &list); + void getApInfoBySsid(QString devName, QString ssid, QStringList &list); //有线连接断开 void activateWired(const QString& devName, const QString& connUuid); void deactivateWired(const QString& devName, const QString& connUuid); //无线连接断开 void activateWireless(const QString& devName, const QString& ssid); void deactivateWireless(const QString& devName, const QString& ssid); + //无线总开关 + void setWirelessSwitchEnable(bool enable); void setWiredDeviceEnable(const QString& devName, bool enable); @@ -49,6 +52,10 @@ public: //唤起新建有线连接界面 void showCreateWiredConnectWidget(const QString devName); + void getWirelessDeviceCap(QMap &map); + + void rescan(); + signals: //设备插拔 void deviceStatusChanged(); @@ -60,13 +67,13 @@ signals: void lanUpdate(QString devName, QStringList info); void wlanAdd(QString devName, QStringList info); void wlanRemove(QString devName,QString ssid); - void wlanactiveConnectionStateChanged(QString devName, QString ssid, int status); + void wlanactiveConnectionStateChanged(QString devName, QString ssid, QString uuid, int status); void lanActiveConnectionStateChanged(QString devName, QString uuid, int status); void activateFailed(QString errorMessage); void deactivateFailed(QString errorMessage); //热点断开 void hotspotDeactivated(QString devName, QString ssid); - void hotspotActivated(QString devName, QString ssid); + void hotspotActivated(QString devName, QString ssid, QString uuid); //信号强度变化 void signalStrengthChange(QString devName, QString ssid, int strength); //安全性变化 diff --git a/src/frontend/netdetails/detailpage.cpp b/src/frontend/netdetails/detailpage.cpp index 70aa28f7..7b8e45a8 100644 --- a/src/frontend/netdetails/detailpage.cpp +++ b/src/frontend/netdetails/detailpage.cpp @@ -1,4 +1,6 @@ #include "detailpage.h" +#include +#include extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed); @@ -72,65 +74,78 @@ bool DetailPage::checkIsChanged(const ConInfo info) } } +void DetailPage::addDetailItem(QListWidget *listWidget, DetailWidget *detailWidget) +{ + QListWidgetItem *listWidgetItem = new QListWidgetItem(listWidget); + listWidgetItem->setSizeHint(QSize(listWidget->width(),36)); + listWidgetItem->setFlags(Qt::NoItemFlags); + listWidget->addItem(listWidgetItem); + listWidget->setItemWidget(listWidgetItem, detailWidget); +} + void DetailPage::initUI() { forgetNetBox = new QCheckBox(this); layout = new QVBoxLayout(this); + layout->setContentsMargins(0,0,0,0); - mDetailLayout = new QFormLayout(this); + QWidget *mDetailFrame = new QFrame(this); + mDetailLayout = new QVBoxLayout(mDetailFrame); + mDetailLayout->setContentsMargins(0,0,0,0); + + m_listWidget = new QListWidget(mDetailFrame); + m_listWidget->setFrameShape(QFrame::Shape::NoFrame); + m_listWidget->setBackgroundRole(QPalette::Base); + m_listWidget->setFocusPolicy(Qt::FocusPolicy::NoFocus); + mDetailLayout->addWidget(m_listWidget); mSSID = new QLineEdit(this); mSSID->setAlignment(Qt::AlignRight); if (!isCreate) { - mSSID->setStyleSheet("background:transparent;border-width:0;border-style:outset"); + mSSID->setStyleSheet("background:transparent;border-width:0px;border-style:none"); mSSID->setFocusPolicy(Qt::NoFocus); } else { - mSSID->setStyleSheet("border-width:0;border-style:outset"); +// mSSID->setStyleSheet("border-width:1px;;border-style:solid;border-color:black;border-radius:2px"); + mSSID->setStyleSheet("border-top:0px solid;border-bottom:1px solid;border-left:0px solid;border-right: 0px solid;"); + mSSID->setPlaceholderText(tr("Please input SSID:")); } + m_ssidWidget = new DetailWidget(qobject_cast(mSSID), m_listWidget); + m_ssidWidget->setKey(tr("SSID:")); - mProtocol = new QLabel(this); - QHBoxLayout *mProtocolLayout = new QHBoxLayout(this); - mProtocolLayout->addStretch(); - mProtocolLayout->addWidget(mProtocol); + mProtocol = new QLabel(this); + m_protocolWidget = new DetailWidget(qobject_cast(mProtocol), m_listWidget); + m_protocolWidget->setKey(tr("Protocol:")); - mSecType = new QLabel(this); - QHBoxLayout *mSecTypeLayout = new QHBoxLayout(this); - mSecTypeLayout->addStretch(); - mSecTypeLayout->addWidget(mSecType); + mSecType = new QLabel(this); + m_secTypeWidget = new DetailWidget(qobject_cast(mSecType)); + m_secTypeWidget->setKey(tr("Security Type:")); - mHz = new QLabel(this); - QHBoxLayout *mHzLayout = new QHBoxLayout(this); - mHzLayout->addStretch(); - mHzLayout->addWidget(mHz); + mHz = new QLabel(this); + m_hzWidget = new DetailWidget(qobject_cast(mHz)); + m_hzWidget->setKey(tr("Hz:")); - mChan = new QLabel(this); - QHBoxLayout *mChanLayout = new QHBoxLayout(this); - mChanLayout->addStretch(); - mChanLayout->addWidget(mChan); + mChan = new QLabel(this); + m_chanelWidget = new DetailWidget(qobject_cast(mChan)); + m_chanelWidget->setKey(tr("Chan:")); mBandWidth = new QLabel(this); - QHBoxLayout *mBandWidthLayout = new QHBoxLayout(this); - mBandWidthLayout->addStretch(); - mBandWidthLayout->addWidget(mBandWidth); + m_bandwidthWidget = new DetailWidget(qobject_cast(mBandWidth), m_listWidget); + m_bandwidthWidget->setKey(tr("BandWidth:")); - mIPV4 = new QLabel(this); - QHBoxLayout *mIPV4Layout = new QHBoxLayout(this); - mIPV4Layout->addStretch(); - mIPV4Layout->addWidget(mIPV4); + mIPV4 = new QLabel(this); + m_ipv4Widget = new DetailWidget(qobject_cast(mIPV4), m_listWidget); + m_ipv4Widget->setKey(tr("IPV4:")); - mIPV4Dns = new QLabel(this); - QHBoxLayout *mIPV4DnsLayout = new QHBoxLayout(this); - mIPV4DnsLayout->addStretch(); - mIPV4DnsLayout->addWidget(mIPV4Dns); + mIPV4Dns = new QLabel(this); + m_ipv4DnsWidget = new DetailWidget(qobject_cast(mIPV4Dns), m_listWidget); + m_ipv4DnsWidget->setKey(tr("IPV4 Dns:")); - mIPV6 = new QLabel(this); - QHBoxLayout *mIPV6Layout = new QHBoxLayout(this); - mIPV6Layout->addStretch(); - mIPV6Layout->addWidget(mIPV6); + mIPV6 = new QLabel(this); + m_ipv6Widget = new DetailWidget(qobject_cast(mIPV6), m_listWidget); + m_ipv6Widget->setKey(tr("IPV6:")); - mMac = new QLabel(this); - QHBoxLayout *mMacLayout = new QHBoxLayout(this); - mMacLayout->addStretch(); - mMacLayout->addWidget(mMac); + mMac = new QLabel(this); + m_macWidget = new DetailWidget(qobject_cast(mMac), m_listWidget); + m_macWidget->setKey(tr("Mac:")); autoConnect = new QLabel(this); @@ -143,23 +158,28 @@ void DetailPage::initUI() { mAutoLayout->addWidget(autoConnect); mAutoLayout->addSpacerItem(horizontalSpacer); - mDetailLayout->addRow(tr("SSID:"), mSSID); - mDetailLayout->addRow(tr("Protocol:"), mProtocolLayout); + this->addDetailItem(m_listWidget, m_ssidWidget); + this->addDetailItem(m_listWidget, m_protocolWidget); if (mIsWlan) { - mDetailLayout->addRow(tr("Security Type:"), mSecTypeLayout); - mDetailLayout->addRow(tr("Hz:"), mHzLayout); - mDetailLayout->addRow(tr("Chan:"), mChanLayout); + this->addDetailItem(m_listWidget, m_secTypeWidget); + this->addDetailItem(m_listWidget, m_hzWidget); + this->addDetailItem(m_listWidget, m_chanelWidget); } - mDetailLayout->addRow(tr("BandWidth:"), mBandWidthLayout); - mDetailLayout->addRow(tr("IPV6:"), mIPV6Layout); - mDetailLayout->addRow(tr("IPV4:"), mIPV4Layout); - mDetailLayout->addRow(tr("IPV4 Dns:"), mIPV4DnsLayout); - mDetailLayout->addRow(tr("Mac:"), mMacLayout); + this->addDetailItem(m_listWidget, m_bandwidthWidget); + this->addDetailItem(m_listWidget, m_ipv6Widget); + this->addDetailItem(m_listWidget, m_ipv4Widget); + this->addDetailItem(m_listWidget, m_ipv4DnsWidget); + this->addDetailItem(m_listWidget, m_macWidget); - layout->addLayout(mDetailLayout); - layout->addStretch(); + QPalette mpal(m_listWidget->palette()); + mpal.setColor(QPalette::Base, qApp->palette().base().color()); + mpal.setColor(QPalette::AlternateBase, qApp->palette().alternateBase().color()); + m_listWidget->setAlternatingRowColors(true); +// m_listWidget->setAutoFillBackground(true); + m_listWidget->setPalette(mpal); + + layout->addWidget(mDetailFrame); layout->addLayout(mAutoLayout); - } void DetailPage::setEnableOfSaveBtn() { diff --git a/src/frontend/netdetails/detailpage.h b/src/frontend/netdetails/detailpage.h index 719e33ce..fa40c35a 100644 --- a/src/frontend/netdetails/detailpage.h +++ b/src/frontend/netdetails/detailpage.h @@ -7,7 +7,10 @@ #include #include #include +#include +#include +#include "detailwidget.h" #include "coninfo.h" class DetailPage : public QFrame @@ -34,8 +37,21 @@ public: private: void initUI(); + void addDetailItem(QListWidget *listWidget, DetailWidget *detailWidget); public: + QListWidget * m_listWidget = nullptr; + DetailWidget * m_ssidWidget = nullptr; + DetailWidget * m_protocolWidget = nullptr; + DetailWidget * m_secTypeWidget = nullptr; + DetailWidget * m_hzWidget = nullptr; + DetailWidget * m_chanelWidget = nullptr; + DetailWidget * m_bandwidthWidget = nullptr; + DetailWidget * m_ipv4Widget = nullptr; + DetailWidget * m_ipv4DnsWidget = nullptr; + DetailWidget * m_ipv6Widget = nullptr; + DetailWidget * m_macWidget = nullptr; + QLineEdit *mSSID; QLabel *mProtocol; QLabel *mSecType; @@ -51,7 +67,7 @@ public: // QWidget *autoFrame; private: QVBoxLayout *layout; - QFormLayout *mDetailLayout; + QVBoxLayout *mDetailLayout; QHBoxLayout *mAutoLayout; QCheckBox *forgetNetBox; bool mIsWlan; diff --git a/src/frontend/netdetails/detailwidget.cpp b/src/frontend/netdetails/detailwidget.cpp new file mode 100644 index 00000000..a045e0ce --- /dev/null +++ b/src/frontend/netdetails/detailwidget.cpp @@ -0,0 +1,32 @@ +#include "detailwidget.h" +#define ITEM_HEIGHT 36 +#define ITEM_MARGINS 18,0,16,0 + +DetailWidget::DetailWidget(QWidget *valueWidget, QWidget *parent) + : m_valueWidget(valueWidget) , QWidget(parent) +{ +// m_valueWidget = valueWidget; + initUI(); +} + +DetailWidget::~DetailWidget() +{ + +} + +void DetailWidget::initUI() +{ + this->setFixedHeight(ITEM_HEIGHT); + m_mainLayout = new QHBoxLayout(this); + m_mainLayout->setContentsMargins(ITEM_MARGINS); + + m_keyLabel = new QLabel(this); + m_mainLayout->addWidget(m_keyLabel); + m_mainLayout->addStretch(); + m_mainLayout->addWidget(m_valueWidget); +} + +void DetailWidget::setKey(const QString &keyLabel) +{ + m_keyLabel->setText(keyLabel); +} diff --git a/src/frontend/netdetails/detailwidget.h b/src/frontend/netdetails/detailwidget.h new file mode 100644 index 00000000..00333bb2 --- /dev/null +++ b/src/frontend/netdetails/detailwidget.h @@ -0,0 +1,27 @@ +#ifndef DetailWidget_H +#define DetailWidget_H + +#include +#include +#include + +class DetailWidget : public QWidget +{ + Q_OBJECT +public: + explicit DetailWidget(QWidget *valueWidget = nullptr, QWidget *parent = nullptr); + ~DetailWidget(); + + void setKey(const QString &keyLabel); + +private: + QHBoxLayout * m_mainLayout = nullptr; + QLabel * m_keyLabel = nullptr; + QWidget * m_valueWidget = nullptr; + + void initUI(); +signals: + +}; + +#endif // DetailWidget_H diff --git a/src/frontend/netdetails/netdetail.cpp b/src/frontend/netdetails/netdetail.cpp index bdc14829..6091af7d 100644 --- a/src/frontend/netdetails/netdetail.cpp +++ b/src/frontend/netdetails/netdetail.cpp @@ -3,8 +3,8 @@ #include "backend/kylinipv6arping.h" #include "xatom/xatom-helper.h" -#define WINDOW_WIDTH 540 -#define WINDOW_HEIGHT 574 +#define WINDOW_WIDTH 520 +#define WINDOW_HEIGHT 590 #define BUTTON_SIZE 30 #define ICON_SIZE 22,22 #define TITLE_LAYOUT_MARGINS 9,9,0,0 @@ -44,7 +44,7 @@ NetDetail::NetDetail(QString interface, QString name, QString uuid, bool isActiv m_uuid(uuid), isActive(isActive), isWlan(isWlan), - isCreateNet(isCreateNet), + m_isCreateNet(isCreateNet), QDialog(parent) { //设置窗口无边框,阴影 @@ -64,9 +64,11 @@ NetDetail::NetDetail(QString interface, QString name, QString uuid, bool isActiv setFixedSize(WINDOW_WIDTH,WINDOW_HEIGHT); centerToScreen(); - if (isCreateNet && !uuid.isEmpty()) { - isCreateNet = false; + qDebug() << m_isCreateNet << name; + if (m_isCreateNet && !name.isEmpty()) { + m_isCreateNet = false; } + qDebug() << m_isCreateNet; m_netDeviceResource = new KyNetworkDeviceResourse(this); m_wirelessConnOpration = new KyWirelessConnectOperation(this); m_resource = new KyWirelessNetResource(this); @@ -78,14 +80,15 @@ NetDetail::NetDetail(QString interface, QString name, QString uuid, bool isActiv getConInfo(m_info); pagePadding(name,isWlan); + connect(qApp, &QApplication::paletteChanged, this, &NetDetail::onPaletteChanged); - isCreateOk = !(isCreateNet && !isWlan); + isCreateOk = !(m_isCreateNet && !isWlan); isDetailOk = !(m_name.isEmpty()); isIpv4Ok = true; isIpv6Ok = true; isSecuOk = true; - qDebug() << interface << name << uuid << "isWlan" << isWlan << "isCreateNet" <palette(); + pal.setColor(QPalette::Window, qApp->palette().base().color()); + this->setPalette(pal); + + QPalette listwidget_pal(detailPage->m_listWidget->palette()); + listwidget_pal.setColor(QPalette::Base, qApp->palette().base().color()); + listwidget_pal.setColor(QPalette::AlternateBase, qApp->palette().alternateBase().color()); + detailPage->m_listWidget->setAlternatingRowColors(true); + detailPage->m_listWidget->setPalette(listwidget_pal); + +} + void NetDetail::paintEvent(QPaintEvent *event) { return QDialog::paintEvent(event); } +void NetDetail::closeEvent(QCloseEvent *event) +{ + emit this->detailPageClose(false); + return QDialog::closeEvent(event); +} + void NetDetail::centerToScreen() { QDesktopWidget* m = QApplication::desktop(); @@ -116,7 +139,7 @@ void NetDetail::initUI() QVBoxLayout *mainLayout = new QVBoxLayout(this); mainLayout->setContentsMargins(9,9,14,24); - detailPage = new DetailPage(isWlan, isCreateNet, this); + detailPage = new DetailPage(isWlan, m_isCreateNet, this); ipv4Page = new Ipv4Page(this); ipv6Page = new Ipv6Page(this); securityPage = new SecurityPage(this); @@ -225,12 +248,16 @@ void NetDetail::initUI() bottomLayout->addWidget(cancelBtn); bottomLayout->addWidget(confimBtn); + QPalette pal(this->palette()); + pal.setColor(QPalette::Background, qApp->palette().base().color()); + this->setAutoFillBackground(true); + this->setPalette(pal); } void NetDetail::loadPage() { //判断是否创建网络页面 - if (isCreateNet && !isWlan) { + if (m_isCreateNet && !isWlan) { pageFrame->hide(); stackWidget->setCurrentIndex(CREATE_NET_PAGE_NUM); titleLabel->setText(tr("Add Lan Connect")); @@ -305,7 +332,7 @@ void NetDetail::initComponent() void NetDetail::pagePadding(QString netName, bool isWlan) { //网络详情页填充 - if(isCreateNet && !isWlan) { + if(m_isCreateNet && !isWlan) { return; } @@ -363,7 +390,7 @@ void NetDetail::pagePadding(QString netName, bool isWlan) //获取网路详情信息 void NetDetail::getConInfo(ConInfo &conInfo) { - if (isCreateNet && !isWlan) { + if (m_isCreateNet && !isWlan) { return; } getBaseInfo(conInfo); @@ -555,7 +582,7 @@ void NetDetail::initTtlsInfo(ConInfo &conInfo) //点击了保存更改网络设置的按钮 void NetDetail::on_btnConfirm_clicked() { - if (isCreateNet) { + if (m_isCreateNet) { if (!isWlan) { //新建有线连接 qDebug() << "Confirm create wired connect"; @@ -589,7 +616,7 @@ void NetDetail::on_btnForget_clicked() void NetDetail::setConfirmEnable() { - if (isCreateNet && !isWlan) { + if (m_isCreateNet && !isWlan) { isConfirmBtnEnable = isCreateOk; } else { if (isDetailOk && isIpv4Ok && isIpv6Ok) { @@ -804,14 +831,25 @@ bool NetDetail::updateConnect() m_wiredConnOperation->updateWiredConnect(m_uuid, connetSetting); } - if (isWlan && securityPage->checkIsChanged(m_info)) { - KySecuType secuType; - KyEapMethodType enterpriseType; - securityPage->getSecuType(secuType, enterpriseType); - if (secuType == WPA_AND_WPA2_ENTERPRISE) { - updateWirelessEnterPriseConnect(enterpriseType); - } else { - updateWirelessPersonalConnect(); + bool securityChange = false; + if (isWlan) { + securityChange = securityPage->checkIsChanged(m_info); + if (securityChange) { + KySecuType secuType; + KyEapMethodType enterpriseType; + securityPage->getSecuType(secuType, enterpriseType); + if (secuType == WPA_AND_WPA2_ENTERPRISE) { + updateWirelessEnterPriseConnect(enterpriseType); + } else { + updateWirelessPersonalConnect(); + } + } + } + + if (ipv4Change || ipv6Change || securityChange) { + if (isActive) { + //信息变化 断开-重连 + m_wirelessConnOpration->activateConnection(m_uuid, m_deviceName); } } return true; diff --git a/src/frontend/netdetails/netdetail.h b/src/frontend/netdetails/netdetail.h index 35c469e4..396788a8 100644 --- a/src/frontend/netdetails/netdetail.h +++ b/src/frontend/netdetails/netdetail.h @@ -19,6 +19,7 @@ #include #include #include +#include #include "detailpage.h" #include "ipv4page.h" @@ -37,6 +38,7 @@ public: ~NetDetail(); protected: void paintEvent(QPaintEvent *event); + void closeEvent(QCloseEvent *event); private: void initUI(); @@ -109,7 +111,7 @@ private: QString m_deviceName; bool isWlan; - bool isCreateNet; + bool m_isCreateNet; bool isActive; bool isHideWlan; @@ -127,5 +129,9 @@ private: private slots: void on_btnConfirm_clicked(); void on_btnForget_clicked(); + void onPaletteChanged(); + +signals: + void detailPageClose(bool on); }; #endif // NETDETAIL_H diff --git a/src/frontend/netdetails/netdetails.pri b/src/frontend/netdetails/netdetails.pri index 206899b9..720a66b8 100644 --- a/src/frontend/netdetails/netdetails.pri +++ b/src/frontend/netdetails/netdetails.pri @@ -5,6 +5,7 @@ HEADERS += \ $$PWD/creatnetpage.h \ $$PWD/customtabstyle.h \ $$PWD/detailpage.h \ + $$PWD/detailwidget.h \ $$PWD/ipv4page.h \ $$PWD/ipv6page.h \ $$PWD/netdetail.h \ @@ -14,6 +15,7 @@ SOURCES += \ $$PWD/creatnetpage.cpp \ $$PWD/customtabstyle.cpp \ $$PWD/detailpage.cpp \ + $$PWD/detailwidget.cpp \ $$PWD/ipv4page.cpp \ $$PWD/ipv6page.cpp \ $$PWD/netdetail.cpp \ diff --git a/src/frontend/tab-pages/lanpage.cpp b/src/frontend/tab-pages/lanpage.cpp index 4fd16485..11ff3223 100644 --- a/src/frontend/tab-pages/lanpage.cpp +++ b/src/frontend/tab-pages/lanpage.cpp @@ -22,6 +22,7 @@ LanPage::LanPage(QWidget *parent) : TabPage(parent) m_activeResourse = new KyActiveConnectResourse(this); m_connectResourse = new KyConnectResourse(this); m_deviceResource = new KyNetworkDeviceResourse(this); + m_wiredConnectOperation = new KyWiredConnectOperation(this); initUI(); initNetSwitch(); @@ -679,14 +680,13 @@ void LanPage::initUI() inactiveLanListLayout->addWidget(m_inactivatedLanListWidget); m_settingsLabel->installEventFilter(this); -// emit this->lanConnectChanged(); } QListWidgetItem *LanPage::addNewItem(KyConnectItem *itemData, QListWidget *listWidget) { - QListWidgetItem *p_listWidgetItem = new QListWidgetItem(listWidget); + QListWidgetItem *p_listWidgetItem = new QListWidgetItem(); p_listWidgetItem->setSizeHint(QSize(listWidget->width(),ITEM_HEIGHT)); - listWidget->addItem(p_listWidgetItem); + listWidget->insertItem(0, p_listWidgetItem); LanListItem *p_lanItem = nullptr; if (itemData != nullptr) { @@ -766,8 +766,6 @@ void LanPage::updateConnectionArea(QString uuid) 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; @@ -792,11 +790,20 @@ void LanPage::onUpdateLanlist(QString uuid, updateActivatedConnectionArea(uuid); } else if (state == NetworkManager::ActiveConnection::State::Deactivated) { updateConnectionArea(uuid); + } else if (state == NetworkManager::ActiveConnection::State::Activating + || state == NetworkManager::ActiveConnection::State::Deactivating) { + QString devName = m_activeResourse->getDeviceOfActivateConnect(uuid); + if (devName.isEmpty()) { + m_connectResourse->getInterfaceByUuid(devName, uuid); + } + emit lanActiveConnectionStateChanged(devName, uuid, state); } + emit this->lanConnectChanged(); return; } + void LanPage::getWiredList(QMap > &map) { QStringList devlist; @@ -1040,7 +1047,6 @@ void LanPage::activateWired(const QString& devName, const QString& connUuid) { qDebug() << "[LanPage] activateWired" << devName << connUuid; m_wiredConnectOperation->activateConnection(connUuid, devName); - emit this->lanConnectChanged(); } void LanPage::deactivateWired(const QString& devName, const QString& connUuid) diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index 3666bc45..1b86c99a 100644 --- a/src/frontend/tab-pages/wlanpage.cpp +++ b/src/frontend/tab-pages/wlanpage.cpp @@ -146,7 +146,7 @@ void WlanPage::onWlanSwitchClicked() if (m_wlanSwitchEnable != switchEnable) { qDebug()<< LOG_FLAG << "wlan switch state " << switchEnable; m_wirelessConnectOpreation->setWirelessEnabled(switchEnable); - m_switchGsettings->set(WIRELESS_SWITCH, switchEnable); + //m_switchGsettings->set(WIRELESS_SWITCH, switchEnable); } } @@ -236,8 +236,8 @@ void WlanPage::initDeviceCombox() } } else { m_deviceFrame->hide(); - m_currentDevice = ""; - setDefaultDevice(WIRELESS, m_currentDevice); + //m_currentDevice = ""; + //setDefaultDevice(WIRELESS, m_currentDevice); } connect(m_deviceComboBox, QOverload::of(&QComboBox::currentIndexChanged), @@ -292,15 +292,15 @@ void WlanPage::clearWirelessNetItemMap(QMap &wireless iter = wirelessNetItem.begin(); while (iter != wirelessNetItem.end()) { - QListWidgetItem *p_widgetItem = iter.value(); - WlanListItem *p_wlanItem = (WlanListItem *)wirelessListWidget->itemWidget(p_widgetItem); - wirelessListWidget->removeItemWidget(p_widgetItem); + QListWidgetItem *p_listWidgetItem = iter.value(); + WlanListItem *p_wlanItem = (WlanListItem *)wirelessListWidget->itemWidget(p_listWidgetItem); + wirelessListWidget->removeItemWidget(p_listWidgetItem); delete p_wlanItem; p_wlanItem = nullptr; - delete p_widgetItem; - p_widgetItem = nullptr; + delete p_listWidgetItem; + p_listWidgetItem = nullptr; iter = wirelessNetItem.erase(iter); } @@ -358,8 +358,8 @@ void WlanPage::constructActivateConnectionArea() bool ret = m_wirelessNetResource->getActiveWirelessNetItem(m_currentDevice, wirelessNetItem); if (ret == true) { QListWidgetItem *p_listWidgetItem = addNewItem(wirelessNetItem, m_activatedNetListWidget); - updateWlanItemState(m_activatedNetListWidget, p_listWidgetItem, Activated); m_activateConnectionItemMap.insert(wirelessNetItem.m_NetSsid, p_listWidgetItem); + updateWlanItemState(m_activatedNetListWidget, p_listWidgetItem, Activated); height += p_listWidgetItem->sizeHint().height(); } @@ -369,8 +369,7 @@ void WlanPage::constructActivateConnectionArea() QListWidgetItem *p_listWidgetItem = addEmptyItem(m_activatedNetListWidget); m_activateConnectionItemMap.insert(EMPTY_SSID, p_listWidgetItem); - WlanListItem *p_wlanItem = (WlanListItem *)m_activatedNetListWidget->itemWidget(p_listWidgetItem); - height += p_wlanItem->height(); + height += p_listWidgetItem->sizeHint().height(); } m_activatedNetListWidget->setFixedHeight(height); @@ -401,8 +400,8 @@ void WlanPage::constructWirelessNetArea() } QListWidgetItem *p_listWidgetItem = addNewItem(wirelessNetItem, m_inactivatedNetListWidget); - updateWlanItemState(m_inactivatedNetListWidget, p_listWidgetItem, Deactivated); m_wirelessNetItemMap.insert(wirelessNetItem.m_NetSsid, p_listWidgetItem); + updateWlanItemState(m_inactivatedNetListWidget, p_listWidgetItem, Deactivated); if (height == 0) { @@ -462,8 +461,8 @@ void WlanPage::onWlanAdded(QString interface, KyWirelessNetItem &item) << interface << "; ssid = " << item.m_NetSsid << Q_FUNC_INFO <<__LINE__; QListWidgetItem *p_listWidgetItem = addNewItem(item, m_inactivatedNetListWidget); - updateWlanItemState(m_inactivatedNetListWidget, p_listWidgetItem, Deactivated); m_wirelessNetItemMap.insert(item.m_NetSsid, p_listWidgetItem); + updateWlanItemState(m_inactivatedNetListWidget, p_listWidgetItem, Deactivated); m_inactivatedNetListWidget->setFixedHeight(m_inactivatedNetListWidget->height() + p_listWidgetItem->sizeHint().height() + NET_LIST_SPACING); @@ -526,6 +525,8 @@ void WlanPage::updateWlanListItem(QString ssid) void WlanPage::onConnectionAdd(QString deviceName, QString ssid) { + qDebug() << LOG_FLAG << "one connection is added, it's ssid " << ssid << "device name"<< deviceName; + if (deviceName == m_currentDevice) { updateWlanListItem(ssid); } @@ -534,6 +535,7 @@ void WlanPage::onConnectionAdd(QString deviceName, QString ssid) } void WlanPage::onConnectionRemove(QString deviceName, QString ssid) { + qDebug() << LOG_FLAG << "one connection is removed, it's ssid " << ssid << "device name"<< deviceName; if (deviceName == m_currentDevice) { updateWlanListItem(ssid); } @@ -728,7 +730,7 @@ void WlanPage::sendApStateChangeSignal(QString uuid, emit hotspotDeactivated(deviceName, ssid); } else if (state == NetworkManager::ActiveConnection::State::Activated) { qDebug() << "[WlanPage] hotspot activated"; - emit hotspotActivated(deviceName, ssid); + emit hotspotActivated(deviceName, ssid, uuid); } return; @@ -772,11 +774,10 @@ void WlanPage::updateActivatedArea(QString uuid, QString ssid, QString devName) deleteWirelessItemFormMap(m_activateConnectionItemMap, m_activatedNetListWidget, EMPTY_SSID); QListWidgetItem *p_listWidgetItem = addNewItem(wirelessNetItem, m_activatedNetListWidget); - updateWlanItemState(m_activatedNetListWidget, p_listWidgetItem, Activated); m_activateConnectionItemMap.insert(wirelessNetItem.m_NetSsid, p_listWidgetItem); + updateWlanItemState(m_activatedNetListWidget, p_listWidgetItem, Activated); - m_activatedNetListWidget->setFixedHeight(m_activatedNetListWidget->height() - + p_listWidgetItem->sizeHint().height() + NET_LIST_SPACING); + m_activatedNetListWidget->setFixedHeight(p_listWidgetItem->sizeHint().height()); return; } @@ -794,15 +795,22 @@ void WlanPage::updateWirelessNetArea(QString uuid, QString ssid, QString devName return; } + /* + *此处更新状态是针对激活的链接忘记密码的操作。 + */ + QListWidgetItem *p_activelistItem = m_activateConnectionItemMap.value(ssid); + if (nullptr != p_activelistItem) { + updateWlanItemState(m_activatedNetListWidget, p_activelistItem, Deactivated); + } + deleteWirelessItemFormMap(m_activateConnectionItemMap, m_activatedNetListWidget, ssid); QListWidgetItem *p_activeListWidgetItem = addEmptyItem(m_activatedNetListWidget); m_activateConnectionItemMap.insert(EMPTY_SSID, p_activeListWidgetItem); - m_activatedNetListWidget->setFixedHeight(m_activatedNetListWidget->height() - + p_activeListWidgetItem->sizeHint().height() + NET_LIST_SPACING); + m_activatedNetListWidget->setFixedHeight(p_activeListWidgetItem->sizeHint().height()); QListWidgetItem *p_listWidgetItem = addNewItem(wirelessNetItem, m_inactivatedNetListWidget); - updateWlanItemState(m_inactivatedNetListWidget, p_listWidgetItem, Deactivated); m_wirelessNetItemMap.insert(wirelessNetItem.m_NetSsid, p_listWidgetItem); + updateWlanItemState(m_inactivatedNetListWidget, p_listWidgetItem, Deactivated); m_inactivatedNetListWidget->setFixedHeight(m_inactivatedNetListWidget->height() + p_listWidgetItem->sizeHint().height() + NET_LIST_SPACING); @@ -817,6 +825,7 @@ void WlanPage::onConnectionStateChanged(QString uuid, NetworkManager::ActiveConnection::Reason reason) { if (!m_connectResource->isWirelessConnection(uuid)) { + qDebug()<< LOG_FLAG << "it is not wireless connection" << uuid; return; } @@ -824,11 +833,13 @@ void WlanPage::onConnectionStateChanged(QString uuid, m_wirelessNetResource->getSsidByUuid(uuid, ssid); m_wirelessNetResource->getDeviceByUuid(uuid, devName); if (ssid.isEmpty() || devName.isEmpty()) { + qDebug()<< LOG_FLAG << "ssid or devicename is empty" + << "devicename"<< devName <<"ssid"< wlanList; if (!m_wirelessNetResource->getDeviceWifiNetwork(m_currentDevice, wlanList)) { @@ -998,6 +1011,10 @@ void WlanPage::onRefreshIconTimer() QListWidgetItem *p_sortListWidgetItem = m_wirelessNetItemMap.value(sortSsid); if (p_sortListWidgetItem) { + WlanListItem *p_wlanItem = (WlanListItem *)m_inactivatedNetListWidget->itemWidget(p_listWidgetItem); + if (Deactivated != p_wlanItem->getConnectionState()) { + continue; + } qDebug()<< LOG_FLAG << "sort wlan update position." << sortSsid << Q_FUNC_INFO << __LINE__; int takeRow = m_inactivatedNetListWidget->row(p_sortListWidgetItem); m_inactivatedNetListWidget->takeItem(takeRow); @@ -1014,8 +1031,8 @@ void WlanPage::onRefreshIconTimer() qDebug()<< LOG_FLAG << "sort wlan add new item." << Q_FUNC_INFO << __LINE__; QListWidgetItem *p_newListWidgetItem = insertNewItem(sortItem, m_inactivatedNetListWidget, sortRow); - updateWlanItemState(m_inactivatedNetListWidget, p_listWidgetItem, Deactivated); m_wirelessNetItemMap.insert(sortItem.m_NetSsid, p_newListWidgetItem); + updateWlanItemState(m_inactivatedNetListWidget, p_listWidgetItem, Deactivated); int height = m_inactivatedNetListWidget->height() + p_newListWidgetItem->sizeHint().height() + NET_LIST_SPACING; @@ -1047,12 +1064,12 @@ void WlanPage::getWirelessList(QMap > &map) QString activeSsid ; //先是已连接 if (actMap.contains(iter.key())) { + qDebug() << "find " <getWifiNetwork(iter.key(), actMap[iter.key()].at(0), data)) { vector.append(QStringList()< > &map) } //开启热点 -void WlanPage::activeWirelessAp(const QString apName, const QString apPassword, const QString apDevice) +void WlanPage::activeWirelessAp(const QString apName, const QString apPassword, const QString wirelessBand, const QString apDevice) { QString uuid(""); QList apConnectItemList; @@ -1081,30 +1098,14 @@ void WlanPage::activeWirelessAp(const QString apName, const QString apPassword, uuid = apConnectItemList.at(0)->m_connectUuid; } - m_wirelessConnectOpreation->activeWirelessAp(uuid, apName, apPassword, apDevice); + m_wirelessConnectOpreation->activeWirelessAp(uuid, apName, apPassword, apDevice, wirelessBand); } //断开热点 -void WlanPage::deactiveWirelessAp(const QString apName, const QString apPassword, const QString apDevice) +void WlanPage::deactiveWirelessAp(const QString apName, const QString uuid) { - QString uuid(""); - QList apConnectItemList; - m_connectResource->getApConnections(apConnectItemList); - if (!apConnectItemList.isEmpty()) { - foreach (auto item, apConnectItemList) { - if (apName == item->m_connectName && apPassword == item->m_password && apDevice == item->m_ifaceName) { - uuid = item->m_connectUuid; - qDebug() << "[WlanPage] deactiveWirelessAp uuid = " << uuid; - break; - } - } - } - if (!uuid.isEmpty()) { m_wirelessConnectOpreation->deactiveWirelessAp(apName, uuid); - } else { - qDebug() << "[WlanPage] deactiveWirelessAp can not find apName " << apName; - emit deactivateFailed("Deactivate hotspot failed.Don't exist " + apName); } } @@ -1118,6 +1119,22 @@ void WlanPage::getStoredApInfo(QStringList &list) list << apConnectItemList.at(0)->m_password; list << apConnectItemList.at(0)->m_ifaceName; list << (apConnectItemList.at(0)->m_isActivated? "true":"false"); + list << apConnectItemList.at(0)->m_connectUuid; + list << apConnectItemList.at(0)->m_band; + } +} + +void WlanPage::getApInfoBySsid(QString devName, QString ssid, QStringList &list) +{ + list.clear(); + QList apConnectItemList; + m_connectResource->getApConnections(apConnectItemList); + for (int i = 0; i < apConnectItemList.size(); i++) { + if (apConnectItemList.at(i)->m_connectName == ssid + && apConnectItemList.at(i)->m_ifaceName == devName) { + list << apConnectItemList.at(i)->m_password; + list << apConnectItemList.at(i)->m_band; + } } return; @@ -1203,3 +1220,25 @@ bool WlanPage::wlanIsConnected() return true; } + +void WlanPage::setWirelessSwitchEnable(bool enable) +{ + qDebug() << "dbus setWirelessSwitchEnable = " << enable << __LINE__; + //应该先检测是否有无线网卡可用,才改变开关状态 + if (m_devList.isEmpty()) { + qDebug() << "have no device to use " << Q_FUNC_INFO << __LINE__; + //检测不到无线网卡不再触发click信号 + m_netSwitch->setSwitchStatus(false); + //m_netSwitch->setEnabled(false); + }else{ + m_wirelessConnectOpreation->setWirelessEnabled(enable); + } +} + +void WlanPage::getWirelessDeviceCap(QMap &map) +{ + for (int i = 0; i < m_devList.size(); ++i) { + QString devName = m_devList.at(i); + map.insert(devName, m_netDeviceResource->getWirelessDeviceCapability(devName)); + } +} diff --git a/src/frontend/tab-pages/wlanpage.h b/src/frontend/tab-pages/wlanpage.h index dca1e9e1..6b074c66 100644 --- a/src/frontend/tab-pages/wlanpage.h +++ b/src/frontend/tab-pages/wlanpage.h @@ -30,11 +30,12 @@ public: //for dbus void getWirelessList(QMap > &map); //开启热点 - void activeWirelessAp(const QString apName, const QString apPassword, const QString apDevice); + void activeWirelessAp(const QString apName, const QString apPassword, const QString wirelessBand, const QString apDevice); //断开热点 - void deactiveWirelessAp(const QString apName, const QString apPassword, const QString apDevice); + void deactiveWirelessAp(const QString apName, const QString uuid); //获取热点 void getStoredApInfo(QStringList &list); + void activateWirelessConnection(const QString& devName, const QString& ssid); void deactivateWirelessConnection(const QString& devName, const QString& ssid); @@ -42,13 +43,18 @@ public: bool wlanIsConnected(); + void getApInfoBySsid(QString devName, QString ssid, QStringList &list); + //无线总开关 + void setWirelessSwitchEnable(bool enable); + void getWirelessDeviceCap(QMap &map); + signals: void oneItemExpanded(const QString &ssid); void wlanAdd(QString devName, QStringList info); void wlanRemove(QString devName,QString ssid); - void wlanActiveConnectionStateChanged(QString interface, QString ssid, int status); + void wlanActiveConnectionStateChanged(QString interface, QString ssid, QString uuid, int status); void hotspotDeactivated(QString devName, QString ssid); - void hotspotActivated(QString devName, QString ssid); + void hotspotActivated(QString devName, QString ssid, QString uuid); void signalStrengthChange(QString devName, QString ssid, int strength); void secuTypeChange(QString devName, QString ssid, QString secuType); void hiddenWlanClicked(); @@ -57,6 +63,7 @@ signals: public slots: void onMainWindowVisibleChanged(const bool &visible); void onSecurityTypeChange(QString devName, QString ssid, QString secuType); + void requestScan(); private slots: void onWlanAdded(QString interface, KyWirelessNetItem &item); @@ -78,7 +85,6 @@ private slots: void onWlanSwithGsettingsChanged(const QString &key); void onDeviceComboxIndexChanged(int currentIndex); - void requestScan(); void onHiddenWlanClicked(); void showControlCenter(); void onWifiEnabledChanged(bool isWifiOn); diff --git a/src/main.cpp b/src/main.cpp index cac828c9..6c34052a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -85,6 +85,7 @@ int main(int argc, char *argv[]) QtSingleApplication a(id, argc, argv); qInstallMessageHandler(messageOutput); if (a.isRunning()) { + qInfo() << "Kylin-Network-Manager Is Already Launched, just show"; auto connection = QDBusConnection::sessionBus(); QDBusInterface iface("com.kylin.network", "/com/kylin/network", @@ -94,22 +95,19 @@ int main(int argc, char *argv[]) return 0; } - qDebug()<<"Kylin Network Manager Is Already Launched"; - QApplication::setQuitOnLastWindowClosed(false); // Internationalization QString locale = QLocale::system().name(); QTranslator trans_global; - if (locale == "zh_CN") { - trans_global.load(":/translations/kylin-nm_zh_CN.qm"); + qDebug() << "QLocale " << QLocale(); + if (trans_global.load(QLocale(), "kylin-nm", "_", ":/translations/")) + { a.installTranslator(&trans_global); + qDebug()<<"Translations load success"; + } else { + qWarning() << "Translations load fail"; } - if (locale == "tr_TR") { - trans_global.load(":/translations/kylin-nm_tr.qm"); - a.installTranslator(&trans_global); - } - qDebug()<<"Translations Are Already Loaded"; MainWindow w; w.setProperty("useStyleWindowManager", false); //禁用拖动 diff --git a/translations/kylin-nm_bo.ts b/translations/kylin-nm_bo.ts index 23a75a01..1279ad59 100644 --- a/translations/kylin-nm_bo.ts +++ b/translations/kylin-nm_bo.ts @@ -1,146 +1,6 @@ - - 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 - - - - - IPV4 address conflict, Please change IP - - - - - IPV6 address conflict, Please change IP - - - - - Edit Network - - - - - Add Wired Network - - - CreatNetPage @@ -247,1058 +107,6 @@ - - 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 - - - - - 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 - - - - - 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) - - - - - 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 - - - - - 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) - - - - - DlgHideWifiEapTTLS - - - 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 - - - - - DlgHideWifiLeap - - - Connection - - - - - Network name - - - - - 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 - - - Connection - - - - - Network name - - - - - 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 - - - Connection - - - - - Add Hidden Wi-Fi - - - - - 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 - - - - - Connect to Hidden Wi-Fi Network - - - EnterpriseWlanDialog @@ -1408,43 +216,41 @@ + + LanListItem + + + Wired Device not carried + + + LanPage - + LAN - + Activated LAN - + Inactivated LAN - - - LAN Disconnected Successfully - - - - - LAN Connected Successfully - - ListItem - + Kylin NM - + kylin network applet desktop message @@ -1452,29 +258,28 @@ MainWindow - - - + + kylin-nm - + LAN - + WLAN - + Settings - + Show MainWindow @@ -1572,213 +377,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 @@ -1786,79 +384,6 @@ 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 @@ -1867,76 +392,6 @@ Form - - - - Connect - - - - - Disconnect - - - - - Cancel - - - - - Not connected - - - - - - Disconnected - - - - - - Ethernet - - - - - NetOn, - - - - - - - No Configuration - - - - - No IfName - - - - - IPv4: - - - - - IPv6: - - - - - MAC: - - - - - BandWidth: - - SecurityPage @@ -2134,20 +589,20 @@ - + Disconnect - + Connect - + Forget @@ -2180,163 +635,14 @@ - + 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 - - - - - - - - - - - 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 c5f225da..3df96add 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 731a2500..9ad4c974 100644 --- a/translations/kylin-nm_tr.ts +++ b/translations/kylin-nm_tr.ts @@ -11,141 +11,80 @@ ConfForm - edit network - Ağı düzenle + Ağı düzenle - LAN name: - LAN adı: + LAN adı: - - - Method: - Yöntem: + Yöntem: - Address: - Adres: + Adres: - Netmask: - Netmask: + Netmask: - - Gateway: - - - - DNS 1: - DNS 1: + DNS 1: - DNS 2: - DNS 2: + DNS 2: - - Ipv6 Address: - - - - Edit Conn - Bağ. Düzenle + Bağ. Düzenle - Auto(DHCP) - Oto(DHCP) + Oto(DHCP) - Manual - Elle + Elle - Cancel - İptal + İptal - Save - Kaydet + Kaydet - Ok - Tamam + Tamam - Can not create new wired network for without wired card - Kablolu kart olmadan yeni kablolu ağ oluşturulamıyor + Kablolu kart olmadan yeni kablolu ağ oluşturulamıyor - New network already created - Yeni ağ zaten oluşturuldu + 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ı + Yeni ağ ayarları zaten tamamlandı - - kylin-nm - - - - kylin network applet desktop message - Kylin ağ uygulaması masaüstü mesajı + Kylin ağ uygulaması masaüstü mesajı - - Will check the IP address conflict - - - - - IPV4 address conflict, Please change IP - - - - - IPV6 address conflict, Please change IP - - - - Edit Network - Ağı Düzenle + Ağı Düzenle - Add Wired Network - Kablolu Ağ Ekle + Kablolu Ağ Ekle create wired network successfully @@ -269,66 +208,44 @@ DlgHideWifi - Add Hidden WLAN - Gizli WLAN Ekle + Gizli WLAN Ekle - Connection - Bağlantı + Bağlantı - WLAN name - WLAN adı + WLAN adı - WLAN security - WLAN güvenlik + WLAN güvenlik - Cancel - İptal + İptal - Connect - Bağlantı + Bağlantı - C_reate… - Oluştur... + Oluştur... - None - Yok + Yok - - WPA and WPA2 Personal - - - - - WPA and WPA2 Enterprise - - - - - Conn WLAN Success - WLAN Bağlantısı Başarılı + 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 + Kablosuz şifrenizi veya kablosuz kart kullanılabilirliğini onaylayın WPA & WPA2 Personal @@ -351,361 +268,166 @@ WPA & WPA2 Enterprise - Connect to Hidden WLAN Network - Gizli WLAN Ağına Bağlan + Gizli WLAN Ağına Bağlan DlgHideWifiEapFast - 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ı: + Bağlantı: - Network name - Ağ adı + Ağ adı - WLAN security - WLAN güvenliği + WLAN güvenliği - Authentication - Kimlik Doğrulama + Kimlik Doğrulama - Anonymous identity - Anonim kimlik + Anonim kimlik - Allow automatic PAC pro_visioning - Otomatik PAC pro_visioning'e izin ver + Otomatik PAC pro_visioning'e izin ver - PAC file - PAC dosyası + PAC dosyası - Inner authentication - İç kimlik doğrulama: + İç kimlik doğrulama: - Username - Kullanıcı adı + Kullanıcı adı - Password - Parola + Parola - Cancel - İptal + İptal - Connect - Bağlan + Bağlan - C_reate… - Oluştur... + Oluştur... - - None - Yok - - - - WPA and WPA2 Personal - - - - - WPA and WPA2 Enterprise - + Yok WPA & WPA2 Personal WPA & WPA2 Kişisel - WEP 40/128-bit Key (Hex or ASCII) - WEP 40/128-bit Key (Hex veya ASCII) + WEP 40/128-bit Key (Hex veya ASCII) - WEP 128-bit Passphrase - WEP 128-bit Passphrase + WEP 128-bit Passphrase - Dynamic WEP (802.1X) - Dinamik WEP (802.1x) + Dinamik WEP (802.1x) WPA & WPA2 Enterprise WPA & WPA2 Enterprise - Tunneled TLS - Tünelli TLS + Tünelli TLS - Protected EAP (PEAP) - Korumalı EAP (PEAP) + Korumalı EAP (PEAP) - Anonymous - Anonim + Anonim - Authenticated - Doğrulanmış + Doğrulanmış - Both - Her ikisi de + Her ikisi de DlgHideWifiEapLeap - 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ı: + Bağlantı: - Network name - Ağ adı: + Ağ adı: - WLAN security - WLAN güvenliği: + WLAN güvenliği: - Authentication - Kimlik Doğrulama: + Kimlik Doğrulama: - Username - Kullanıcı adı: + Kullanıcı adı: - Password - Parola: + Parola: - Cancel - 取消 + 取消 - Connect - Bağlan + Bağlan - C_reate… - Oluştur... + Oluştur... - None - Yok - - - - WPA and WPA2 Personal - - - - - WPA and WPA2 Enterprise - - - - WPA & WPA2 Personal - 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) - - - WPA & WPA2 Enterprise - WPA & WPA2 Enterprise - - - - Tunneled TLS - Tünelli TLS - - - - Protected EAP (PEAP) - Korumalı EAP (PEAP) - - - - 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 - + Yok WPA & WPA2 Personal @@ -732,392 +454,83 @@ 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 + Korumalı EAP (PEAP) - 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 - - - - WPA & WPA2 Personal - 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) - - - WPA & WPA2 Enterprise - WPA & WPA2 Enterprise - - - - Tunneled TLS - Tünelli TLS - - - - Protected EAP (PEAP) - Korumalı EAP (PEAP) - - - - DlgHideWifiEapTTLS + DlgHideWifiEapPeap Connect to Hidden WLAN Network Gizli WLAN Ağına Bağlan - Add hidden WLAN - Gizli WLAN ekle + Gizli WLAN ekle - Connection - Bağlantı: + Bağlantı: - Network name - Ağ adı: + Ağ adı: - WLAN security - WLAN Güvenliği: + WLAN güvenliği: - Authentication - Kimlik Doğrulama: + Kimlik Doğrulama: - Anonymous identity - Anonim kimlik: + Anonim kimlik: - Domain - Domain: + Domain: - CA certificate - CA Sertifikası: + CA sertifikası: - CA certificate password - CA sertifika şifresi: + CA sertifika şifresi: - No CA certificate is required - CA sertifikası gerekmez + CA sertifikası gerekmez + + + PEAP version + PEAP sürümü: - Inner authentication - İç kimlik doğrulama: + İç kimlik doğrulama: - Username - Kullanıcı adı: + Kullanıcı adı: - Password - Parola: + Parola: - Cancel - İptal + İptal - Connect - Bağlan + Bağlan - - C_reate… - Oluştur... - - - - None - Yok - - - - WPA and WPA2 Personal - - - - - WPA and WPA2 Enterprise - - - - WPA & WPA2 Personal - 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) - - - WPA & WPA2 Enterprise - 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 - + Yok WPA & WPA2 Personal @@ -1140,21 +553,325 @@ WPA & WPA2 Enterprise - Tunneled TLS - Tünelli TLS + Tünelli TLS - Protected EAP (PEAP) - Korumalı EAP (PEAP) + Korumalı EAP (PEAP) - - - Choose from file - Dosyadan seç... + Dosyadan seçin... + + + Automatic + Otomatik + + + Version 0 + Sürüm 0 + + + Version 1 + Sürüm 1 + + + + 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 & WPA2 Personal + 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) + + + WPA & WPA2 Enterprise + WPA & WPA2 Enterprise + + + Tunneled TLS + Tünelli TLS + + + Protected EAP (PEAP) + Korumalı EAP (PEAP) + + + + DlgHideWifiEapTTLS + + 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 + + + Inner authentication + İç kimlik doğrulama: + + + Username + Kullanıcı adı: + + + Password + Parola: + + + Cancel + İptal + + + Connect + Bağlan + + + C_reate… + Oluştur... + + + None + Yok + + + WPA & WPA2 Personal + 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) + + + WPA & WPA2 Enterprise + WPA & WPA2 Enterprise + + + Tunneled TLS + Tünelli TLS + + + Protected EAP (PEAP) + Korumalı EAP (PEAP) + + + Choose from file + Dosyadan seçiniz... + + + + 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 & WPA2 Personal + 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) + + + WPA & WPA2 Enterprise + WPA & WPA2 Enterprise + + + Tunneled TLS + Tünelli TLS + + + Protected EAP (PEAP) + Korumalı EAP (PEAP) + + + Choose from file + Dosyadan seç... @@ -1168,97 +885,61 @@ Gizli WLAN Ekle - Connection - Bağlantı + Bağlantı - Network name - Ağ adı + Ağ adı WLAN security WLAN Güvenlik - - Add hidden Wi-Fi - - - - - Wi-Fi security - - - - Username - Kullanıcı adı + Kullanıcı adı - Password - Parola + Parola - Cancel - İptal + İptal - Connect - Bağlan + Bağlan - C_reate… - Oluştur... + Oluştur... - None - Yok - - - - WPA and WPA2 Personal - - - - - WPA and WPA2 Enterprise - + Yok WPA & WPA2 Personal WPA & WPA2 Kişisel - WEP 40/128-bit Key (Hex or ASCII) - WEP 40/128-bit Key (Hex veya ASCII) + WEP 40/128-bit Key (Hex veya ASCII) - WEP 128-bit Passphrase - WEP 128-bit Passphrase + WEP 128-bit Passphrase - Dynamic WEP (802.1X) - Dinamik WEP (802.1X) + Dinamik WEP (802.1X) WPA & WPA2 Enterprise WPA & WPA2 Enterprise - - - Connect to Hidden Wi-Fi Network - - DlgHideWifiWep @@ -1271,116 +952,76 @@ Gizli WLAN Ekle - Connection - Bağlantı: + Bağlantı: - Network name - Ağ adı: + Ağ adı: WLAN security WLAN Güvenliği: - - Add hidden Wi-Fi - - - - - Wi-Fi security - - - - Key - Anahtar + Anahtar - WEP index - WEP index + WEP index - Authentication - Kimlik Doğrulama: + Kimlik Doğrulama: - Cancel - İptal + İptal - Connect - Bağlan + Bağlan - C_reate… - Oluştur... + Oluştur... - None - Yok - - - - WPA and WPA2 Personal - - - - - WPA and WPA2 Enterprise - + Yok WPA & WPA2 Personal WPA & WPA2 Kişisel - WEP 40/128-bit Key (Hex or ASCII) - WEP 40/128-bit Key (Hex veya ASCII) + WEP 40/128-bit Key (Hex veya ASCII) - WEP 128-bit Passphrase - WEP 128-bit Passphrase + WEP 128-bit Passphrase - Dynamic WEP (802.1X) - Dinamik WEP (802.1x) + Dinamik WEP (802.1x) WPA & WPA2 Enterprise WPA & WPA2 Enterprise - 1(default) - 1(default) + 1(default) - Open System - Sistemi aç + Sistemi aç - Shared Key - Paylaşılan Anahtar - - - - Connect to Hidden Wi-Fi Network - + Paylaşılan Anahtar @@ -1394,9 +1035,8 @@ Gizli WLAN Ekle - Connection - Bağlantı: + Bağlantı: WLAN name @@ -1407,66 +1047,24 @@ WLAN güvenlik: - - Add Hidden Wi-Fi - - - - - Wi-Fi name - - - - - Wi-Fi security - - - - Password - Parola: + Parola: - Cancel - İptal + İptal - Connect - Bağlan + Bağlan - C_reate… - Oluştur... + Oluştur... - None - Yok - - - - WPA and WPA2 Personal - - - - - WPA and WPA2 Enterprise - - - - - - Conn Wifi Success - - - - - - Confirm your Wi-Fi password or usable of wireless card - + Yok Conn WLAN Success @@ -1492,11 +1090,6 @@ Dynamic WEP (802.1X) Dinamik WEP (802.1x) - - - Connect to Hidden Wi-Fi Network - - DlgHotspotCreate @@ -1649,43 +1242,41 @@ Kylin ağ uygulaması masaüstü mesajı + + LanListItem + + + Wired Device not carried + + + 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ı @@ -1693,9 +1284,8 @@ MainWindow - - - + + kylin-nm @@ -1716,17 +1306,17 @@ Gizli Ağı Bağlan - + LAN - + WLAN WLAN - + Settings @@ -1743,7 +1333,7 @@ HotSpot - + Show MainWindow Ana Pencereyi Göster @@ -1939,208 +1529,80 @@ OldMainWindow - Ethernet Networks - Ethernet Ağları + Ethernet Ağları - New LAN - Yeni LAN + Yeni LAN - WLAN Networks - WLAN Ağları + WLAN Ağları - Hide WLAN - Gizli WLAN + Gizli WLAN - No usable network in the list - Listede kullanılabilir ağ yok + Listede kullanılabilir ağ yok - - - Ethernet - Kablolu Ağ + Kablolu Ağ - HotSpot - HotSpot + HotSpot - - FlyMode - - - - - Advanced - Gelişmiş + Gelişmiş - - kylin-nm - - - - Show MainWindow - Ana Pencereyi Göster + Ana Pencereyi Göster - - Wired net is disconnected - Kablolu ağ bağlantısı kesildi + Kablolu ağ bağlantısı kesildi - - No wireless card detected - - - - - - - - Not connected - Bağlanamadı + Bağlanamadı - - - - - - - - - Disconnected - Bağlantı Kesildi + Bağlantı Kesildi - - - NetOn, - - - - - 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 - - - - WLAN is disconnected - Kablosuz bağlantı kesildi + Kablosuz bağlantı kesildi - - Conn Ethernet Success - Ethernet Bağlantısı Başarılı + 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ı + 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 + 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 - + WLAN parolasını doğrula @@ -2159,21 +1621,12 @@ Ayar - - - - - - Connect - Bağlan + Bağlan - - - Disconnect - Bağlantıyı Kes + Bağlantıyı Kes Input Password... @@ -2183,11 +1636,6 @@ Connect to Hidden WLAN Network Gizli WLAN Ağına Bağlan - - - Signal: - - Public Halka açık @@ -2197,59 +1645,32 @@ Güvenli - - Cancel - - - - - Property - - - - - Password Incorrect - - - - - - Forget - - - - Rate - Oran + Oran - None - Yok + Yok - WLAN Security: - WLAN güvenliği: + WLAN güvenliği: Sifnal: Sinyal gücü: - MAC: - Fiziksel adres: + Fiziksel adres: - Conn WLAN Success - WLAN Bağlantısı Başarılı + 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 + Kablosuz şifrenizi veya kablosuz kart kullanılabilirliğini onaylayın Conn WLAN Failed @@ -2268,74 +1689,44 @@ Ayar - - Connect - Bağlan + Bağlan - Disconnect - Bağlantıyı Kes + Bağlantıyı Kes - - Cancel - - - - Not connected - Bağlanamadı + Bağlanamadı - - Disconnected - Bağlantı Kesildi + Bağlantı Kesildi - - Ethernet - Kablolu Ağ + Kablolu Ağ - - NetOn, - - - - - - No Configuration - Yapılandırma Yok + Yapılandırma Yok - - No IfName - - - - IPv4: - IPv4 adresi: + IPv4 adresi: - IPv6: - IPv6 adresi: + IPv6 adresi: - BandWidth: - Bant genişliği: + Bant genişliği: - MAC: - Fiziksel adres: + Fiziksel adres: Auto @@ -2545,20 +1936,20 @@ - + Disconnect Bağlantıyı Kes - + Connect - + Forget @@ -2591,12 +1982,12 @@ - + WLAN Connected Successfully - + WLAN Disconnected Successfully @@ -2604,150 +1995,16 @@ 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: + Kimlik: - - Anonymous Identity - - - - Domain - 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 65618262..7dc3e676 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 45769660..06f4bbf6 100644 --- a/translations/kylin-nm_zh_CN.ts +++ b/translations/kylin-nm_zh_CN.ts @@ -4,187 +4,78 @@ 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地址冲突 + 正在检测ip地址冲突 - IPV4 address conflict, Please change IP - ip地址冲突,请更改ip + ip地址冲突,请更改ip - IPV6 address conflict, Please change IP - ip地址冲突,请更改ip {6 ?} - - - - Edit Network - - - - - Add Wired Network - + ip地址冲突,请更改ip {6 ?} CreatNetPage - + Connection Name 网络名称 - + Ipv4Config Ipv4配置 - + Address 地址 - + Netmask 子网掩码 - + Default Gateway 默认网关 - + Prefs DNS 首选DNS - + Alternative DNS 备选DNS - + Auto(DHCP) 自动(DHCP) - + Manual 手动 @@ -192,57 +83,57 @@ DetailPage - + Auto Connection 自动连接 - + SSID: SSID: - + Protocol: 协议: - + Security Type: 安全类型: - + Hz: 网络频带: - + Chan: - 带宽: + 网络通道: - + BandWidth: 带宽: - + IPV6: - 本地链接Ipv6地址: + 本地链接IPV6地址: - + IPV4: - Ipv4地址: + IPV4地址: - + IPV4 Dns: - Ipv4 DNS服务器: + IPV4 DNS服务器: - + Mac: 物理地址: @@ -250,1117 +141,295 @@ 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 手动 @@ -1368,83 +437,94 @@ Ipv6Page - + Ipv6Config Ipv6配置 - + Address 地址 - + Subnet prefix Length 子网前缀长度 - + Default Gateway 默认网关 - + Prefs DNS 首选DNS - + Alternative DNS 备选DNS - + Auto(DHCP) 自动 - + Manual 手动 + + LanListItem + + + Not connected + 未连接 + + + + Wired Device not carried + 未插入网线 + + LanPage - + LAN 有线网络 - + Activated LAN 已激活 - + Inactivated LAN 未激活 - LAN Disconnected Successfully - 有线网络断开 + 有线网络断开 - LAN Connected Successfully - 连接有线网络成功 + 连接有线网络成功 ListItem - + Kylin NM 麒麟网络工具 - + kylin network applet desktop message 网络提示消息 @@ -1452,555 +532,255 @@ MainWindow - - - + + kylin-nm 麒麟网络工具 - + LAN 有线网络 有线网络 - + WLAN 无线局域网 无线局域网 - + Show MainWindow 打开网络工具 - + Settings - 网络设置 - 网络设置 + 设置网络项 + 设置网络项 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 ?} + ipv4地址冲突! 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 用户名 @@ -2010,54 +790,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) @@ -2065,27 +845,27 @@ TabPage - + Current Device 当前网卡 - + Devices Closed! 设备关闭! - + Settings 网络设置 - + Kylin NM 麒麟网络工具 - + kylin network applet desktop message 网络提示消息 @@ -2093,42 +873,42 @@ WiFiConfigDialog - + Dialog - + WLAN Authentication - + Input WLAN Information Please - + WLAN ID: - + WLAN Name: - + Password: - + Cancl - + Ok @@ -2136,31 +916,31 @@ WlanListItem - + Not connected 未连接 - - + + Disconnect 断开 - - - + + + Connect 连接 - - + + Forget 忘记此网络 - + Auto Connect 自动连接 @@ -2168,32 +948,32 @@ WlanPage - + WLAN 无线局域网 - + Activated WLAN 已激活 - + Other WLAN 其他 - + More... 更多... - + WLAN Connected Successfully 连接无线网络成功 - + WLAN Disconnected Successfully 断开无线网络 @@ -2201,150 +981,56 @@ WpaWifiDialog - - Dialog - - - - - Connect WLAN - - - - - Name - - - - - Security - - - - EAP type - EAP方法 + 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证书 - - CA Files (*.pem *.der *.p12 *.crt *.cer *.pfx) - CA 证书 (*.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 - + 不需要CA证书