From c94b567b63537fc4f22576b0363077d053c7f075 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Jan 16 2008 05:48:15 +0000 Subject: 2.21.4 --- diff --git a/.cvsignore b/.cvsignore index 84fc298..6697a86 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -gnome-applets-2.21.2.tar.bz2 +gnome-applets-2.21.4.tar.bz2 diff --git a/gnome-applets.spec b/gnome-applets.spec index b57fd2f..ee56aea 100644 --- a/gnome-applets.spec +++ b/gnome-applets.spec @@ -34,8 +34,8 @@ Summary: Small applications for the GNOME panel Name: gnome-applets -Version: 2.21.2 -Release: 2%{?dist} +Version: 2.21.4 +Release: 1%{?dist} Epoch: 1 License: GPLv2+ and GFDL+ Group: User Interface/Desktops @@ -114,6 +114,7 @@ BuildRequires: libgnomekbd-devel >= %{libgnomekbd_version} BuildRequires: libxslt # for patch 39 BuildRequires: NetworkManager-devel +BuildRequires: libgweather-devel Requires: gnome-panel >= %{gnome_panel_version} Requires: libxklavier >= %{libxklavier_version} @@ -175,7 +176,7 @@ libraries contained in the gnome-applets package. %patch31 -p1 -b .fix-find %patch33 -p1 -b .node-leak %patch35 -p1 -b .mixer-sync -%patch39 -p1 -b .geweather-network +%patch39 -p1 -b .gweather-network %patch40 -p1 -b .battstat-null cp gswitchit/gswitchit-applet.png gswitchit/gswitchit-properties-capplet.png @@ -359,6 +360,9 @@ fi %{_libdir}/libgweather.so %changelog +* Wed Jan 16 2008 Matthias Clasen - 1:2.21.4-1 +- Update to 2.21.4 + * Sun Dec 9 2007 Matthias Clasen - 1:2.21.2-2 - Silence the %%post script diff --git a/gweather-network.patch b/gweather-network.patch index 554cd93..feb574d 100644 --- a/gweather-network.patch +++ b/gweather-network.patch @@ -1,6 +1,6 @@ -diff -up gnome-applets-2.20.0/gweather/gweather-applet.c.network gnome-applets-2.20.0/gweather/gweather-applet.c ---- gnome-applets-2.20.0/gweather/gweather-applet.c.network 2007-10-21 00:12:36.000000000 -0400 -+++ gnome-applets-2.20.0/gweather/gweather-applet.c 2007-10-21 00:12:41.000000000 -0400 +diff -up gnome-applets-2.21.2/gweather/gweather-applet.c.gweather-network gnome-applets-2.21.2/gweather/gweather-applet.c +--- gnome-applets-2.21.2/gweather/gweather-applet.c.gweather-network 2007-11-27 03:59:41.000000000 -0500 ++++ gnome-applets-2.21.2/gweather/gweather-applet.c 2008-01-05 23:05:00.000000000 -0500 @@ -29,6 +29,10 @@ #include #endif @@ -12,7 +12,7 @@ diff -up gnome-applets-2.20.0/gweather/gweather-applet.c.network gnome-applets-2 #include "gweather.h" #include "gweather-about.h" #include "gweather-pref.h" -@@ -291,6 +295,8 @@ applet_destroy (GtkWidget *widget, GWeat +@@ -288,6 +292,8 @@ applet_destroy (GtkWidget *widget, GWeat weather_info_abort (gw_applet->gweather_info); } @@ -21,7 +21,7 @@ diff -up gnome-applets-2.20.0/gweather/gweather-applet.c.network gnome-applets-2 void gweather_applet_create (GWeatherApplet *gw_applet) { AtkObject *atk_obj; -@@ -326,7 +332,7 @@ void gweather_applet_create (GWeatherApp +@@ -323,7 +329,7 @@ void gweather_applet_create (GWeatherApp g_signal_connect (GTK_OBJECT(gw_applet->applet), "button_press_event", GTK_SIGNAL_FUNC(clicked_cb), gw_applet); g_signal_connect (G_OBJECT(gw_applet->applet), "key_press_event", @@ -30,7 +30,7 @@ diff -up gnome-applets-2.20.0/gweather/gweather-applet.c.network gnome-applets-2 gtk_widget_set_tooltip_text (GTK_WIDGET(gw_applet->applet), _("GNOME Weather")); -@@ -356,9 +362,9 @@ void gweather_applet_create (GWeatherApp +@@ -353,9 +359,9 @@ void gweather_applet_create (GWeatherApp NULL); } @@ -43,25 +43,61 @@ diff -up gnome-applets-2.20.0/gweather/gweather-applet.c.network gnome-applets-2 } gint timeout_cb (gpointer data) -@@ -525,3 +531,52 @@ void gweather_update (GWeatherApplet *gw +@@ -520,3 +526,88 @@ void gweather_update (GWeatherApplet *gw update_finish, gw_applet); } } + ++static void ++state_notify (DBusPendingCall *pending, gpointer data) ++{ ++ GWeatherApplet *gw_applet = data; ++ ++ DBusMessage *msg = dbus_pending_call_steal_reply (pending); ++ ++ if (!msg) ++ return; ++ ++ if (dbus_message_get_type (msg) == DBUS_MESSAGE_TYPE_METHOD_RETURN) { ++ dbus_uint32_t result; ++ ++ if (dbus_message_get_args (msg, NULL, ++ DBUS_TYPE_UINT32, &result, ++ DBUS_TYPE_INVALID)) { ++ if (result == NM_STATE_CONNECTED) { ++ gweather_update (gw_applet); ++ } ++ } ++ } ++ ++ dbus_message_unref (msg); ++} ++ ++static void ++check_network (DBusConnection *connection, gpointer user_data) ++{ ++ DBusMessage *message; ++ DBusPendingCall *reply; ++ ++ message = dbus_message_new_method_call (NM_DBUS_SERVICE, ++ NM_DBUS_PATH, ++ NM_DBUS_INTERFACE, ++ "state"); ++ if (dbus_connection_send_with_reply (connection, message, &reply, -1)) { ++ dbus_pending_call_set_notify (reply, state_notify, user_data, NULL); ++ dbus_pending_call_unref (reply); ++ } ++ ++ dbus_message_unref (message); ++} ++ +static DBusHandlerResult +filter_func (DBusConnection *connection, DBusMessage *message, void *user_data) +{ -+ GWeatherApplet *gw_applet = user_data; -+ guint32 state = NM_DEVICE_STATE_UNKNOWN; -+ -+ if (dbus_message_is_signal (message, -+ NM_DBUS_INTERFACE_DEVICE, "StateChanged")) { -+ dbus_message_get_args (message, NULL, -+ DBUS_TYPE_UINT32, &state, -+ DBUS_TYPE_INVALID); -+ if (state == NM_DEVICE_STATE_ACTIVATED) { -+ gweather_update (gw_applet); -+ } ++ if (dbus_message_is_signal (message, ++ NM_DBUS_INTERFACE, ++ "StateChanged")) { ++ check_network (connection, user_data); + + return DBUS_HANDLER_RESULT_HANDLED; + } diff --git a/sources b/sources index 43b248f..969a690 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -2a511432e38b222dffc0909f81419503 gnome-applets-2.21.2.tar.bz2 +dba81fa85a3b238b1a3b600865c2201d gnome-applets-2.21.4.tar.bz2 ccd89d3a58076214e2f34216388c9621 gnome-applets-2.9.3.1-modemlights.tar.bz2