mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-30 11:02:19 +08:00
qt ui: don't refresh wifi widget if it is not visible (#19876)
Co-authored-by: Comma Device <device@comma.ai> old-commit-hash: 621a6c16a462fabc4a0696695a1797f8bf5db093
This commit is contained in:
@@ -100,7 +100,11 @@ Networking::Networking(QWidget* parent) : QWidget(parent){
|
||||
}
|
||||
|
||||
void Networking::refresh(){
|
||||
if(!this->isVisible()){
|
||||
return;
|
||||
}
|
||||
wifiWidget->refresh();
|
||||
an->refresh();
|
||||
}
|
||||
|
||||
void Networking::connectToNetwork(Network n) {
|
||||
@@ -255,11 +259,6 @@ AdvancedNetworking::AdvancedNetworking(QWidget* parent, WifiManager* wifi): QWid
|
||||
s->addWidget(settingsWidget);
|
||||
s->setCurrentIndex(1);
|
||||
setLayout(s);
|
||||
|
||||
// Update network status
|
||||
QTimer* timer = new QTimer(this);
|
||||
QObject::connect(timer, SIGNAL(timeout()), this, SLOT(refresh()));
|
||||
timer->start(5000);
|
||||
}
|
||||
|
||||
void AdvancedNetworking::refresh(){
|
||||
|
||||
@@ -58,7 +58,7 @@ signals:
|
||||
void closeKeyboard();
|
||||
void backPress();
|
||||
|
||||
private slots:
|
||||
public slots:
|
||||
void receiveText(QString text);
|
||||
void abortTextInput();
|
||||
void toggleTethering(int enable);
|
||||
|
||||
Reference in New Issue
Block a user