Hello community,
here is the log from the commit of package gnome-main-menu
checked in at Thu Jan 10 15:21:24 CET 2008.
--------
--- GNOME/gnome-main-menu/gnome-main-menu.changes 2007-11-06 00:45:07.000000000 +0100
+++ /mounts/work_src_done/STABLE/gnome-main-menu/gnome-main-menu.changes 2007-12-24 18:38:25.000000000 +0100
@@ -1,0 +2,5 @@
+Mon Dec 24 18:38:17 CET 2007 - sreeves@suse.de
+
+- Use NetworkManager 0.7
+
+-------------------------------------------------------------------
New:
----
gnome-main-menu_to_NM7.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gnome-main-menu.spec ++++++
--- /var/tmp/diff_new_pack.XS2173/_old 2008-01-10 15:20:07.000000000 +0100
+++ /var/tmp/diff_new_pack.XS2173/_new 2008-01-10 15:20:07.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package gnome-main-menu (Version 0.9.8)
#
-# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
@@ -19,12 +19,13 @@
Group: System/GUI/GNOME
AutoReqProv: on
Version: 0.9.8
-Release: 120
+Release: 142
Summary: The GNOME Desktop Menu
Source: %{name}-%{version}.tar.gz
Source1: system-items-opensuse.xbel
Patch: gnome-main-menu-misplaced-system-desktop-files.patch
Patch1: gnome-main-menu-BNC136622.patch
+Patch2: gnome-main-menu_to_NM7.patch
Url: http://www.gnome.org
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: gnome-panel dbus-1-glib hal tango-icon-theme wireless-tools libssui
@@ -79,9 +80,11 @@
%setup -n gnome-main-menu-%{version}
%patch -p1
%patch1 -p0
+%patch2 -p0
cp -f %{S:1} main-menu/etc/system-items.xbel
%build
+autoreconf -f -i
export CFLAGS="$RPM_OPT_FLAGS"
%configure \
--libexecdir=%{_prefix}/lib/%{name} \
@@ -147,7 +150,10 @@
%defattr (-, root, root)
%{_prefix}/%{_lib}/nautilus/extensions-1.0/*.so
%{_prefix}/%{_lib}/nautilus/extensions-1.0/*.la
+
%changelog
+* Mon Dec 24 2007 - sreeves@suse.de
+- Use NetworkManager 0.7
* Tue Nov 06 2007 - sreeves@suse.de
- Dont show lock screen option when logged in as root - BNC #136622
* Thu Oct 11 2007 - sbrabec@suse.cz
++++++ gnome-main-menu_to_NM7.patch ++++++
Index: configure.in
===================================================================
--- configure.in (revision 372)
+++ configure.in (working copy)
@@ -43,7 +43,7 @@
AC_SUBST(LIBSLAB_CFLAGS)
AC_SUBST(LIBSLAB_LIBS)
-PKG_CHECK_MODULES(MAIN_MENU, [ $COMMON_MODULES libpanelapplet-2.0 gnome-desktop-2.0 gconf-2.0 libgtop-2.0 libgnome-2.0 libgnomeui-2.0 dbus-glib-1 NetworkManager hal-storage cairo ])
+PKG_CHECK_MODULES(MAIN_MENU, [ $COMMON_MODULES libpanelapplet-2.0 gnome-desktop-2.0 gconf-2.0 libgtop-2.0 libgnome-2.0 libgnomeui-2.0 dbus-glib-1 NetworkManager libnm_glib hal-storage cairo ])
AC_CHECK_HEADERS(iwlib.h, [ AC_CHECK_LIB(iw, iw_sockets_open, have_iwlib=yes, have_iwlib=no)], have_iwlib=no)
Index: main-menu/src/network-status-agent.c
===================================================================
--- main-menu/src/network-status-agent.c (revision 372)
+++ main-menu/src/network-status-agent.c (working copy)
@@ -21,7 +21,12 @@
#include "network-status-agent.h"
#include
+#include
#include
+#include
+#include
+#include
+#include
#include
#include
#include
@@ -33,9 +38,7 @@
typedef struct
{
- DBusGConnection *nm_conn;
- DBusGProxy *nm_proxy;
-
+ NMClient * nm_client;
guint state_curr;
} NetworkStatusAgentPrivate;
@@ -46,14 +49,10 @@
static void init_nm_connection (NetworkStatusAgent *);
static NetworkStatusInfo *nm_get_first_active_device_info (NetworkStatusAgent *);
-static GList *nm_get_devices (NetworkStatusAgent *);
-static NetworkStatusInfo *nm_get_device_info (NetworkStatusAgent *, DBusGProxy *);
+static NetworkStatusInfo *nm_get_device_info (NetworkStatusAgent *, NMDevice *);
-static void nm_state_change_cb (DBusGProxy *, guint, gpointer);
-static DBusHandlerResult nm_message_filter (DBusConnection *, DBusMessage *, gpointer);
+static void nm_state_change_cb (NMDevice *device, NMDeviceState state, gpointer user_data);
-static gboolean string_is_valid_dbus_path (const gchar *);
-
static NetworkStatusInfo *gtop_get_first_active_device_info (void);
enum
@@ -88,8 +87,7 @@
agent->nm_present = FALSE;
- priv->nm_conn = NULL;
- priv->nm_proxy = NULL;
+ priv->nm_client = NULL;
priv->state_curr = 0;
}
@@ -105,7 +103,7 @@
NetworkStatusAgentPrivate *priv = NETWORK_STATUS_AGENT_GET_PRIVATE (agent);
NetworkStatusInfo *info = NULL;
- if (!priv->nm_conn)
+ if (!priv->nm_client)
init_nm_connection (agent);
if (agent->nm_present)
@@ -119,7 +117,9 @@
static void
network_status_agent_dispose (GObject * obj)
{
- /* FIXME */
+ NetworkStatusAgentPrivate *priv = NETWORK_STATUS_AGENT_GET_PRIVATE (obj);
+ if (priv->nm_client)
+ g_object_unref (priv->nm_client);
}
static void
@@ -127,44 +127,18 @@
{
NetworkStatusAgentPrivate *priv = NETWORK_STATUS_AGENT_GET_PRIVATE (agent);
- GError *error = NULL;
+ priv->nm_client = nm_client_new();
- priv->nm_conn = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
-
- if (!priv->nm_conn)
+ if (!priv->nm_client)
{
- handle_g_error (&error, "%s: dbus_g_bus_get () failed", G_STRFUNC);
+ g_log (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, "nm_client_new failed");
agent->nm_present = FALSE;
return;
}
- if (!dbus_bus_name_has_owner (dbus_g_connection_get_connection (priv->nm_conn),
- NM_DBUS_SERVICE, NULL))
- {
- agent->nm_present = FALSE;
-
- return;
- }
-
agent->nm_present = TRUE;
-
- dbus_connection_set_exit_on_disconnect (dbus_g_connection_get_connection (priv->nm_conn),
- FALSE);
-
- priv->nm_proxy =
- dbus_g_proxy_new_for_name (priv->nm_conn, NM_DBUS_SERVICE, NM_DBUS_PATH,
- NM_DBUS_INTERFACE);
-
- dbus_g_proxy_add_signal (priv->nm_proxy, NM_DBUS_SIGNAL_STATE_CHANGE, G_TYPE_UINT,
- G_TYPE_INVALID);
-
- dbus_g_proxy_connect_signal (priv->nm_proxy, NM_DBUS_SIGNAL_STATE_CHANGE,
- G_CALLBACK (nm_state_change_cb), agent, NULL);
-
- dbus_connection_add_filter (dbus_g_connection_get_connection (priv->nm_conn),
- nm_message_filter, agent, NULL);
}
static NetworkStatusInfo *
@@ -174,22 +148,27 @@
NetworkStatusInfo *info = NULL;
- GList *devices;
- GList *node;
+ GSList *devices;
+ GSList *node;
- if (!priv->nm_conn)
+ if (!priv->nm_client)
return NULL;
- devices = nm_get_devices (agent);
+ devices = nm_client_get_devices (priv->nm_client);
for (node = devices; node; node = node->next)
{
- info = nm_get_device_info (agent, (DBusGProxy *) node->data);
+ info = nm_get_device_info (agent, NM_DEVICE (node->data));
if (info)
{
if (info->active)
+ {
+ NMDevice * nm_device;
+ nm_device = NM_DEVICE (node->data);
+ g_signal_connect (nm_device, "state-changed", G_CALLBACK (nm_state_change_cb), agent);
break;
+ }
g_object_unref (info);
@@ -197,135 +176,92 @@
}
}
- /* FIXME: free contents of devices ? */
- g_list_free (devices);
+ //the NM internal code does not free these. g_slist_foreach (devices, (GFunc) g_object_unref, NULL);
+ g_slist_free (devices);
return info;
}
-static GList *
-nm_get_devices (NetworkStatusAgent * agent)
+static gchar *
+ip4_address_as_string (guint32 ip)
{
- NetworkStatusAgentPrivate *priv = NETWORK_STATUS_AGENT_GET_PRIVATE (agent);
+ struct in_addr tmp_addr;
+ gchar *ip_string;
- GPtrArray *ptr_array;
- gint i;
+ tmp_addr.s_addr = ip;
+ ip_string = inet_ntoa (tmp_addr);
- GList *devices = NULL;
-
- DBusGProxy *proxy;
-
- GError *error = NULL;
-
- dbus_g_proxy_call (priv->nm_proxy, "getDevices", &error, G_TYPE_INVALID,
- dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_PROXY), &ptr_array,
- G_TYPE_INVALID);
-
- if (error)
- {
- handle_g_error (&error, "%s: calling \"getDevices\" failed", G_STRFUNC);
-
- return NULL;
- }
-
- for (i = 0; i < ptr_array->len; i++)
- {
- proxy = (DBusGProxy *) g_ptr_array_index (ptr_array, i);
-
- devices = g_list_append (devices, proxy);
- }
- g_ptr_array_free (ptr_array, TRUE);
-
- return devices;
+ return g_strdup (ip_string);
}
static NetworkStatusInfo *
-nm_get_device_info (NetworkStatusAgent * agent, DBusGProxy * device)
+nm_get_device_info (NetworkStatusAgent * agent, NMDevice * device)
{
- NetworkStatusAgentPrivate *priv = NETWORK_STATUS_AGENT_GET_PRIVATE (agent);
NetworkStatusInfo *info = g_object_new (NETWORK_STATUS_INFO_TYPE, NULL);
+ GArray *array;
- DBusGProxy *proxy;
- gchar *network_path = NULL;
+ info->iface = nm_device_get_iface (device);
+ info->driver = nm_device_get_driver (device);
+ info->active = (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) ? TRUE : FALSE;
+ if (! info->active)
+ return info;
+ NMIP4Config * cfg = nm_device_get_ip4_config (device);
+ if(! cfg)
+ return info;
+ info->ip4_addr = ip4_address_as_string (nm_ip4_config_get_address (cfg));
+ info->subnet_mask = ip4_address_as_string (nm_ip4_config_get_netmask (cfg));
+ info->broadcast = ip4_address_as_string (nm_ip4_config_get_broadcast (cfg));
+ info->route = ip4_address_as_string (nm_ip4_config_get_gateway (cfg));
- GError *error = NULL;
-
- proxy = dbus_g_proxy_new_for_name (priv->nm_conn, NM_DBUS_SERVICE,
- dbus_g_proxy_get_path (device), NM_DBUS_INTERFACE_DEVICES);
-
- dbus_g_proxy_call (proxy, "getProperties", &error, G_TYPE_INVALID,
- DBUS_TYPE_G_PROXY, NULL,
- G_TYPE_STRING, &info->iface,
- G_TYPE_UINT, &info->type,
- G_TYPE_STRING, NULL,
- G_TYPE_BOOLEAN, &info->active,
- G_TYPE_UINT, NULL,
- G_TYPE_STRING, &info->ip4_addr,
- G_TYPE_STRING, &info->subnet_mask,
- G_TYPE_STRING, &info->broadcast,
- G_TYPE_STRING, &info->hw_addr,
- G_TYPE_STRING, &info->route,
- G_TYPE_STRING, &info->primary_dns,
- G_TYPE_STRING, &info->secondary_dns,
- G_TYPE_INT, NULL,
- G_TYPE_INT, NULL,
- G_TYPE_BOOLEAN, NULL,
- G_TYPE_INT, &info->speed_mbs,
- G_TYPE_UINT, NULL,
- G_TYPE_UINT, NULL,
- G_TYPE_STRING, &network_path,
- G_TYPE_STRV, NULL,
- G_TYPE_INVALID);
-
- if (error)
+ info->primary_dns = NULL;
+ info->secondary_dns = NULL;
+ array = nm_ip4_config_get_nameservers (cfg);
+ if (array)
{
- handle_g_error (&error, "%s: calling \"getProperties\" (A) failed", G_STRFUNC);
-
- g_free (network_path);
- g_object_unref (info);
-
- return NULL;
+ if (array->len > 0)
+ info->primary_dns = ip4_address_as_string (g_array_index (array, guint32, 0));
+ if (array->len > 1)
+ info->secondary_dns = ip4_address_as_string (g_array_index (array, guint32, 1));
}
+ g_array_free (array, TRUE);
- if (info->active)
+ g_object_unref (cfg);
+
+ if (NM_IS_DEVICE_802_11_WIRELESS(device))
{
- dbus_g_proxy_call (proxy, "getDriver", &error, G_TYPE_INVALID, G_TYPE_STRING,
- &info->driver, G_TYPE_INVALID);
+ GSList *iter;
+ GSList *aps;
+ info->type = DEVICE_TYPE_802_11_WIRELESS;
- if (error)
- handle_g_error (&error, "%s: calling \"getDriver\" failed", G_STRFUNC);
-
- if (info->type == DEVICE_TYPE_802_11_WIRELESS
- && string_is_valid_dbus_path (network_path))
+ info->speed_mbs = nm_device_802_11_wireless_get_bitrate (NM_DEVICE_802_11_WIRELESS(device));
+ info->hw_addr = g_strdup (nm_device_802_11_wireless_get_hw_address (NM_DEVICE_802_11_WIRELESS(device)));
+ aps = nm_device_802_11_wireless_get_access_points (NM_DEVICE_802_11_WIRELESS(device));
+ for (iter = aps; iter; iter = iter->next)
{
- proxy = dbus_g_proxy_new_for_name (priv->nm_conn, NM_DBUS_SERVICE,
- network_path, NM_DBUS_INTERFACE_DEVICES);
-
- dbus_g_proxy_call (proxy, "getProperties", &error, G_TYPE_INVALID,
- DBUS_TYPE_G_PROXY, NULL,
- G_TYPE_STRING, &info->essid,
- G_TYPE_STRING, NULL,
- G_TYPE_INT, NULL,
- G_TYPE_DOUBLE, NULL,
- G_TYPE_INT, NULL,
- G_TYPE_BOOLEAN, NULL,
- G_TYPE_INT, NULL,
- G_TYPE_BOOLEAN, NULL,
- G_TYPE_INVALID);
+ const GByteArray * ssid;
+ ssid = nm_access_point_get_ssid (NM_ACCESS_POINT (iter->data));
+ if (ssid)
+ info->essid = g_strdup (nm_utils_escape_ssid (ssid->data, ssid->len));
+ else
+ info->essid = g_strdup ("(none)");
+ break; //fixme - we only show one for now
}
- if (error)
- handle_g_error (&error, "%s: calling \"getProperties\" (B) failed",
- G_STRFUNC);
+ g_slist_foreach (aps, (GFunc) g_object_unref, NULL);
+ g_slist_free (aps);
}
+ else if (NM_IS_DEVICE_802_3_ETHERNET (device))
+ {
+ info->type = DEVICE_TYPE_802_3_ETHERNET;
+ info->speed_mbs = nm_device_802_3_ethernet_get_speed (NM_DEVICE_802_3_ETHERNET(device));
+ info->hw_addr = nm_device_802_3_ethernet_get_hw_address (NM_DEVICE_802_3_ETHERNET(device));
+ }
- g_free (network_path);
-
return info;
}
static void
-nm_state_change_cb (DBusGProxy * proxy, guint state, gpointer user_data)
+nm_state_change_cb (NMDevice *device, NMDeviceState state, gpointer user_data)
{
NetworkStatusAgent *this = NETWORK_STATUS_AGENT (user_data);
NetworkStatusAgentPrivate *priv = NETWORK_STATUS_AGENT_GET_PRIVATE (this);
@@ -338,75 +274,6 @@
g_signal_emit (this, network_status_agent_signals [STATUS_CHANGED], 0);
}
-static DBusHandlerResult
-nm_message_filter (DBusConnection * nm_conn, DBusMessage * msg, gpointer user_data)
-{
- if ((dbus_message_is_signal (msg, DBUS_INTERFACE_LOCAL, "Disconnected")
- && !strcmp (dbus_message_get_path (msg), DBUS_PATH_LOCAL))
- || dbus_message_is_signal (msg, DBUS_INTERFACE_DBUS, "NameOwnerChanged"))
- {
- init_nm_connection (NETWORK_STATUS_AGENT (user_data));
-
- return DBUS_HANDLER_RESULT_HANDLED;
- }
-
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-}
-
-/*
- * This macro and function are copied from dbus-marshal-validate.c
- */
-
-#define VALID_NAME_CHARACTER(c) ( \
- ((c) >= '0' && (c) <= '9') || \
- ((c) >= 'A' && (c) <= 'Z') || \
- ((c) >= 'a' && (c) <= 'z') || \
- ((c) == '_') \
-)
-
-static gboolean
-string_is_valid_dbus_path (const gchar * str)
-{
- const gchar *s;
- const gchar *end;
- const gchar *last_slash;
-
- gint len;
-
- len = strlen (str);
-
- s = str;
- end = s + len;
-
- if (*s != '/')
- return FALSE;
- last_slash = s;
- ++s;
-
- while (s != end)
- {
- if (*s == '/')
- {
- if ((s - last_slash) < 2)
- return FALSE; /* no empty path components allowed */
-
- last_slash = s;
- }
- else
- {
- if (!VALID_NAME_CHARACTER (*s))
- return FALSE;
- }
-
- ++s;
- }
-
- if ((end - last_slash) < 2 && len > 1)
- return FALSE; /* trailing slash not allowed unless the string is "/" */
-
- return TRUE;
-}
-
#define CHECK_FLAG(flags, offset) (((flags) & (1 << (offset))) ? TRUE : FALSE)
static NetworkStatusInfo *
@@ -470,3 +337,4 @@
g_strfreev (networks);
return info;
}
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org