wpa_gui: More informative tray icon tool tip message

Show associated network SSID in the tool tip message of the
application's tray icon. When network is not associated, then simple
"(not-associated)" message is shown.

Signed-off-by: Arkadiusz Bokowy <arkadiusz.bokowy@gmail.com>
This commit is contained in:
Arkadiusz (Arkq) Bokowy 2014-12-06 17:02:18 +01:00 committed by Jouni Malinen
parent acb63c753b
commit 2087b64fef
2 changed files with 13 additions and 2 deletions

View File

@ -492,6 +492,7 @@ void WpaGui::updateStatus()
textSsid->clear();
textBssid->clear();
textIpAddress->clear();
updateTrayToolTip(tr("no status information"));
#ifdef CONFIG_NATIVE_WINDOWS
static bool first = true;
@ -539,6 +540,7 @@ void WpaGui::updateStatus()
} else if (strcmp(start, "ssid") == 0) {
ssid_updated = true;
textSsid->setText(pos);
updateTrayToolTip(pos + tr(" (associated)"));
} else if (strcmp(start, "ip_address") == 0) {
ipaddr_updated = true;
textIpAddress->setText(pos);
@ -586,8 +588,10 @@ void WpaGui::updateStatus()
textStatus->clear();
if (!auth_updated)
textAuthentication->clear();
if (!ssid_updated)
if (!ssid_updated) {
textSsid->clear();
updateTrayToolTip(tr("(not-associated)"));
}
if (!bssid_updated)
textBssid->clear();
if (!ipaddr_updated)
@ -1271,7 +1275,6 @@ void WpaGui::createTrayIcon(bool trayOnly)
QApplication::setQuitOnLastWindowClosed(false);
tray_icon = new QSystemTrayIcon(this);
tray_icon->setToolTip(qAppName() + tr(" - wpa_supplicant user interface"));
if (QImageReader::supportedImageFormats().contains(QByteArray("svg")))
tray_icon->setIcon(QIcon(":/icons/wpa_gui.svg"));
else
@ -1408,6 +1411,13 @@ void WpaGui::showTrayStatus()
}
void WpaGui::updateTrayToolTip(const QString &msg)
{
if (tray_icon)
tray_icon->setToolTip(msg);
}
void WpaGui::closeEvent(QCloseEvent *event)
{
if (eh) {

View File

@ -70,6 +70,7 @@ public slots:
virtual void showTrayMessage(QSystemTrayIcon::MessageIcon type,
int sec, const QString &msg);
virtual void showTrayStatus();
virtual void updateTrayToolTip(const QString &msg);
virtual void wpsDialog();
virtual void peersDialog();
virtual void tabChanged(int index);