Browse Source

Use notify-send for notifications

wpa_supplicant
mid-kid 7 years ago
parent
commit
56ad6fae0b
  1. 2
      config/wpa_gui.desktop
  2. 27
      patches/wpa_supplicant-2.5-notify.patch
  3. 3
      wpa_supplicant.SlackBuild

2
config/wpa_gui.desktop

@ -1,7 +1,7 @@
[Desktop Entry] [Desktop Entry]
Name=wpa_gui Name=wpa_gui
Comment[en]=Wpa_supplicant management Comment[en]=Wpa_supplicant management
Exec=kdesu wpa_gui Exec=wpa_gui
Icon=wpa_gui Icon=wpa_gui
Type=Application Type=Application
Categories=Qt;Network; Categories=Qt;Network;

27
patches/wpa_supplicant-2.5-notify.patch

@ -0,0 +1,27 @@
diff -Nur ../wpa_supplicant-2.5/wpa_supplicant/wpa_gui-qt4/wpagui.cpp ./wpa_supplicant/wpa_gui-qt4/wpagui.cpp
--- ../wpa_supplicant-2.5/wpa_supplicant/wpa_gui-qt4/wpagui.cpp 2015-09-27 21:02:05.000000000 +0200
+++ ./wpa_supplicant/wpa_gui-qt4/wpagui.cpp 2016-10-11 21:34:31.043783564 +0200
@@ -10,6 +10,7 @@
#include <windows.h>
#endif /* CONFIG_NATIVE_WINDOWS */
+#include <stdlib.h>
#include <cstdio>
#include <unistd.h>
#include <QMessageBox>
@@ -1415,13 +1416,10 @@
void WpaGui::showTrayMessage(QSystemTrayIcon::MessageIcon type, int sec,
const QString & msg)
{
- if (!QSystemTrayIcon::supportsMessages())
+ if (isVisible() || quietMode)
return;
- if (isVisible() || !tray_icon || !tray_icon->isVisible() || quietMode)
- return;
-
- tray_icon->showMessage(qAppName(), msg, type, sec * 1000);
+ system(("notify-send -a " + qAppName() + " -t " + QString::number(sec * 1000) + " '" + qAppName() + "' '" + msg + "'").toStdString().c_str());
}

3
wpa_supplicant.SlackBuild

@ -96,6 +96,9 @@ cat $CWD/patches/quiet-scan-results-message.diff | patch -p1 --verbose || exit 1
cat $CWD/patches/assoc-timeout.diff | patch -p1 --verbose || exit 1 cat $CWD/patches/assoc-timeout.diff | patch -p1 --verbose || exit 1
cat $CWD/patches/flush-debug-output.diff | patch -p1 --verbose || exit 1 cat $CWD/patches/flush-debug-output.diff | patch -p1 --verbose || exit 1
# Use notify-send for notifications
cat $CWD/patches/wpa_supplicant-2.5-notify.patch | patch -p0 --verbose || exit 1
cd wpa_supplicant cd wpa_supplicant
# Create the configuration file for building wpa_supplicant: # Create the configuration file for building wpa_supplicant:

Loading…
Cancel
Save