Skip to content

Commit

Permalink
Ensure that networks are still loaded after an application exits, or …
Browse files Browse the repository at this point in the history
…you toggle the wifi
  • Loading branch information
Eeems committed Sep 7, 2020
1 parent 747da3c commit 9c49b27
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 2 additions & 0 deletions applications/oxide/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class Controller : public QObject
return false;
}
wifiManager = WifiManager::singleton();
}else{
wifiManager->loadNetworks();
}
return true;
};
Expand Down
21 changes: 12 additions & 9 deletions applications/oxide/wifimanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@ class WifiManager : public DBusInterface
: DBusInterface(SERVICE, path, SERVICE + ".Interface", connection),
xochitlSettings("/home/root/.config/remarkable/xochitl.conf", QSettings::IniFormat) {
// this->connection().connect("fi.w1.wpa_supplicant1", wlan0Path, "fi.w1.wpa_supplicant1.Interface", "ScanDone", this, SLOT(scanDone()));
loadNetworks();
};
~WifiManager() {};
void waitForScan(){
while(Scanning()){
usleep(1000);
}
}
bool isConnected(){
return CurrentNetwork()->getPath().path() != "/";
}
void loadNetworks(){
xochitlSettings.sync();
xochitlSettings.beginGroup("wifinetworks");
QList<QVariantMap> networks;
Expand All @@ -194,15 +206,6 @@ class WifiManager : public DBusInterface
qDebug() << "Registered network " + network->SSID();
network->setEnabled(true);
}
};
~WifiManager() {};
void waitForScan(){
while(Scanning()){
usleep(1000);
}
}
bool isConnected(){
return CurrentNetwork()->getPath().path() != "/";
}
void Scan(bool active = false){
QMap<QString, QVariant> args;
Expand Down

0 comments on commit 9c49b27

Please sign in to comment.