Added func connectableWifiPriorityList,and added some resources

This commit is contained in:
andrew-wuhan-huawei-990-pc 2021-03-22 21:00:26 +08:00
parent 526f120acd
commit 964ae308d1
14 changed files with 52 additions and 7 deletions

View File

@ -79,5 +79,15 @@
<file>res/s/conning-s/12.png</file>
<file>res/x/setup.png</file>
<file>res/x/control.svg</file>
<file>res/w/wifi6-full-pwd.png</file>
<file>res/w/wifi6-full.png</file>
<file>res/w/wifi6-high-pwd.png</file>
<file>res/w/wifi6-high.png</file>
<file>res/w/wifi6-low-pwd.png</file>
<file>res/w/wifi6-low.png</file>
<file>res/w/wifi6-medium-pwd.png</file>
<file>res/w/wifi6-medium.png</file>
<file>res/w/wifi6-none.png</file>
<file>res/w/wifi6-null-pwd.png</file>
</qresource>
</RCC>

BIN
res/w/wifi6-full-pwd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

BIN
res/w/wifi6-full.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 711 B

BIN
res/w/wifi6-high-pwd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 B

BIN
res/w/wifi6-high.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 765 B

BIN
res/w/wifi6-low-pwd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 804 B

BIN
res/w/wifi6-low.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 755 B

BIN
res/w/wifi6-medium-pwd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 814 B

BIN
res/w/wifi6-medium.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 765 B

BIN
res/w/wifi6-none.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

BIN
res/w/wifi6-null-pwd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 783 B

View File

@ -55,7 +55,6 @@ void LoadingDiv::switchAnimStep()
if (this->currentPage > 12) {
this->currentPage = 1; //循环播放
}
this->countCurrentTime += FRAMESPEED;
if (this->countCurrentTime >= ALLTIME) {
emit this->toStopLoading(); //发出信号停止主界面和托盘区的等待动画

View File

@ -1807,16 +1807,51 @@ void MainWindow::wifiListOptimize(QStringList& slist)
}
}
if(ifContinue) continue;
// if(conFreq < 5000)
// apSignalSet[conName+"2.4"] = conSignal;
// else
// apSignalSet[conName+"5"] = conSignal;
targetList<<i;
}
slist = targetList;
return ;
}
QStringList MainWindow::connectableWifiPriorityList(const QStringList slist){
QStringList target;
if(!slist.size()) return target;
OneConnForm *ocf = new OneConnForm();
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 tmp = slist;
for(int i=1;i<tmp.size();i++){
QString line = tmp.at(i);
QString name = line.mid(indexName).trimmed();
int freq = line.mid(indexFreq,4).trimmed().toInt();
int signal = line.mid(indexSignal,3).trimmed().toInt();
if(freq >= 5000 && ocf->isWifiConfExist(name) && signal > 55){ //两格以上有配置的5Gwifi中选择信号最佳的
target << line;
tmp.removeAt(i);
}
}
for(QString i:tmp){
QString name = i.mid(indexName).trimmed();
if(ocf->isWifiConfExist(name)){
target<<i;
}
}
return target;
}
// 加载wifi列表
void MainWindow::loadWifiListDone(QStringList slist)
{

View File

@ -169,8 +169,8 @@ public:
int is_fly_mode_on = 0; //是否已经打开飞行模式
int is_hot_sopt_on = 0; //是否已经打开热点
int is_connect_hide_wifi = 0; //是否正在连接隐藏wifi
QString currSelNetName = ""; //当前ScrollArea中选中的网络名称
QString currConnIfname = ""; //当前连接的有线网对应网卡名称,只有一个有线网连接的情况
int currSelNetNum = 0; //当前选中的item序号
bool isLanBeConnUp = false; //lan是否连接上
@ -290,6 +290,7 @@ private:
QString oldActLanName = ""; //上一次获取的已连接有线网名称
int oldDbusActLanDNS = 0; //上一次获取的已连接有线网的DNS代号
void wifiListOptimize(QStringList& slist); //只保留同名同频信号最强AP
QStringList connectableWifiPriorityList(const QStringList slist); //可连接wifi优先级列表
//循环检测网络连接状态
QTimer *iconTimer = nullptr;
QTimer *wiredCableUpTimer = nullptr;