mirror of
https://github.com/Quill-OS/quill.git
synced 2024-12-28 08:37:22 -08:00
Wi-Fi: Auto-connect on wake-up things
This commit is contained in:
parent
ae25446924
commit
1aca2ba615
2 changed files with 26 additions and 3 deletions
|
@ -65,6 +65,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
global::usbms::koboxExportExtensions = false;
|
global::usbms::koboxExportExtensions = false;
|
||||||
global::mainwindow::tabSwitcher::repaint = true;
|
global::mainwindow::tabSwitcher::repaint = true;
|
||||||
resetFullWindowException = false;
|
resetFullWindowException = false;
|
||||||
|
wifiIconClickedWhileReconnecting = false;
|
||||||
|
|
||||||
// Getting the screen's size
|
// Getting the screen's size
|
||||||
sW = QGuiApplication::screens()[0]->size().width();
|
sW = QGuiApplication::screens()[0]->size().width();
|
||||||
|
@ -924,7 +925,7 @@ void MainWindow::updateWifiIcon(int mode) {
|
||||||
*/
|
*/
|
||||||
if(mode == 0) {
|
if(mode == 0) {
|
||||||
QTimer *wifiIconTimer = new QTimer(this);
|
QTimer *wifiIconTimer = new QTimer(this);
|
||||||
wifiIconTimer->setInterval(60000);
|
wifiIconTimer->setInterval(10000);
|
||||||
connect(wifiIconTimer, SIGNAL(timeout()), this, SLOT(setWifiIcon()));
|
connect(wifiIconTimer, SIGNAL(timeout()), this, SLOT(setWifiIcon()));
|
||||||
wifiIconTimer->start();
|
wifiIconTimer->start();
|
||||||
}
|
}
|
||||||
|
@ -988,9 +989,25 @@ void MainWindow::setWifiIcon() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::openWifiDialog() {
|
void MainWindow::openWifiDialog() {
|
||||||
|
if(checkconfig("/external_root/run/was_connected_to_wifi") == true and wifiIconClickedWhileReconnecting == false) {
|
||||||
|
showToast("Reconnection in progress\nTap again to cancel");
|
||||||
|
wifiIconClickedWhileReconnecting = true;
|
||||||
|
QTimer::singleShot(10000, this, SLOT(resetWifiIconClickedWhileReconnecting()));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(wifiIconClickedWhileReconnecting == true) {
|
||||||
|
string_writeconfig("/opt/ibxd", "stop_wifi_reconnection\n");
|
||||||
|
while(true) {
|
||||||
|
if(QFile::exists("/run/stop_wifi_reconnection_done")) {
|
||||||
|
QFile::remove("/run/stop_wifi_reconnection_done");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
global::toast::wifiToast = true;
|
global::toast::wifiToast = true;
|
||||||
showToast("Searching for networks");
|
showToast("Searching for networks");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::on_wifiBtn_clicked()
|
void MainWindow::on_wifiBtn_clicked()
|
||||||
{
|
{
|
||||||
|
@ -1145,3 +1162,7 @@ void MainWindow::checkForOtaUpdate() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::resetWifiIconClickedWhileReconnecting() {
|
||||||
|
wifiIconClickedWhileReconnecting = false;
|
||||||
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ public:
|
||||||
bool existing_recent_books = false;
|
bool existing_recent_books = false;
|
||||||
bool reboot_after_update = false;
|
bool reboot_after_update = false;
|
||||||
bool resetFullWindowException;
|
bool resetFullWindowException;
|
||||||
|
bool wifiIconClickedWhileReconnecting;
|
||||||
int timerTime = 0;
|
int timerTime = 0;
|
||||||
QString relative_path;
|
QString relative_path;
|
||||||
QString usbmsStatus;
|
QString usbmsStatus;
|
||||||
|
@ -96,6 +97,7 @@ private slots:
|
||||||
void resetWindow(bool resetStackedWidget);
|
void resetWindow(bool resetStackedWidget);
|
||||||
void resetFullWindow();
|
void resetFullWindow();
|
||||||
void setRecentBooksLabelsTruncateTreshold();
|
void setRecentBooksLabelsTruncateTreshold();
|
||||||
|
void resetWifiIconClickedWhileReconnecting();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow * ui;
|
Ui::MainWindow * ui;
|
||||||
|
|
Loading…
Reference in a new issue