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:
parent
acb63c753b
commit
2087b64fef
2 changed files with 13 additions and 2 deletions
|
@ -492,6 +492,7 @@ void WpaGui::updateStatus()
|
||||||
textSsid->clear();
|
textSsid->clear();
|
||||||
textBssid->clear();
|
textBssid->clear();
|
||||||
textIpAddress->clear();
|
textIpAddress->clear();
|
||||||
|
updateTrayToolTip(tr("no status information"));
|
||||||
|
|
||||||
#ifdef CONFIG_NATIVE_WINDOWS
|
#ifdef CONFIG_NATIVE_WINDOWS
|
||||||
static bool first = true;
|
static bool first = true;
|
||||||
|
@ -539,6 +540,7 @@ void WpaGui::updateStatus()
|
||||||
} else if (strcmp(start, "ssid") == 0) {
|
} else if (strcmp(start, "ssid") == 0) {
|
||||||
ssid_updated = true;
|
ssid_updated = true;
|
||||||
textSsid->setText(pos);
|
textSsid->setText(pos);
|
||||||
|
updateTrayToolTip(pos + tr(" (associated)"));
|
||||||
} else if (strcmp(start, "ip_address") == 0) {
|
} else if (strcmp(start, "ip_address") == 0) {
|
||||||
ipaddr_updated = true;
|
ipaddr_updated = true;
|
||||||
textIpAddress->setText(pos);
|
textIpAddress->setText(pos);
|
||||||
|
@ -586,8 +588,10 @@ void WpaGui::updateStatus()
|
||||||
textStatus->clear();
|
textStatus->clear();
|
||||||
if (!auth_updated)
|
if (!auth_updated)
|
||||||
textAuthentication->clear();
|
textAuthentication->clear();
|
||||||
if (!ssid_updated)
|
if (!ssid_updated) {
|
||||||
textSsid->clear();
|
textSsid->clear();
|
||||||
|
updateTrayToolTip(tr("(not-associated)"));
|
||||||
|
}
|
||||||
if (!bssid_updated)
|
if (!bssid_updated)
|
||||||
textBssid->clear();
|
textBssid->clear();
|
||||||
if (!ipaddr_updated)
|
if (!ipaddr_updated)
|
||||||
|
@ -1271,7 +1275,6 @@ void WpaGui::createTrayIcon(bool trayOnly)
|
||||||
QApplication::setQuitOnLastWindowClosed(false);
|
QApplication::setQuitOnLastWindowClosed(false);
|
||||||
|
|
||||||
tray_icon = new QSystemTrayIcon(this);
|
tray_icon = new QSystemTrayIcon(this);
|
||||||
tray_icon->setToolTip(qAppName() + tr(" - wpa_supplicant user interface"));
|
|
||||||
if (QImageReader::supportedImageFormats().contains(QByteArray("svg")))
|
if (QImageReader::supportedImageFormats().contains(QByteArray("svg")))
|
||||||
tray_icon->setIcon(QIcon(":/icons/wpa_gui.svg"));
|
tray_icon->setIcon(QIcon(":/icons/wpa_gui.svg"));
|
||||||
else
|
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)
|
void WpaGui::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
if (eh) {
|
if (eh) {
|
||||||
|
|
|
@ -70,6 +70,7 @@ public slots:
|
||||||
virtual void showTrayMessage(QSystemTrayIcon::MessageIcon type,
|
virtual void showTrayMessage(QSystemTrayIcon::MessageIcon type,
|
||||||
int sec, const QString &msg);
|
int sec, const QString &msg);
|
||||||
virtual void showTrayStatus();
|
virtual void showTrayStatus();
|
||||||
|
virtual void updateTrayToolTip(const QString &msg);
|
||||||
virtual void wpsDialog();
|
virtual void wpsDialog();
|
||||||
virtual void peersDialog();
|
virtual void peersDialog();
|
||||||
virtual void tabChanged(int index);
|
virtual void tabChanged(int index);
|
||||||
|
|
Loading…
Reference in a new issue