2019-10-31 09:56:53 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ONECONNFORM_H
|
|
|
|
#define ONECONNFORM_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QScreen>
|
|
|
|
#include <QThread>
|
|
|
|
#include <QDialog>
|
2019-12-03 19:55:20 +08:00
|
|
|
#include <QLineEdit>
|
|
|
|
#include <QShortcut>
|
|
|
|
#include <QKeyEvent>
|
2019-10-31 09:56:53 +08:00
|
|
|
|
|
|
|
#include "confform.h"
|
|
|
|
#include "kylin-network-interface.h"
|
|
|
|
#include "backthread.h"
|
|
|
|
#include "ksimplenm.h"
|
|
|
|
|
|
|
|
class MainWindow;
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class OneConnForm;
|
|
|
|
}
|
|
|
|
|
|
|
|
class OneConnForm : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit OneConnForm(QWidget *parent = 0, MainWindow *mw = 0, ConfForm *confForm = 0, KSimpleNM *ksnm = 0);
|
|
|
|
~OneConnForm();
|
|
|
|
|
2020-02-18 14:01:09 +08:00
|
|
|
void setSignal(QString lv, QString secu);
|
2019-10-31 09:56:53 +08:00
|
|
|
void setName(QString name);
|
|
|
|
void setSpecialName(QString name);
|
|
|
|
QString getName();
|
|
|
|
void setRate(QString rate);
|
2020-02-21 08:50:52 +08:00
|
|
|
void setLine(bool isShow);
|
2020-02-18 14:01:09 +08:00
|
|
|
void setWifiInfo(QString str1, QString str2, QString str3);
|
2019-10-31 09:56:53 +08:00
|
|
|
|
2020-02-24 14:21:40 +08:00
|
|
|
void setSelected(bool isSelected, bool isCurrName);
|
2020-02-18 14:01:09 +08:00
|
|
|
void setHideItem(bool isHideItem, bool isShowHideBtn);
|
|
|
|
void setTopItem(bool isSelected);
|
2019-10-31 09:56:53 +08:00
|
|
|
void setAct(bool isAct);
|
|
|
|
|
2020-02-18 14:01:09 +08:00
|
|
|
void setConnedString(bool showLable, QString str, QString str1);
|
2019-10-31 09:56:53 +08:00
|
|
|
|
2020-02-25 18:06:53 +08:00
|
|
|
void setLePassword();
|
|
|
|
|
2019-10-31 09:56:53 +08:00
|
|
|
QString wifiName;
|
|
|
|
bool isSelected;
|
|
|
|
bool isActive;
|
2020-02-18 14:01:09 +08:00
|
|
|
bool isConnected;
|
2019-10-31 09:56:53 +08:00
|
|
|
int signalLv;
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void selectedOneWifiForm(QString wifiName);
|
|
|
|
void connDone(int connFlag);
|
|
|
|
void disconnActiveWifi();
|
|
|
|
|
|
|
|
void sigConnWifi(QString);
|
|
|
|
void sigConnWifiPWD(QString, QString);
|
|
|
|
|
|
|
|
protected:
|
2020-01-09 16:32:16 +08:00
|
|
|
void mousePressEvent(QMouseEvent *event);
|
2020-02-18 14:01:09 +08:00
|
|
|
bool eventFilter(QObject *obj, QEvent *event);
|
2019-10-31 09:56:53 +08:00
|
|
|
|
|
|
|
private slots:
|
2020-01-09 16:32:16 +08:00
|
|
|
void on_btnConn_clicked();
|
2019-10-31 09:56:53 +08:00
|
|
|
void on_btnDisConn_clicked();
|
|
|
|
|
|
|
|
void slotConnWifi();
|
|
|
|
void slotConnWifiPWD();
|
2020-01-09 16:32:16 +08:00
|
|
|
void slotConnWifiResult(int connFlag);
|
2019-10-31 09:56:53 +08:00
|
|
|
|
|
|
|
void on_btnConnPWD_clicked();
|
|
|
|
|
|
|
|
void on_btnHideConn_clicked();
|
|
|
|
|
2019-11-29 17:55:39 +08:00
|
|
|
void on_checkBoxPwd_stateChanged(int arg1);
|
|
|
|
|
2020-02-18 14:01:09 +08:00
|
|
|
void on_lePassword_textEdited(const QString &arg1);
|
|
|
|
|
|
|
|
void on_btnConnSub_clicked();
|
|
|
|
|
2020-02-21 17:19:51 +08:00
|
|
|
void waitAnimStep();
|
|
|
|
void startWaiting(bool isConn);
|
|
|
|
void stopWaiting();
|
|
|
|
|
2019-10-31 09:56:53 +08:00
|
|
|
private:
|
2020-02-21 17:19:51 +08:00
|
|
|
QTimer *waitTimer;
|
|
|
|
int waitPage;
|
|
|
|
bool isWaiting = false;
|
|
|
|
|
2019-10-31 09:56:53 +08:00
|
|
|
Ui::OneConnForm *ui;
|
|
|
|
MainWindow *mw;
|
|
|
|
ConfForm *cf;
|
|
|
|
KSimpleNM *ks;
|
2020-02-18 14:01:09 +08:00
|
|
|
bool hasPwd;
|
2019-10-31 09:56:53 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ONECONNFORM_H
|