Browse Source

Use less frequent polling when wpa_gui is hidden

Jouni Malinen 16 years ago
parent
commit
64a6f69362
1 changed files with 8 additions and 0 deletions
  1. 8 0
      wpa_supplicant/wpa_gui-qt4/wpagui.cpp

+ 8 - 0
wpa_supplicant/wpa_gui-qt4/wpagui.cpp

@@ -702,6 +702,14 @@ void WpaGui::ping()
 		updateStatus();
 		updateNetworks();
 	}
+
+#ifndef CONFIG_CTRL_IFACE_NAMED_PIPE
+	/* Use less frequent pings and status updates when the main window is
+	 * hidden (running in taskbar). */
+	int interval = isHidden() ? 5000 : 1000;
+	if (timer->interval() != interval)
+		timer->setInterval(interval);
+#endif /* CONFIG_CTRL_IFACE_NAMED_PIPE */
 }