aboutsummaryrefslogtreecommitdiff
path: root/x11/gnomeapplets2/files/patch-wireless_wireless-applet.c
diff options
context:
space:
mode:
Diffstat (limited to 'x11/gnomeapplets2/files/patch-wireless_wireless-applet.c')
-rw-r--r--x11/gnomeapplets2/files/patch-wireless_wireless-applet.c55
1 files changed, 24 insertions, 31 deletions
diff --git a/x11/gnomeapplets2/files/patch-wireless_wireless-applet.c b/x11/gnomeapplets2/files/patch-wireless_wireless-applet.c
index 3b247a47b947..5c1e32e88b09 100644
--- a/x11/gnomeapplets2/files/patch-wireless_wireless-applet.c
+++ b/x11/gnomeapplets2/files/patch-wireless_wireless-applet.c
@@ -1,6 +1,6 @@
---- wireless/wireless-applet.c.orig Mon May 19 00:50:43 2003
-+++ wireless/wireless-applet.c Wed Aug 20 12:12:05 2003
-@@ -30,12 +30,27 @@
+--- wireless/wireless-applet.c.orig Sat Aug 23 09:10:54 2003
++++ wireless/wireless-applet.c Thu Aug 28 00:44:16 2003
+@@ -30,12 +30,25 @@
#include <math.h>
#include <dirent.h>
@@ -10,10 +10,8 @@
+#include <net/if.h>
+#include <net/if_var.h>
+#include <dev/an/if_aironet_ieee.h>
-+#if __FreeBSD_version >= 460100
+#include <dev/wi/if_wavelan_ieee.h>
+#endif
-+#endif
+
#include <gnome.h>
#include <panel-applet.h>
@@ -28,32 +26,33 @@
#define CFG_UPDATE_INTERVAL 2
typedef enum {
-@@ -93,6 +108,14 @@
+@@ -89,6 +102,12 @@
WirelessApplet *applet);
static void wireless_applet_about_cb (BonoboUIComponent *uic,
WirelessApplet *applet);
+#ifdef __FreeBSD__
+static int an_getval(WirelessApplet *applet, char *device, struct an_req *areq);
+static void get_an_data(WirelessApplet *applet, char *device, long int *level);
-+#if __FreeBSD_version >= 460100
+static int wi_getval(WirelessApplet *applet, char *device, struct wi_req *areq);
+static void get_wi_data(WirelessApplet *applet, char *device, long int *level);
+#endif
-+#endif
static const BonoboUIVerb wireless_menu_verbs [] = {
BONOBO_UI_UNSAFE_VERB ("WirelessProperties",
-@@ -150,7 +173,9 @@
+@@ -143,9 +162,11 @@
g_free (tmp);
/* Update the image */
+#ifndef __FreeBSD__
- percent = CLAMP (percent, 0, 100);
+ percent = CLAMP (percent, -1, 100);
+#endif
- if (applet->pixmaps[percent] != applet->current_pixmap)
- {
-@@ -234,6 +259,7 @@
+- if (percent < 0)
++ if (percent < 0 || percent > 100)
+ state = PIX_BROKEN;
+ else if (percent == 0)
+ state = PIX_NO_LINK;
+@@ -176,6 +197,7 @@
int percent;
/* Calculate the percentage based on the link quality */
@@ -61,7 +60,7 @@
if (level < 0) {
percent = -1;
} else {
-@@ -244,8 +270,11 @@
+@@ -186,6 +208,9 @@
percent = CLAMP (percent, 0, 100);
}
}
@@ -69,17 +68,13 @@
+ percent = (int)level;
+#endif
-- if (percent < 0) {
-+ if (percent < 0 || percent > 100) {
- applet->state = BUSTED_LINK;
- wireless_applet_animation_state (applet);
- } else if (percent == 0) {
-@@ -387,22 +416,182 @@
- applet->show_dialogs = show;
+ wireless_applet_draw (applet, percent);
+ }
+@@ -228,22 +253,179 @@
+ }
}
+#ifdef __FreeBSD__
-+#if __FreeBSD_version >= 460100
+static int
+wi_getval(WirelessApplet *applet, char *device, struct wi_req *wreq)
+{
@@ -135,7 +130,7 @@
+
+ return;
+}
-+#endif
++
+static int
+an_getval(WirelessApplet *applet, char *device, struct an_req *areq)
+{
@@ -244,7 +239,6 @@
+ wireless_applet_update_state (applet, device, 0, level, 0);
+ }
+ }
-+#if __FreeBSD_version >= 460100
+ else
+ if (g_strncasecmp(device, "wi", 2)==0) {
+ applet->devices = g_list_prepend (applet->devices, g_strdup (device));
@@ -253,13 +247,12 @@
+ wireless_applet_update_state (applet, device, 0, level, 0);
+ }
+ }
-+#endif
+ ifs++;
+#else
char *ptr;
fgets (line, 256, applet->file);
-@@ -435,6 +624,7 @@
+@@ -276,6 +458,7 @@
wireless_applet_update_state (applet, device, link, level, noise);
}
}
@@ -267,7 +260,7 @@
} while (1);
if (g_list_length (applet->devices)==1) {
-@@ -446,17 +636,23 @@
+@@ -287,17 +470,23 @@
}
/* rewind the /proc/net/wireless file */
@@ -291,7 +284,7 @@
wireless_applet_read_device_state (applet);
-@@ -522,6 +718,7 @@
+@@ -344,6 +533,7 @@
static void
start_file_read (WirelessApplet *applet)
{
@@ -299,7 +292,7 @@
applet->file = fopen ("/proc/net/wireless", "rt");
if (applet->file == NULL) {
gtk_tooltips_set_tip (applet->tips,
-@@ -530,6 +727,7 @@
+@@ -352,6 +542,7 @@
NULL);
show_error_dialog (_("There doesn't seem to be any wireless devices configured on your system.\nPlease verify your configuration if you think this is incorrect."));
}
@@ -307,7 +300,7 @@
}
static void
-@@ -775,8 +973,10 @@
+@@ -577,8 +768,10 @@
applet->prefs = NULL;
}
@@ -317,4 +310,4 @@
+#endif
}
- static GtkWidget *
+ static void