From 9c872cd24e3a2ebed693522c476076ac0de42d26 Mon Sep 17 00:00:00 2001 From: andrew-wuhan-huawei-990-pc Date: Wed, 3 Mar 2021 11:50:24 +0800 Subject: [PATCH 1/4] Wifi list optimized.Only the strongest AP reserved --- kylin-nm.pro.user | 314 +++++++++++++++++++++++++++++++++++++++++++++ src/mainwindow.cpp | 59 +++++++++ src/mainwindow.h | 2 +- 3 files changed, 374 insertions(+), 1 deletion(-) create mode 100644 kylin-nm.pro.user diff --git a/kylin-nm.pro.user b/kylin-nm.pro.user new file mode 100644 index 00000000..fe408f94 --- /dev/null +++ b/kylin-nm.pro.user @@ -0,0 +1,314 @@ + + + + + + EnvironmentId + {6c64315c-325f-436a-81aa-84425f75d544} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + 桌面 + 桌面 + {43a40bb2-faa1-4471-b06f-c7adca98b40b} + 0 + 0 + 0 + + /home/kylin/build-kylin-nm-unknown-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + /home/kylin/build-kylin-nm-unknown-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + /home/kylin/build-kylin-nm-unknown-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 036e1c28..e7f812b7 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1759,6 +1759,65 @@ void MainWindow::getConnListDone(QStringList slist) return; } } +void MainWindow::wifiListOptimize(QStringList& slist) +{ + QString headLine = slist.at(0); + int indexSignal,indexSecu, indexFreq, indexBSsid, indexName; + headLine = headLine.trimmed(); + + bool isChineseExist = headLine.contains(QRegExp("[\\x4e00-\\x9fa5]+")); + if (isChineseExist) { + indexSignal = headLine.indexOf("SIGNAL"); + indexSecu = headLine.indexOf("安全性"); + indexFreq = headLine.indexOf("频率") + 4; + indexBSsid = headLine.indexOf("BSSID") + 6; + indexName = indexBSsid + 19; + } else { + indexSignal = headLine.indexOf("SIGNAL"); + indexSecu = headLine.indexOf("SECURITY"); + indexFreq = headLine.indexOf("FREQ"); + indexBSsid = headLine.indexOf("BSSID"); + indexName = indexBSsid + 19; + } + + QStringList targetList; //slist优化,同名同频AP中只留信号最强 + targetList<= 5000 && freq >= 5000){ + if(conSignal < signal){ + ifContinue = true; + break; + } + } + } + } + if(ifContinue) continue; +// if(conFreq < 5000) +// apSignalSet[conName+"2.4"] = conSignal; +// else +// apSignalSet[conName+"5"] = conSignal; + targetList< Date: Wed, 3 Mar 2021 11:57:00 +0800 Subject: [PATCH 2/4] remove temporary files --- kylin-nm.pro.user | 314 ---------------------------------------------- 1 file changed, 314 deletions(-) delete mode 100644 kylin-nm.pro.user diff --git a/kylin-nm.pro.user b/kylin-nm.pro.user deleted file mode 100644 index fe408f94..00000000 --- a/kylin-nm.pro.user +++ /dev/null @@ -1,314 +0,0 @@ - - - - - - EnvironmentId - {6c64315c-325f-436a-81aa-84425f75d544} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - - ProjectExplorer.Project.Target.0 - - 桌面 - 桌面 - {43a40bb2-faa1-4471-b06f-c7adca98b40b} - 0 - 0 - 0 - - /home/kylin/build-kylin-nm-unknown-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - /home/kylin/build-kylin-nm-unknown-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - /home/kylin/build-kylin-nm-unknown-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - From f281dcf787358205fe1d78b95037faaf6eae6ddd Mon Sep 17 00:00:00 2001 From: andrew-wuhan-huawei-990-pc Date: Wed, 3 Mar 2021 15:17:45 +0800 Subject: [PATCH 3/4] Fix UI occlusion --- src/wpawifidialog.cpp | 4 ++-- translations/kylin-nm_zh_CN.qm | Bin 22244 -> 22223 bytes translations/kylin-nm_zh_CN.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wpawifidialog.cpp b/src/wpawifidialog.cpp index 23d4f719..11e46018 100644 --- a/src/wpawifidialog.cpp +++ b/src/wpawifidialog.cpp @@ -112,7 +112,7 @@ void WpaWifiDialog::initUI() { nameEditor = new QLineEdit(nameFrame); nameEditor->setFixedHeight(48); nameLabel->setFixedWidth(100); - nameLabel->setText(tr("Connection name")); + nameLabel->setText(tr("Name")); nameEditor->setText(connectionName); if (connectionName == "") { //添加隐藏wifi时 @@ -165,7 +165,7 @@ void WpaWifiDialog::initUI() { innerCombox = new QComboBox(innerFrame); innerCombox->setFixedHeight(48); innerLabel->setFixedWidth(100); - innerLabel->setText(tr("inner authentication")); + innerLabel->setText(tr("Inner auth")); innerLyt->addWidget(innerLabel); innerLyt->addWidget(innerCombox); innerFrame->setLayout(innerLyt); diff --git a/translations/kylin-nm_zh_CN.qm b/translations/kylin-nm_zh_CN.qm index b77540402a3f6a158465fd8bad6792a0248019c1..9b07eadd444b2e895d5388eda29d0279c3cb5e60 100644 GIT binary patch delta 176 zcmaE|mht>r#tH6h9;OTo-gy&U(;4SXTsxhycd{#^Cwolb76t|%mCbV*%^4Z*ZNAEs z&dA6x*_K6da~g{sBjb_DOIhbLMsIdyt7laF!hOQ`2m^!7eD2e8PckqVZs!qslEA>g z)X(GG`2uLR$>zK4M;IA(H!tF3@t%A?#ANc4FbQrh&%C_UB89}#l8nh0!-OY=u}m%q aVV%4>gqM}YFEKY2CU{LvbhAci1tS1sayzO3 delta 172 zcmV;d08{_ZtpVh%0gy+LPh|mZk+qirUXx7$Ne@n_l>h)s00CT4v;Y80^|PG;Hvs{! zv(*A;0RcIaJp>^Kd#ru{08IX~T?9V?0hN=T1)l*dvpoiX0RhF6y$2by-Uq`00YbB) z2?R@%a8w188C4As4?}NmZe?S1X>V>IZeeX@l2jLyrc^YO)+QCRS5 - Connection name + Name 连接名称 @@ -1786,7 +1786,7 @@ - inner authentication + Inner auth 阶段2身份验证 From 0490e2919f1ad9f0c0667d8dab77e1b13c31f711 Mon Sep 17 00:00:00 2001 From: andrew-wuhan-huawei-990-pc Date: Wed, 3 Mar 2021 16:47:20 +0800 Subject: [PATCH 4/4] Fix bug#39000 limited lineedit max length --- kylin-nm.pro.user | 315 ++++++++++++++++++++++++++++++++++++++++++++++ src/confform.ui | 3 + src/mainwindow.h | 2 +- 3 files changed, 319 insertions(+), 1 deletion(-) create mode 100644 kylin-nm.pro.user diff --git a/kylin-nm.pro.user b/kylin-nm.pro.user new file mode 100644 index 00000000..24dbf217 --- /dev/null +++ b/kylin-nm.pro.user @@ -0,0 +1,315 @@ + + + + + + EnvironmentId + {6c64315c-325f-436a-81aa-84425f75d544} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + 桌面 + 桌面 + {43a40bb2-faa1-4471-b06f-c7adca98b40b} + 0 + 0 + 0 + + /home/kylin/build-kylin-nm-unknown-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + /home/kylin/build-kylin-nm-unknown-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + /home/kylin/build-kylin-nm-unknown-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + kylin-nm2 + Qt4ProjectManager.Qt4RunConfiguration:/home/kylin/桌面/kylin-nm/kylin-nm.pro + /home/kylin/桌面/kylin-nm/kylin-nm.pro + + false + + false + true + true + false + false + true + + /home/kylin/build-kylin-nm-unknown-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/src/confform.ui b/src/confform.ui index b4526a40..30a4f156 100644 --- a/src/confform.ui +++ b/src/confform.ui @@ -315,6 +315,9 @@ 10 + + 20 + diff --git a/src/mainwindow.h b/src/mainwindow.h index 0873de5b..2640a13a 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -289,7 +289,7 @@ private: QString lastAddedConn = ""; QString oldActLanName = ""; //上一次获取的已连接有线网名称 int oldDbusActLanDNS = 0; //上一次获取的已连接有线网的DNS代号 - void wifiListOptimize(QString& slist); //只保留同名同频信号最强AP + void wifiListOptimize(QStringList& slist); //只保留同名同频信号最强AP //循环检测网络连接状态 QTimer *iconTimer = nullptr; QTimer *wiredCableUpTimer = nullptr;