--- a/ChangeLog Sat May 13 01:34:47 2006 +0000
+++ b/ChangeLog Sat May 13 17:59:05 2006 +0000
@@ -1,3 +1,44 @@
+2006-05-13 Erwann Chenede - <[email protected]>
+
+ integration of the new branding Nimbus (opensolaris bits only)
+
+ * gnome-panel.spec : reshuffled patch numbering after
+ removal of 2 patch and the addition of one.
+ * ext-sources/gnome-main-menu.png : new launch
+ button (opensolaris version)
+ * patches/gnome-panel-12-branding-hack.diff : Added
+ * patches/gnome-panel-03-launch-button.diff : Removed
+ * patches/gnome-panel-09-menu-stripe.diff : Removed
+ * patches/gnome-panel-08-notificationarea-tooltip.diff : renumbered
+ * patches/gnome-panel-06-concurrent-login.diff : renumbered
+ * patches/gnome-panel-05-fish-applet.diff : renumbered
+ * patches/gnome-panel-12-branding-hack.diff : renumbered
+ * patches/gnome-panel-11-clock-timezone.diff : renumbered
+ * patches/gnome-panel-07-panel-applet-session-never-restart.diff :
+ renumbered
+ * patches/gnome-panel-13-launch-menu.diff : renumbered
+ * patches/gnome-panel-12-restrict-app-launching.diff : renumbered
+ * patches/gnome-panel-04-workspace-switcher.diff : renumbered
+ * patches/gnome-panel-10-input-method-filter-keypress.diff : renumbered
+ * patches/gnome-panel-11-launch-menu.diff : renumbered
+
+ * libgnome.spec : changed default background and theme
+ * patches/libgnome-01-default-background.diff : new default bkg
+ * patches/libgnome-02-default-theme.diff : new gtk theme
+
+ * gnome-backgrounds.spec : new backgrounds
+ * patches/gnome-backgrounds-01-sun-backgrounds.diff : new xml
+ specs for the bkgs.
+
+ * patches/gdm-01-branding-defaults-solaris.diff : new default
+ theme for gdm
+
+ * sun-gdm-themes.spec : new tarball with new gdm theme
+
+ * Solaris/SUNWgnome-themes.spec : added nimbus.spec to this pkg
+
+ * nimbus.spec : new spec file for the new gtk/metacity theme
+
2006-05-12 Brian Cameron <[email protected]>
* gdm.spec, patches/gdm-12-fixconfig.diff: Fix a problem that prevents
--- a/Solaris/SUNWgnome-themes.spec Sat May 13 01:34:47 2006 +0000
+++ b/Solaris/SUNWgnome-themes.spec Sat May 13 17:59:05 2006 +0000
@@ -2,7 +2,7 @@
# spec file for package SUNWgnome-themes
#
# includes module(s): hicolor-icon-theme, gnome-themes, gtk2-engines,
-# blueprint, sun-gdm-themes, gnome-icon-theme
+# blueprint, nimbus, sun-gdm-themes, gnome-icon-theme
#
# Copyright (c) 2003 Sun Microsystems, Inc.
# This file and all modifications and additions to the pristine
@@ -17,6 +17,7 @@
%use engines = gtk2-engines.spec
%use gthemes = gnome-themes.spec
%use blueprint = blueprint.spec
+%use nimbus = nimbus.spec
%use gdmtheme = sun-gdm-themes.spec
%use icontheme = gnome-icon-theme.spec
%use backgrounds = gnome-backgrounds.spec
@@ -71,6 +72,7 @@
%engines.prep -d %name-%version
%gthemes.prep -d %name-%version
%blueprint.prep -d %name-%version
+%nimbus.prep -d %name-%version
%gdmtheme.prep -d %name-%version
%icontheme.prep -d %name-%version
%backgrounds.prep -d %name-%version
@@ -96,6 +98,7 @@
%engines.build -d %name-%version
%gthemes.build -d %name-%version
%blueprint.build -d %name-%version
+%nimbus.build -d %name-%version
%gdmtheme.build -d %name-%version
%icontheme.build -d %name-%version
%backgrounds.build -d %name-%version
@@ -110,6 +113,7 @@
%engines.install -d %name-%version
%gthemes.install -d %name-%version
%blueprint.install -d %name-%version
+%nimbus.install -d %name-%version
%gdmtheme.install -d %name-%version
%icontheme.install -d %name-%version
%backgrounds.install -d %name-%version
Binary file ext-sources/gnome-main-menu.png has changed
--- a/gnome-backgrounds.spec Sat May 13 01:34:47 2006 +0000
+++ b/gnome-backgrounds.spec Sat May 13 17:59:05 2006 +0000
@@ -10,12 +10,12 @@
License: GPL
Group: System/GUI/GNOME
Version: 2.14.1
-Release: 2
+Release: 3
Distribution: Java Desktop System
Vendor: Sun Microsystems, Inc.
Summary: Selection of backgrounds for the GNOME desktop
Source: http://ftp.gnome.org/pub/GNOME/sources/%{name}/2.14/%{name}-%{version}.tar.bz2
-Source1: opensolaris-backgrounds-0.1.tar.bz2
+Source1: opensolaris-backgrounds-0.2.tar.bz2
Patch1: gnome-backgrounds-01-sun-backgrounds.diff
URL: http://www.gnome.org
BuildRoot: %{_tmppath}/%{name}-%{version}-build
--- a/gnome-panel.spec Sat May 13 01:34:47 2006 +0000
+++ b/gnome-panel.spec Sat May 13 17:59:05 2006 +0000
@@ -24,17 +24,16 @@
Source8: world_map-960.png
Patch1: gnome-panel-01-default-setup.diff
Patch2: gnome-panel-02-time-settings.diff
-Patch3: gnome-panel-03-launch-button.diff
-Patch4: gnome-panel-04-workspace-switcher.diff
-Patch5: gnome-panel-05-fish-applet.diff
-Patch6: gnome-panel-06-concurrent-login.diff
-Patch7: gnome-panel-07-panel-applet-session-never-restart.diff
-Patch8: gnome-panel-08-notificationarea-tooltip.diff
-Patch9: gnome-panel-09-menu-stripe.diff
-Patch10: gnome-panel-10-input-method-filter-keypress.diff
-Patch11: gnome-panel-11-clock-timezone.diff
-Patch12: gnome-panel-12-restrict-app-launching.diff
-Patch13: gnome-panel-13-launch-menu.diff
+Patch3: gnome-panel-03-workspace-switcher.diff
+Patch4: gnome-panel-04-fish-applet.diff
+Patch5: gnome-panel-05-concurrent-login.diff
+Patch6: gnome-panel-06-panel-applet-session-never-restart.diff
+Patch7: gnome-panel-07-notificationarea-tooltip.diff
+Patch8: gnome-panel-08-input-method-filter-keypress.diff
+Patch9: gnome-panel-09-clock-timezone.diff
+Patch10: gnome-panel-10-restrict-app-launching.diff
+Patch11: gnome-panel-11-launch-menu.diff
+Patch12: gnome-panel-12-branding-hack.diff
URL: http://www.gnome.org
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -100,18 +99,17 @@
%patch6 -p1
%patch7 -p1
%patch8 -p1
-%patch9 -p1
-%patch10 -p1
%ifos linux
#FIXME: need to ifos linux this patch
# because it depends on patch2 (time-settings):
%if 0
#FIXME: need to if 0 this patch because it needs rework for 2.14
-%patch11 -p1
+%patch9 -p1
%endif
%endif
+%patch10 -p1
+%patch11 -p1
%patch12 -p1
-%patch13 -p1
cp %SOURCE2 icons/gnome-main-menu.png
--- a/libgnome.spec Sat May 13 01:34:47 2006 +0000
+++ b/libgnome.spec Sat May 13 17:59:05 2006 +0000
@@ -9,7 +9,7 @@
License: LGPL
Group: System/Libraries/GNOME
Version: 2.14.1
-Release: 4
+Release: 5
Distribution: Java Desktop System
Vendor: Sun Microsystems, Inc.
Summary: GNOME Base Library
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nimbus.spec Sat May 13 17:59:05 2006 +0000
@@ -0,0 +1,74 @@
+#
+# spec file for package nimbus
+#
+# Copyright (c) 2006 Sun Microsystems, Inc.
+# This file and all modifications and additions to the pristine
+# package are under the same license as the package itself.
+#
+Name: nimbus
+Summary: Engine for GTK2 Nimbus Theme
+Version: 0.0.1
+%define tarball_version %{version}
+Release: 1
+License: LGPL
+Distribution: Java Desktop System
+Vendor: Sun Microsystems, Inc.
+Group: System/GUI/GNOME
+Source: %{name}-%{tarball_version}.tar.bz2
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+URL: http://www.sun.com/software/javadesktopsystem/
+
+%define gtk2_version 2.4.0
+%define intltool_version 0.30
+BuildRequires: gtk2 >= %{gtk2_version}
+BuildRequires: intltool >= %{intltool_version}
+
+%description
+This package contains the Nimbus theme engine for GTK2
+
+%prep
+%setup -q -n %name-%tarball_version
+
+%build
+%ifos linux
+if [ -x /usr/bin/getconf ]; then
+ CPUS=`getconf _NPROCESSORS_ONLN`
+fi
+%else
+ CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
+%endif
+if test "x$CPUS" = "x" -o $CPUS = 0; then
+ CPUS=1
+fi
+
+libtoolize --force
+aclocal $ACLOCAL_FLAGS -I .
+automake -a -c -f
+autoconf
+CFLAGS="$RPM_OPT_FLAGS"
+./autogen.sh --prefix=%{_prefix} \
+ --libdir=%{_prefix}/%_lib \
+ --sysconfdir=%{_sysconfdir}
+make -j $CPUS
+cd -
+
+%install
+make DESTDIR=$RPM_BUILD_ROOT install
+rm $RPM_BUILD_ROOT%{_libdir}/gtk-2.0/*/engines/*.a
+rm $RPM_BUILD_ROOT%{_libdir}/gtk-2.0/*/engines/*.la
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-, root, root)
+%{_libdir}/gtk-2.0/*/engines/*.so
+%{_datadir}/themes/*
+%{_datadir}/icons/*
+%{_datadir}/locale/*
+%{_datadir}/pixmaps/*
+
+%changelog
+* Mon May 12 2006 Erwann Chenede - <[email protected]>
+- initial implementation of the spec file
+
--- a/patches/gdm-01-branding-defaults-solaris.diff Sat May 13 01:34:47 2006 +0000
+++ b/patches/gdm-01-branding-defaults-solaris.diff Sat May 13 17:59:05 2006 +0000
@@ -91,7 +91,7 @@
# The GTK+ theme to use for the GUI.
-#GtkTheme=Default
-+GtkTheme=blueprint
++GtkTheme=nimbus
# If to allow changing the GTK+ (widget) theme from the greeter. Currently
# this only affects the standard greeter as the graphical greeter does not yet
# have this ability.
@@ -110,8 +110,8 @@
# and specify just one theme.
-#GraphicalTheme=circles
-#GraphicalThemes=circles/:happygnome
-+GraphicalTheme=OpenSolaris-blueprint
-+GraphicalThemes=OpenSolaris-blueprint/:circles/:happygnome
++GraphicalTheme=Sun-Nimbus
++GraphicalThemes=Sun-Nimbus/:circles/:happygnome
GraphicalThemeDir=@datadir@/gdm/themes/
GraphicalThemeRand=false
--- a/patches/gnome-backgrounds-01-sun-backgrounds.diff Sat May 13 01:34:47 2006 +0000
+++ b/patches/gnome-backgrounds-01-sun-backgrounds.diff Sat May 13 17:59:05 2006 +0000
@@ -1,49 +1,55 @@
-diff -Nrup gnome-backgrounds-2.10.1/Makefile.am gnome-backgrounds-2.10.1-os/Makefile.am
---- gnome-backgrounds-2.10.1/Makefile.am 2005-03-07 08:35:04.000000000 +0000
-+++ gnome-backgrounds-2.10.1-os/Makefile.am 2005-10-04 13:04:13.024071000 +0000
+diff -Nrup gnome-backgrounds-2.14.1/Makefile.am ../gnome-backgrounds-2.14.1-clean/Makefile.am
+--- gnome-backgrounds-2.14.1/Makefile.am 2006-01-28 12:41:15.000000000 +0100
++++ ../gnome-backgrounds-2.14.1-clean/Makefile.am 2006-05-12 17:50:45.606476000 +0200
@@ -1,4 +1,4 @@
-SUBDIRS = branded tiles translucent nature po
+SUBDIRS = branded tiles translucent nature sun po
EXTRA_DIST = intltool-extract.in intltool-merge.in intltool-update.in
-diff -Nrup gnome-backgrounds-2.10.1/configure.in gnome-backgrounds-2.10.1-os/configure.in
---- gnome-backgrounds-2.10.1/configure.in 2005-04-11 09:25:49.000000000 +0000
-+++ gnome-backgrounds-2.10.1-os/configure.in 2005-10-04 13:04:13.023582000 +0000
-@@ -19,5 +19,6 @@ po/Makefile.in
- branded/Makefile
+diff -Nrup gnome-backgrounds-2.14.1/configure.in ../gnome-backgrounds-2.14.1-clean/configure.in
+--- gnome-backgrounds-2.14.1/configure.in 2006-04-11 22:39:24.000000000 +0200
++++ ../gnome-backgrounds-2.14.1-clean/configure.in 2006-05-12 17:50:45.605592000 +0200
+@@ -23,5 +23,6 @@ branded/Makefile
+ nature/Makefile
tiles/Makefile
translucent/Makefile
+sun/Makefile
po/Makefile
])
-diff -Nrup gnome-backgrounds-2.10.1/sun/Makefile.am gnome-backgrounds-2.10.1-os/sun/Makefile.am
---- gnome-backgrounds-2.10.1/sun/Makefile.am 1970-01-01 00:00:00.000000000 +0000
-+++ gnome-backgrounds-2.10.1-os/sun/Makefile.am 2005-10-04 14:17:47.502271000 +0000
-@@ -0,0 +1,40 @@
+diff -Nrup gnome-backgrounds-2.14.1/sun/Makefile.am ../gnome-backgrounds-2.14.1-clean/sun/Makefile.am
+--- gnome-backgrounds-2.14.1/sun/Makefile.am 1970-01-01 01:00:00.000000000 +0100
++++ ../gnome-backgrounds-2.14.1-clean/sun/Makefile.am 2006-05-12 17:50:45.694606000 +0200
+@@ -0,0 +1,46 @@
+backgrounddir = $(datadir)/pixmaps/backgrounds/sun
+
+background_DATA =\
-+ ambience.jpg \
-+ bluepattern.jpg \
-+ bubbles.jpg \
-+ gliding.jpg \
-+ glowworms.jpg \
-+ greenpattern.jpg \
-+ halos.jpg \
-+ lakeview.jpg \
-+ lasers.jpg \
-+ nightlights.jpg \
-+ northernlights.jpg \
-+ opensolaris.jpg \
-+ orangepattern.jpg \
-+ raindrop.jpg \
-+ rays.jpg \
-+ slopes.jpg \
-+ stormscape.jpg \
-+ surfing.jpg \
-+ windsurfing.jpg \
-+ winter.jpg
++ bubbles.jpg \
++ di-elliptical-blue.png \
++ di-elliptical-dark_gray.png \
++ di-elliptical-gray.png \
++ di-elliptical-green.png \
++ di-elliptical-yellow.png \
++ di-sails-blue.png \
++ di-sails-dark_gray.png \
++ di-sails-gray.png \
++ di-sails-green.png \
++ di-sails-orange.png \
++ di-sails-yellow.png \
++ di-scurve-blue.png \
++ di-scurve-gray.png \
++ di-scurve-green.png \
++ di-scurve-orange.png \
++ di-scurve-yellow.png \
++ di-shell-blue.png \
++ di-shell-gray.png \
++ di-shell-green.png \
++ di-shell-orange.png \
++ di-shell-yellow.png \
++ lakeview.jpg \
++ raindrop.jpg \
++ slopes.jpg \
++ winter.jpg
+
+metadata_in_files = sun-backgrounds.xml.in
+metadatadir = $(datadir)/gnome-background-properties
@@ -61,118 +67,141 @@
+
+MAINTAINERCLEANFILES = \
+ Makefile.in
-Binary files gnome-backgrounds-2.10.1/sun/Sun-Default-color.png and gnome-backgrounds-2.10.1-os/sun/Sun-Default-color.png differ
-Binary files gnome-backgrounds-2.10.1/sun/Sun-Linen.jpg and gnome-backgrounds-2.10.1-os/sun/Sun-Linen.jpg differ
-Binary files gnome-backgrounds-2.10.1/sun/Sun-LiveCD.jpg and gnome-backgrounds-2.10.1-os/sun/Sun-LiveCD.jpg differ
-Binary files gnome-backgrounds-2.10.1/sun/Sun-Velvet.png and gnome-backgrounds-2.10.1-os/sun/Sun-Velvet.png differ
-Binary files gnome-backgrounds-2.10.1/sun/greenlock.jpg and gnome-backgrounds-2.10.1-os/sun/greenlock.jpg differ
-Binary files gnome-backgrounds-2.10.1/sun/opensolaris.jpg and gnome-backgrounds-2.10.1-os/sun/opensolaris.jpg differ
-Binary files gnome-backgrounds-2.10.1/sun/orangelock.jpg and gnome-backgrounds-2.10.1-os/sun/orangelock.jpg differ
-diff -Nrup gnome-backgrounds-2.10.1/sun/sun-backgrounds.xml.in.in gnome-backgrounds-2.10.1-os/sun/sun-backgrounds.xml.in.in
---- gnome-backgrounds-2.10.1/sun/sun-backgrounds.xml.in.in 1970-01-01 00:00:00.000000000 +0000
-+++ gnome-backgrounds-2.10.1-os/sun/sun-backgrounds.xml.in.in 2005-10-04 14:17:45.326102000 +0000
-@@ -0,0 +1,104 @@
+diff -Nrup gnome-backgrounds-2.14.1/sun/sun-backgrounds.xml.in.in ../gnome-backgrounds-2.14.1-clean/sun/sun-backgrounds.xml.in.in
+--- gnome-backgrounds-2.14.1/sun/sun-backgrounds.xml.in.in 1970-01-01 01:00:00.000000000 +0100
++++ ../gnome-backgrounds-2.14.1-clean/sun/sun-backgrounds.xml.in.in 2006-05-12 17:50:45.694815000 +0200
+@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd">
+<wallpapers>
+ <wallpaper deleted="false">
-+ <_name>Ray</_name>
-+ <filename>@datadir@/pixmaps/backgrounds/sun/rays.jpg</filename>
-+ <options>scaled</options>
++ <_name>Di Elliptical Blue</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-elliptical-blue.png</filename>
++ <options>stretched</options>
+ </wallpaper>
+ <wallpaper deleted="false">
-+ <_name>Innovate on OpenSolaris</_name>
-+ <filename>@datadir@/pixmaps/backgrounds/sun/opensolaris.jpg</filename>
-+ <options>scaled</options>
++ <_name>Di Elliptical Dark Gray</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-elliptical-dark_gray.png</filename>
++ <options>stretched</options>
++ </wallpaper>
++ <wallpaper deleted="false">
++ <_name>Di Elliptical Gray</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-elliptical-gray.png</filename>
++ <options>stretched</options>
++ </wallpaper>
++ <wallpaper deleted="false">
++ <_name>Di Elliptical Green</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-elliptical-green.png</filename>
++ <options>stretched</options>
++ </wallpaper>
++ <wallpaper deleted="false">
++ <_name>Di Elliptical Yellow</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-elliptical-yellow.png</filename>
++ <options>stretched</options>
++ </wallpaper>
++ <wallpaper deleted="false">
++ <_name>Di Sails Blue</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-sails-blue.png</filename>
++ <options>stretched</options>
++ </wallpaper>
++ <wallpaper deleted="false">
++ <_name>Di Sails Dark Gray</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-sails-dark_gray.png</filename>
++ <options>stretched</options>
++ </wallpaper>
++ <wallpaper deleted="false">
++ <_name>Di Sails Gray</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-sails-gray.png</filename>
++ <options>stretched</options>
++ </wallpaper>
++ <wallpaper deleted="false">
++ <_name>Di Sails Green</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-sails-green.png</filename>
++ <options>stretched</options>
++ </wallpaper>
++ <wallpaper deleted="false">
++ <_name>Di Sails Orange</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-sails-orange.png</filename>
++ <options>stretched</options>
++ </wallpaper>
++ <wallpaper deleted="false">
++ <_name>Di Sails Yellow</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-sails-yellow.png</filename>
++ <options>stretched</options>
+ </wallpaper>
+ <wallpaper deleted="false">
+ <_name>Raindrop</_name>
+ <filename>@datadir@/pixmaps/backgrounds/sun/raindrop.jpg</filename>
-+ <options>scaled</options>
-+ </wallpaper>
-+ <wallpaper deleted="false">
-+ <_name>Windsurfing</_name>
-+ <filename>@datadir@/pixmaps/backgrounds/sun/windsurfing.jpg</filename>
-+ <options>scaled</options>
-+ </wallpaper>
-+ <wallpaper deleted="false">
-+ <_name>Ambience</_name>
-+ <filename>@datadir@/pixmaps/backgrounds/sun/ambience.jpg</filename>
-+ <options>scaled</options>
++ <options>stretched</options>
+ </wallpaper>
+ <wallpaper deleted="false">
+ <_name>Bubbles</_name>
+ <filename>@datadir@/pixmaps/backgrounds/sun/bubbles.jpg</filename>
-+ <options>scaled</options>
++ <options>stretched</options>
+ </wallpaper>
+ <wallpaper deleted="false">
+ <_name>Lake View</_name>
+ <filename>@datadir@/pixmaps/backgrounds/sun/lakeview.jpg</filename>
-+ <options>scaled</options>
-+ </wallpaper>
-+ <wallpaper deleted="false">
-+ <_name>Halos</_name>
-+ <filename>@datadir@/pixmaps/backgrounds/sun/halos.jpg</filename>
-+ <options>scaled</options>
-+ </wallpaper>
-+ <wallpaper deleted="false">
-+ <_name>Lasers</_name>
-+ <filename>@datadir@/pixmaps/backgrounds/sun/lasers.jpg</filename>
-+ <options>scaled</options>
-+ </wallpaper>
-+ <wallpaper deleted="false">
-+ <_name>Stormy</_name>
-+ <filename>@datadir@/backgrounds/sun/stormscape.jpg</filename>
-+ <options>scaled</options>
-+ </wallpaper>
-+ <wallpaper deleted="false">
-+ <_name>Surfing</_name>
-+ <filename>@datadir@/pixmaps/backgrounds/sun/surfing.jpg</filename>
-+ <options>scaled</options>
++ <options>stretched</options>
+ </wallpaper>
+ <wallpaper deleted="false">
+ <_name>Winter</_name>
+ <filename>@datadir@/pixmaps/backgrounds/sun/winter.jpg</filename>
-+ <options>scaled</options>
-+ </wallpaper>
-+ <wallpaper deleted="false">
-+ <_name>Glow Worms</_name>
-+ <filename>@datadir@/pixmaps/backgrounds/sun/glowworms.jpg</filename>
-+ <options>scaled</options>
++ <options>stretched</options>
+ </wallpaper>
+ <wallpaper deleted="false">
+ <_name>Slopes</_name>
+ <filename>@datadir@/pixmaps/backgrounds/sun/slopes.jpg</filename>
-+ <options>scaled</options>
-+ </wallpaper>
-+ <wallpaper deleted="false">
-+ <_name>Gliding</_name>
-+ <filename>@datadir@/pixmaps/backgrounds/sun/gliding.jpg</filename>
-+ <options>scaled</options>
-+ </wallpaper>
-+ <wallpaper deleted="false">
-+ <_name>Night Lights</_name>
-+ <filename>@datadir@/pixmaps/backgrounds/sun/nightlights.jpg</filename>
-+ <options>scaled</options>
++ <options>stretched</options>
+ </wallpaper>
+ <wallpaper deleted="false">
-+ <_name>Northern Lights</_name>
-+ <filename>@datadir@/pixmaps/backgrounds/sun/northernlights.jpg</filename>
-+ <options>scaled</options>
++ <_name>Di S Curve Blue</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-scurve-blue.png</filename>
++ <options>stretched</options>
++ </wallpaper>
++ <wallpaper deleted="false">
++ <_name>Di S Curve Gray</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-scurve-gray.png</filename>
++ <options>stretched</options>
+ </wallpaper>
-+ <wallpaper deleted="false">
-+ <_name>Orange Twist</_name>
-+ <filename>@datadir@/pixmaps/backgrounds/sun/orangepattern.jpg</filename>
-+ <options>scaled</options>
++ <wallpaper deleted="false">
++ <_name>Di S Curve Green</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-scurve-green.png</filename>
++ <options>stretched</options>
++ </wallpaper>
++ <wallpaper deleted="false">
++ <_name>Di S Curve Yellow</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-scurve-yellow.png</filename>
++ <options>stretched</options>
++ </wallpaper>
++ <wallpaper deleted="false">
++ <_name>Di S Curve Orange</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-scurve-orange.png</filename>
++ <options>stretched</options>
+ </wallpaper>
-+ <wallpaper deleted="false">
-+ <_name>Green Twist</_name>
-+ <filename>@datadir@/pixmaps/backgrounds/sun/greenpattern.jpg</filename>
-+ <options>scaled</options>
++ <wallpaper deleted="false">
++ <_name>Di Shell Blue</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-shell-blue.png</filename>
++ <options>stretched</options>
++ </wallpaper>
++ <wallpaper deleted="false">
++ <_name>Di Shell Gray</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-shell-gray.png</filename>
++ <options>stretched</options>
+ </wallpaper>
-+ <wallpaper deleted="false">
-+ <_name>Blue Twist</_name>
-+ <filename>@datadir@/pixmaps/backgrounds/sun/bluepattern.jpg</filename>
-+ <options>scaled</options>
++ <wallpaper deleted="false">
++ <_name>Di Shell Green</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-shell-green.png</filename>
++ <options>stretched</options>
++ </wallpaper>
++ <wallpaper deleted="false">
++ <_name>Di Shell Yellow</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-shell-yellow.png</filename>
++ <options>stretched</options>
++ </wallpaper>
++ <wallpaper deleted="false">
++ <_name>Di Shell Orange</_name>
++ <filename>@datadir@/pixmaps/backgrounds/sun/di-shell-orange.png</filename>
++ <options>stretched</options>
+ </wallpaper>
+</wallpapers>
--- a/patches/gnome-panel-03-launch-button.diff Sat May 13 01:34:47 2006 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1863 +0,0 @@
-diff -urNp gnome-panel-2.12.1/gnome-panel/Makefile.am gnome-panel-2.12.1-hacked/gnome-panel/Makefile.am
---- gnome-panel-2.12.1/gnome-panel/Makefile.am 2005-10-27 18:11:51.923618000 +1300
-+++ gnome-panel-2.12.1-hacked/gnome-panel/Makefile.am 2005-10-27 18:15:18.303586000 +1300
-@@ -77,6 +77,7 @@ panel_sources = \
- main.c \
- panel-widget.c \
- button-widget.c \
-+ constraint-scaling.c \
- xstuff.c \
- panel-session.c \
- panel-compatibility.c \
-@@ -123,6 +124,7 @@ panel_headers = \
- panel-widget.h \
- panel-globals.h \
- button-widget.h \
-+ constraint-scaling.h \
- xstuff.h \
- panel-session.h \
- panel-compatibility.h \
-diff -urNp gnome-panel-2.12.1/gnome-panel/button-widget.c gnome-panel-2.12.1-hacked/gnome-panel/button-widget.c
---- gnome-panel-2.12.1/gnome-panel/button-widget.c 2005-07-21 21:57:17.000000000 +1200
-+++ gnome-panel-2.12.1-hacked/gnome-panel/button-widget.c 2005-10-27 18:25:01.785669000 +1300
-@@ -5,6 +5,9 @@
- #include <glib/gi18n.h>
- #include <gdk/gdkkeysyms.h>
- #include <gtk/gtk.h>
-+#include <libgnome/gnome-i18n.h>
-+#include <libgnome/gnome-util.h>
-+#include <libgnome/gnome-desktop-item.h>
- #include <gdk-pixbuf/gdk-pixbuf.h>
-
- #include "button-widget.h"
-@@ -18,8 +21,10 @@
-
-
-
--static GdkPixbuf * get_missing (GtkIconTheme *icon_theme,
-- int preffered_size);
-+static GdkPixbuf * get_missing ( int preffered_size);
-+static GdkPixbuf *button_load_pixbuf (const char *file,
-+ char **error);
-+
- static void button_widget_icon_theme_changed (ButtonWidget *button);
- static void button_widget_reload_pixbuf (ButtonWidget *button);
-
-@@ -29,7 +34,11 @@ enum {
- PROP_HAS_ARROW,
- PROP_DND_HIGHLIGHT,
- PROP_ORIENTATION,
-- PROP_ICON_NAME
-+ PROP_ICON_NAME,
-+ PROP_STOCK_ID,
-+ PROP_TEXT,
-+ PROP_BOUNDARY_BOX,
-+ PROP_TEXT_FONT
- };
-
- #define BUTTON_WIDGET_DISPLACEMENT 2
-@@ -133,13 +142,6 @@ button_widget_realize(GtkWidget *widget)
-
- widget->style = gtk_style_attach (widget->style, widget->window);
-
-- BUTTON_WIDGET (widget)->icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (widget));
-- g_signal_connect_object (BUTTON_WIDGET (widget)->icon_theme, "changed",
-- G_CALLBACK (button_widget_icon_theme_changed),
-- button,
-- G_CONNECT_SWAPPED);
--
-- button_widget_reload_pixbuf (BUTTON_WIDGET (widget));
- }
-
- static void
-@@ -170,48 +170,143 @@
- g_object_unref (button->pixbuf);
- button->pixbuf = NULL;
-
-- if (button->pixbuf_hc)
-- g_object_unref (button->pixbuf_hc);
-- button->pixbuf_hc = NULL;
-+ if (button->scaled)
-+ g_object_unref (button->scaled);
-+ button->scaled = NULL;
-+
-+ if (button->scaled_hc)
-+ g_object_unref (button->scaled_hc);
-+ button->scaled_hc = NULL;
-+
-+ if (button->c_pixbuf) {
-+ if (button->c_pixbuf->pixbuf)
-+ g_object_unref (button->c_pixbuf->pixbuf);
-+ button->c_pixbuf->pixbuf = NULL;
-+
-+ if (button->c_pixbuf->scaled)
-+ g_object_unref (button->c_pixbuf->scaled);
-+ button->c_pixbuf->scaled = NULL;
-+ }
- }
-
- static void
--button_widget_reload_pixbuf (ButtonWidget *button)
-+button_widget_load_pixbuf_and_scale (ButtonWidget *button)
- {
-- button_widget_unset_pixbufs (button);
-+ double scale;
-+ int width;
-+ int height;
-+ GdkPixbuf *scaled = button->scaled;
-+ gboolean use_text_pixbuf = FALSE;
-+
-+ if (button->orientation & PANEL_HORIZONTAL_MASK) {
-+ if (button->use_constrained_pixbuf) {
-+ scaled = button->c_pixbuf->scaled;
-+ use_text_pixbuf = TRUE;
-+ }
-+ }
-
-- if (button->size <= 1 || button->icon_theme == NULL)
-+ if (button->size <= 1 )
- return;
-
-- if (button->filename != NULL && button->filename [0] != '\0') {
-- char *error = NULL;
-+ if (button->pixbuf == NULL) {
-+ if (!button->filename && !button->stock_id)
-+ return;
-+
-+ if (button->filename != NULL) {
-+ char *error = NULL;
-+
-+ button->pixbuf = button_load_pixbuf (button->filename, &error);
-+ if (error) {
-+ panel_error_dialog (gdk_screen_get_default (),
-+ "cannot_load_pixbuf",
-+ _("Failed to load image %s"),
-+ "%s",
-+ button->filename,
-+ error);
-+ g_free (error);
-+ }
-+ }
-+
-+ if (button->pixbuf == NULL &&
-+ button->stock_id != NULL)
-+ button->pixbuf = gtk_widget_render_icon (
-+ GTK_WIDGET (button),
-+ button->stock_id,
-+ GTK_ICON_SIZE_DIALOG,
-+ NULL);
-+
-+/* FIXME: this should be based on the panel size */
-+#define PREFERRED_SIZE 48
-+ if (button->pixbuf == NULL)
-+ button->pixbuf = get_missing (PREFERRED_SIZE);
-+#undef PREFERRED_SIZE
-
-- button->pixbuf = panel_load_icon (button->icon_theme,
-- button->filename,
-- button->size,
-- button->orientation & PANEL_VERTICAL_MASK ? button->size : -1,
-- button->orientation & PANEL_HORIZONTAL_MASK ? button->size : -1,
-- &error);
-- if (error) {
-- panel_error_dialog (gdk_screen_get_default (),
-- "cannot_load_pixbuf", TRUE,
-- _("Could not load icon"),
-- "%s",
-- error);
-- g_free (error);
-+ if (!button->pixbuf)
-+ return;
-+ }
-+
-+ width = gdk_pixbuf_get_width (button->pixbuf);
-+ height = gdk_pixbuf_get_height (button->pixbuf);
-+
-+
-+ if (button->orientation & PANEL_HORIZONTAL_MASK)
-+ scale = (double) button->size / height;
-+ else
-+ scale = (double) button->size / width;
-+
-+ width *= scale;
-+ height *= scale;
-+
-+ if (scaled) {
-+ if (gdk_pixbuf_get_width (scaled) == width &&
-+ gdk_pixbuf_get_height (scaled) == height)
-+ return; /* no need to re-scale */
-+
-+ g_object_unref (scaled);
-+
-+ if (button->use_constrained_pixbuf)
-+ button->c_pixbuf->scaled = NULL;
-+ else
-+ button->scaled = NULL;
-+
-+ scaled = NULL;
-+ }
-+
-+ if (use_text_pixbuf) {
-+ if (constrained_pixbuf_init (button->c_pixbuf,
-+ button->pixbuf)) {
-+ constrained_pixbuf_compute_layout (GTK_WIDGET (button),
-+ button->c_pixbuf,
-+ button->size);
-+
-+ constrained_pixbuf_render (button->c_pixbuf,
-+ button->size);
-+ scaled = button->c_pixbuf->scaled;
-+ } else {
-+ use_text_pixbuf = FALSE;
-+ button->use_constrained_pixbuf = FALSE;
- }
- }
-
-- if (button->pixbuf == NULL)
-- button->pixbuf = get_missing (button->icon_theme,
-- button->size);
-+ if (!use_text_pixbuf) {
-+ scaled = gdk_pixbuf_scale_simple (button->pixbuf, width, height,
-+ GDK_INTERP_BILINEAR);
-+ button->scaled = scaled;
-+ }
-
-- if (button->pixbuf == NULL)
-- return;
-+ if (button->scaled_hc)
-+ g_object_unref (button->scaled_hc);
-
-- button->pixbuf_hc = make_hc_pixbuf (button->pixbuf);
-+ button->scaled_hc = make_hc_pixbuf (scaled);
-
- gtk_widget_queue_resize (GTK_WIDGET (button));
-+}
-+
-+static void
-+button_widget_reload_pixbuf (ButtonWidget *button)
-+{
-+ button_widget_unset_pixbufs (button);
-+ button_widget_load_pixbuf_and_scale (button);
- }
-
- static void
-@@ -225,15 +320,32 @@ button_widget_icon_theme_changed (Button
- }
-
- static void
-+button_widget_gtk_theme_changed (ButtonWidget *button)
-+{
-+ if (button->stock_id != NULL) {
-+ if (button->c_pixbuf->text)
-+ button->use_constrained_pixbuf = TRUE;
-+ button_widget_reload_pixbuf (button);
-+ }
-+}
-+
-+static void
- button_widget_finalize (GObject *object)
- {
- ButtonWidget *button = (ButtonWidget *) object;
-
- button_widget_unset_pixbufs (button);
-
-+ if (button->c_pixbuf)
-+ constrained_pixbuf_free (button->c_pixbuf);
-+ button->c_pixbuf = NULL;
-+
- g_free (button->filename);
- button->filename = NULL;
-
-+ g_free (button->stock_id);
-+ button->stock_id = NULL;
-+
- parent_class->finalize (object);
- }
-
-@@ -265,6 +377,26 @@ button_widget_get_property (GObject *
- case PROP_ICON_NAME:
- g_value_set_string (value, button->filename);
- break;
-+ case PROP_STOCK_ID:
-+ g_value_set_string (value, button->stock_id);
-+ break;
-+ case PROP_TEXT:
-+ g_value_set_string (value, button->c_pixbuf->text);
-+ break;
-+ case PROP_BOUNDARY_BOX:
-+ {
-+ char *string = g_strdup_printf ("[%d,%d,%d,%d]",
-+ button->c_pixbuf->border_left,
-+ button->c_pixbuf->border_right,
-+ button->c_pixbuf->border_bottom,
-+ button->c_pixbuf->border_top);
-+ g_value_set_string (value, string);
-+ }
-+ /* FIXME free here ? */
-+ break;
-+ case PROP_TEXT_FONT:
-+ g_value_set_string (value, button->c_pixbuf->font);
-+ break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
-@@ -299,67 +431,149 @@ button_widget_set_property (GObject
- case PROP_ICON_NAME:
- button_widget_set_icon_name (button, g_value_get_string (value));
- break;
-+ case PROP_STOCK_ID:
-+ button_widget_set_stock_id (button, g_value_get_string (value));
-+ break;
-+ case PROP_TEXT:
-+ button_widget_set_text (button, g_value_get_string (value));
-+ break;
-+ case PROP_BOUNDARY_BOX:
-+ button_widget_set_boundary_box (button, g_value_get_string (value));
-+ break;
-+ case PROP_TEXT_FONT:
-+ button_widget_set_text_font (button, g_value_get_string (value));
-+ break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
- }
-
-+static char *default_pixmap = NULL;
-+
- static GdkPixbuf *
--get_missing (GtkIconTheme *icon_theme,
-- int preffered_size)
-+get_missing (int preffered_size)
- {
- GdkPixbuf *retval = NULL;
-
-- retval = gtk_icon_theme_load_icon (icon_theme, "gnome-unknown",
-- preffered_size, 0, NULL);
-+ if (default_pixmap == NULL)
-+ default_pixmap = gnome_desktop_item_find_icon (panel_icon_theme, "gnome-unknown.png",
-+ preffered_size, 0);
-+
-+ if (default_pixmap != NULL)
-+ retval = gdk_pixbuf_new_from_file (default_pixmap,
-+ NULL);
-+
- if (retval == NULL)
- retval = missing_pixbuf (preffered_size);
-
- return retval;
- }
-
--static GtkArrowType
--calc_arrow (PanelOrientation orientation,
-- int button_width,
-- int button_height,
-- int *x,
-- int *y,
-- int *width,
-- int *height)
-+static GdkPixbuf *
-+load_pixbuf (const char *file,
-+ int preffered_size,
-+ char **str_error)
- {
-- GtkArrowType retval = GTK_ARROW_UP;
-- double scale;
-+ GError *error = NULL;
-+ GdkPixbuf *retval = NULL;
-+ char *full;
-+
-+ if (g_path_is_absolute (file))
-+ full = g_strdup (file);
-+ else
-+ full = gnome_desktop_item_find_icon (panel_icon_theme, file, preffered_size, 0);
-+
-+ if (full) {
-+ retval = gdk_pixbuf_new_from_file (full, &error);
-+ if (!retval) {
-+ if (str_error)
-+ *str_error = g_strdup (error ? error->message : _("none"));
-+ g_error_free (error);
-+ }
-+ g_free (full);
-+ } else if (str_error)
-+ *str_error = g_strdup (_("file not found"));
-+
-+ return retval;
-+}
-+
-+static GdkPixbuf *
-+button_load_pixbuf (const char *file,
-+ char **error)
-+{
-+/* FIXME: this should be based on the panel size */
-+#define PREFERRED_SIZE 48
-+
-+ GdkPixbuf *retval = NULL;
-
-- scale = (orientation & PANEL_HORIZONTAL_MASK ? button_height : button_width) / 48.0;
-+ if (string_empty (file))
-+ return NULL;
-
-- *width = 12 * scale;
-- *height = 12 * scale;
-+ retval = load_pixbuf (file, PREFERRED_SIZE, NULL);
-+ if (!retval) {
-+ char *tmp;
-+
-+ if (error && *error) {
-+ g_free (*error);
-+ *error = NULL;
-+ }
-+
-+ tmp = g_path_get_basename (file);
-+ retval = load_pixbuf (tmp, PREFERRED_SIZE, error);
-+ g_free (tmp);
-+ }
-+
-+ return retval;
-+
-+#undef PREFERRED_SIZE
-+}
-+
-+static void
-+draw_arrow (GdkPoint *points,
-+ PanelOrientation orientation,
-+ int width,
-+ int height)
-+{
-+ double scale;
-+
-+ scale = (orientation & PANEL_HORIZONTAL_MASK ? height : width) / 48.0;
-
- switch (orientation) {
- case PANEL_ORIENTATION_TOP:
-- *x = scale * 3;
-- *y = scale * (48 - 13);
-- retval = GTK_ARROW_DOWN;
-+ points [0].x = 4 * scale;
-+ points [0].y = height - 10 * scale;
-+ points [1].x = 12 * scale;
-+ points [1].y = height - 10 * scale;
-+ points [2].x = 8 * scale;
-+ points [2].y = height - 3 * scale;
- break;
- case PANEL_ORIENTATION_BOTTOM:
-- *x = scale * (48 - 13);
-- *y = scale * 1;
-- retval = GTK_ARROW_UP;
-- break;
-- case PANEL_ORIENTATION_LEFT:
-- *x = scale * (48 - 13);
-- *y = scale * 3;
-- retval = GTK_ARROW_RIGHT;
-- break;
-- case PANEL_ORIENTATION_RIGHT:
-- *x = scale * 1;
-- *y = scale * 3;
-- retval = GTK_ARROW_LEFT;
-- break;
-- }
-+ points [0].x = width - 12 * scale;
-+ points [0].y = 10 * scale;
-+ points [1].x = width - 4 * scale;
-+ points [1].y = 10 * scale;
-+ points [2].x = width - 8 * scale;
-+ points [2].y = 3 * scale;
-+ break;
-+ case PANEL_ORIENTATION_LEFT:
-+ points [0].x = width - 10 * scale;
-+ points [0].y = height - 12 * scale;
-+ points [1].x = width - 10 * scale;
-+ points [1].y = height - 4 * scale;
-+ points [2].x = width - 3 * scale;
-+ points [2].y = height - 8 * scale;
-+ break;
-+ case PANEL_ORIENTATION_RIGHT:
-+ points [0].x = 10 * scale;
-+ points [0].y = 4 * scale;
-+ points [1].x = 10 * scale;
-+ points [1].y = 12 * scale;
-+ points [2].x = 3 * scale;
-+ points [2].y = 8 * scale;
-+ break;
-+ }
-
-- return retval;
- }
-
- static gboolean
-@@ -382,24 +596,30 @@ button_widget_expose (GtkWidget
- if (!GTK_WIDGET_VISIBLE (widget) || !GTK_WIDGET_MAPPED (widget))
- return FALSE;
-
-- if (!button_widget->pixbuf_hc && !button_widget->pixbuf)
-+ if (!button_widget->scaled_hc && !button_widget->scaled)
- return FALSE;
-
- /* offset for pressed buttons */
- off = (button_widget->activatable && button->in_button && button->button_down) ?
- BUTTON_WIDGET_DISPLACEMENT * widget->allocation.height / 48.0 : 0;
-
-- if (!button_widget->activatable) {
-- pb = gdk_pixbuf_copy (button_widget->pixbuf);
-- gdk_pixbuf_saturate_and_pixelate (button_widget->pixbuf,
-+ if (!button_widget->activatable)
-+ {
-+ pb = gdk_pixbuf_copy (button_widget->scaled);
-+ gdk_pixbuf_saturate_and_pixelate (button_widget->scaled,
- pb,
- 0.8,
- TRUE);
- } else if (panel_global_config_get_highlight_when_over () &&
- (button->in_button || GTK_WIDGET_HAS_FOCUS (widget)))
-- pb = g_object_ref (button_widget->pixbuf_hc);
-- else
-- pb = g_object_ref (button_widget->pixbuf);
-+ pb = g_object_ref (button_widget->scaled_hc);
-+ else {
-+ if (button_widget->use_constrained_pixbuf &&
-+ (button_widget->orientation & PANEL_HORIZONTAL_MASK))
-+ pb = g_object_ref (button_widget->c_pixbuf->scaled);
-+ else
-+ pb = g_object_ref (button_widget->scaled);
-+ }
-
- g_assert (pb != NULL);
-
-@@ -426,33 +646,55 @@ button_widget_expose (GtkWidget
-
- g_object_unref (pb);
-
-- if (button_widget->arrow) {
-- GtkArrowType arrow_type;
-- int x, y, width, height;
--
-- x = y = width = height = -1;
--
-- arrow_type = calc_arrow (button_widget->orientation,
-- widget->allocation.width,
-- widget->allocation.height,
-- &x,
-- &y,
-- &width,
-- &height);
-+ if (button_widget->use_constrained_pixbuf &&
-+ (button_widget->orientation & PANEL_HORIZONTAL_MASK)) {
-+ int x = 0, y = 0;
-+ GdkGCValues gc_values;
-+ GdkGCValuesMask gc_values_mask;
-+ GdkColor font_color;
-+ static GdkGC *font_color_gc = NULL;
-+
-+ if (font_color_gc == NULL) {
-+ font_color.red = 23 * 256;
-+ font_color.green = 70 * 256;
-+ font_color.blue = 83 * 256;
-+
-+ gdk_colormap_alloc_color (widget->style->colormap, &font_color, FALSE, TRUE);
-+
-+ gc_values_mask = GDK_GC_FOREGROUND | GDK_GC_BACKGROUND;
-+ gc_values.foreground = font_color;
-+ gc_values.background = font_color;
-+ font_color_gc = gtk_gc_get (widget->style->depth,
-+ widget->style->colormap,
-+ &gc_values, gc_values_mask);
-+ }
-
-- gtk_paint_arrow (widget->style,
-- widget->window,
-- GTK_STATE_NORMAL,
-- GTK_SHADOW_NONE,
-- NULL,
-- widget,
-- NULL,
-- arrow_type,
-- TRUE,
-- widget->allocation.x + x,
-- widget->allocation.y + y,
-- width,
-- height);
-+ if (panel_global_config_get_highlight_when_over ()) {
-+ x++; y++;
-+ }
-+
-+ gdk_draw_layout (widget->window, font_color_gc,
-+ button_widget->c_pixbuf->border_left_scaled + button_widget->c_pixbuf->center_x + widget->allocation.x + x,
-+ button_widget->c_pixbuf->border_top + button_widget->c_pixbuf->center_y + widget->allocation.y + y + 1,
-+ button_widget->c_pixbuf->layout);
-+
-+ gdk_draw_layout (widget->window, widget->style->white_gc,
-+ button_widget->c_pixbuf->border_left_scaled + button_widget->c_pixbuf->center_x + widget->allocation.x + x,
-+ button_widget->c_pixbuf->border_top + button_widget->c_pixbuf->center_y + widget->allocation.y + y,
-+ button_widget->c_pixbuf->layout);
-+ } else if (button_widget->arrow) {
-+ int i;
-+ GdkPoint points[3];
-+
-+ draw_arrow (points, button_widget->orientation, widget->allocation.width, widget->allocation.height);
-+
-+ for (i = 0; i < 3; i++) {
-+ points[i].x += off + widget->allocation.x;
-+ points[i].y += off + widget->allocation.y;
-+ }
-+
-+ gdk_draw_polygon (widget->window, widget->style->white_gc, TRUE, points, 3);
-+ gdk_draw_polygon (widget->window, widget->style->black_gc, FALSE, points, 3);
- }
-
- if (button_widget->dnd_highlight) {
-@@ -488,10 +730,15 @@ button_widget_size_request (GtkWidget
- GtkRequisition *requisition)
- {
- ButtonWidget *button_widget = BUTTON_WIDGET (widget);
-+ GdkPixbuf *scaled = button_widget->scaled;
-
-- if (button_widget->pixbuf) {
-- requisition->width = gdk_pixbuf_get_width (button_widget->pixbuf);
-- requisition->height = gdk_pixbuf_get_height (button_widget->pixbuf);
-+ if (button_widget->use_constrained_pixbuf &&
-+ (button_widget->orientation & PANEL_HORIZONTAL_MASK))
-+ scaled = button_widget->c_pixbuf->scaled;
-+
-+ if (scaled) {
-+ requisition->width = gdk_pixbuf_get_width (scaled);
-+ requisition->height = gdk_pixbuf_get_height (scaled);
- }
- }
-
-@@ -513,7 +760,7 @@ button_widget_size_allocate (GtkWidget
- if (button_widget->size != size) {
- button_widget->size = size;
-
-- button_widget_reload_pixbuf (button_widget);
-+ button_widget_load_pixbuf_and_scale (button_widget);
- }
-
- widget->allocation = *allocation;
-@@ -590,20 +837,30 @@ button_widget_leave_notify (GtkWidget *w
- static void
- button_widget_instance_init (ButtonWidget *button)
- {
-- button->icon_theme = NULL;
-- button->pixbuf = NULL;
-- button->pixbuf_hc = NULL;
--
-- button->filename = NULL;
-
-+ button->pixbuf = NULL;
-+ button->scaled = NULL;
-+ button->scaled_hc = NULL;
-+
-+ button->arrow = 0;
-+
- button->orientation = PANEL_ORIENTATION_TOP;
-
-- button->size = 0;
-
-- button->activatable = FALSE;
-- button->ignore_leave = FALSE;
-- button->arrow = FALSE;
- button->dnd_highlight = FALSE;
-+
-+ button->use_constrained_pixbuf = FALSE;
-+ button->c_pixbuf = g_new0 (ConstrainedPixbuf, 1);
-+
-+ button->size = 0;
-+
-+ g_signal_connect_object (panel_icon_theme, "changed",
-+ G_CALLBACK (button_widget_icon_theme_changed),
-+ button,
-+ G_CONNECT_SWAPPED);
-+
-+ g_signal_connect (button, "style-set",
-+ G_CALLBACK (button_widget_gtk_theme_changed), button);
- }
-
- static void
-@@ -675,6 +932,41 @@ button_widget_class_init (ButtonWidgetCl
- "The desired icon for the ButtonWidget",
- NULL,
- G_PARAM_READWRITE));
-+ g_object_class_install_property (
-+ gobject_class,
-+ PROP_STOCK_ID,
-+ g_param_spec_string ("stock-id",
-+ "Stock Icon ID",
-+ "The desired stock icon for the ButtonWidget",
-+ NULL,
-+ G_PARAM_READWRITE));
-+
-+ g_object_class_install_property (
-+ gobject_class,
-+ PROP_TEXT,
-+ g_param_spec_string ("text",
-+ _("Button Text"),
-+ _("The desired Text for the ButtonWidget"),
-+ NULL,
-+ G_PARAM_READWRITE));
-+
-+ g_object_class_install_property (
-+ gobject_class,
-+ PROP_BOUNDARY_BOX,
-+ g_param_spec_string ("boundary-box",
-+ _("Icon Boundary Box"),
-+ _("The desired Boundary Box for icon of the ButtonWidget"),
-+ NULL,
-+ G_PARAM_READWRITE));
-+
-+ g_object_class_install_property (
-+ gobject_class,
-+ PROP_TEXT_FONT,
-+ g_param_spec_string ("text-font",
-+ _("Text Font"),
-+ _("The desired Font for text of the ButtonWidget"),
-+ NULL,
-+ G_PARAM_READWRITE));
- }
-
- GType
-@@ -719,6 +1011,22 @@ button_widget_new (const char *fil
- return retval;
- }
-
-+GtkWidget *
-+button_widget_new_from_stock (const char *stock_id,
-+ gboolean arrow,
-+ PanelOrientation orientation)
-+{
-+ GtkWidget *retval;
-+
-+ retval = g_object_new (BUTTON_TYPE_WIDGET,
-+ "has-arrow", arrow,
-+ "orientation", orientation,
-+ "stock-id", stock_id,
-+ NULL);
-+ return retval;
-+}
-+
-+
- void
- button_widget_set_activatable (ButtonWidget *button,
- gboolean activatable)
-@@ -758,6 +1066,9 @@ button_widget_set_icon_name (ButtonWidge
- g_free (button->filename);
- button->filename = g_strdup (icon_name);
-
-+ if (button->c_pixbuf->text)
-+ button->use_constrained_pixbuf = TRUE;
-+
- button_widget_reload_pixbuf (button);
-
- g_object_notify (G_OBJECT (button), "icon-name");
-@@ -772,6 +1083,34 @@ button_widget_get_icon_name (ButtonWidge
- }
-
- void
-+button_widget_set_stock_id (ButtonWidget *button,
-+ const char *stock_id)
-+{
-+ g_return_if_fail (BUTTON_IS_WIDGET (button));
-+
-+ if (button->stock_id && stock_id && !strcmp (button->stock_id, stock_id))
-+ return;
-+
-+ if (button->stock_id)
-+ g_free (button->stock_id);
-+
-+ button->stock_id = g_strdup (stock_id);
-+
-+ button_widget_reload_pixbuf (button);
-+
-+ g_object_notify (G_OBJECT (button), "stock-id");
-+}
-+
-+const char *
-+button_widget_get_stock_id (ButtonWidget *button)
-+{
-+ g_return_val_if_fail (BUTTON_IS_WIDGET (button), NULL);
-+
-+ return button->stock_id;
-+}
-+
-+
-+void
- button_widget_set_orientation (ButtonWidget *button,
- PanelOrientation orientation)
- {
-@@ -784,6 +1123,7 @@ button_widget_set_orientation (ButtonWid
-
- /* Force a re-scale */
- button->size = -1;
-+ button_widget_reload_pixbuf (button);
-
- gtk_widget_queue_resize (GTK_WIDGET (button));
-
-@@ -849,3 +1189,119 @@ button_widget_get_dnd_highlight (ButtonW
-
- return button->dnd_highlight;
- }
-+
-+void
-+button_widget_set_text (ButtonWidget *button,
-+ const char *text)
-+{
-+ g_return_if_fail (BUTTON_IS_WIDGET (button));
-+
-+ if (!text)
-+ return;
-+
-+ if (button->c_pixbuf->text && text &&
-+ !strcmp (button->c_pixbuf->text, text))
-+ return;
-+
-+ if (button->c_pixbuf->text)
-+ g_free (button->c_pixbuf->text);
-+
-+ button->c_pixbuf->text = g_strdup (text);
-+
-+ button->use_constrained_pixbuf = TRUE;
-+
-+ button_widget_reload_pixbuf (button);
-+
-+ atk_object_set_name (gtk_widget_get_accessible (GTK_WIDGET (button)), text);
-+ g_object_notify (G_OBJECT (button), "text");
-+}
-+
-+const char *
-+button_widget_get_text (ButtonWidget *button)
-+{
-+ g_return_val_if_fail (BUTTON_IS_WIDGET (button), FALSE);
-+
-+ return button->c_pixbuf->text;
-+}
-+
-+void
-+button_widget_set_text_font (ButtonWidget *button,
-+ const char *font)
-+{
-+ g_return_if_fail (BUTTON_IS_WIDGET (button));
-+
-+ if (!font)
-+ return;
-+
-+ if (font && button->c_pixbuf->font &&
-+ !strcmp (button->c_pixbuf->font, font))
-+ return;
-+
-+ if (button->c_pixbuf->font)
-+ g_free (button->c_pixbuf->font);
-+
-+ button->c_pixbuf->font = g_strdup (font);
-+
-+ if (button->c_pixbuf->text)
-+ button->use_constrained_pixbuf = TRUE;
-+
-+ button_widget_reload_pixbuf (button);
-+
-+ g_object_notify (G_OBJECT (button), "text-font");
-+}
-+
-+const char *
-+button_widget_get_text_font (ButtonWidget *button)
-+{
-+ g_return_val_if_fail (BUTTON_IS_WIDGET (button), FALSE);
-+
-+ return button->c_pixbuf->font;
-+}
-+
-+void
-+button_widget_set_boundary_box (ButtonWidget *button,
-+ const char *boundary_str)
-+{
-+ int num_items;
-+ g_return_if_fail (BUTTON_IS_WIDGET (button));
-+
-+ if (!boundary_str)
-+ return;
-+
-+ num_items = sscanf (boundary_str, "[%d,%d,%d,%d]",
-+ &button->c_pixbuf->border_left,
-+ &button->c_pixbuf->border_right,
-+ &button->c_pixbuf->border_bottom,
-+ &button->c_pixbuf->border_top);
-+
-+ if (num_items != 4) {
-+ g_warning (_("boundary box data should be formatted [x,x,x,x]"));
-+ button->c_pixbuf->border_left = 0;
-+ button->c_pixbuf->border_right = 0;
-+ button->c_pixbuf->border_bottom = 0;
-+ button->c_pixbuf->border_top = 0;
-+ return;
-+ }
-+
-+ button->use_constrained_pixbuf = TRUE;
-+
-+ button_widget_reload_pixbuf (button);
-+
-+ g_object_notify (G_OBJECT (button), "boundary-box");
-+}
-+
-+void
-+button_widget_get_boundary_box (ButtonWidget *button,
-+ int *left,
-+ int *right,
-+ int *bottom,
-+ int *top)
-+{
-+ g_return_if_fail (BUTTON_IS_WIDGET (button));
-+
-+ *left = button->c_pixbuf->border_left;
-+ *right = button->c_pixbuf->border_right;
-+ *bottom = button->c_pixbuf->border_bottom;
-+ *top = button->c_pixbuf->border_top;
-+}
-+
-diff -urNp gnome-panel-2.12.1/gnome-panel/button-widget.h gnome-panel-2.12.1-hacked/gnome-panel/button-widget.h
---- gnome-panel-2.12.1/gnome-panel/button-widget.h 2005-01-30 09:39:01.000000000 +1300
-+++ gnome-panel-2.12.1-hacked/gnome-panel/button-widget.h 2005-10-27 18:15:18.296596000 +1300
-@@ -3,6 +3,7 @@
-
- #include <gtk/gtk.h>
- #include "panel-enums.h"
-+#include "constraint-scaling.h"
-
- G_BEGIN_DECLS
-
-@@ -18,11 +19,15 @@ typedef struct _ButtonWidgetClass Button
- struct _ButtonWidget {
- GtkButton parent;
-
-- GtkIconTheme *icon_theme;
- GdkPixbuf *pixbuf;
-- GdkPixbuf *pixbuf_hc;
-+ GdkPixbuf *scaled;
-+ GdkPixbuf *scaled_hc;
-
- char *filename;
-+ char *stock_id;
-+
-+ gboolean use_constrained_pixbuf;
-+ ConstrainedPixbuf *c_pixbuf;
-
- PanelOrientation orientation;
-
-@@ -42,12 +47,18 @@ GType button_widget_get_type
- GtkWidget * button_widget_new (const char *pixmap,
- gboolean arrow,
- PanelOrientation orientation);
-+GtkWidget * button_widget_new_from_stock (const char *stock_id,
-+ gboolean arrow,
-+ PanelOrientation orientation);
- void button_widget_set_activatable (ButtonWidget *button,
- gboolean activatable);
- gboolean button_widget_get_activatable (ButtonWidget *button);
- void button_widget_set_icon_name (ButtonWidget *button,
- const char *icon_name);
- const char * button_widget_get_icon_name (ButtonWidget *button);
-+void button_widget_set_stock_id (ButtonWidget *button,
-+ const char *stock_id);
-+const char * button_widget_get_stock_id (ButtonWidget *button);
- void button_widget_set_orientation (ButtonWidget *button,
- PanelOrientation orientation);
- PanelOrientation button_widget_get_orientation (ButtonWidget *button);
-@@ -58,6 +69,21 @@ void button_widget_set_dnd_h
- gboolean dnd_highlight);
- gboolean button_widget_get_dnd_highlight (ButtonWidget *button);
-
-+void button_widget_set_text (ButtonWidget *button,
-+ const char *text);
-+const char * button_widget_get_text (ButtonWidget *button);
-+
-+void button_widget_set_text_font (ButtonWidget *button,
-+ const char *font);
-+const char * button_widget_get_text_font (ButtonWidget *button);
-+void button_widget_set_boundary_box (ButtonWidget *button,
-+ const char *boundary_str);
-+void button_widget_get_boundary_box (ButtonWidget *button,
-+ int *left,
-+ int *right,
-+ int *bottom,
-+ int *top);
-+
- G_END_DECLS
-
- #endif /* __BUTTON_WIDGET_H__ */
-diff -urNp gnome-panel-2.12.1/gnome-panel/constraint-scaling.c gnome-panel-2.12.1-hacked/gnome-panel/constraint-scaling.c
---- gnome-panel-2.12.1/gnome-panel/constraint-scaling.c 1970-01-01 12:00:00.000000000 +1200
-+++ gnome-panel-2.12.1-hacked/gnome-panel/constraint-scaling.c 2005-10-27 18:15:18.302381000 +1300
-@@ -0,0 +1,592 @@
-+/*
-+ * constraint-scaling.c : routines to scale image following a boundary box
-+ * and to compute the optimal font for a given
-+ * boundary box.
-+ *
-+ * Copyright (C) 2003 Sun Microsystems, Inc.
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License as
-+ * published by the Free Software Foundation; either version 2 of the
-+ * License, or (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful, but
-+ * WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-+ * 02111-1307, USA.
-+ *
-+ * Authors:
-+ * Erwann Chenede - <[email protected]>
-+ *
-+ * scaling inspired from the pixbuf gtk theme constrained scaling
-+ * routines from :
-+ * Owen Taylor <[email protected]>
-+ * Carsten Haitzler <[email protected]>
-+ */
-+
-+#include <string.h>
-+#include <stdio.h>
-+#include "constraint-scaling.h"
-+
-+static GdkPixbuf *
-+replicate_single (GdkPixbuf *src,
-+ gint src_x,
-+ gint src_y,
-+ gint width,
-+ gint height)
-+{
-+ guint n_channels = gdk_pixbuf_get_n_channels (src);
-+ guchar *pixels = (gdk_pixbuf_get_pixels (src) +
-+ src_y * gdk_pixbuf_get_rowstride (src) +
-+ src_x * n_channels);
-+ guchar r = *(pixels++);
-+ guchar g = *(pixels++);
-+ guchar b = *(pixels++);
-+ guint dest_rowstride;
-+ guchar *dest_pixels;
-+ guchar a = 0;
-+ GdkPixbuf *result;
-+ int i, j;
-+
-+ if (n_channels == 4)
-+ a = *(pixels++);
-+
-+ result = gdk_pixbuf_new (GDK_COLORSPACE_RGB, n_channels == 4, 8,
-+ width, height);
-+ dest_rowstride = gdk_pixbuf_get_rowstride (result);
-+ dest_pixels = gdk_pixbuf_get_pixels (result);
-+
-+ for (i = 0; i < height; i++)
-+ {
-+ guchar *p = dest_pixels + dest_rowstride *i;
-+
-+ for (j = 0; j < width; j++)
-+ {
-+ *(p++) = r;
-+ *(p++) = g;
-+ *(p++) = b;
-+
-+ if (n_channels == 4)
-+ *(p++) = a;
-+ }
-+ }
-+
-+ return result;
-+}
-+
-+static GdkPixbuf *
-+replicate_rows (GdkPixbuf *src,
-+ gint src_x,
-+ gint src_y,
-+ gint width,
-+ gint height)
-+{
-+ guint n_channels = gdk_pixbuf_get_n_channels (src);
-+ guint src_rowstride = gdk_pixbuf_get_rowstride (src);
-+ guchar *pixels = (gdk_pixbuf_get_pixels (src) + src_y * src_rowstride + src_x * n_channels);
-+ guchar *dest_pixels;
-+ GdkPixbuf *result;
-+ guint dest_rowstride;
-+ int i;
-+
-+ result = gdk_pixbuf_new (GDK_COLORSPACE_RGB, n_channels == 4, 8,
-+ width, height);
-+ dest_rowstride = gdk_pixbuf_get_rowstride (result);
-+ dest_pixels = gdk_pixbuf_get_pixels (result);
-+
-+ for (i = 0; i < height; i++)
-+ memcpy (dest_pixels + dest_rowstride * i, pixels, n_channels * width);
-+
-+ return result;
-+}
-+
-+static GdkPixbuf *
-+replicate_cols (GdkPixbuf *src,
-+ gint src_x,
-+ gint src_y,
-+ gint width,
-+ gint height)
-+{
-+ guint n_channels = gdk_pixbuf_get_n_channels (src);
-+ guint src_rowstride = gdk_pixbuf_get_rowstride (src);
-+ guchar *pixels = (gdk_pixbuf_get_pixels (src) + src_y * src_rowstride + src_x * n_channels);
-+ guchar *dest_pixels;
-+ GdkPixbuf *result;
-+ guint dest_rowstride;
-+ int i, j;
-+
-+ result = gdk_pixbuf_new (GDK_COLORSPACE_RGB, n_channels == 4, 8,
-+ width, height);
-+ dest_rowstride = gdk_pixbuf_get_rowstride (result);
-+ dest_pixels = gdk_pixbuf_get_pixels (result);
-+
-+ for (i = 0; i < height; i++)
-+ {
-+ guchar *p = dest_pixels + dest_rowstride * i;
-+ guchar *q = pixels + src_rowstride * i;
-+
-+ guchar r = *(q++);
-+ guchar g = *(q++);
-+ guchar b = *(q++);
-+ guchar a = 0;
-+
-+ if (n_channels == 4)
-+ a = *(q++);
-+
-+ for (j = 0; j < width; j++)
-+ {
-+ *(p++) = r;
-+ *(p++) = g;
-+ *(p++) = b;
-+
-+ if (n_channels == 4)
-+ *(p++) = a;
-+ }
-+ }
-+
-+ return result;
-+}
-+
-+/* Scale the rectangle (src_x, src_y, src_width, src_height)
-+ * onto the rectangle (dest_x, dest_y, dest_width, dest_height)
-+ * of the destination
-+ */
-+static void
-+partial_render (GdkPixbuf *src,
-+ guint hints,
-+ GdkPixbuf *scaled,
-+ gint src_x,
-+ gint src_y,
-+ gint src_width,
-+ gint src_height,
-+ gint dest_x,
-+ gint dest_y,
-+ gint dest_width,
-+ gint dest_height)
-+{
-+ GdkPixbuf *tmp_pixbuf;
-+ GdkRectangle rect;
-+ int x_offset, y_offset;
-+ gboolean has_alpha = gdk_pixbuf_get_has_alpha (src);
-+ gint src_rowstride = gdk_pixbuf_get_rowstride (src);
-+ gint src_n_channels = gdk_pixbuf_get_n_channels (src);
-+
-+ if (dest_width <= 0 || dest_height <= 0)
-+ return;
-+
-+ rect.x = dest_x;
-+ rect.y = dest_y;
-+ rect.width = dest_width;
-+ rect.height = dest_height;
-+
-+ if (hints & MISSING)
-+ return;
-+
-+ if (dest_width == src_width && dest_height == src_height)
-+ {
-+ tmp_pixbuf = g_object_ref (src);
-+
-+ x_offset = src_x + rect.x - dest_x;
-+ y_offset = src_y + rect.y - dest_y;
-+ }
-+ else if ((hints & CONSTANT_COLS) && (hints & CONSTANT_ROWS))
-+ {
-+ tmp_pixbuf = replicate_single (src, src_x, src_y, dest_width, dest_height);
-+
-+ x_offset = rect.x - dest_x;
-+ y_offset = rect.y - dest_y;
-+ }
-+ else if (dest_width == src_width && (hints & CONSTANT_COLS))
-+ {
-+ tmp_pixbuf = replicate_rows (src, src_x, src_y, dest_width, dest_height);
-+
-+ x_offset = rect.x - dest_x;
-+ y_offset = rect.y - dest_y;
-+ }
-+ else if (dest_height == src_height && (hints & CONSTANT_ROWS))
-+ {
-+ tmp_pixbuf = replicate_cols (src, src_x, src_y, dest_width, dest_height);
-+
-+ x_offset = rect.x - dest_x;
-+ y_offset = rect.y - dest_y;
-+ }
-+ else
-+ {
-+ double x_scale = (double)dest_width / src_width;
-+ double y_scale = (double)dest_height / src_height;
-+ guchar *pixels;
-+ GdkPixbuf *partial_src;
-+
-+ pixels = (gdk_pixbuf_get_pixels (src)
-+ + src_y * src_rowstride
-+ + src_x * src_n_channels);
-+
-+ partial_src = gdk_pixbuf_new_from_data (pixels, GDK_COLORSPACE_RGB,
-+ has_alpha,
-+ 8, src_width, src_height,
-+ src_rowstride,
-+ NULL, NULL);
-+
-+ tmp_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
-+ has_alpha, 8,
-+ rect.width, rect.height);
-+
-+ gdk_pixbuf_scale (partial_src, tmp_pixbuf,
-+ 0, 0, rect.width, rect.height,
-+ dest_x - rect.x, dest_y - rect.y,
-+ x_scale, y_scale,
-+ GDK_INTERP_BILINEAR);
-+
-+ gdk_pixbuf_unref (partial_src);
-+
-+ x_offset = 0;
-+ y_offset = 0;
-+ }
-+
-+ gdk_pixbuf_copy_area (tmp_pixbuf,
-+ x_offset, y_offset,
-+ rect.width, rect.height,
-+ scaled,
-+ rect.x,
-+ rect.y);
-+
-+ gdk_pixbuf_unref (tmp_pixbuf);
-+}
-+
-+
-+void
-+constrained_pixbuf_render (ConstrainedPixbuf *cp,
-+ gint height)
-+{
-+ gint src_x[4], src_y[4], dest_x[4], dest_y[4];
-+ gint x = 0, y = 0, width, pixbuf_width, pixbuf_height, tmp_width;
-+ GdkPixbuf *tmp_scaled;
-+
-+ tmp_width = (gdk_pixbuf_get_width (cp->pixbuf) * height) / gdk_pixbuf_get_height (cp->pixbuf);
-+ cp->border_left_scaled = (cp->border_left * height) / gdk_pixbuf_get_height (cp->pixbuf);
-+ cp->border_right_scaled = (cp->border_right * height) / gdk_pixbuf_get_height (cp->pixbuf);
-+
-+ width = cp->border_left_scaled + cp->border_right_scaled + cp->resulting_width;
-+
-+ tmp_scaled = gdk_pixbuf_scale_simple (cp->pixbuf, tmp_width, height,
-+ GDK_INTERP_BILINEAR);
-+
-+ pixbuf_width = gdk_pixbuf_get_width (tmp_scaled);
-+ pixbuf_height = gdk_pixbuf_get_height (tmp_scaled);
-+
-+
-+ if (width == pixbuf_width && height == pixbuf_height)
-+ {
-+ if (cp->scaled)
-+ g_object_unref (cp->scaled);
-+ cp->scaled = tmp_scaled;
-+ return;
-+ }
-+
-+ if (cp->scaled)
-+ {
-+ g_object_unref (cp->scaled);
-+ cp->scaled = NULL;
-+ }
-+ cp->scaled = gdk_pixbuf_new (gdk_pixbuf_get_colorspace (tmp_scaled),
-+ gdk_pixbuf_get_has_alpha (tmp_scaled),
-+ gdk_pixbuf_get_bits_per_sample (tmp_scaled),
-+ width,
-+ height);
-+ gdk_pixbuf_fill (cp->scaled, 0xff0000ff);
-+
-+ src_x[0] = 0;
-+ src_x[1] = cp->border_left_scaled;
-+ src_x[2] = pixbuf_width - cp->border_right_scaled;
-+ src_x[3] = pixbuf_width;
-+
-+ src_y[0] = 0;
-+ src_y[1] = cp->border_top;
-+ src_y[2] = pixbuf_height - cp->border_bottom;
-+ src_y[3] = pixbuf_height;
-+
-+ dest_x[0] = x;
-+ dest_x[1] = x + cp->border_left_scaled;
-+ dest_x[2] = x + width - cp->border_right_scaled;
-+ dest_x[3] = x + width;
-+
-+ dest_y[0] = y;
-+ dest_y[1] = y + cp->border_top;
-+ dest_y[2] = y + height - cp->border_bottom;
-+ dest_y[3] = y + height;
-+
-+ if (cp->component_mask & COMPONENT_ALL)
-+ cp->component_mask = (COMPONENT_ALL - 1) & ~cp->component_mask;
-+
-+#define RENDER_COMPONENT(X1,X2,Y1,Y2) \
-+ partial_render (tmp_scaled, cp->hints[Y1][X1], \
-+ cp->scaled, \
-+ src_x[X1], src_y[Y1], \
-+ src_x[X2] - src_x[X1], src_y[Y2] - src_y[Y1], \
-+ dest_x[X1], dest_y[Y1], \
-+ dest_x[X2] - dest_x[X1], dest_y[Y2] - dest_y[Y1]);
-+
-+ if (cp->component_mask & COMPONENT_NORTH_WEST)
-+ RENDER_COMPONENT (0, 1, 0, 1);
-+
-+ if (cp->component_mask & COMPONENT_NORTH)
-+ RENDER_COMPONENT (1, 2, 0, 1);
-+
-+ if (cp->component_mask & COMPONENT_NORTH_EAST)
-+ RENDER_COMPONENT (2, 3, 0, 1);
-+
-+ if (cp->component_mask & COMPONENT_WEST)
-+ RENDER_COMPONENT (0, 1, 1, 2);
-+
-+ if (cp->component_mask & COMPONENT_CENTER)
-+ RENDER_COMPONENT (1, 2, 1, 2);
-+
-+ if (cp->component_mask & COMPONENT_EAST)
-+ RENDER_COMPONENT (2, 3, 1, 2);
-+
-+ if (cp->component_mask & COMPONENT_SOUTH_WEST)
-+ RENDER_COMPONENT (0, 1, 2, 3);
-+
-+ if (cp->component_mask & COMPONENT_SOUTH)
-+ RENDER_COMPONENT (1, 2, 2, 3);
-+
-+ if (cp->component_mask & COMPONENT_SOUTH_EAST)
-+ RENDER_COMPONENT (2, 3, 2, 3);
-+
-+ g_object_unref (tmp_scaled);
-+}
-+
-+static guint
-+compute_hint (GdkPixbuf *pixbuf,
-+ gint x0,
-+ gint x1,
-+ gint y0,
-+ gint y1)
-+{
-+ int i, j;
-+ int hints = CONSTANT_ROWS | CONSTANT_COLS | MISSING;
-+ int n_channels = gdk_pixbuf_get_n_channels (pixbuf);
-+
-+ guchar *data = gdk_pixbuf_get_pixels (pixbuf);
-+ int rowstride = gdk_pixbuf_get_rowstride (pixbuf);
-+
-+ if (x0 == x1 || y0 == y1)
-+ return 0;
-+
-+ for (i = y0; i < y1; i++)
-+ {
-+ guchar *p = data + i * rowstride + x0 * n_channels;
-+ guchar r = p[0];
-+ guchar g = p[1];
-+ guchar b = p[2];
-+ guchar a = 0;
-+
-+ if (n_channels == 4)
-+ a = p[3];
-+
-+ for (j = x0; j < x1 ; j++)
-+ {
-+ if (n_channels != 4 || p[3] != 0)
-+ {
-+ hints &= ~MISSING;
-+ if (!(hints & CONSTANT_ROWS))
-+ goto cols;
-+ }
-+
-+ if (r != *(p++) ||
-+ g != *(p++) ||
-+ b != *(p++) ||
-+ (n_channels != 4 && a != *(p++)))
-+ {
-+ hints &= ~CONSTANT_ROWS;
-+ if (!(hints & MISSING))
-+ goto cols;
-+ }
-+ }
-+ }
-+
-+ cols:
-+ for (i = y0 + 1; i < y1; i++)
-+ {
-+ guchar *base = data + y0 * rowstride + x0 * n_channels;
-+ guchar *p = data + i * rowstride + x0 * n_channels;
-+
-+ if (memcmp (p, base, n_channels * (x1 - x0)) != 0)
-+ {
-+ hints &= ~CONSTANT_COLS;
-+ return hints;
-+ }
-+ }
-+
-+ return hints;
-+}
-+
-+static gboolean
-+compute_hints (ConstrainedPixbuf *const_pixbuf)
-+{
-+ int i, j, k = 0;
-+ gint width = gdk_pixbuf_get_width (const_pixbuf->pixbuf);
-+ gint height = gdk_pixbuf_get_height (const_pixbuf->pixbuf);
-+
-+ if (const_pixbuf->border_left + const_pixbuf->border_right > width ||
-+ const_pixbuf->border_top + const_pixbuf->border_bottom > height)
-+ return FALSE;
-+
-+ for (i = 0; i < 3; i++)
-+ {
-+ gint y0, y1;
-+
-+ switch (i)
-+ {
-+ case 0:
-+ y0 = 0;
-+ y1 = const_pixbuf->border_top;
-+ break;
-+ case 1:
-+ y0 = const_pixbuf->border_top;
-+ y1 = height - const_pixbuf->border_bottom;
-+ break;
-+ default:
-+ y0 = height - const_pixbuf->border_bottom;
-+ y1 = height;
-+ break;
-+ }
-+
-+ for (j = 0; j < 3; j++)
-+ {
-+ gint x0, x1;
-+
-+
-+ switch (j)
-+ {
-+ case 0:
-+ x0 = 0;
-+ x1 = const_pixbuf->border_left;
-+ break;
-+ case 1:
-+ x0 = const_pixbuf->border_left;
-+ x1 = width - const_pixbuf->border_right;
-+ break;
-+ default:
-+ x0 = width - const_pixbuf->border_right;
-+ x1 = width;
-+ break;
-+ }
-+
-+ const_pixbuf->hints[i][j] = compute_hint (const_pixbuf->pixbuf, x0, x1, y0, y1);
-+ k++;
-+ }
-+ }
-+ return TRUE;
-+}
-+
-+gboolean
-+constrained_pixbuf_init (ConstrainedPixbuf *cp,
-+ GdkPixbuf *src)
-+{
-+ if (cp->pixbuf)
-+ g_object_unref (cp->pixbuf);
-+ cp->pixbuf = NULL;
-+
-+ if (cp->scaled)
-+ g_object_unref (cp->scaled);
-+ cp->scaled = NULL;
-+
-+ cp->pixbuf = gdk_pixbuf_copy (src);
-+
-+ if (!cp->pixbuf)
-+ {
-+ g_free (cp);
-+ return FALSE;
-+ }
-+
-+ cp->component_mask = COMPONENT_ALL;
-+
-+ if (!compute_hints (cp))
-+ return FALSE;
-+
-+ return TRUE;
-+}
-+
-+void
-+constrained_pixbuf_free (ConstrainedPixbuf *cp)
-+{
-+ if (cp->text)
-+ g_free (cp->text);
-+ if (cp->font)
-+ g_free (cp->font);
-+
-+ if (cp->layout)
-+ g_object_unref (cp->layout);
-+
-+ if (cp->pixbuf)
-+ g_object_unref (cp->pixbuf);
-+ if (cp->scaled)
-+ g_object_unref (cp->scaled);
-+
-+ g_free (cp);
-+}
-+
-+void
-+constrained_pixbuf_compute_layout (GtkWidget *widget,
-+ ConstrainedPixbuf *cp,
-+ int height)
-+{
-+ char font_full [256];
-+ int pango_width, pango_height;
-+ PangoFontDescription *font_desc = NULL;
-+ int requested_height = height - (cp->border_top + cp->border_bottom);
-+ int font_size = 3;
-+ gboolean fit = FALSE;
-+
-+ PangoLayout *layout = gtk_widget_create_pango_layout (widget, cp->text);
-+
-+ while (!fit)
-+ {
-+ int pix_width, pix_height;
-+ font_size++;
-+
-+ sprintf (font_full, "%s %d", cp->font, font_size);
-+
-+ if (font_desc)
-+ pango_font_description_free(font_desc);
-+
-+ if (font_size < 0)
-+ {
-+ fit = TRUE;
-+ font_size = 4;
-+ }
-+
-+ font_desc = pango_font_description_from_string (font_full);
-+ pango_layout_set_font_description (layout, font_desc);
-+
-+ pango_layout_get_size (layout, &pango_width, &pango_height);
-+
-+ pix_height = PANGO_PIXELS (pango_height);
-+ pix_width = PANGO_PIXELS (pango_width);
-+
-+ /* find optimal height */
-+ if (PANGO_PIXELS (pango_height) > requested_height)
-+ {
-+ font_size--;
-+ fit = TRUE;
-+ }
-+ }
-+
-+ sprintf (font_full, "%s %d", cp->font, font_size);
-+ pango_font_description_free(font_desc);
-+ font_desc = pango_font_description_from_string (font_full);
-+ pango_layout_set_font_description (layout, font_desc);
-+ pango_layout_get_size (layout, &pango_width, &pango_height);
-+
-+ cp->resulting_width = PANGO_PIXELS (pango_width);
-+ cp->center_x = (cp->resulting_width - PANGO_PIXELS (pango_width)) / 2;
-+ cp->center_y = (requested_height - PANGO_PIXELS (pango_height) ) / 2;
-+
-+ cp->layout = layout;
-+}
-diff -urNp gnome-panel-2.12.1/gnome-panel/constraint-scaling.h gnome-panel-2.12.1-hacked/gnome-panel/constraint-scaling.h
---- gnome-panel-2.12.1/gnome-panel/constraint-scaling.h 1970-01-01 12:00:00.000000000 +1200
-+++ gnome-panel-2.12.1-hacked/gnome-panel/constraint-scaling.h 2005-10-27 18:15:18.302916000 +1300
-@@ -0,0 +1,70 @@
-+#ifndef __CONSTRAINT_SCALING_H__
-+#define __CONSTRAINT_SCALING_H__
-+#include <gtk/gtk.h>
-+#include <gdk-pixbuf/gdk-pixbuf.h>
-+#include <pango/pango.h>
-+
-+typedef struct _ConstrainedPixbuf ConstrainedPixbuf;
-+
-+typedef enum {
-+ CONSTANT_ROWS = 1 << 0,
-+ CONSTANT_COLS = 1 << 1,
-+ MISSING = 1 << 2
-+} RenderHints;
-+
-+struct _ConstrainedPixbuf
-+{
-+ char *text;
-+ char *font;
-+
-+ PangoLayout *layout;
-+
-+ GdkPixbuf *pixbuf;
-+ GdkPixbuf *scaled;
-+
-+ int center_x;
-+ int center_y;
-+ int resulting_width;
-+ gint border_left_scaled;
-+ gint border_right_scaled;
-+
-+ guint component_mask;
-+ gint border_left;
-+ gint border_right;
-+ gint border_bottom;
-+ gint border_top;
-+ guint hints[3][3];
-+};
-+
-+typedef enum
-+{
-+ COMPONENT_NORTH_WEST = 1 << 0,
-+ COMPONENT_NORTH = 1 << 1,
-+ COMPONENT_NORTH_EAST = 1 << 2,
-+ COMPONENT_WEST = 1 << 3,
-+ COMPONENT_CENTER = 1 << 4,
-+ COMPONENT_EAST = 1 << 5,
-+ COMPONENT_SOUTH_EAST = 1 << 6,
-+ COMPONENT_SOUTH = 1 << 7,
-+ COMPONENT_SOUTH_WEST = 1 << 8,
-+ COMPONENT_ALL = 1 << 9
-+} ConstrainedPixbufComponent;
-+
-+gboolean
-+constrained_pixbuf_init (ConstrainedPixbuf *cp,
-+ GdkPixbuf *src);
-+
-+void
-+constrained_pixbuf_free (ConstrainedPixbuf *cp);
-+
-+
-+void
-+constrained_pixbuf_render (ConstrainedPixbuf *cp,
-+ gint height);
-+
-+void
-+constrained_pixbuf_compute_layout (GtkWidget *widget,
-+ ConstrainedPixbuf *cp,
-+ int height);
-+
-+#endif /*__CONSTRAINT_SCALING_H__*/
-diff -urNp gnome-panel-2.12.1/gnome-panel/launcher.c gnome-panel-2.12.1-hacked/gnome-panel/launcher.c
---- gnome-panel-2.12.1/gnome-panel/launcher.c 2005-07-22 04:10:33.000000000 +1200
-+++ gnome-panel-2.12.1-hacked/gnome-panel/launcher.c 2005-10-27 18:15:18.305898000 +1300
-@@ -604,7 +604,7 @@ setup_button (Launcher *launcher)
- icon = gnome_desktop_item_get_string (launcher->ditem,
- GNOME_DESKTOP_ITEM_ICON);
- if (!icon)
-- icon = freeme = guess_icon_from_exec (BUTTON_WIDGET (launcher->button)->icon_theme,
-+ icon = freeme = guess_icon_from_exec (gtk_icon_theme_get_for_screen (gtk_widget_get_screen ((launcher->button))),
- launcher->ditem);
-
- button_widget_set_icon_name (BUTTON_WIDGET (launcher->button), sure_string (icon));
-diff -urNp gnome-panel-2.12.1/gnome-panel/main.c gnome-panel-2.12.1-hacked/gnome-panel/main.c
---- gnome-panel-2.12.1/gnome-panel/main.c 2005-06-28 03:27:18.000000000 +1200
-+++ gnome-panel-2.12.1-hacked/gnome-panel/main.c 2005-10-27 18:15:18.291128000 +1300
-@@ -40,6 +40,8 @@ GSList *panel_list = NULL;
-
- GtkTooltips *panel_tooltips = NULL;
-
-+GnomeIconTheme *panel_icon_theme = NULL;
-+
- static const GOptionEntry options[] = {
- { NULL }
- };
-@@ -63,7 +65,9 @@ main (int argc, char **argv)
-
- gnome_authentication_manager_init ();
-
-- gtk_window_set_default_icon_name ("gnome-panel");
-+ panel_icon_theme = gnome_icon_theme_new ();
-+ gnome_icon_theme_set_allow_svg (panel_icon_theme, TRUE);
-+
-
- panel_tooltips = gtk_tooltips_new ();
-
-diff -urNp gnome-panel-2.12.1/gnome-panel/menu.c gnome-panel-2.12.1-hacked/gnome-panel/menu.c
---- gnome-panel-2.12.1/gnome-panel/menu.c 2005-10-27 18:11:51.927300000 +1300
-+++ gnome-panel-2.12.1-hacked/gnome-panel/menu.c 2005-10-27 18:15:18.301192000 +1300
-@@ -276,7 +276,7 @@ panel_create_menu (void)
- if (!registered_icon_theme_changer) {
- registered_icon_theme_changer = TRUE;
-
-- g_signal_connect (gtk_icon_theme_get_default (), "changed",
-+ g_signal_connect (panel_icon_theme, "changed",
- G_CALLBACK (icon_theme_changed), NULL);
- }
-
-diff -urNp gnome-panel-2.12.1/gnome-panel/panel-globals.h gnome-panel-2.12.1-hacked/gnome-panel/panel-globals.h
---- gnome-panel-2.12.1/gnome-panel/panel-globals.h 2005-01-30 04:50:43.000000000 +1300
-+++ gnome-panel-2.12.1-hacked/gnome-panel/panel-globals.h 2005-10-27 18:15:18.304175000 +1300
-@@ -26,6 +26,7 @@
- #define __PANEL_GLOBALS_H__
-
- #include <gtk/gtk.h>
-+#include <libgnomeui/gnome-icon-theme.h>
-
- G_BEGIN_DECLS
-
-@@ -34,6 +35,7 @@ extern GSList *panel_list;
-
- extern GtkTooltips *panel_tooltips;
-
-+extern GnomeIconTheme *panel_icon_theme;
- G_END_DECLS
-
- #endif /* __PANEL_GLOBALS_H__ */
-diff -urNp gnome-panel-2.12.1/gnome-panel/panel-menu-button.c gnome-panel-2.12.1-hacked/gnome-panel/panel-menu-button.c
---- gnome-panel-2.12.1/gnome-panel/panel-menu-button.c 2005-09-18 19:29:05.000000000 +1200
-+++ gnome-panel-2.12.1-hacked/gnome-panel/panel-menu-button.c 2005-10-27 18:15:18.293041000 +1300
-@@ -659,7 +659,10 @@ panel_menu_button_load (const char *men
- gboolean locked,
- int position,
- gboolean exactpos,
-- const char *id)
-+ const char *id,
-+ const char *text,
-+ const char *text_font,
-+ const char *boundary_box)
- {
- PanelMenuButton *button;
- AppletInfo *info;
-@@ -673,6 +676,10 @@ panel_menu_button_load (const char *men
- "use-menu-path", use_menu_path,
- "use-custom-icon", use_custom_icon,
- "has-arrow", TRUE,
-+ "text", text,
-+ "text-font", text_font,
-+ "boundary-box", boundary_box,
-+
- NULL);
-
- info = panel_applet_register (GTK_WIDGET (button), NULL, NULL,
-@@ -891,12 +898,18 @@ panel_menu_button_load_from_gconf (Panel
- int position,
- gboolean exactpos,
- const char *id)
-+
- {
- GConfClient *client;
-+ const char *profile;
- const char *key;
- char *menu_path;
- char *custom_icon;
-- char *tooltip;
-+ char *tooltip = NULL;
-+ char *text = NULL;
-+ char *text_font = NULL;
-+ char *boundary_box = NULL;
-+
- gboolean use_menu_path;
- gboolean use_custom_icon;
-
-@@ -917,6 +930,25 @@ panel_menu_button_load_from_gconf (Panel
- key = panel_gconf_full_key (PANEL_GCONF_OBJECTS, id, "use_custom_icon");
- use_custom_icon = gconf_client_get_bool (client, key, NULL);
-
-+ if (strcmp (menu_path,"applications:/") == 0)
-+ {
-+
-+ key = panel_gconf_full_key (PANEL_GCONF_OBJECTS, id, "text");
-+ text = gconf_client_get_string (client, key, NULL);
-+
-+ key = panel_gconf_full_key (PANEL_GCONF_OBJECTS, id, "text_font");
-+ text_font = gconf_client_get_string (client, key, NULL);
-+
-+ key = panel_gconf_full_key (PANEL_GCONF_OBJECTS, id, "boundary_box");
-+ boundary_box = gconf_client_get_string (client, key, NULL);
-+
-+ if (tooltip == NULL)
-+ tooltip = g_strdup (_("Main Menu"));
-+
-+ if (tooltip != NULL && strcmp (tooltip, "") == 0)
-+ tooltip = g_strdup (_("Main Menu"));
-+ }
-+
- panel_menu_button_load (menu_path,
- use_menu_path,
- custom_icon,
-@@ -926,7 +958,11 @@ panel_menu_button_load_from_gconf (Panel
- locked,
- position,
- exactpos,
-- id);
-+ id,
-+ text,
-+ text_font,
-+ boundary_box);
-+
-
- g_free (menu_path);
- g_free (custom_icon);
-diff -urNp gnome-panel-2.12.1/gnome-panel/panel-object.schemas.in gnome-panel-2.12.1-hacked/gnome-panel/panel-object.schemas.in
---- gnome-panel-2.12.1/gnome-panel/panel-object.schemas.in 2005-01-29 12:41:09.000000000 +1300
-+++ gnome-panel-2.12.1-hacked/gnome-panel/panel-object.schemas.in 2005-10-27 18:15:18.307906000 +1300
-@@ -159,6 +159,53 @@
- </locale>
- </schema>
-
-+ <schema>
-+ <key>/schemas/apps/panel/objects/text</key>
-+ <owner>panel</owner>
-+ <type>string</type>
-+ <default>Launch</default>
-+ <locale name="C">
-+ <default>Launch</default>
-+ <short>Text used for object's button</short>
-+ <long>
-+ The Text that will be drawn on top of the menu button.
-+ </long>
-+ </locale>
-+ </schema>
-+
-+ <schema>
-+ <key>/schemas/apps/panel/objects/text_font</key>
-+ <owner>panel</owner>
-+ <type>string</type>
-+ <default>Bitstream Vera Sans Mono</default>
-+ <locale name="C">
-+ <default>Bitstream Vera Sans Mono</default>
-+ <short>Font used to draw the Text for object's button</short>
-+ <long>
-+ Define the font family which will be used to draw the text
-+ on the menu button (no font size should be added).
-+ </long>
-+ </locale>
-+ </schema>
-+
-+ <schema>
-+ <key>/schemas/apps/panel/objects/boundary_box</key>
-+ <owner>panel</owner>
-+ <type>string</type>
-+ <default>[10, 20, 7, 3]</default>
-+ <locale name="C">
-+ <default>[10, 20, 7, 3]</default>
-+ <short>Boundary box where the text will be drawn</short>
-+ <long>
-+ Define the boundary box where the text will be drawn.
-+ The background image will be scaled accordingly.
-+ [left border, right border, bottom border, top border]
-+ each border correspond to a offset with respect to the
-+ image border.
-+ </long>
-+ </locale>
-+ </schema>
-+
- <!-- Applies to menu buttons -->
-
- <schema>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/gnome-panel-03-workspace-switcher.diff Sat May 13 17:59:05 2006 +0000
@@ -0,0 +1,75 @@
+--- gnome-panel-2.6.1/libpanel-applet/panel-applet.c 2004-02-04 20:27:55.000000000 +0530
++++ gnome-panel-2.6.1-new/libpanel-applet/panel-applet.c 2004-06-09 21:07:35.000000000 +0530
+@@ -111,6 +111,9 @@ enum {
+ };
+
+ static void
++panel_applet_set_preferences_key (PanelApplet *applet,
++ gboolean set);
++static void
+ panel_applet_associate_schemas_in_dir (GConfClient *client,
+ const gchar *prefs_key,
+ const gchar *schema_dir,
+@@ -209,6 +212,7 @@ panel_applet_add_preferences (PanelApple
+ schema_dir, our_error->message);
+ g_error_free (our_error);
+ }
++ panel_applet_set_preferences_key (applet, TRUE);
+ }
+
+ char *
+@@ -224,11 +228,16 @@ panel_applet_get_preferences_key (PanelA
+
+ static void
+ panel_applet_set_preferences_key (PanelApplet *applet,
+- const char *prefs_key)
++ gboolean set)
+ {
+ g_return_if_fail (PANEL_IS_APPLET (applet));
+
+- if (applet->priv->prefs_key) {
++ if (set) {
++ gconf_client_add_dir (applet->priv->client,
++ applet->priv->prefs_key,
++ GCONF_CLIENT_PRELOAD_RECURSIVE,
++ NULL);
++ } else if (applet->priv->prefs_key) {
+ gconf_client_remove_dir (applet->priv->client,
+ applet->priv->prefs_key,
+ NULL);
+@@ -236,15 +245,6 @@ panel_applet_set_preferences_key (PanelA
+ g_free (applet->priv->prefs_key);
+ applet->priv->prefs_key = NULL;
+ }
+-
+- if (prefs_key) {
+- applet->priv->prefs_key = g_strdup (prefs_key);
+-
+- gconf_client_add_dir (applet->priv->client,
+- applet->priv->prefs_key,
+- GCONF_CLIENT_PRELOAD_RECURSIVE,
+- NULL);
+- }
+ }
+
+ PanelAppletFlags
+@@ -397,7 +397,7 @@ panel_applet_finalize (GObject *object)
+ {
+ PanelApplet *applet = PANEL_APPLET (object);
+
+- panel_applet_set_preferences_key (applet, NULL);
++ panel_applet_set_preferences_key (applet, FALSE);
+
+ if (applet->priv->client)
+ g_object_unref (applet->priv->client);
+@@ -1195,7 +1195,7 @@ panel_applet_item_handler_get_object (Bo
+ continue;
+
+ if (!strcmp (option->key, "prefs_key") && !applet->priv->prefs_key)
+- panel_applet_set_preferences_key (applet, option->value);
++ applet->priv->prefs_key = g_strdup (option->value);
+
+ else if (!strcmp (option->key, "background"))
+ bonobo_pbclient_set_string (BONOBO_OBJREF (applet->priv->prop_sack),
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/gnome-panel-04-fish-applet.diff Sat May 13 17:59:05 2006 +0000
@@ -0,0 +1,87 @@
+diff -urNp gnome-panel-2.12.1/applets/Makefile.am gnome-panel-2.12.1-hacked/applets/Makefile.am
+--- gnome-panel-2.12.1/applets/Makefile.am 2003-03-07 13:43:19.000000000 +1300
++++ gnome-panel-2.12.1-hacked/applets/Makefile.am 2005-10-28 13:08:39.637882000 +1300
+@@ -1,6 +1,5 @@
+ SUBDIRS = \
+ clock \
+- fish \
+ notification_area \
+ wncklet
+
+--- gnome-panel-2.13.4/configure.in.orig Mon Jan 16 13:35:04 2006
++++ gnome-panel-2.13.4/configure.in Mon Jan 16 13:37:39 2006
+@@ -207,7 +207,6 @@
+ po/Makefile.in
+ applets/Makefile
+ applets/clock/Makefile
+-applets/fish/Makefile
+ applets/notification_area/Makefile
+ applets/wncklet/Makefile
+ doc/Makefile
+@@ -215,31 +214,24 @@
+ doc/reference/panel-applet/Makefile
+ help/Makefile
+ help/clock/Makefile
+-help/fish/Makefile
+ help/window-list/Makefile
+ help/workspace-switcher/Makefile
+ help/ja/Makefile
+-help/ja/fish/Makefile
+ help/ja/window-list/Makefile
+ help/ja/workspace-switcher/Makefile
+ help/de/Makefile
+-help/de/fish/Makefile
+ help/de/window-list/Makefile
+ help/de/workspace-switcher/Makefile
+ help/sv/Makefile
+-help/sv/fish/Makefile
+ help/sv/window-list/Makefile
+ help/sv/workspace-switcher/Makefile
+ help/ko/Makefile
+-help/ko/fish/Makefile
+ help/ko/window-list/Makefile
+ help/ko/workspace-switcher/Makefile
+ help/zh_CN/Makefile
+-help/zh_CN/fish/Makefile
+ help/zh_CN/window-list/Makefile
+ help/zh_CN/workspace-switcher/Makefile
+ help/zh_TW/Makefile
+-help/zh_TW/fish/Makefile
+ help/zh_TW/window-list/Makefile
+ help/zh_TW/workspace-switcher/Makefile
+ man/Makefile
+--- gnome-panel-2.13.4/help/Makefile.am.orig Mon Jan 16 13:44:56 2006
++++ gnome-panel-2.13.4/help/Makefile.am Mon Jan 16 13:45:02 2006
+@@ -1 +1 @@
+-SUBDIRS = clock fish window-list workspace-switcher ja de sv ko zh_CN zh_TW
++SUBDIRS = clock window-list workspace-switcher ja de sv ko zh_CN zh_TW
+--- gnome-panel-2.13.4/help/ja/Makefile.am.orig Mon Jan 16 13:38:28 2006
++++ gnome-panel-2.13.4/help/ja/Makefile.am Mon Jan 16 13:38:32 2006
+@@ -1 +1 @@
+-SUBDIRS = fish window-list workspace-switcher
++SUBDIRS = window-list workspace-switcher
+--- gnome-panel-2.13.4/help/de/Makefile.am.orig Mon Jan 16 13:37:55 2006
++++ gnome-panel-2.13.4/help/de/Makefile.am Mon Jan 16 13:38:15 2006
+@@ -1 +1 @@
+-SUBDIRS = fish window-list workspace-switcher
++SUBDIRS = window-list workspace-switcher
+--- gnome-panel-2.13.4/help/sv/Makefile.am.orig Mon Jan 16 13:38:43 2006
++++ gnome-panel-2.13.4/help/sv/Makefile.am Mon Jan 16 13:38:45 2006
+@@ -1 +1 @@
+-SUBDIRS = fish window-list workspace-switcher
++SUBDIRS = window-list workspace-switcher
+--- gnome-panel-2.13.4/help/ko/Makefile.am.orig Mon Jan 16 13:38:37 2006
++++ gnome-panel-2.13.4/help/ko/Makefile.am Mon Jan 16 13:38:39 2006
+@@ -1 +1 @@
+-SUBDIRS = fish window-list workspace-switcher
++SUBDIRS = window-list workspace-switcher
+--- gnome-panel-2.13.4/help/zh_CN/Makefile.am.orig Mon Jan 16 13:38:55 2006
++++ gnome-panel-2.13.4/help/zh_CN/Makefile.am Mon Jan 16 13:38:56 2006
+@@ -1 +1 @@
+-SUBDIRS = fish window-list workspace-switcher
++SUBDIRS = window-list workspace-switcher
+--- gnome-panel-2.13.4/help/zh_TW/Makefile.am.orig Mon Jan 16 13:39:03 2006
++++ gnome-panel-2.13.4/help/zh_TW/Makefile.am Mon Jan 16 13:39:13 2006
+@@ -1 +1 @@
+-SUBDIRS = fish window-list workspace-switcher
++SUBDIRS = window-list workspace-switcher
--- a/patches/gnome-panel-04-workspace-switcher.diff Sat May 13 01:34:47 2006 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
---- gnome-panel-2.6.1/libpanel-applet/panel-applet.c 2004-02-04 20:27:55.000000000 +0530
-+++ gnome-panel-2.6.1-new/libpanel-applet/panel-applet.c 2004-06-09 21:07:35.000000000 +0530
-@@ -111,6 +111,9 @@ enum {
- };
-
- static void
-+panel_applet_set_preferences_key (PanelApplet *applet,
-+ gboolean set);
-+static void
- panel_applet_associate_schemas_in_dir (GConfClient *client,
- const gchar *prefs_key,
- const gchar *schema_dir,
-@@ -209,6 +212,7 @@ panel_applet_add_preferences (PanelApple
- schema_dir, our_error->message);
- g_error_free (our_error);
- }
-+ panel_applet_set_preferences_key (applet, TRUE);
- }
-
- char *
-@@ -224,11 +228,16 @@ panel_applet_get_preferences_key (PanelA
-
- static void
- panel_applet_set_preferences_key (PanelApplet *applet,
-- const char *prefs_key)
-+ gboolean set)
- {
- g_return_if_fail (PANEL_IS_APPLET (applet));
-
-- if (applet->priv->prefs_key) {
-+ if (set) {
-+ gconf_client_add_dir (applet->priv->client,
-+ applet->priv->prefs_key,
-+ GCONF_CLIENT_PRELOAD_RECURSIVE,
-+ NULL);
-+ } else if (applet->priv->prefs_key) {
- gconf_client_remove_dir (applet->priv->client,
- applet->priv->prefs_key,
- NULL);
-@@ -236,15 +245,6 @@ panel_applet_set_preferences_key (PanelA
- g_free (applet->priv->prefs_key);
- applet->priv->prefs_key = NULL;
- }
--
-- if (prefs_key) {
-- applet->priv->prefs_key = g_strdup (prefs_key);
--
-- gconf_client_add_dir (applet->priv->client,
-- applet->priv->prefs_key,
-- GCONF_CLIENT_PRELOAD_RECURSIVE,
-- NULL);
-- }
- }
-
- PanelAppletFlags
-@@ -397,7 +397,7 @@ panel_applet_finalize (GObject *object)
- {
- PanelApplet *applet = PANEL_APPLET (object);
-
-- panel_applet_set_preferences_key (applet, NULL);
-+ panel_applet_set_preferences_key (applet, FALSE);
-
- if (applet->priv->client)
- g_object_unref (applet->priv->client);
-@@ -1195,7 +1195,7 @@ panel_applet_item_handler_get_object (Bo
- continue;
-
- if (!strcmp (option->key, "prefs_key") && !applet->priv->prefs_key)
-- panel_applet_set_preferences_key (applet, option->value);
-+ applet->priv->prefs_key = g_strdup (option->value);
-
- else if (!strcmp (option->key, "background"))
- bonobo_pbclient_set_string (BONOBO_OBJREF (applet->priv->prop_sack),
-
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/gnome-panel-05-concurrent-login.diff Sat May 13 17:59:05 2006 +0000
@@ -0,0 +1,71 @@
+--- gnome-panel-2.6.1/gnome-panel/panel-gconf.c 2004-04-02 18:05:41.000000000 +0100
++++ gnome-panel-2.6.1-new/gnome-panel/panel-gconf.c 2004-10-08 11:17:41.343758872 +0100
+@@ -104,13 +104,13 @@ panel_gconf_key_type_to_id_list (PanelGC
+
+ switch (type) {
+ case PANEL_GCONF_TOPLEVELS:
+- retval = "toplevel_id_list";
++ retval = "toplevel_id_list_jds";
+ break;
+ case PANEL_GCONF_APPLETS:
+- retval = "applet_id_list";
++ retval = "applet_id_list_jds";
+ break;
+ case PANEL_GCONF_OBJECTS:
+- retval = "object_id_list";
++ retval = "object_id_list_jds";
+ break;
+ default:
+ retval = NULL;
+--- gnome-panel-2.6.1/gnome-panel/panel-profile.c 2004-04-02 18:05:41.000000000 +0100
++++ gnome-panel-2.6.1-new/gnome-panel/panel-profile.c 2004-10-08 11:19:29.073381480 +0100
+@@ -2365,8 +2365,14 @@ panel_profile_load (void)
+
+ panel_compatibility_maybe_copy_old_config (client);
+
++ /* Commenting this out till we figure out a clean way to migrate
++ objects of previous version of a release to the newer version
++ along with the objects that we intend to add in the newer version
++
+ panel_compatibility_migrate_panel_id_list (client);
+
++ */
++
+ gconf_client_add_dir (client, PANEL_CONFIG_DIR "/general", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+
+ panel_profile_load_list (client,
+--- gnome-panel-2.6.1/gnome-panel/panel-default-setup.entries 2004-10-07 19:02:01.000000000 +0100
++++ gnome-panel-2.6.1-new/gnome-panel/panel-default-setup.entries 2004-10-08 11:17:17.548376320 +0100
+@@ -5,8 +5,8 @@
+ <!-- List of toplevels -->
+
+ <entry>
+- <key>general/toplevel_id_list</key>
+- <schema_key>/schemas/apps/panel/general/toplevel_id_list</schema_key>
++ <key>general/toplevel_id_list_jds</key>
++ <schema_key>/schemas/apps/panel/general/toplevel_id_list_jds</schema_key>
+ <value>
+ <list type="string">
+ <value>
+@@ -19,8 +19,8 @@
+ <!-- List of objects -->
+
+ <entry>
+- <key>general/object_id_list</key>
+- <schema_key>/schemas/apps/panel/general/object_id_list</schema_key>
++ <key>general/object_id_list_jds</key>
++ <schema_key>/schemas/apps/panel/general/object_id_list_jds</schema_key>
+ <value>
+ <list type="string">
+ <value>
+@@ -33,8 +33,8 @@
+ <!-- List of applets -->
+
+ <entry>
+- <key>general/applet_id_list</key>
+- <schema_key>/schemas/apps/panel/general/applet_id_list</schema_key>
++ <key>general/applet_id_list_jds</key>
++ <schema_key>/schemas/apps/panel/general/applet_id_list_jds</schema_key>
+ <value>
+ <list type="string">
+ <value>
--- a/patches/gnome-panel-05-fish-applet.diff Sat May 13 01:34:47 2006 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-diff -urNp gnome-panel-2.12.1/applets/Makefile.am gnome-panel-2.12.1-hacked/applets/Makefile.am
---- gnome-panel-2.12.1/applets/Makefile.am 2003-03-07 13:43:19.000000000 +1300
-+++ gnome-panel-2.12.1-hacked/applets/Makefile.am 2005-10-28 13:08:39.637882000 +1300
-@@ -1,6 +1,5 @@
- SUBDIRS = \
- clock \
-- fish \
- notification_area \
- wncklet
-
---- gnome-panel-2.13.4/configure.in.orig Mon Jan 16 13:35:04 2006
-+++ gnome-panel-2.13.4/configure.in Mon Jan 16 13:37:39 2006
-@@ -207,7 +207,6 @@
- po/Makefile.in
- applets/Makefile
- applets/clock/Makefile
--applets/fish/Makefile
- applets/notification_area/Makefile
- applets/wncklet/Makefile
- doc/Makefile
-@@ -215,31 +214,24 @@
- doc/reference/panel-applet/Makefile
- help/Makefile
- help/clock/Makefile
--help/fish/Makefile
- help/window-list/Makefile
- help/workspace-switcher/Makefile
- help/ja/Makefile
--help/ja/fish/Makefile
- help/ja/window-list/Makefile
- help/ja/workspace-switcher/Makefile
- help/de/Makefile
--help/de/fish/Makefile
- help/de/window-list/Makefile
- help/de/workspace-switcher/Makefile
- help/sv/Makefile
--help/sv/fish/Makefile
- help/sv/window-list/Makefile
- help/sv/workspace-switcher/Makefile
- help/ko/Makefile
--help/ko/fish/Makefile
- help/ko/window-list/Makefile
- help/ko/workspace-switcher/Makefile
- help/zh_CN/Makefile
--help/zh_CN/fish/Makefile
- help/zh_CN/window-list/Makefile
- help/zh_CN/workspace-switcher/Makefile
- help/zh_TW/Makefile
--help/zh_TW/fish/Makefile
- help/zh_TW/window-list/Makefile
- help/zh_TW/workspace-switcher/Makefile
- man/Makefile
---- gnome-panel-2.13.4/help/Makefile.am.orig Mon Jan 16 13:44:56 2006
-+++ gnome-panel-2.13.4/help/Makefile.am Mon Jan 16 13:45:02 2006
-@@ -1 +1 @@
--SUBDIRS = clock fish window-list workspace-switcher ja de sv ko zh_CN zh_TW
-+SUBDIRS = clock window-list workspace-switcher ja de sv ko zh_CN zh_TW
---- gnome-panel-2.13.4/help/ja/Makefile.am.orig Mon Jan 16 13:38:28 2006
-+++ gnome-panel-2.13.4/help/ja/Makefile.am Mon Jan 16 13:38:32 2006
-@@ -1 +1 @@
--SUBDIRS = fish window-list workspace-switcher
-+SUBDIRS = window-list workspace-switcher
---- gnome-panel-2.13.4/help/de/Makefile.am.orig Mon Jan 16 13:37:55 2006
-+++ gnome-panel-2.13.4/help/de/Makefile.am Mon Jan 16 13:38:15 2006
-@@ -1 +1 @@
--SUBDIRS = fish window-list workspace-switcher
-+SUBDIRS = window-list workspace-switcher
---- gnome-panel-2.13.4/help/sv/Makefile.am.orig Mon Jan 16 13:38:43 2006
-+++ gnome-panel-2.13.4/help/sv/Makefile.am Mon Jan 16 13:38:45 2006
-@@ -1 +1 @@
--SUBDIRS = fish window-list workspace-switcher
-+SUBDIRS = window-list workspace-switcher
---- gnome-panel-2.13.4/help/ko/Makefile.am.orig Mon Jan 16 13:38:37 2006
-+++ gnome-panel-2.13.4/help/ko/Makefile.am Mon Jan 16 13:38:39 2006
-@@ -1 +1 @@
--SUBDIRS = fish window-list workspace-switcher
-+SUBDIRS = window-list workspace-switcher
---- gnome-panel-2.13.4/help/zh_CN/Makefile.am.orig Mon Jan 16 13:38:55 2006
-+++ gnome-panel-2.13.4/help/zh_CN/Makefile.am Mon Jan 16 13:38:56 2006
-@@ -1 +1 @@
--SUBDIRS = fish window-list workspace-switcher
-+SUBDIRS = window-list workspace-switcher
---- gnome-panel-2.13.4/help/zh_TW/Makefile.am.orig Mon Jan 16 13:39:03 2006
-+++ gnome-panel-2.13.4/help/zh_TW/Makefile.am Mon Jan 16 13:39:13 2006
-@@ -1 +1 @@
--SUBDIRS = fish window-list workspace-switcher
-+SUBDIRS = window-list workspace-switcher
--- a/patches/gnome-panel-06-concurrent-login.diff Sat May 13 01:34:47 2006 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
---- gnome-panel-2.6.1/gnome-panel/panel-gconf.c 2004-04-02 18:05:41.000000000 +0100
-+++ gnome-panel-2.6.1-new/gnome-panel/panel-gconf.c 2004-10-08 11:17:41.343758872 +0100
-@@ -104,13 +104,13 @@ panel_gconf_key_type_to_id_list (PanelGC
-
- switch (type) {
- case PANEL_GCONF_TOPLEVELS:
-- retval = "toplevel_id_list";
-+ retval = "toplevel_id_list_jds";
- break;
- case PANEL_GCONF_APPLETS:
-- retval = "applet_id_list";
-+ retval = "applet_id_list_jds";
- break;
- case PANEL_GCONF_OBJECTS:
-- retval = "object_id_list";
-+ retval = "object_id_list_jds";
- break;
- default:
- retval = NULL;
---- gnome-panel-2.6.1/gnome-panel/panel-profile.c 2004-04-02 18:05:41.000000000 +0100
-+++ gnome-panel-2.6.1-new/gnome-panel/panel-profile.c 2004-10-08 11:19:29.073381480 +0100
-@@ -2365,8 +2365,14 @@ panel_profile_load (void)
-
- panel_compatibility_maybe_copy_old_config (client);
-
-+ /* Commenting this out till we figure out a clean way to migrate
-+ objects of previous version of a release to the newer version
-+ along with the objects that we intend to add in the newer version
-+
- panel_compatibility_migrate_panel_id_list (client);
-
-+ */
-+
- gconf_client_add_dir (client, PANEL_CONFIG_DIR "/general", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
-
- panel_profile_load_list (client,
---- gnome-panel-2.6.1/gnome-panel/panel-default-setup.entries 2004-10-07 19:02:01.000000000 +0100
-+++ gnome-panel-2.6.1-new/gnome-panel/panel-default-setup.entries 2004-10-08 11:17:17.548376320 +0100
-@@ -5,8 +5,8 @@
- <!-- List of toplevels -->
-
- <entry>
-- <key>general/toplevel_id_list</key>
-- <schema_key>/schemas/apps/panel/general/toplevel_id_list</schema_key>
-+ <key>general/toplevel_id_list_jds</key>
-+ <schema_key>/schemas/apps/panel/general/toplevel_id_list_jds</schema_key>
- <value>
- <list type="string">
- <value>
-@@ -19,8 +19,8 @@
- <!-- List of objects -->
-
- <entry>
-- <key>general/object_id_list</key>
-- <schema_key>/schemas/apps/panel/general/object_id_list</schema_key>
-+ <key>general/object_id_list_jds</key>
-+ <schema_key>/schemas/apps/panel/general/object_id_list_jds</schema_key>
- <value>
- <list type="string">
- <value>
-@@ -33,8 +33,8 @@
- <!-- List of applets -->
-
- <entry>
-- <key>general/applet_id_list</key>
-- <schema_key>/schemas/apps/panel/general/applet_id_list</schema_key>
-+ <key>general/applet_id_list_jds</key>
-+ <schema_key>/schemas/apps/panel/general/applet_id_list_jds</schema_key>
- <value>
- <list type="string">
- <value>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/gnome-panel-06-panel-applet-session-never-restart.diff Sat May 13 17:59:05 2006 +0000
@@ -0,0 +1,53 @@
+--- gnome-panel-2.14.1/libpanel-applet/panel-applet.h.orig 2006-04-13 18:12:51.122226000 +0100
++++ gnome-panel-2.14.1/libpanel-applet/panel-applet.h 2006-04-13 18:27:50.227047000 +0100
+@@ -183,6 +183,18 @@
+ * + optional : PREFIX, SYSCONFDIR, DATADIR and LIBDIR.
+ */
+
++static void panel_applet_session_never_restart (void);
++
++void panel_applet_session_never_restart ()
++{
++ GnomeClient *client;
++ client = gnome_master_client ();
++ gnome_client_set_restart_style (client, GNOME_RESTART_NEVER);
++ gnome_client_connect (client);
++ gnome_client_flush (client);
++}
++
++#define PANEL_APPLET_SESSION_NEVER_RESTART panel_applet_session_never_restart()
+ #if !defined(ENABLE_NLS)
+ #if defined(PREFIX) && defined(SYSCONFDIR) && defined(DATADIR) && defined(LIBDIR)
+ #define PANEL_APPLET_BONOBO_FACTORY(iid, type, name, version, callback, data) \
+@@ -210,6 +210,7 @@
+ GNOME_CLIENT_PARAM_SM_CONNECT, FALSE, \
+ GNOME_PROGRAM_STANDARD_PROPERTIES, \
+ NULL); \
++ PANEL_APPLET_SESSION_NEVER_RESTART; \
+ retval = panel_applet_factory_main (iid, type, callback, data); \
+ g_object_unref (program); \
+ return retval; \
+@@ -225,6 +226,7 @@
+ argc, argv, \
+ GNOME_CLIENT_PARAM_SM_CONNECT, FALSE, \
+ GNOME_PARAM_NONE); \
++ PANEL_APPLET_SESSION_NEVER_RESTART; \
+ retval = panel_applet_factory_main (iid, type, callback, data); \
+ g_object_unref (program); \
+ return retval; \
+@@ -247,6 +249,7 @@
+ GNOME_CLIENT_PARAM_SM_CONNECT, FALSE, \
+ GNOME_PROGRAM_STANDARD_PROPERTIES, \
+ NULL); \
++ PANEL_APPLET_SESSION_NEVER_RESTART; \
+ retval = panel_applet_factory_main (iid, type, callback, data); \
+ g_object_unref (program); \
+ return retval; \
+@@ -265,6 +268,7 @@
+ argc, argv, \
+ GNOME_CLIENT_PARAM_SM_CONNECT, FALSE, \
+ GNOME_PARAM_NONE); \
++ PANEL_APPLET_SESSION_NEVER_RESTART; \
+ retval = panel_applet_factory_main (iid, type, callback, data); \
+ g_object_unref (program); \
+ return retval; \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/gnome-panel-07-notificationarea-tooltip.diff Sat May 13 17:59:05 2006 +0000
@@ -0,0 +1,62 @@
+--- gnome-panel-2.6.1/applets/notification_area/main.c 2005-05-12 17:24:33.245309000 -0500
++++ gnome-panel-2.6.1/applets/notification_area/main.c 2005-05-12 17:26:23.198974000 -0500
+@@ -54,11 +54,25 @@ typedef struct
+ GtkWidget *box;
+ GtkWidget *about_dialog;
+ GtkWidget *frame;
++ GtkTooltips *tooltips;
+
++ GSList *icons;
+ GtkOrientation orientation;
+ } SystemTray;
+
+ static void
++set_tooltip (SystemTray *tray)
++{
++ tray->tooltips = gtk_tooltips_new ();
++ g_object_ref (tray->tooltips);
++ gtk_object_sink (GTK_OBJECT (tray->tooltips));
++ g_object_set_data_full (G_OBJECT (tray->tooltips), "tooltips", tray->tooltips,
++ (GDestroyNotify) g_object_unref);
++ gtk_tooltips_set_tip (tray->tooltips, GTK_WIDGET (tray->applet),
++ _("Area where notification icons appear"), NULL);
++}
++
++static void
+ help_cb (BonoboUIComponent *uic,
+ SystemTray *tray,
+ const gchar *verbname)
+@@ -159,6 +173,10 @@ tray_added (EggTrayManager *manager, Gtk
+ tray = all_trays->data;
+
+ gtk_box_pack_end (GTK_BOX (tray->box), icon, FALSE, FALSE, 0);
++
++ tray->icons = g_slist_append (tray->icons, icon);
++
++ gtk_tooltips_disable (tray->tooltips);
+
+ gtk_widget_show (icon);
+ }
+@@ -166,7 +184,13 @@ tray_added (EggTrayManager *manager, Gtk
+ static void
+ tray_removed (EggTrayManager *manager, GtkWidget *icon, void *data)
+ {
++ SystemTray *tray;
+
++ tray = all_trays->data;
++ tray->icons = g_slist_remove (tray->icons, icon);
++
++ if (g_slist_length (tray->icons) == 0)
++ gtk_tooltips_enable (tray->tooltips);
+ }
+
+ static void
+@@ -381,6 +405,8 @@ applet_factory (PanelApplet *applet,
+ tray);
+
+ update_size_and_orientation (tray);
++
++ set_tooltip (tray);
+
+ gtk_container_add (GTK_CONTAINER (tray->applet), tray->frame);
+
--- a/patches/gnome-panel-07-panel-applet-session-never-restart.diff Sat May 13 01:34:47 2006 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
---- gnome-panel-2.14.1/libpanel-applet/panel-applet.h.orig 2006-04-13 18:12:51.122226000 +0100
-+++ gnome-panel-2.14.1/libpanel-applet/panel-applet.h 2006-04-13 18:27:50.227047000 +0100
-@@ -183,6 +183,18 @@
- * + optional : PREFIX, SYSCONFDIR, DATADIR and LIBDIR.
- */
-
-+static void panel_applet_session_never_restart (void);
-+
-+void panel_applet_session_never_restart ()
-+{
-+ GnomeClient *client;
-+ client = gnome_master_client ();
-+ gnome_client_set_restart_style (client, GNOME_RESTART_NEVER);
-+ gnome_client_connect (client);
-+ gnome_client_flush (client);
-+}
-+
-+#define PANEL_APPLET_SESSION_NEVER_RESTART panel_applet_session_never_restart()
- #if !defined(ENABLE_NLS)
- #if defined(PREFIX) && defined(SYSCONFDIR) && defined(DATADIR) && defined(LIBDIR)
- #define PANEL_APPLET_BONOBO_FACTORY(iid, type, name, version, callback, data) \
-@@ -210,6 +210,7 @@
- GNOME_CLIENT_PARAM_SM_CONNECT, FALSE, \
- GNOME_PROGRAM_STANDARD_PROPERTIES, \
- NULL); \
-+ PANEL_APPLET_SESSION_NEVER_RESTART; \
- retval = panel_applet_factory_main (iid, type, callback, data); \
- g_object_unref (program); \
- return retval; \
-@@ -225,6 +226,7 @@
- argc, argv, \
- GNOME_CLIENT_PARAM_SM_CONNECT, FALSE, \
- GNOME_PARAM_NONE); \
-+ PANEL_APPLET_SESSION_NEVER_RESTART; \
- retval = panel_applet_factory_main (iid, type, callback, data); \
- g_object_unref (program); \
- return retval; \
-@@ -247,6 +249,7 @@
- GNOME_CLIENT_PARAM_SM_CONNECT, FALSE, \
- GNOME_PROGRAM_STANDARD_PROPERTIES, \
- NULL); \
-+ PANEL_APPLET_SESSION_NEVER_RESTART; \
- retval = panel_applet_factory_main (iid, type, callback, data); \
- g_object_unref (program); \
- return retval; \
-@@ -265,6 +268,7 @@
- argc, argv, \
- GNOME_CLIENT_PARAM_SM_CONNECT, FALSE, \
- GNOME_PARAM_NONE); \
-+ PANEL_APPLET_SESSION_NEVER_RESTART; \
- retval = panel_applet_factory_main (iid, type, callback, data); \
- g_object_unref (program); \
- return retval; \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/gnome-panel-08-input-method-filter-keypress.diff Sat May 13 17:59:05 2006 +0000
@@ -0,0 +1,15 @@
+--- gnome-panel-2.13.3/gnome-panel/panel-run-dialog.c.orig 2006-01-04 17:43:03.000999000 +0000
++++ gnome-panel-2.13.3/gnome-panel/panel-run-dialog.c 2006-01-04 17:44:14.640718000 +0000
+@@ -1357,6 +1357,12 @@
+ char *temp;
+ int pos, tmp;
+
++ /* commit the string when IM is enable */
++ if (GTK_ENTRY (entry)->editable && event->type == GDK_KEY_PRESS && event->length > 0) {
++ if (gtk_im_context_filter_keypress (GTK_ENTRY (entry)->im_context, event))
++ return TRUE;
++ }
++
+ if (event->type != GDK_KEY_PRESS)
+ return FALSE;
+
--- a/patches/gnome-panel-08-notificationarea-tooltip.diff Sat May 13 01:34:47 2006 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
---- gnome-panel-2.6.1/applets/notification_area/main.c 2005-05-12 17:24:33.245309000 -0500
-+++ gnome-panel-2.6.1/applets/notification_area/main.c 2005-05-12 17:26:23.198974000 -0500
-@@ -54,11 +54,25 @@ typedef struct
- GtkWidget *box;
- GtkWidget *about_dialog;
- GtkWidget *frame;
-+ GtkTooltips *tooltips;
-
-+ GSList *icons;
- GtkOrientation orientation;
- } SystemTray;
-
- static void
-+set_tooltip (SystemTray *tray)
-+{
-+ tray->tooltips = gtk_tooltips_new ();
-+ g_object_ref (tray->tooltips);
-+ gtk_object_sink (GTK_OBJECT (tray->tooltips));
-+ g_object_set_data_full (G_OBJECT (tray->tooltips), "tooltips", tray->tooltips,
-+ (GDestroyNotify) g_object_unref);
-+ gtk_tooltips_set_tip (tray->tooltips, GTK_WIDGET (tray->applet),
-+ _("Area where notification icons appear"), NULL);
-+}
-+
-+static void
- help_cb (BonoboUIComponent *uic,
- SystemTray *tray,
- const gchar *verbname)
-@@ -159,6 +173,10 @@ tray_added (EggTrayManager *manager, Gtk
- tray = all_trays->data;
-
- gtk_box_pack_end (GTK_BOX (tray->box), icon, FALSE, FALSE, 0);
-+
-+ tray->icons = g_slist_append (tray->icons, icon);
-+
-+ gtk_tooltips_disable (tray->tooltips);
-
- gtk_widget_show (icon);
- }
-@@ -166,7 +184,13 @@ tray_added (EggTrayManager *manager, Gtk
- static void
- tray_removed (EggTrayManager *manager, GtkWidget *icon, void *data)
- {
-+ SystemTray *tray;
-
-+ tray = all_trays->data;
-+ tray->icons = g_slist_remove (tray->icons, icon);
-+
-+ if (g_slist_length (tray->icons) == 0)
-+ gtk_tooltips_enable (tray->tooltips);
- }
-
- static void
-@@ -381,6 +405,8 @@ applet_factory (PanelApplet *applet,
- tray);
-
- update_size_and_orientation (tray);
-+
-+ set_tooltip (tray);
-
- gtk_container_add (GTK_CONTAINER (tray->applet), tray->frame);
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/gnome-panel-09-clock-timezone.diff Sat May 13 17:59:05 2006 +0000
@@ -0,0 +1,2965 @@
+--- gnome-panel-2.10.1/applets/clock/clock.c 2005-06-30 22:24:08.063906512 +0530
++++ gnome-panel-2.10.1-new/applets/clock/clock.c 2005-06-30 22:37:14.807303336 +0530
+@@ -60,16 +60,7 @@
+ #include <libgnome/gnome-init.h>
+ #include <libgnomeui/gnome-url.h>
+
+-#ifdef HAVE_LIBECAL
+-#include "calendar-client.h"
+-#endif
+-
+-#define INTERNETSECOND (864)
+-#define INTERNETBEAT (86400)
+-
+-#define N_GCONF_PREFS 7
+-
+-#define NEVER_SENSITIVE "never_sensitive"
++#include "clock.h"
+
+ static const char* KEY_FORMAT = "format";
+ static const char* KEY_SHOW_SECONDS = "show_seconds";
+@@ -78,6 +69,7 @@ static const char* KEY_GMT_TIME = "
+ static const char* KEY_CONFIG_TOOL = "config_tool";
+ static const char* KEY_CUSTOM_FORMAT = "custom_format";
+ static const char* KEY_SHOW_WEEK = "show_week_numbers";
++static const char* KEY_SHOW_ZONES = "show_zones";
+
+ static const char *clock_config_tools [] = {
+ "gnome-time-settings",
+@@ -86,16 +78,6 @@ static const char *clock_config_tools []
+ "time-admin",
+ };
+
+-/* Needs to match the indices in the combo */
+-typedef enum {
+- CLOCK_FORMAT_INVALID = 0,
+- CLOCK_FORMAT_12,
+- CLOCK_FORMAT_24,
+- CLOCK_FORMAT_UNIX,
+- CLOCK_FORMAT_INTERNET,
+- CLOCK_FORMAT_CUSTOM
+-} ClockFormat;
+-
+ static GConfEnumStringPair format_type_enum_map [] = {
+ { CLOCK_FORMAT_12, "12-hour" },
+ { CLOCK_FORMAT_24, "24-hour" },
+@@ -88,62 +88,6 @@
+ { 0, NULL }
+ };
+
+-typedef struct _ClockData ClockData;
+-
+-struct _ClockData {
+- /* widgets */
+- GtkWidget *applet;
+- GtkWidget *clockw;
+- GtkWidget *toggle;
+- GtkWidget *props;
+- GtkWidget *about;
+- GtkWidget *calendar_popup;
+- GtkWidget *calendar;
+-
+-#ifdef HAVE_LIBECAL
+- GtkWidget *task_list;
+- GtkWidget *appointment_list;
+-
+- GtkListStore *appointments_model;
+- GtkListStore *tasks_model;
+- GtkTreeModelFilter *tasks_filter;
+-
+- CalendarClient *client;
+-#endif /* HAVE_LIBECAL */
+-
+- /* preferences */
+- ClockFormat format;
+- char *custom_format;
+- gboolean showseconds;
+- gboolean showdate;
+- gboolean gmt_time;
+- gboolean showweek;
+-
+- char *config_tool;
+-
+- /* runtime data */
+- time_t current_time;
+- char *timeformat;
+- guint timeout;
+- PanelAppletOrient orient;
+- int size;
+-
+- int fixed_width;
+- int fixed_height;
+-
+- GtkWidget *showseconds_check;
+- GtkWidget *showdate_check;
+- GtkWidget *gmt_time_check;
+- GtkWidget *custom_hbox;
+- GtkWidget *custom_label;
+- GtkWidget *custom_entry;
+- gboolean custom_format_shown;
+-
+- gboolean can_handle_format_12;
+-
+- guint listeners [N_GCONF_PREFS];
+-};
+-
+ static void update_clock (ClockData * cd);
+ static float get_itime (time_t current_time);
+
+@@ -186,10 +114,10 @@ unfix_size (ClockData *cd)
+ gtk_widget_queue_resize (cd->toggle);
+ }
+
+-static void
+-set_tooltip (GtkWidget *applet,
+- GtkWidget *widget,
+- const char *tip)
++void
++clock_set_tooltip (GtkWidget *applet,
++ GtkWidget *widget,
++ const char *tip)
+ {
+ GtkTooltips *tooltips;
+
+@@ -350,8 +350,32 @@
+ g_free (loc);
+
+ utf8 = g_locale_to_utf8 (date, -1, NULL, NULL, NULL);
+- set_tooltip (cd->applet, cd->toggle, utf8);
++ clock_set_tooltip (cd->applet, cd->toggle, utf8);
+ g_free (utf8);
++
++ if (cd->multizone_popup && cd->tip_list && GTK_WIDGET_MAPPED (cd->multizone_popup)) {
++ GSList *tmp_list;
++ char timeformat [128];
++ char *cr;
++
++ g_stpcpy (timeformat, cd->timeformat);
++ cr = g_strrstr (timeformat, "\n");
++ if (cr)
++ *cr = ' ';
++
++ for (tmp_list = cd->tip_list; tmp_list ; tmp_list = tmp_list->next) {
++ char tip_hour[256];
++ TipZone *tip_zone = tmp_list->data;
++
++ tm = tz_get_localtime_at (tip_zone->zone, &cd->current_time);
++
++ if (strftime (tip_hour, sizeof (tip_hour), timeformat, tm) <= 0)
++ strcpy (tip_hour, "???");
++
++ gtk_label_set_text (GTK_LABEL (tip_zone->time_label),
++ g_locale_to_utf8 (tip_hour, -1, NULL, NULL, NULL));
++ }
++ }
+ } else {
+ #ifdef HAVE_LIBECAL
+ set_tooltip (cd->applet, cd->toggle, _("Click to view your appointments and tasks"));
+@@ -465,6 +417,14 @@ destroy_clock(GtkWidget * widget, ClockD
+ gtk_widget_destroy (cd->calendar_popup);
+ cd->calendar_popup = NULL;
+
++ if (cd->multizone_popup)
++ gtk_widget_destroy (cd->multizone_popup);
++ cd->multizone_popup = NULL;
++
++ if (cd->timezone_dialog)
++ gtk_widget_destroy (cd->timezone_dialog);
++ cd->timezone_dialog = NULL;
++
+ g_free (cd->timeformat);
+ g_free (cd->config_tool);
+ g_free (cd->custom_format);
+@@ -1448,12 +1408,46 @@ present_calendar_popup (ClockData *cd,
+ }
+
+ static void
++pop_timezones (ClockData *cd)
++{
++ GtkWidget *button = cd->multizone_toggle;
++
++ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button))) {
++ GtkWidget *calendar = g_object_get_data (G_OBJECT (button), "calendar");
++
++ if (!cd->multizone_popup) {
++ cd->multizone_popup = create_multi_timezones_popup (cd, gtk_widget_get_screen (cd->applet));
++ }
++
++ refresh_clock (cd);
++ gtk_widget_show_all (cd->multizone_popup);
++
++ if (calendar) {
++ gtk_widget_hide (calendar);
++ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->toggle), FALSE);
++ }
++
++ present_calendar_popup (cd, cd->multizone_popup, button);
++ } else {
++ if (cd->multizone_popup)
++ gtk_widget_hide (cd->multizone_popup);
++ }
++
++ update_clock (cd);
++}
++
++static void
+ update_popup (ClockData *cd)
+ {
++ GtkWindow *window;
++
++ window = g_object_get_data (G_OBJECT (cd->toggle), "calendar");
++
+ if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cd->toggle))) {
+ if (cd->calendar_popup)
+ gtk_widget_destroy (cd->calendar_popup);
+ cd->calendar_popup = NULL;
++ g_object_set_data (G_OBJECT (cd->toggle), "calendar", NULL);
+ return;
+ }
+
+@@ -1461,9 +1455,15 @@ update_popup (ClockData *cd)
+ cd->calendar_popup = create_calendar (cd, gtk_widget_get_screen (cd->applet));
+ g_object_add_weak_pointer (G_OBJECT (cd->calendar_popup),
+ (gpointer *) &cd->calendar_popup);
++ g_object_set_data (G_OBJECT (cd->toggle), "calendar", cd->calendar_popup);
+ }
+
+ if (cd->calendar_popup && GTK_WIDGET_REALIZED (cd->toggle)) {
++ if (cd->multizone_popup) {
++ gtk_widget_hide (cd->multizone_popup);
++ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->multizone_toggle), FALSE);
++ }
++
+ #ifdef HAVE_LIBECAL
+ if (cd->tasks_filter && cd->task_list)
+ gtk_tree_model_filter_refilter (cd->tasks_filter);
+@@ -1475,6 +1475,12 @@ update_popup (ClockData *cd)
+ }
+
+ static void
++toggle_timezone (GtkWidget *button, ClockData *cd)
++{
++ pop_timezones (cd);
++}
++
++static void
+ toggle_calendar (GtkWidget *button,
+ ClockData *cd)
+ {
+@@ -1530,12 +1536,92 @@ force_no_focus_padding (GtkWidget *widge
+ }
+
+ static void
++change_clock_orientation (ClockData *cd)
++{
++ GtkWidget *box;
++
++ switch (cd->orient) {
++ case PANEL_APPLET_ORIENT_RIGHT:
++ case PANEL_APPLET_ORIENT_LEFT:
++ box = gtk_vbox_new (FALSE, 1);
++ break;
++ case PANEL_APPLET_ORIENT_DOWN:
++ case PANEL_APPLET_ORIENT_UP:
++ box = gtk_hbox_new (FALSE, 1);
++ break;
++ }
++
++ if (cd->hbox) {
++ gtk_widget_reparent (cd->multizone_toggle, box);
++ gtk_widget_reparent (cd->toggle, box);
++ gtk_container_remove (GTK_CONTAINER (cd->applet), cd->hbox);
++ } else {
++ gtk_container_add (GTK_CONTAINER (box), cd->multizone_toggle);
++ gtk_container_add (GTK_CONTAINER (box), cd->toggle);
++ }
++
++ cd->hbox = box;
++ gtk_container_add (GTK_CONTAINER (cd->applet), box);
++ gtk_widget_show_all (box);
++
++ if (!cd->show_multiple_timezones)
++ gtk_widget_hide (cd->multizone_toggle);
++}
++
++static void
++multizone_scale_image (GtkWidget *widget,
++ GtkAllocation *allocation,
++ ClockData *cd)
++{
++#define TOGGLE_BUTTON_BORDER 10
++ GdkPixbuf *pb;
++ int w, h, new_w, new_h;
++ gboolean need_to_scale = FALSE;
++ w = gdk_pixbuf_get_width (cd->image);
++ h = gdk_pixbuf_get_height (cd->image);
++
++ switch (cd->orient) {
++ case PANEL_APPLET_ORIENT_UP:
++ case PANEL_APPLET_ORIENT_DOWN:
++
++ if (cd->save_allocation_h != allocation->height) {
++ cd->save_allocation_h = allocation->height;
++ new_h = allocation->height - TOGGLE_BUTTON_BORDER;
++ new_w = (w * new_h) / h;
++ need_to_scale = TRUE;
++ }
++ break;
++ case PANEL_APPLET_ORIENT_RIGHT:
++ case PANEL_APPLET_ORIENT_LEFT:
++ if (cd->save_allocation_w != allocation->width) {
++ cd->save_allocation_w = allocation->width;
++ new_w = allocation->width - TOGGLE_BUTTON_BORDER;
++ new_h = (h * new_w) /w ;
++ need_to_scale = TRUE;
++ }
++ break;
++ }
++
++ if (need_to_scale) {
++ if (new_h < TOGGLE_BUTTON_BORDER)
++ new_h = TOGGLE_BUTTON_BORDER;
++ if (new_w < TOGGLE_BUTTON_BORDER)
++ new_w = TOGGLE_BUTTON_BORDER;
++
++ pb = gdk_pixbuf_scale_simple (cd->image, new_w, new_h, GDK_INTERP_HYPER);
++ gtk_image_set_from_pixbuf (GTK_IMAGE (cd->multizone_image), pb);
++ }
++}
++
++static void
+ create_clock_widget (ClockData *cd)
+ {
+ GtkWidget *clock;
+ GtkWidget *toggle;
+ GtkWidget *alignment;
+-
++ GtkIconInfo *icon_info;
++
++ cd->orient = panel_applet_get_orient (PANEL_APPLET (cd->applet));
+ clock = gtk_label_new ("hmm?");
+ g_signal_connect (clock, "size_request",
+ G_CALLBACK (clock_size_request),
+@@ -1714,23 +1738,38 @@
+
+ cd->clockw = clock;
+
+- cd->props = NULL;
++ cd->size = panel_applet_get_size (PANEL_APPLET (cd->applet));
+
+- cd->orient = panel_applet_get_orient (PANEL_APPLET (cd->applet));
+-
+- /* Initialize label orientation */
+- if (cd->orient == PANEL_APPLET_ORIENT_RIGHT)
+- gtk_label_set_angle (GTK_LABEL (cd->clockw), 90);
+- else if (cd->orient == PANEL_APPLET_ORIENT_LEFT)
+- gtk_label_set_angle (GTK_LABEL (cd->clockw), 270);
+- else
+- gtk_label_set_angle (GTK_LABEL (cd->clockw), 0);
++ cd->multizone_toggle = gtk_toggle_button_new ();
++ gtk_container_set_resize_mode (GTK_CONTAINER (cd->multizone_toggle),
++ GTK_RESIZE_IMMEDIATE);
++ gtk_button_set_relief (GTK_BUTTON (cd->multizone_toggle), GTK_RELIEF_NONE);
++
++ icon_info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), "stock_timezone", 48, 0);
++ cd->image = gtk_icon_info_load_icon (icon_info, NULL);
++ cd->multizone_image = gtk_image_new_from_pixbuf (cd->image);
++ gtk_icon_info_free (icon_info);
++ gtk_widget_show (cd->multizone_image);
++
++ gtk_container_add (GTK_CONTAINER (cd->multizone_toggle), cd->multizone_image);
++ gtk_widget_show (cd->multizone_toggle);
++
++ change_clock_orientation (cd);
++ cd->save_allocation_h = 0;
++ cd->save_allocation_w = 0;
+
+- cd->size = panel_applet_get_size (PANEL_APPLET (cd->applet));
++ cd->props = NULL;
+
+ g_signal_connect (G_OBJECT(clock), "destroy",
+ G_CALLBACK (destroy_clock),
+ cd);
++
++ g_signal_connect (cd->multizone_toggle, "toggled",
++ G_CALLBACK (toggle_timezone), cd);
++
++ g_signal_connect (cd->multizone_toggle, "size-allocate",
++ G_CALLBACK (multizone_scale_image), cd);
++
+
+ set_atk_name_description (GTK_WIDGET (cd->applet), NULL,
+ _("Computer Clock"));
+@@ -1599,6 +1709,7 @@ applet_change_orient (PanelApplet
+ unfix_size (cd);
+ update_clock (cd);
+ update_popup (cd);
++ change_clock_orientation (cd);
+ }
+
+ static void
+@@ -1972,6 +2083,29 @@ show_week_changed (GConfClient *client,
+ }
+
+ static void
++show_multi_zones_changed (GConfClient *client,
++ guint cnxn_id,
++ GConfEntry *entry,
++ ClockData *clock)
++{
++ gboolean value;
++
++ if (!entry->value || entry->value->type != GCONF_VALUE_BOOL)
++ return;
++
++ value = gconf_value_get_bool (entry->value);
++
++ clock->show_multiple_timezones = (value != 0);
++
++ if (clock->show_multiple_timezones)
++ gtk_widget_show (clock->multizone_toggle);
++ else
++ gtk_widget_hide (clock->multizone_toggle);
++
++ refresh_clock (clock);
++}
++
++static void
+ setup_gconf (ClockData *clock)
+ {
+ GConfClient *client;
+@@ -2042,6 +2176,15 @@ setup_gconf (ClockData *clock)
+ clock, NULL, NULL);
+ g_free (key);
+
++ key = panel_applet_gconf_get_full_key (PANEL_APPLET (clock->applet),
++ KEY_SHOW_ZONES);
++ clock->listeners [7] =
++ gconf_client_notify_add (
++ client, key,
++ (GConfClientNotifyFunc) show_multi_zones_changed,
++ clock, NULL, NULL);
++ g_free (key);
++
+ g_object_unref (G_OBJECT (client));
+ }
+
+@@ -2133,12 +2276,9 @@ fill_clock_applet (PanelApplet *applet)
+
+ cd->timeformat = NULL;
+
++ cd->show_multiple_timezones = panel_applet_gconf_get_bool (applet, KEY_SHOW_ZONES, NULL);
+ create_clock_widget (cd);
+
+- gtk_container_set_border_width (GTK_CONTAINER (cd->applet), 0);
+- gtk_container_set_border_width (GTK_CONTAINER (cd->toggle), 0);
+- gtk_container_add (GTK_CONTAINER (cd->applet), cd->toggle);
+-
+ gtk_window_set_default_icon_name ("clock");
+ gtk_widget_show (cd->applet);
+
+@@ -2351,6 +2491,16 @@ set_custom_format_cb (GtkEntry *entry,
+ }
+
+ static void
++set_show_zones_cb (GtkWidget *w,
++ ClockData *clock)
++{
++ panel_applet_gconf_set_bool (PANEL_APPLET (clock->applet),
++ KEY_SHOW_ZONES,
++ GTK_TOGGLE_BUTTON (w)->active,
++ NULL);
++}
++
++static void
+ properties_response_cb (GtkWidget *widget,
+ int id,
+ ClockData *cd)
+@@ -2496,6 +2646,15 @@ display_properties_dialog (BonoboUICompo
+ cd);
+ gtk_widget_show (cd->gmt_time_check);
+
++ cd->showzones_check = gtk_check_button_new_with_mnemonic (_("Show _timezones button"));
++ gtk_box_pack_start (GTK_BOX (vbox), cd->showzones_check, FALSE, FALSE, 0);
++ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->showzones_check),
++ cd->show_multiple_timezones);
++ g_signal_connect (G_OBJECT (cd->showzones_check), "toggled",
++ G_CALLBACK (set_show_zones_cb),
++ cd);
++ gtk_widget_show (cd->showzones_check);
++
+ g_signal_connect (cd->props, "destroy",
+ G_CALLBACK (gtk_widget_destroyed),
+ &cd->props);
+--- gnome-panel-2.10.1/applets/clock/clock.h 1970-01-01 05:30:00.000000000 +0530
++++ gnome-panel-2.10.1-new/applets/clock/clock.h 2005-06-30 22:37:14.808303184 +0530
+@@ -0,0 +1,173 @@
++#ifndef __CLOCK_H__
++#define __CLOCK_H__
++
++#include <stdio.h>
++#include <sys/stat.h>
++#include <unistd.h>
++#include <dirent.h>
++#include <string.h>
++#include <time.h>
++#include <langinfo.h>
++
++#include <panel-applet.h>
++#include <panel-applet-gconf.h>
++
++#include <gtk/gtk.h>
++#include <gdk/gdkkeysyms.h>
++#include <libbonobo.h>
++#include <gconf/gconf-client.h>
++#include <libgnomeui/gnome-help.h>
++#include <libgnome/gnome-init.h>
++#include <libgnomeui/gnome-url.h>
++
++#include <glade/glade.h>
++
++#ifdef HAVE_LIBECAL
++#include "calendar-client.h"
++#endif
++#include "tz.h"
++#include "../gnome-time-settings/e-map/e-map.h"
++
++#define INTERNETSECOND (864)
++#define INTERNETBEAT (86400)
++
++#define N_GCONF_PREFS 8
++
++#define NEVER_SENSITIVE "never_sensitive"
++
++typedef struct _ClockData ClockData;
++typedef struct _TimezoneSelectionDialog TimezoneSelectionDialog;
++typedef struct _TipZone TipZone;
++
++typedef enum {
++ CLOCK_FORMAT_INVALID = 0,
++ CLOCK_FORMAT_12,
++ CLOCK_FORMAT_24,
++ CLOCK_FORMAT_UNIX,
++ CLOCK_FORMAT_INTERNET,
++ CLOCK_FORMAT_CUSTOM
++} ClockFormat;
++
++struct _ClockData {
++ /* widgets */
++ GtkWidget *applet;
++ GtkWidget *clockw;
++ GtkWidget *toggle;
++ GtkWidget *props;
++ GtkWidget *about;
++ GtkWidget *calendar_popup;
++ GtkWidget *calendar;
++ GtkWidget *timezone_dialog;
++ GtkWidget *multizone_popup;
++
++
++ GtkWidget *hbox;
++
++ GtkWidget *multizone_toggle;
++ GtkWidget *multizone_image;
++ GdkPixbuf *image;
++
++#ifdef HAVE_LIBECAL
++ GtkWidget *task_list;
++ GtkWidget *appointment_list;
++
++ GtkListStore *appointments_model;
++ GtkListStore *tasks_model;
++ GtkTreeModelFilter *tasks_filter;
++
++ CalendarClient *client;
++#endif /* HAVE_LIBECAL */
++
++ /* preferences */
++ ClockFormat format;
++ char *custom_format;
++ gboolean showseconds;
++ gboolean showdate;
++ gboolean gmt_time;
++ gboolean showweek;
++ gboolean show_multiple_timezones;
++
++ char *config_tool;
++
++ /* runtime data */
++ time_t current_time;
++ char *timeformat;
++ guint timeout;
++ PanelAppletOrient orient;
++ int size;
++ int save_allocation_h;
++ int save_allocation_w;
++
++ TimezoneSelectionDialog *tsd;
++ GSList *tip_list;
++ TzDB *tzdb;
++
++ int fixed_width;
++ int fixed_height;
++
++ GtkWidget *showseconds_check;
++ GtkWidget *showdate_check;
++ GtkWidget *gmt_time_check;
++ GtkWidget *custom_hbox;
++ GtkWidget *custom_label;
++ GtkWidget *custom_entry;
++ GtkWidget *showzones_check;
++ gboolean custom_format_shown;
++
++ guint listeners [N_GCONF_PREFS];
++};
++
++void
++clock_set_tooltip (GtkWidget *applet,
++ GtkWidget *widget,
++ const char *tip);
++
++
++#define TZ_MAP_POINT_NORMAL_RGBA 0xc070a0ff
++#define TZ_MAP_POINT_HOVER_RGBA 0xffff60ff
++#define TZ_MAP_POINT_SELECTED_1_RGBA 0xff60e0ff
++#define TZ_MAP_POINT_SELECTED_2_RGBA 0x000000ff
++
++
++struct _TimezoneSelectionDialog
++{
++ GtkWidget *dialog;
++ GladeXML *xml;
++
++ EMapPoint *point_selected;
++ EMapPoint *point_hover;
++ EMap *map;
++ glong correction;
++ char *zone;
++
++ guint timeout;
++
++ /* multi timezone part */
++ GtkWidget *tips_tree;
++ GtkTreeStore *model;
++
++ ClockData *cd;
++};
++
++void
++display_timezone_selection_dialog (BonoboUIComponent *uic,
++ ClockData *cd,
++ const gchar *verbname);
++
++/* multi-timezone part */
++
++
++struct _TipZone {
++ char *zone;
++ char *nick;
++ GtkWidget *time_label;
++ GtkWidget *nick_label;
++};
++
++GtkWidget * create_multi_timezones_popup (ClockData *cd,
++ GdkScreen *screen);
++void create_multizone_table (TimezoneSelectionDialog *tsd);
++void timzone_dialog_set_zones_only (TimezoneSelectionDialog *tsd);
++void timzone_dialog_set_main_zone_only (TimezoneSelectionDialog *tsd);
++gboolean multizone_is_zone_in_tip_list (ClockData *cd, char *zone);
++#endif /* __CLOCK_H__ */
+--- gnome-panel-2.10.1/applets/clock/clock.schemas.in 2005-06-30 22:24:08.042909704 +0530
++++ gnome-panel-2.10.1-new/applets/clock/clock.schemas.in 2005-06-30 22:37:14.810302880 +0530
+@@ -189,6 +189,17 @@
+ </locale>
+ </schema>
+
++ <schema>
++ <key>/schemas/apps/clock_applet/prefs/show_zones</key>
++ <owner>clock-applet</owner>
++ <type>bool</type>
++ <default>false</default>
++ <locale name="C">
++ <short>Show the timezone button</short>
++ <long>If true, display the timezone button in the clock, in addition to time.</long>
++ </locale>
++ </schema>
++
+ </schemalist>
+
+ </gconfschemafile>
+--- gnome-panel-2.10.1/applets/clock/Makefile.am 2005-03-07 19:45:15.000000000 +0530
++++ gnome-panel-2.10.1-new/applets/clock/Makefile.am 2005-06-30 22:37:14.811302728 +0530
+@@ -6,6 +6,7 @@ INCLUDES = \
+ $(WARN_CFLAGS) \
+ $(CLOCK_CFLAGS) \
+ -DDATADIR=\""$(datadir)"\" \
++ -DGLADEDIR=\""$(datadir)/gnome/panel/glade"\" \
+ -DLIBDIR=\""$(libdir)"\" \
+ -DSYSCONFDIR=\""$(sysconfdir)"\" \
+ -DPREFIX=\""$(prefix)"\" \
+@@ -20,17 +21,27 @@ CALENDAR_SOURCES = \
+ calendar-debug.h
+ endif
+
+-clock_applet_SOURCES = clock.c $(CALENDAR_SOURCES)
++clock_applet_SOURCES = clock.c \
++ $(CALENDAR_SOURCES) \
++ tz.h \
++ tz.c \
++ clock.h \
++ timezone-selection.c \
++ multi-timezone.c
+
+ clock_applet_LDADD = \
+ ../../libpanel-applet/libpanel-applet-2.la \
+- $(CLOCK_LIBS)
++ $(CLOCK_LIBS) \
++ ../gnome-time-settings/e-map/libemap.a
+
+ libexec_PROGRAMS = clock-applet
+
+ GNOME_ClockApplet_Factory.server.in: GNOME_ClockApplet_Factory.server.in.in
+ sed -e "s|\@LIBEXECDIR\@|$(libexecdir)|" $< > $@
+
++gladedir = $(datadir)/gnome/panel/glade
++glade_DATA = timezone.glade
++
+ uidir = $(datadir)/gnome-2.0/ui
+ ui_DATA = GNOME_ClockApplet.xml
+
+--- gnome-panel-2.10.1/applets/clock/multi-timezone.c 1970-01-01 05:30:00.000000000 +0530
++++ gnome-panel-2.10.1-new/applets/clock/multi-timezone.c 2005-06-30 22:37:14.814302272 +0530
+@@ -0,0 +1,539 @@
++#include "config.h"
++#include "clock.h"
++
++#define GW(name) glade_xml_get_widget (tsd->xml, name)
++static const char* KEY_TIPS_ZONE = "tips-zone";
++/* popup part */
++static void set_tip_zone_to_gconf (TimezoneSelectionDialog *tsd, char *zone, char *nick, int key_num);
++static void update_list_tip_zone (ClockData *cd);
++
++static void
++hide_it (GtkWidget* w, GdkEventButton *event, ClockData *cd)
++{
++ gtk_widget_hide (cd->multizone_popup);
++ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->multizone_toggle),
++ FALSE);
++}
++
++static void
++set_zone_tip_from_name (ClockData *cd, GtkWidget *widget, char *zone)
++{
++ TzInfo *tz;
++ TzLocation *tz_loc = NULL;
++
++ if (!zone)
++ return;
++
++ if (!cd->tzdb)
++ {
++ cd->tzdb = tz_load_db ();
++ if (!cd->tzdb)
++ return;
++ }
++
++ tz_loc = tz_get_location_by_name (cd->tzdb, zone);
++
++ if (!tz_loc)
++ {
++ char *current_timezone = tz_get_system_timezone ();
++ if (current_timezone)
++ {
++ tz_loc = tz_get_location_by_name (cd->tzdb,
++ current_timezone);
++ g_free (current_timezone);
++ }
++ }
++ if (tz_loc)
++ {
++ char *tip;
++ tz = tz_info_from_location (tz_loc);
++
++ tip = g_strdup_printf ("%s - %s (%s)\nGMT%s%ld %s%s%s",
++ _(tz_loc->zone),
++ tz_loc->country,
++ tz->tzname_normal,
++ (tz->utc_offset / 3600) >= 0 ? "+" : " ",
++ tz->utc_offset / 3600,
++ tz->daylight == 0 ? " ": _("use daylight savings"),
++ tz_loc->comment ? "\n" : " ",
++ tz_loc->comment ? tz_loc->comment : " ");
++ clock_set_tooltip (cd->applet, widget, tip);
++ g_free (tip);
++ }
++}
++
++static GtkWidget *
++add_timezone_button (ClockData *cd,
++ TipZone *tip)
++{
++ GtkWidget *hbox, *label_zone, *label_time, *event_box;
++
++ hbox = gtk_hbox_new (TRUE, 0);
++ label_zone = gtk_label_new (tip->nick);
++ label_time = gtk_label_new ("12:00");
++ event_box = gtk_event_box_new ();
++
++
++ tip->time_label = label_time;
++ tip->nick_label = label_zone;
++
++
++ gtk_box_pack_start (GTK_BOX (hbox), label_zone, TRUE, TRUE, 2);
++ gtk_misc_set_alignment (GTK_MISC (label_zone), 0, 0.5);
++ gtk_box_pack_start (GTK_BOX (hbox), label_time, TRUE, TRUE, 2);
++ gtk_misc_set_alignment (GTK_MISC (label_time), 1, 0.5);
++
++ gtk_container_add (GTK_CONTAINER (event_box), hbox);
++
++ set_zone_tip_from_name (cd, event_box, tip->zone);
++
++ g_signal_connect (event_box,
++ "button-press-event",
++ G_CALLBACK (hide_it),
++ cd);
++
++ gtk_widget_show_all (event_box);
++ return event_box;
++}
++
++static gboolean
++close_on_escape (GtkWidget *widget,
++ GdkEventKey *event,
++ ClockData *cd)
++{
++ if (event->keyval == GDK_Escape) {
++ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->toggle), FALSE);
++ return TRUE;
++ }
++
++ return FALSE;
++}
++
++static gboolean
++delete_event (GtkWidget *widget,
++ GdkEvent *event,
++ ClockData *cd)
++{
++ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->toggle), FALSE);
++ return TRUE;
++}
++
++static void
++edit_zones (GtkWidget *w, ClockData *cd)
++{
++ if (cd->multizone_popup)
++ {
++ gtk_widget_hide (cd->multizone_popup);
++ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->multizone_toggle),
++ FALSE);
++ }
++ if (cd->tsd)
++ {
++ gtk_window_set_screen (GTK_WINDOW (cd->timezone_dialog),
++ gtk_widget_get_screen (cd->applet));
++ gtk_window_present (GTK_WINDOW (cd->timezone_dialog));
++ return;
++ }
++
++ display_timezone_selection_dialog (NULL, cd, NULL);
++}
++
++GtkWidget *
++create_multi_timezones_popup (ClockData *cd,
++ GdkScreen *screen)
++{
++ GtkWindow *window;
++ GtkWidget *vbox_zones, *vbox, *separ, *button, *frame;
++ GSList *tmp_list;
++
++ update_list_tip_zone (cd);
++
++ window = GTK_WINDOW (gtk_window_new (GTK_WINDOW_POPUP));
++
++ gtk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_DOCK);
++ gtk_window_set_decorated (window, FALSE);
++ gtk_window_set_resizable (window, FALSE);
++ gtk_window_stick (window);
++ gtk_window_set_screen (window, screen);
++
++ g_signal_connect (window, "delete_event",
++ G_CALLBACK (delete_event), cd);
++
++ g_signal_connect (window, "key_press_event",
++ G_CALLBACK (close_on_escape), cd);
++
++ vbox_zones = gtk_vbox_new (TRUE, 4);
++ vbox = gtk_vbox_new (FALSE, 4);
++ frame = gtk_frame_new (NULL);
++
++ gtk_container_add (GTK_CONTAINER (frame), vbox);
++
++ for (tmp_list = cd->tip_list;
++ tmp_list ; tmp_list = tmp_list->next)
++ {
++ GtkWidget *zone;
++ TipZone *tip_zone = tmp_list->data;
++
++ zone = add_timezone_button (cd, tip_zone);
++
++ gtk_container_add (GTK_CONTAINER (vbox_zones), zone);
++ }
++
++ gtk_container_add (GTK_CONTAINER (vbox), vbox_zones);
++
++ separ = gtk_hseparator_new ();
++ gtk_container_add (GTK_CONTAINER (vbox), separ);
++
++ button = gtk_button_new_with_label (_("Edit Time Zones..."));
++ gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
++
++ g_signal_connect (button, "clicked", G_CALLBACK (edit_zones),
++ cd);
++
++ gtk_container_add (GTK_CONTAINER (vbox), button);
++
++ gtk_container_add (GTK_CONTAINER (window), frame);
++
++ return GTK_WIDGET (window);
++}
++
++
++static gchar *
++get_timezone_msgid (TimezoneSelectionDialog *tsd, gchar *zone)
++{
++ GPtrArray *locs;
++ gchar *msgid;
++ int i;
++
++ locs = tz_get_locations (tsd->cd->tzdb);
++
++ for (i = 0; i < locs->len; i++)
++ {
++ msgid = tz_location_get_zone (g_ptr_array_index (locs, i));
++
++ if (!g_utf8_collate (_(msgid), zone))
++ {
++ g_free (zone);
++ return g_strdup (msgid);
++ }
++ }
++
++ return zone;
++}
++
++static int
++get_next_available_tips_zone_key_num (TimezoneSelectionDialog *tsd)
++{
++ GSList *list = NULL, *li;
++ int num = -1;
++ char *tips_store_path = panel_applet_gconf_get_full_key (PANEL_APPLET (tsd->cd->applet), KEY_TIPS_ZONE);
++
++
++ list = gconf_client_all_entries (gconf_client_get_default (), tips_store_path, NULL);
++
++ if (list == NULL)
++ return 0;
++
++
++ for (li = list; li != NULL; li = li->next)
++ {
++ GConfEntry *entry = li->data;
++ char *key_name = g_path_get_basename (gconf_entry_get_key (entry));
++ int key_num = atoi (key_name);
++ num = key_num > num ? key_num : num;
++ }
++ return num + 1;
++}
++
++enum {
++ ZONE_COLUMN,
++ NIK_COLUMN,
++ EDITABLE_COL,
++ KEY_NUM_COLUMN,
++ NUM_COLUMNS
++};
++
++void static
++on_add_to_tip_button_clicked (GtkWidget * w,
++ TimezoneSelectionDialog *tsd)
++{
++ GtkTreeIter iter;
++ char *nick;
++ char *zone = g_strdup (gtk_entry_get_text (GTK_ENTRY (GTK_COMBO ( GW ("location_combo"))->entry)));
++ int key_num = get_next_available_tips_zone_key_num (tsd);
++
++ gtk_tree_store_append (tsd->model, &iter, NULL);
++
++ if (nick != NULL)
++ nick = index (zone, '/');
++ else
++ nick = zone;
++ nick = strdup (nick+1);
++
++ gtk_tree_store_set (tsd->model, &iter,
++ ZONE_COLUMN, zone,
++ NIK_COLUMN, nick,
++ EDITABLE_COL, TRUE,
++ KEY_NUM_COLUMN, key_num,
++ -1);
++
++ zone = get_timezone_msgid (tsd, zone);
++
++ set_tip_zone_to_gconf (tsd, zone, nick, key_num);
++
++ gtk_widget_set_sensitive (GW ("remove_from_tip_button"), TRUE);
++ gtk_widget_set_sensitive (GW ("add_to_tip_button"), FALSE);
++
++ g_free (zone);
++ update_list_tip_zone (tsd->cd);
++}
++
++void static
++on_remove_from_tip_button_clicked (GtkWidget *widget,
++ TimezoneSelectionDialog *tsd)
++{
++ GtkTreeIter iter;
++ GtkTreeModel *model;
++ gchar *zone, *nick;
++ GtkTreeSelection *sel;
++
++ sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tsd->tips_tree));
++
++ if (gtk_tree_selection_get_selected (sel, &model, &iter))
++ {
++ char *path, *key;
++ int key_num;
++
++ gtk_tree_model_get (model, &iter,
++ ZONE_COLUMN, &zone,
++ NIK_COLUMN, &nick,
++ KEY_NUM_COLUMN, &key_num,
++ -1);
++
++ gtk_tree_store_remove (GTK_TREE_STORE (model), &iter);
++
++ path = panel_applet_gconf_get_full_key (PANEL_APPLET (tsd->cd->applet),
++ KEY_TIPS_ZONE);
++ key = g_strdup_printf ("%s/%d", path, key_num);
++
++ gconf_client_unset (gconf_client_get_default (), key, NULL);
++
++ g_free (zone);
++ g_free (nick);
++ update_list_tip_zone (tsd->cd);
++ }
++}
++
++static void set_tip_zone_to_gconf (TimezoneSelectionDialog *tsd,
++ char *zone,
++ char *nick,
++ int key_num)
++{
++ char *path = panel_applet_gconf_get_full_key (PANEL_APPLET (tsd->cd->applet),
++ KEY_TIPS_ZONE);
++
++ char *key_name = g_strdup_printf ("%s/%d", path, key_num);
++
++ gconf_client_set_pair (gconf_client_get_default (),
++ key_name,
++ GCONF_VALUE_STRING,
++ GCONF_VALUE_STRING,
++ &zone,
++ &nick,
++ NULL);
++ g_free (path);
++ g_free (key_name);
++}
++
++static void
++edited (GtkCellRendererText *cell,
++ gchar *path_string,
++ gchar *new_text,
++ TimezoneSelectionDialog *tsd)
++{
++ GtkTreeModel *model = GTK_TREE_MODEL (tsd->model);
++ GtkTreeIter iter;
++ GtkTreePath *path = gtk_tree_path_new_from_string (path_string);
++ char *zone;
++ int key_num;
++
++ gtk_tree_model_get_iter (model, &iter, path);
++
++ gtk_tree_model_get (model, &iter, ZONE_COLUMN, &zone, KEY_NUM_COLUMN, &key_num, -1);
++
++ zone = get_timezone_msgid (tsd, zone);
++
++ gtk_tree_store_set (GTK_TREE_STORE (model), &iter, NIK_COLUMN, new_text, -1);
++
++ set_tip_zone_to_gconf (tsd, zone, new_text, key_num);
++
++ gtk_tree_path_free (path);
++ g_free (zone);
++ update_list_tip_zone (tsd->cd);
++}
++static void
++populate_tips_store (TimezoneSelectionDialog *tsd, GtkTreeStore *model)
++{
++ char *tips_store_path;
++ GConfClient *client;
++ GSList *list = NULL, *li;
++ GtkTreeIter iter;
++ client = gconf_client_get_default ();
++
++ tips_store_path = panel_applet_gconf_get_full_key (PANEL_APPLET (tsd->cd->applet),
++ KEY_TIPS_ZONE);
++
++ list = gconf_client_all_entries (client, tips_store_path, NULL);
++
++ if (!list)
++ gtk_widget_set_sensitive (GW ("remove_from_tip_button"), FALSE);
++
++ for (li = list; li != NULL; li = li->next)
++ {
++ char *zone, *nick;
++ GConfEntry *entry = li->data;
++ char *key_name = g_path_get_basename (gconf_entry_get_key (entry));
++ GConfValue *key_value = gconf_entry_get_value (entry);
++ int key_num = atoi (key_name);
++
++ zone = g_strdup (gconf_value_get_string (gconf_value_get_car (key_value)));
++ nick = g_strdup (gconf_value_get_string (gconf_value_get_cdr (key_value)));
++
++ gtk_tree_store_append (model, &iter, NULL);
++
++ gtk_tree_store_set (model, &iter,
++ ZONE_COLUMN, _(zone),
++ NIK_COLUMN, nick,
++ EDITABLE_COL, TRUE,
++ KEY_NUM_COLUMN, key_num,
++ -1);
++
++ g_free (key_name);
++ g_free (zone);
++ g_free (nick);
++ }
++
++ g_free (tips_store_path);
++}
++
++void
++create_multizone_table (TimezoneSelectionDialog *tsd)
++{
++ GtkTreeStore *model;
++ GtkWidget *tree_view;
++ GtkCellRenderer *renderer;
++
++ model = gtk_tree_store_new (NUM_COLUMNS,
++ G_TYPE_STRING,
++ G_TYPE_STRING,
++ G_TYPE_BOOLEAN,
++ G_TYPE_INT);
++
++
++ populate_tips_store (tsd, model);
++
++ tsd->tips_tree = GW ("tips_tree");
++ tree_view = tsd->tips_tree;
++ tsd->model = model;
++
++ gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), GTK_TREE_MODEL (model));
++ gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (tree_view), TRUE);
++
++ renderer = gtk_cell_renderer_text_new ();
++ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
++ -1, _("Timezone"),
++ renderer,
++ "text", ZONE_COLUMN,
++ NULL);
++ g_signal_connect (renderer, "edited",
++ G_CALLBACK (edited), model);
++
++ renderer = gtk_cell_renderer_text_new ();
++
++ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
++ -1, _("Comments"),
++ renderer,
++ "text", NIK_COLUMN,
++ "editable", EDITABLE_COL,
++ NULL);
++ g_signal_connect (renderer, "edited",
++ G_CALLBACK (edited), tsd);
++
++ gtk_widget_show (tree_view);
++
++ g_signal_connect (G_OBJECT (GW ("add_to_tip_button")), "clicked",
++ G_CALLBACK (on_add_to_tip_button_clicked), tsd);
++
++ g_signal_connect (G_OBJECT (GW ("remove_from_tip_button")), "clicked",
++ G_CALLBACK (on_remove_from_tip_button_clicked), tsd);
++
++
++}
++
++static void free_tip_list (GSList *tips)
++{
++ if (tips)
++ {
++ GSList *tmp_list;
++ for (tmp_list = tips; tmp_list ; tmp_list = tmp_list->next)
++ {
++ TipZone *tip_tmp = tmp_list->data;
++ g_free (tip_tmp->zone);
++ g_free (tip_tmp->nick);
++ g_free (tip_tmp);
++ }
++ g_slist_free (tips);
++ }
++}
++
++static void
++update_list_tip_zone (ClockData *cd)
++{
++ GSList *list = NULL, *li;
++
++ char *tips_store_path = panel_applet_gconf_get_full_key (PANEL_APPLET (cd->applet), KEY_TIPS_ZONE);
++
++ free_tip_list (cd->tip_list);
++ cd->tip_list = NULL;
++
++ if (cd->multizone_popup)
++ {
++ gtk_widget_destroy (cd->multizone_popup);
++ cd->multizone_popup = NULL;
++ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->multizone_toggle),
++ FALSE);
++ }
++
++ list = gconf_client_all_entries (gconf_client_get_default (),
++ tips_store_path, NULL);
++
++ if (list == NULL)
++ return;
++
++ for (li = list; li != NULL; li = li->next)
++ {
++ GConfEntry *entry = li->data;
++ GConfValue *key_value = gconf_entry_get_value (entry);
++ if (key_value)
++ {
++ TipZone *tip_zone = g_new (TipZone, 1);
++ tip_zone->zone = g_strdup (gconf_value_get_string (gconf_value_get_car (key_value)));
++ tip_zone->nick = g_strdup (gconf_value_get_string (gconf_value_get_cdr (key_value)));
++ cd->tip_list = g_slist_append (cd->tip_list, tip_zone);
++ }
++ }
++}
++
++gboolean
++multizone_is_zone_in_tip_list (ClockData *cd, char *zone)
++{
++ GSList *tmp_list = NULL;
++ for (tmp_list = cd->tip_list; tmp_list ; tmp_list = tmp_list->next)
++ {
++ TipZone *tip_tmp = tmp_list->data;
++ if (strcmp (tip_tmp->zone, zone) == 0)
++ return TRUE;
++ }
++ return FALSE;
++}
++
+--- gnome-panel-2.10.1/applets/clock/timezone.glade 1970-01-01 05:30:00.000000000 +0530
++++ gnome-panel-2.10.1-new/applets/clock/timezone.glade 2005-06-30 22:37:14.818301664 +0530
+@@ -0,0 +1,581 @@
++<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
++<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
++
++<glade-interface>
++<requires lib="gnome"/>
++
++<widget class="GtkDialog" id="timezone_dialog">
++ <property name="width_request">545</property>
++ <property name="height_request">575</property>
++ <property name="title" translatable="yes">Change Clock Applet Time Zone</property>
++ <property name="type">GTK_WINDOW_TOPLEVEL</property>
++ <property name="window_position">GTK_WIN_POS_NONE</property>
++ <property name="modal">False</property>
++ <property name="resizable">True</property>
++ <property name="destroy_with_parent">False</property>
++ <property name="decorated">True</property>
++ <property name="skip_taskbar_hint">False</property>
++ <property name="skip_pager_hint">False</property>
++ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
++ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
++ <property name="has_separator">True</property>
++ <signal name="delete_event" handler="gtk_widget_hide" last_modification_time="Thu, 20 Nov 2003 16:52:00 GMT"/>
++ <signal name="destroy_event" handler="gtk_widget_hide" last_modification_time="Thu, 20 Nov 2003 16:52:19 GMT"/>
++
++ <child internal-child="vbox">
++ <widget class="GtkVBox" id="dialog-vbox3">
++ <property name="width_request">635</property>
++ <property name="height_request">384</property>
++ <property name="visible">True</property>
++ <property name="homogeneous">False</property>
++ <property name="spacing">0</property>
++
++ <child internal-child="action_area">
++ <widget class="GtkHButtonBox" id="dialog-action_area3">
++ <property name="visible">True</property>
++ <property name="layout_style">GTK_BUTTONBOX_END</property>
++
++ <child>
++ <widget class="GtkButton" id="helpbutton">
++ <property name="visible">True</property>
++ <property name="can_default">True</property>
++ <property name="can_focus">True</property>
++ <property name="label">gtk-help</property>
++ <property name="use_stock">True</property>
++ <property name="relief">GTK_RELIEF_NORMAL</property>
++ <property name="focus_on_click">True</property>
++ <property name="response_id">-11</property>
++ </widget>
++ </child>
++
++ <child>
++ <widget class="GtkButton" id="timezone_apply_button">
++ <property name="visible">True</property>
++ <property name="can_default">True</property>
++ <property name="can_focus">True</property>
++ <property name="label">gtk-close</property>
++ <property name="use_stock">True</property>
++ <property name="relief">GTK_RELIEF_NORMAL</property>
++ <property name="focus_on_click">True</property>
++ <property name="response_id">-7</property>
++ <signal name="clicked" handler="gtk_widget_hide" object="timezone_dialog" last_modification_time="Thu, 20 Nov 2003 17:54:21 GMT"/>
++ </widget>
++ </child>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">False</property>
++ <property name="fill">False</property>
++ <property name="pack_type">GTK_PACK_END</property>
++ </packing>
++ </child>
++
++ <child>
++ <widget class="GtkVBox" id="time_zone_dialog_content">
++ <property name="border_width">12</property>
++ <property name="visible">True</property>
++ <property name="homogeneous">False</property>
++ <property name="spacing">12</property>
++
++ <child>
++ <widget class="GtkLabel" id="zoom_label">
++ <property name="visible">True</property>
++ <property name="label" translatable="yes">Click your nearerst city or select it from the list (left click to zoom in):</property>
++ <property name="use_underline">False</property>
++ <property name="use_markup">True</property>
++ <property name="justify">GTK_JUSTIFY_LEFT</property>
++ <property name="wrap">False</property>
++ <property name="selectable">False</property>
++ <property name="xalign">0</property>
++ <property name="yalign">0.5</property>
++ <property name="xpad">0</property>
++ <property name="ypad">0</property>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">False</property>
++ <property name="fill">False</property>
++ </packing>
++ </child>
++
++ <child>
++ <widget class="GtkVBox" id="timezone_vbox">
++ <property name="width_request">335</property>
++ <property name="height_request">337</property>
++ <property name="visible">True</property>
++ <property name="homogeneous">False</property>
++ <property name="spacing">12</property>
++
++ <child>
++ <widget class="GtkScrolledWindow" id="map_window">
++ <property name="width_request">60</property>
++ <property name="height_request">230</property>
++ <property name="visible">True</property>
++ <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
++ <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
++ <property name="shadow_type">GTK_SHADOW_IN</property>
++ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
++
++ <child>
++ <placeholder/>
++ </child>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">True</property>
++ <property name="fill">True</property>
++ </packing>
++ </child>
++
++ <child>
++ <widget class="GtkHBox" id="hbox52">
++ <property name="visible">True</property>
++ <property name="homogeneous">True</property>
++ <property name="spacing">0</property>
++
++ <child>
++ <widget class="GtkLabel" id="location_label">
++ <property name="visible">True</property>
++ <property name="label" translatable="yes"></property>
++ <property name="use_underline">False</property>
++ <property name="use_markup">False</property>
++ <property name="justify">GTK_JUSTIFY_LEFT</property>
++ <property name="wrap">False</property>
++ <property name="selectable">False</property>
++ <property name="xalign">0</property>
++ <property name="yalign">0.5</property>
++ <property name="xpad">0</property>
++ <property name="ypad">11</property>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">False</property>
++ <property name="fill">False</property>
++ </packing>
++ </child>
++
++ <child>
++ <widget class="GtkLabel" id="time_clock_label">
++ <property name="visible">True</property>
++ <property name="label" translatable="yes"></property>
++ <property name="use_underline">False</property>
++ <property name="use_markup">False</property>
++ <property name="justify">GTK_JUSTIFY_RIGHT</property>
++ <property name="wrap">False</property>
++ <property name="selectable">False</property>
++ <property name="xalign">1</property>
++ <property name="yalign">0.5</property>
++ <property name="xpad">0</property>
++ <property name="ypad">0</property>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">False</property>
++ <property name="fill">False</property>
++ </packing>
++ </child>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">False</property>
++ <property name="fill">False</property>
++ </packing>
++ </child>
++
++ <child>
++ <widget class="GtkHBox" id="hbox_main_zone">
++ <property name="visible">True</property>
++ <property name="homogeneous">False</property>
++ <property name="spacing">19</property>
++
++ <child>
++ <widget class="GtkLabel" id="label45">
++ <property name="visible">True</property>
++ <property name="label" translatable="yes">Time_zone:</property>
++ <property name="use_underline">True</property>
++ <property name="use_markup">False</property>
++ <property name="justify">GTK_JUSTIFY_CENTER</property>
++ <property name="wrap">False</property>
++ <property name="selectable">False</property>
++ <property name="xalign">0.5</property>
++ <property name="yalign">0.5</property>
++ <property name="xpad">0</property>
++ <property name="ypad">0</property>
++ <property name="mnemonic_widget">entry_location</property>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">False</property>
++ <property name="fill">False</property>
++ </packing>
++ </child>
++
++ <child>
++ <widget class="GtkCombo" id="location_combo">
++ <property name="visible">True</property>
++ <property name="value_in_list">False</property>
++ <property name="allow_empty">False</property>
++ <property name="case_sensitive">False</property>
++ <property name="enable_arrow_keys">True</property>
++ <property name="enable_arrows_always">True</property>
++
++ <child internal-child="entry">
++ <widget class="GtkEntry" id="entry_location">
++ <property name="visible">True</property>
++ <property name="editable">False</property>
++ <property name="visibility">True</property>
++ <property name="max_length">0</property>
++ <property name="text" translatable="yes"></property>
++ <property name="has_frame">True</property>
++ <property name="invisible_char" translatable="yes">*</property>
++ <property name="activates_default">False</property>
++ </widget>
++ </child>
++
++ <child internal-child="list">
++ <widget class="GtkList" id="convertwidget5">
++ <property name="visible">True</property>
++ <property name="selection_mode">GTK_SELECTION_BROWSE</property>
++
++ <child>
++ <widget class="GtkListItem" id="convertwidget6">
++ <property name="visible">True</property>
++
++ <child>
++ <widget class="GtkLabel" id="convertwidget7">
++ <property name="visible">True</property>
++ <property name="label" translatable="yes"></property>
++ <property name="use_underline">False</property>
++ <property name="use_markup">False</property>
++ <property name="justify">GTK_JUSTIFY_LEFT</property>
++ <property name="wrap">False</property>
++ <property name="selectable">False</property>
++ <property name="xalign">0</property>
++ <property name="yalign">0.5</property>
++ <property name="xpad">0</property>
++ <property name="ypad">0</property>
++ </widget>
++ </child>
++ </widget>
++ </child>
++ </widget>
++ </child>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">True</property>
++ <property name="fill">True</property>
++ </packing>
++ </child>
++
++ <child>
++ <placeholder/>
++ </child>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">False</property>
++ <property name="fill">False</property>
++ </packing>
++ </child>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">True</property>
++ <property name="fill">True</property>
++ </packing>
++ </child>
++
++ <child>
++ <widget class="GtkHSeparator" id="hseparator_main_zone">
++ <property name="visible">True</property>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">True</property>
++ <property name="fill">True</property>
++ </packing>
++ </child>
++
++ <child>
++ <widget class="GtkHBox" id="tip_options_vbox">
++ <property name="homogeneous">False</property>
++ <property name="spacing">6</property>
++
++ <child>
++ <widget class="GtkVBox" id="vbox27">
++ <property name="visible">True</property>
++ <property name="homogeneous">False</property>
++ <property name="spacing">0</property>
++
++ <child>
++ <widget class="GtkLabel" id="label127">
++ <property name="visible">True</property>
++ <property name="label" translatable="yes">_List:</property>
++ <property name="use_underline">True</property>
++ <property name="use_markup">False</property>
++ <property name="justify">GTK_JUSTIFY_LEFT</property>
++ <property name="wrap">False</property>
++ <property name="selectable">False</property>
++ <property name="xalign">0.5</property>
++ <property name="yalign">0.5</property>
++ <property name="xpad">0</property>
++ <property name="ypad">0</property>
++ <property name="mnemonic_widget">scrolledwindow1</property>
++ </widget>
++ <packing>
++ <property name="padding">4</property>
++ <property name="expand">False</property>
++ <property name="fill">False</property>
++ </packing>
++ </child>
++
++ <child>
++ <placeholder/>
++ </child>
++
++ <child>
++ <placeholder/>
++ </child>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">False</property>
++ <property name="fill">False</property>
++ </packing>
++ </child>
++
++ <child>
++ <widget class="GtkScrolledWindow" id="scrolledwindow1">
++ <property name="visible">True</property>
++ <property name="can_focus">True</property>
++ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
++ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
++ <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
++ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
++
++ <child>
++ <widget class="GtkTreeView" id="tips_tree">
++ <property name="visible">True</property>
++ <property name="can_focus">True</property>
++ <property name="headers_visible">True</property>
++ <property name="rules_hint">False</property>
++ <property name="reorderable">False</property>
++ <property name="enable_search">True</property>
++ </widget>
++ </child>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">True</property>
++ <property name="fill">True</property>
++ </packing>
++ </child>
++
++ <child>
++ <widget class="GtkVBox" id="vbox26">
++ <property name="visible">True</property>
++ <property name="homogeneous">False</property>
++ <property name="spacing">0</property>
++
++ <child>
++ <placeholder/>
++ </child>
++
++ <child>
++ <widget class="GtkButton" id="add_to_tip_button">
++ <property name="visible">True</property>
++ <property name="can_default">True</property>
++ <property name="can_focus">True</property>
++ <property name="relief">GTK_RELIEF_NORMAL</property>
++ <property name="focus_on_click">True</property>
++
++ <child>
++ <widget class="GtkAlignment" id="alignment2">
++ <property name="visible">True</property>
++ <property name="xalign">0.5</property>
++ <property name="yalign">0.5</property>
++ <property name="xscale">0</property>
++ <property name="yscale">0</property>
++ <property name="top_padding">0</property>
++ <property name="bottom_padding">0</property>
++ <property name="left_padding">0</property>
++ <property name="right_padding">0</property>
++
++ <child>
++ <widget class="GtkHBox" id="hbox53">
++ <property name="visible">True</property>
++ <property name="homogeneous">False</property>
++ <property name="spacing">2</property>
++
++ <child>
++ <widget class="GtkImage" id="image2">
++ <property name="visible">True</property>
++ <property name="stock">gtk-add</property>
++ <property name="icon_size">4</property>
++ <property name="xalign">0.5</property>
++ <property name="yalign">0.5</property>
++ <property name="xpad">0</property>
++ <property name="ypad">0</property>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">False</property>
++ <property name="fill">False</property>
++ </packing>
++ </child>
++
++ <child>
++ <widget class="GtkLabel" id="label122">
++ <property name="visible">True</property>
++ <property name="label" translatable="yes">_Add</property>
++ <property name="use_underline">True</property>
++ <property name="use_markup">False</property>
++ <property name="justify">GTK_JUSTIFY_LEFT</property>
++ <property name="wrap">False</property>
++ <property name="selectable">False</property>
++ <property name="xalign">0.5</property>
++ <property name="yalign">0.5</property>
++ <property name="xpad">0</property>
++ <property name="ypad">0</property>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">False</property>
++ <property name="fill">False</property>
++ </packing>
++ </child>
++ </widget>
++ </child>
++ </widget>
++ </child>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">False</property>
++ <property name="fill">True</property>
++ </packing>
++ </child>
++
++ <child>
++ <widget class="GtkLabel" id="label129">
++ <property name="visible">True</property>
++ <property name="label" translatable="yes"></property>
++ <property name="use_underline">False</property>
++ <property name="use_markup">False</property>
++ <property name="justify">GTK_JUSTIFY_LEFT</property>
++ <property name="wrap">False</property>
++ <property name="selectable">False</property>
++ <property name="xalign">0.5</property>
++ <property name="yalign">0.5</property>
++ <property name="xpad">0</property>
++ <property name="ypad">0</property>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">False</property>
++ <property name="fill">False</property>
++ </packing>
++ </child>
++
++ <child>
++ <widget class="GtkButton" id="remove_from_tip_button">
++ <property name="visible">True</property>
++ <property name="can_default">True</property>
++ <property name="can_focus">True</property>
++ <property name="relief">GTK_RELIEF_NORMAL</property>
++ <property name="focus_on_click">True</property>
++
++ <child>
++ <widget class="GtkAlignment" id="alignment3">
++ <property name="visible">True</property>
++ <property name="xalign">0.5</property>
++ <property name="yalign">0.5</property>
++ <property name="xscale">0</property>
++ <property name="yscale">0</property>
++ <property name="top_padding">0</property>
++ <property name="bottom_padding">0</property>
++ <property name="left_padding">0</property>
++ <property name="right_padding">0</property>
++
++ <child>
++ <widget class="GtkHBox" id="hbox57">
++ <property name="visible">True</property>
++ <property name="homogeneous">False</property>
++ <property name="spacing">2</property>
++
++ <child>
++ <widget class="GtkImage" id="image3">
++ <property name="visible">True</property>
++ <property name="stock">gtk-remove</property>
++ <property name="icon_size">4</property>
++ <property name="xalign">0.5</property>
++ <property name="yalign">0.5</property>
++ <property name="xpad">0</property>
++ <property name="ypad">0</property>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">False</property>
++ <property name="fill">False</property>
++ </packing>
++ </child>
++
++ <child>
++ <widget class="GtkLabel" id="label124">
++ <property name="visible">True</property>
++ <property name="label" translatable="yes">_Remove</property>
++ <property name="use_underline">True</property>
++ <property name="use_markup">False</property>
++ <property name="justify">GTK_JUSTIFY_LEFT</property>
++ <property name="wrap">False</property>
++ <property name="selectable">False</property>
++ <property name="xalign">0.5</property>
++ <property name="yalign">0.5</property>
++ <property name="xpad">0</property>
++ <property name="ypad">0</property>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">False</property>
++ <property name="fill">False</property>
++ </packing>
++ </child>
++ </widget>
++ </child>
++ </widget>
++ </child>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">True</property>
++ <property name="fill">False</property>
++ </packing>
++ </child>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">False</property>
++ <property name="fill">False</property>
++ <property name="pack_type">GTK_PACK_END</property>
++ </packing>
++ </child>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">True</property>
++ <property name="fill">True</property>
++ </packing>
++ </child>
++ </widget>
++ <packing>
++ <property name="padding">0</property>
++ <property name="expand">True</property>
++ <property name="fill">True</property>
++ </packing>
++ </child>
++ </widget>
++ </child>
++</widget>
++
++</glade-interface>
+--- gnome-panel-2.10.1/applets/clock/timezone-selection.c 1970-01-01 05:30:00.000000000 +0530
++++ gnome-panel-2.10.1-new/applets/clock/timezone-selection.c 2005-06-30 22:37:14.820301360 +0530
+@@ -0,0 +1,450 @@
++#include "config.h"
++#include "clock.h"
++
++
++#define GW(name) glade_xml_get_widget (tsd->xml, name)
++
++static void
++mark_selected_city (TimezoneSelectionDialog * tsd, gchar * defaultv);
++
++static void
++display_help (GtkWidget * w, gpointer data)
++{
++ GError *error = NULL;
++
++ gnome_help_display_desktop_on_screen (NULL, "clock", "clock", "clock-usage",
++ gtk_widget_get_screen (w), &error);
++
++ if (error)
++ {
++ GtkWidget *dialog;
++ dialog = gtk_message_dialog_new (GTK_WINDOW (w),
++ GTK_DIALOG_DESTROY_WITH_PARENT,
++ GTK_MESSAGE_ERROR,
++ GTK_BUTTONS_OK,
++ _("There was an error displaying help: %s"),
++ error->message);
++
++ g_signal_connect (G_OBJECT (dialog), "response",
++ G_CALLBACK (gtk_widget_destroy), NULL);
++
++ gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
++ gtk_window_set_screen (GTK_WINDOW (dialog), gtk_widget_get_screen (w));
++ gtk_widget_show (dialog);
++ g_error_free (error);
++ }
++}
++
++
++static TzLocation *
++tz_location_from_point (TimezoneSelectionDialog * tsd, EMapPoint * point)
++{
++ TzLocation *tz_loc = NULL;
++ GPtrArray *locs;
++ double p_longitude, p_latitude;
++ double l_longitude, l_latitude;
++ int i;
++
++ locs = tz_get_locations (tsd->cd->tzdb);
++ e_map_point_get_location (point, &p_longitude, &p_latitude);
++
++ for (i = 0; i < locs->len; i++)
++ {
++ tz_location_get_position (g_ptr_array_index (locs, i),
++ &l_longitude, &l_latitude);
++
++ if (l_longitude - 0.005 <= p_longitude &&
++ l_longitude + 0.005 >= p_longitude &&
++ l_latitude - 0.005 <= p_latitude &&
++ l_latitude + 0.005 >= p_latitude)
++ {
++ tz_loc = g_ptr_array_index (locs, i);
++ break;
++ }
++ }
++
++ return (tz_loc);
++}
++
++static void
++set_tz_from_name (TimezoneSelectionDialog * tsd, gchar * name)
++{
++ TzLocation *tz_loc = NULL;
++ GPtrArray *locs;
++ double l_longitude = 0.0, l_latitude = 0.0;
++ int i;
++
++ locs = tz_get_locations (tsd->cd->tzdb);
++
++ for (i = 0; i < locs->len; i++)
++ {
++ tz_loc = g_ptr_array_index (locs, i);
++
++ if (tz_loc
++ && (!g_utf8_collate (_(tz_location_get_zone (tz_loc)), _(name))))
++ {
++ tz_location_get_position (tz_loc, &l_longitude, &l_latitude);
++ break;
++ }
++ }
++
++ if (tsd->point_selected)
++ e_map_point_set_color_rgba (tsd->map,
++ tsd->point_selected,
++ TZ_MAP_POINT_NORMAL_RGBA);
++ tsd->point_selected =
++ e_map_get_closest_point (tsd->map, l_longitude, l_latitude, FALSE);
++
++ gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (GW ("location_combo"))->entry),
++ _(tz_location_get_zone
++ (tz_location_from_point (tsd, tsd->point_selected))));
++}
++
++static gchar *
++get_selected_tz_name (TimezoneSelectionDialog * tsd)
++{
++ gchar *entry_text;
++
++ entry_text =
++ (gchar *)
++ gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (GW ("location_combo"))->entry));
++
++ return entry_text;
++}
++
++static gboolean
++update_map (GtkWidget * w, gpointer data)
++{
++ TimezoneSelectionDialog *tsd = (TimezoneSelectionDialog *) data;
++ char *timezone = (char *) gtk_entry_get_text (GTK_ENTRY (w));
++
++ if (strlen (timezone) > 0)
++ {
++ gchar *tz_name;
++ TzLocation *tz_location;
++
++ set_tz_from_name (tsd, g_strdup (timezone));
++
++ tz_name = get_selected_tz_name (tsd);
++ tz_location = tz_get_location_by_name (tsd->cd->tzdb, tz_name);
++ }
++
++ gtk_widget_set_sensitive (GW ("add_to_tip_button"),
++ !multizone_is_zone_in_tip_list(tsd->cd, timezone));
++
++ return TRUE;
++}
++
++static gboolean
++out_map (GtkWidget * w, GdkEventCrossing * event, gpointer data)
++{
++ const char *old_zone;
++ TimezoneSelectionDialog *tsd = (TimezoneSelectionDialog *) data;
++ GtkWidget *location_label = GW ("location_label");
++
++ if (event->mode != GDK_CROSSING_NORMAL)
++ return FALSE;
++
++ if (tsd->point_hover && tsd->point_hover != tsd->point_selected)
++ e_map_point_set_color_rgba (tsd->map, tsd->point_hover,
++ TZ_MAP_POINT_NORMAL_RGBA);
++
++ tsd->point_hover = NULL;
++
++ old_zone = gtk_label_get_text (GTK_LABEL (location_label));
++
++ if (strcmp (old_zone, ""))
++ {
++ gtk_label_set_text (GTK_LABEL (location_label), "");
++ gtk_label_set_text (GTK_LABEL (GW ("time_clock_label")), "");
++ }
++
++ return TRUE;
++}
++
++static gboolean
++button_pressed (GtkWidget * w, GdkEventButton * event, gpointer data)
++{
++ double longitude, latitude;
++ TimezoneSelectionDialog *tsd = (TimezoneSelectionDialog *) data;
++ GtkWidget *zoom_label = GW ("zoom_label");
++
++ e_map_window_to_world (tsd->map, (double) event->x, (double) event->y,
++ &longitude, &latitude);
++
++ if (event->button != 1)
++ {
++ e_map_zoom_out (tsd->map);
++ gtk_label_set_text (GTK_LABEL (zoom_label),
++ _("Click your nearerst city or select it from the list (left click to zoom in):"));
++ }
++ else
++ {
++ GtkWidget *location_entry;
++ TzLocation *tz_location;
++ gchar *entry_text, *entry_text_new;
++
++ if (e_map_get_magnification (tsd->map) <= 1.0)
++ e_map_zoom_to_location (tsd->map, longitude, latitude);
++
++ if (tsd->point_selected)
++ e_map_point_set_color_rgba (tsd->map,
++ tsd->point_selected,
++ TZ_MAP_POINT_NORMAL_RGBA);
++ tsd->point_selected = tsd->point_hover;
++
++ location_entry = GTK_COMBO (GW ("location_combo"))->entry;
++ tz_location = tz_location_from_point (tsd, tsd->point_selected);
++
++ entry_text = (gchar *) gtk_entry_get_text (GTK_ENTRY (location_entry));
++ entry_text_new = _(tz_location_get_zone (tz_location));
++
++
++ if (!entry_text || !entry_text_new
++ || g_utf8_collate (entry_text, entry_text_new))
++ {
++ gtk_entry_set_text (GTK_ENTRY (location_entry), entry_text_new);
++ gtk_widget_set_sensitive (GW ("add_to_tip_button"),
++ !multizone_is_zone_in_tip_list(tsd->cd, entry_text_new));
++ }
++ gtk_label_set_text (GTK_LABEL (zoom_label),
++ _("Click your nearerst city or select it from the list (right click to zoom out):"));
++ mark_selected_city (tsd, entry_text_new);
++ }
++
++ return TRUE;
++}
++
++static gboolean
++motion (GtkWidget * widget, GdkEventMotion * event, gpointer data)
++{
++ TimezoneSelectionDialog *tsd = (TimezoneSelectionDialog *) data;
++ double longitude, latitude;
++ GtkWidget *time_label = GW ("time_clock_label");
++ GtkWidget *location_label = GW ("location_label");
++
++
++ e_map_window_to_world (tsd->map, (double) event->x, (double) event->y,
++ &longitude, &latitude);
++
++ if (tsd->point_hover && tsd->point_hover != tsd->point_selected)
++ e_map_point_set_color_rgba (tsd->map, tsd->point_hover,
++ TZ_MAP_POINT_NORMAL_RGBA);
++
++ tsd->point_hover =
++ e_map_get_closest_point (tsd->map, longitude, latitude, TRUE);
++
++ if (tsd->point_hover != tsd->point_selected)
++ e_map_point_set_color_rgba (tsd->map, tsd->point_hover,
++ TZ_MAP_POINT_HOVER_RGBA);
++
++ tsd->correction =
++ tz_location_get_utc_offset (tz_location_from_point
++ (tsd, tsd->point_hover));
++
++ /* e_tz_map_location_from_point() can in theory return NULL, but in
++ * practice there are no reasons why it should */
++
++ gtk_label_set_text (GTK_LABEL (location_label),
++ _(tz_location_get_zone
++ (tz_location_from_point (tsd, tsd->point_hover))));
++
++ if (strcmp (gtk_label_get_text (GTK_LABEL (location_label)), "") == 0)
++ {
++ gtk_label_set_text (GTK_LABEL (time_label), "");
++ }
++ else
++ {
++ struct tm tm;
++ time_t tt;
++ char clock[256];
++
++ time (&tt);
++ tt += tsd->correction;
++ gmtime_r (&tt, &tm);
++ memset (clock, 0, 256);
++ sprintf (clock, "%02d:%02d:%02d", tm.tm_hour, tm.tm_min, tm.tm_sec);
++ gtk_label_set_text (GTK_LABEL (time_label), clock);
++ }
++
++
++ return TRUE;
++}
++
++static gboolean
++flash_selected_point (gpointer data)
++{
++ TimezoneSelectionDialog *tsd = (TimezoneSelectionDialog *) data;
++
++ if (!IS_E_MAP (tsd->map))
++ return FALSE;
++
++ if (!tsd->point_selected)
++ return TRUE;
++
++ if (e_map_point_get_color_rgba (tsd->point_selected) ==
++ TZ_MAP_POINT_SELECTED_1_RGBA)
++ e_map_point_set_color_rgba (tsd->map, tsd->point_selected,
++ TZ_MAP_POINT_SELECTED_2_RGBA);
++ else
++ e_map_point_set_color_rgba (tsd->map, tsd->point_selected,
++ TZ_MAP_POINT_SELECTED_1_RGBA);
++
++ return TRUE;
++}
++
++
++static void
++mark_selected_city (TimezoneSelectionDialog * tsd, gchar * defaultv)
++{
++ TzLocation *tz_loc = NULL;
++ GPtrArray *locs;
++ int i;
++ double l_longitude = 0.0, l_latitude = 0.0;
++ char *system_timezone = tz_get_system_timezone ();
++
++ if (!defaultv || !strcmp ("localtimezone", defaultv))
++ tsd->zone = g_strdup (system_timezone);
++ else
++ {
++ g_free (tsd->zone);
++ tsd->zone = g_strdup (defaultv);
++ }
++
++ locs = tz_get_locations (tsd->cd->tzdb);
++
++ for (i = 0; i < locs->len; i++)
++ {
++ tz_loc = g_ptr_array_index (locs, i);
++
++ if (tz_loc
++ &&
++ (!g_utf8_collate (_(tz_location_get_zone (tz_loc)), _(tsd->zone))))
++ {
++ tz_location_get_position (tz_loc, &l_longitude, &l_latitude);
++ break;
++ }
++ }
++
++ if (tsd->point_selected)
++ e_map_point_set_color_rgba (tsd->map,
++ tsd->point_selected,
++ TZ_MAP_POINT_NORMAL_RGBA);
++ tsd->point_selected =
++ e_map_get_closest_point (tsd->map, l_longitude, l_latitude, FALSE);
++
++ gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (GW ("location_combo"))->entry),
++ _(tz_location_get_zone (tz_location_from_point
++ (tsd, tsd->point_selected))));
++}
++
++static void
++reset_zone (GtkWidget * w, TimezoneSelectionDialog * tsd)
++{
++ char *current_zone = tz_get_system_timezone ();
++
++ mark_selected_city (tsd, current_zone);
++
++ g_free (current_zone);
++}
++
++void
++display_timezone_selection_dialog (BonoboUIComponent *uic,
++ ClockData *cd,
++ const gchar *verbname)
++{
++ GtkWidget *location_entry;
++ GPtrArray *locs;
++ GList *items = NULL;
++ int i;
++ TimezoneSelectionDialog *tsd;
++
++ if (cd->timezone_dialog)
++ {
++ gtk_window_set_screen (GTK_WINDOW (cd->timezone_dialog),
++ gtk_widget_get_screen (cd->applet));
++ gtk_window_present (GTK_WINDOW (cd->timezone_dialog));
++ e_map_zoom_out (cd->tsd->map);
++ return;
++ }
++
++ tsd = g_new0 (TimezoneSelectionDialog, 1);
++
++ tsd->cd = cd;
++ cd->tsd = tsd;
++
++ tsd->xml = glade_xml_new (GLADEDIR "/timezone.glade", NULL, NULL);
++
++ if (tsd->xml == NULL)
++ {
++ g_warning (G_STRLOC "timezone.glade cannot be found");
++ return;
++ }
++ glade_xml_signal_autoconnect (tsd->xml);
++
++ tsd->map = e_map_new ();
++
++ e_map_set_smooth_zoom (tsd->map, TRUE);
++
++ gtk_widget_set_events (GTK_WIDGET (tsd->map),
++ gtk_widget_get_events (GTK_WIDGET (tsd->map)) |
++ GDK_LEAVE_NOTIFY_MASK | GDK_VISIBILITY_NOTIFY_MASK);
++
++ gtk_container_add (GTK_CONTAINER (GW ("map_window")),
++ GTK_WIDGET (tsd->map));
++ gtk_widget_show (GTK_WIDGET (tsd->map));
++
++
++ if (!cd->tzdb)
++ cd->tzdb = tz_load_db ();
++ if (!cd->tzdb)
++ {
++ g_warning (G_STRLOC "Unable to load system timezone database.");
++ return;
++ }
++
++ locs = tz_get_locations (cd->tzdb);
++
++ for (i = 0; g_ptr_array_index (locs, i); i++)
++ {
++ TzLocation *tzl;
++ tzl = g_ptr_array_index (locs, i);
++ e_map_add_point (tsd->map, NULL, tzl->longitude, tzl->latitude,
++ TZ_MAP_POINT_NORMAL_RGBA);
++ items = g_list_append (items, _(tzl->zone));
++ }
++
++ gtk_combo_set_popdown_strings (GTK_COMBO (GW ("location_combo")), items);
++
++ mark_selected_city (tsd, "localtimezone");
++
++ tsd->timeout = g_timeout_add (100, flash_selected_point, (gpointer) tsd);
++
++ g_signal_connect (G_OBJECT (tsd->map), "motion-notify-event",
++ G_CALLBACK (motion), (gpointer) tsd);
++ g_signal_connect (G_OBJECT (tsd->map), "button-press-event",
++ G_CALLBACK (button_pressed), (gpointer) tsd);
++ g_signal_connect (G_OBJECT (tsd->map), "leave-notify-event",
++ G_CALLBACK (out_map), (gpointer) tsd);
++
++ location_entry = GTK_COMBO (GW ("location_combo"))->entry;
++ g_signal_connect (G_OBJECT (location_entry), "changed",
++ G_CALLBACK (update_map), (gpointer) tsd);
++
++ g_signal_connect (G_OBJECT (GW ("reset_button")), "clicked",
++ G_CALLBACK (reset_zone), tsd);
++
++ g_signal_connect (G_OBJECT (GW ("helpbutton")), "clicked",
++ G_CALLBACK (display_help), tsd);
++
++ tsd->dialog = GW ("timezone_dialog");
++ cd->timezone_dialog = tsd->dialog;
++
++ gtk_window_set_screen (GTK_WINDOW (cd->timezone_dialog),
++ gtk_widget_get_screen (cd->applet));
++
++ create_multizone_table (tsd);
++
++ gtk_widget_show_all (cd->timezone_dialog);
++
++}
+--- gnome-panel-2.10.1/applets/clock/tz.c 1970-01-01 05:30:00.000000000 +0530
++++ gnome-panel-2.10.1-new/applets/clock/tz.c 2005-06-30 22:37:14.823300904 +0530
+@@ -0,0 +1,499 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
++/* Generic timezone utilities.
++ *
++ * Copyright (C) 2000-2001 Ximian, Inc.
++ * Copyright (C) 2004 Sun Microsystems, Inc.
++ *
++ * Authors: Hans Petter Jansson <[email protected]>
++ * additional functions by Erwann Chenede <[email protected]>
++ *
++ * Largely based on Michael Fulbright's work on Anaconda.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
++ */
++
++#include "tz.h"
++
++/* Forward declarations for private functions */
++
++static float convert_pos (gchar * pos, int digits);
++static int compare_country_names (const void *a, const void *b);
++static void sort_locations_by_country (GPtrArray * locations);
++static gchar *tz_data_file_get (void);
++
++extern char **environ;
++#ifdef HAVE_SOLARIS
++extern time_t timezone;
++extern char *tzname[2];
++#endif
++
++/* ---------------- *
++ * Public interface *
++ * ---------------- */
++
++struct tm *
++tz_get_localtime_at (const char *zone,
++ const time_t *now)
++{
++ char **environ_old;
++ char **envp;
++ struct tm *retval;
++ int i, env_len, tz_index;
++
++ tz_index = -1;
++ for (env_len = 0; environ [env_len]; env_len++)
++ if (!strncmp (environ [env_len], "TZ=", strlen ("TZ=")))
++ tz_index = env_len;
++
++ if (tz_index == -1)
++ tz_index = env_len++;
++
++ envp = g_new0 (char *, env_len + 1);
++
++ for (i = 0; i < env_len; i++)
++ if (i == tz_index)
++ envp [i] = g_strconcat ("TZ=", zone, NULL);
++ else
++ envp [i] = g_strdup (environ [i]);
++
++ environ_old = environ;
++ environ = envp;
++
++ retval = localtime (now);
++
++ environ = environ_old;
++ g_strfreev (envp);
++
++ return retval;
++}
++
++TzDB *
++tz_load_db (void)
++{
++ gchar *tz_data_file;
++ TzDB *tz_db;
++ FILE *tzfile;
++ char buf[4096];
++
++ tz_data_file = tz_data_file_get ();
++ if (!tz_data_file)
++ {
++ g_warning ("Could not get the TimeZone data file name");
++ return NULL;
++ }
++ tzfile = fopen (tz_data_file, "r");
++ if (!tzfile)
++ {
++ g_warning ("Could not open *%s*\n", tz_data_file);
++ g_free (tz_data_file);
++ return NULL;
++ }
++
++ tz_db = g_new0 (TzDB, 1);
++ tz_db->locations = g_ptr_array_new ();
++
++ while (fgets (buf, sizeof (buf), tzfile))
++ {
++ gchar **tmpstrarr;
++ gchar *latstr, *lngstr, *p;
++ TzLocation *loc;
++
++ if (*buf == '#')
++ continue;
++
++ g_strchomp (buf);
++ tmpstrarr = g_strsplit (buf, "\t", 4);
++
++ latstr = g_strdup (tmpstrarr[1]);
++ p = latstr + 1;
++ while (*p != '-' && *p != '+')
++ p++;
++ lngstr = g_strdup (p);
++ *p = '\0';
++
++ loc = g_new (TzLocation, 1);
++ loc->country = g_strdup (tmpstrarr[0]);
++ loc->zone = g_strdup (tmpstrarr[2]);
++ loc->comment = (tmpstrarr[3]) ? g_strdup (tmpstrarr[3]) : NULL;
++ loc->latitude = convert_pos (latstr, 2);
++ loc->longitude = convert_pos (lngstr, 3);
++
++ g_ptr_array_add (tz_db->locations, (gpointer) loc);
++
++ g_free (latstr);
++ g_free (lngstr);
++ g_strfreev (tmpstrarr);
++ }
++
++ fclose (tzfile);
++
++ /* now sort by country */
++ sort_locations_by_country (tz_db->locations);
++
++ /* added a NULL pointer at the end of the array to prevent errors. Carlos */
++ g_ptr_array_add (tz_db->locations, (gpointer) NULL);
++
++ g_free (tz_data_file);
++
++ return tz_db;
++}
++void
++tz_location_free (TzLocation * tz)
++{
++
++ if (tz->country)
++ g_free (tz->country);
++ if (tz->zone)
++ g_free (tz->zone);
++ if (tz->comment)
++ g_free (tz->comment);
++
++ g_free (tz);
++}
++
++void
++tz_free_db (TzDB *tz_db)
++{
++ int i;
++ for (i = 0; g_ptr_array_index (tz_db->locations, i); i++)
++ {
++ TzLocation *loc = g_ptr_array_index (tz_db->locations, i);
++ tz_location_free (loc);
++ }
++ g_ptr_array_free (tz_db->locations, FALSE);
++ g_free (tz_db);
++}
++
++GPtrArray *
++tz_get_locations (TzDB * db)
++{
++ return db->locations;
++}
++
++
++gchar *
++tz_location_get_country (TzLocation * loc)
++{
++ return loc->country;
++}
++
++
++gchar *
++tz_location_get_zone (TzLocation * loc)
++{
++ return loc->zone;
++}
++
++
++gchar *
++tz_location_get_comment (TzLocation * loc)
++{
++ return loc->comment;
++}
++
++
++void
++tz_location_get_position (TzLocation * loc, double *longitude,
++ double *latitude)
++{
++ *longitude = loc->longitude;
++ *latitude = loc->latitude;
++}
++
++
++
++
++TzInfo *
++tz_info_from_location (TzLocation * loc)
++{
++ TzInfo *tzinfo;
++ time_t curtime;
++ struct tm *curzone;
++
++ g_return_val_if_fail (loc != NULL, NULL);
++ g_return_val_if_fail (loc->zone != NULL, NULL);
++
++ tzinfo = g_new0 (TzInfo, 1);
++
++ curtime = time (NULL);
++ curzone = tz_get_localtime_at (loc->zone, &curtime);
++#if 0
++ g_print ("%s %s %d\n", curzone->tm_zone,
++ &curzone->tm_zone[curzone->tm_isdst], curzone->tm_isdst);
++#endif
++
++#ifdef HAVE_LINUX
++ tzinfo->tzname_normal = g_strdup (curzone->tm_zone);
++ if (curzone->tm_isdst)
++ tzinfo->tzname_daylight = g_strdup (&curzone->tm_zone[curzone->tm_isdst]);
++ else
++ tzinfo->tzname_daylight = NULL;
++
++ tzinfo->utc_offset = curzone->tm_gmtoff;
++#endif
++
++
++#ifdef HAVE_SOLARIS
++ tzinfo->tzname_normal = g_strdup (loc->zone);
++
++ if (curzone->tm_isdst)
++ tzinfo->tzname_daylight = g_strdup (tzname[0]);
++ else
++ tzinfo->tzname_daylight = NULL;
++
++ tzinfo->utc_offset -= (timezone - 3600);
++#endif
++ tzinfo->daylight = curzone->tm_isdst;
++
++ return tzinfo;
++}
++
++glong
++tz_location_get_utc_offset (TzLocation * loc)
++{
++ TzInfo *tz_info;
++ glong offset;
++
++ tz_info = tz_info_from_location (loc);
++ offset = tz_info->utc_offset;
++ tz_info_free (tz_info);
++ return offset;
++}
++
++void
++tz_info_free (TzInfo * tzinfo)
++{
++ g_return_if_fail (tzinfo != NULL);
++
++ if (tzinfo->tzname_normal)
++ g_free (tzinfo->tzname_normal);
++ if (tzinfo->tzname_daylight)
++ g_free (tzinfo->tzname_daylight);
++ g_free (tzinfo);
++}
++
++#ifdef HAVE_LINUX
++static gboolean
++find_from_inode (char *dir, int inode, char **filename)
++{
++ int num_dirent, i;
++ struct dirent **namelist;
++
++ num_dirent = scandir (dir, &namelist, 0, alphasort);
++
++ if (num_dirent == 0)
++ return FALSE;
++
++ for (i = 0; i < num_dirent; i++)
++ {
++ struct stat file_st;
++
++ if (strcmp (namelist[i]->d_name, ".") != 0 &&
++ strcmp (namelist[i]->d_name, "..") != 0)
++ {
++ char path[1024];
++
++ sprintf (path, "%s/%s", dir, namelist[i]->d_name);
++
++ if (stat (path, &file_st) == 0)
++ {
++
++ if (S_ISDIR (file_st.st_mode))
++ {
++ if (find_from_inode (path, inode, filename))
++ {
++ g_free (namelist);
++ return TRUE;
++ }
++ }
++ else if (inode == file_st.st_ino)
++ {
++ *filename = g_strdup (path);
++ g_free (namelist);
++ return TRUE;
++ }
++ }
++ else
++ {
++ g_free (namelist);
++ return FALSE;
++ }
++ }
++ }
++ g_free (namelist);
++ return FALSE;
++}
++#endif
++
++char *
++tz_get_system_timezone (void)
++{
++ struct stat st_clock, st_lt;
++
++ int fd, status;
++
++ char *tmpfilebuf, *tok_res, **toks, *file, *tz;
++
++ status = stat (SYS_CLOCK_FILE, &st_clock);
++
++ if (status == 0)
++ {
++ fd = open (SYS_CLOCK_FILE, O_RDONLY);
++
++ if (fd > 0)
++ {
++ tmpfilebuf = g_new (char, st_clock.st_size + 1);
++
++ status = read (fd, tmpfilebuf, st_clock.st_size);
++
++ close (fd);
++
++ if (status == st_clock.st_size)
++ {
++ printf ("ZONE_TOKEN is %s\n", ZONE_TOKEN);
++ tok_res = strstr (tmpfilebuf, ZONE_TOKEN);
++
++ if (tok_res) /* found timezone */
++ {
++ char *tz = NULL, **toks2;
++#ifdef HAVE_SOLARIS
++ toks = g_strsplit (tok_res, "\n", 3);
++
++ if (toks[0])
++ {
++ toks2 = g_strsplit (toks[0], ZONE_TOKEN, 3);
++ }
++ g_strfreev (toks);
++
++ tz = g_strdup (toks2[1]);
++#endif
++#ifdef HAVE_LINUX
++ toks = g_strsplit (tok_res, "\"", 3);
++
++ tz = g_strdup (toks[1]);
++ g_strfreev (toks);
++#endif
++ g_free (tmpfilebuf);
++ return tz;
++ }
++ }
++ }
++ }
++
++
++#ifdef HAVE_LINUX
++ /* the SYS_CLOCK_FILE didn't contain timezone info
++ * find the timezone from hard link LOCALTIME_FILE */
++
++ status = stat (LOCALTIME_FILE, &st_lt);
++
++ if (find_from_inode (ZONE_DIR, st_lt.st_ino, &file))
++ {
++ file += strlen (ZONE_DIR) + 1; /* +1 is for the / */
++
++ tz = g_strdup (file);
++ g_free (file);
++ return tz;
++ }
++#endif
++ return NULL;
++}
++
++
++/* ----------------- *
++ * Private functions *
++ * ----------------- */
++
++static gchar *
++tz_data_file_get (void)
++{
++ gchar *file;
++
++ file = g_strdup (TZ_DATA_FILE);
++
++ return file;
++}
++
++static float
++convert_pos (gchar * pos, int digits)
++{
++ gchar whole[10];
++ gchar *fraction;
++ gint i;
++ float t1, t2;
++
++ if (!pos || strlen (pos) < 4 || digits > 9)
++ return 0.0;
++
++ for (i = 0; i < digits + 1; i++)
++ whole[i] = pos[i];
++ whole[i] = '\0';
++ fraction = pos + digits + 1;
++
++ t1 = g_strtod (whole, NULL);
++ t2 = g_strtod (fraction, NULL);
++
++ if (t1 >= 0.0)
++ return t1 + t2 / pow (10.0, strlen (fraction));
++ else
++ return t1 - t2 / pow (10.0, strlen (fraction));
++}
++
++
++
++
++static int
++compare_country_names (const void *a, const void *b)
++{
++ const TzLocation *tza = *(TzLocation **) a;
++ const TzLocation *tzb = *(TzLocation **) b;
++
++ return strcmp (tza->zone, tzb->zone);
++}
++
++
++static void
++sort_locations_by_country (GPtrArray * locations)
++{
++ qsort (locations->pdata, locations->len, sizeof (gpointer),
++ compare_country_names);
++}
++
++TzLocation *
++tz_get_location_by_name (TzDB *tzdb, gchar * name)
++{
++ TzLocation *tz_loc = NULL;
++ GPtrArray *locs;
++ int i;
++
++ locs = tz_get_locations (tzdb);
++
++ for (i = 0; i < locs->len; i++)
++ {
++ TzLocation *tz_loc_temp;
++
++ tz_loc_temp = g_ptr_array_index (locs, i);
++
++ if (tz_loc_temp
++ && !g_utf8_collate (_(tz_location_get_zone (tz_loc_temp)), _(name)))
++ {
++ tz_loc = tz_loc_temp;
++ break;
++ }
++ }
++
++ return tz_loc;
++}
++
+--- gnome-panel-2.10.1/applets/clock/tz.h 1970-01-01 05:30:00.000000000 +0530
++++ gnome-panel-2.10.1-new/applets/clock/tz.h 2005-06-30 22:37:14.824300752 +0530
+@@ -0,0 +1,113 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
++/* Generic timezone utilities.
++ *
++ * Copyright (C) 2000-2001 Ximian, Inc.
++ * Copyright (C) 2004 Sun Microsystems, Inc.
++ *
++ * Authors: Hans Petter Jansson <[email protected]>
++ * Erwann Chenede <[email protected]>
++ *
++ *
++ * Largely based on Michael Fulbright's work on Anaconda.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
++ */
++
++
++#ifndef _E_TZ_H
++#define _E_TZ_H
++
++#include <glib.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <time.h>
++#include <math.h>
++#include <string.h>
++#include <dirent.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <fcntl.h>
++#include <time.h>
++#include <config.h>
++#include <libgnome/libgnome.h>
++
++#ifdef HAVE_LINUX
++#define TZ_DATA_FILE "/usr/share/zoneinfo/zone.tab"
++#define ZONE_TOKEN "TIMEZONE=\""
++#define SYS_CLOCK_FILE "/etc/sysconfig/clock"
++#endif
++#ifdef HAVE_SOLARIS
++#define TZ_DATA_FILE "/usr/share/lib/zoneinfo/tab/zone_sun.tab"
++#define ZONE_TOKEN "TZ="
++#define SYS_CLOCK_FILE "/etc/TIMEZONE"
++#endif
++
++#define LOCALTIME_FILE "/etc/localtime"
++#define ZONE_DIR "/usr/share/zoneinfo"
++
++typedef struct _TzDB TzDB;
++typedef struct _TzLocation TzLocation;
++typedef struct _TzInfo TzInfo;
++
++
++struct _TzDB
++{
++ GPtrArray *locations;
++};
++
++struct _TzLocation
++{
++ gchar *country;
++ gdouble latitude;
++ gdouble longitude;
++ gchar *zone;
++ gchar *comment;
++};
++
++/* see the glibc info page information on time zone information */
++/* tzname_normal is the default name for the timezone */
++/* tzname_daylight is the name of the zone when in daylight savings */
++/* utc_offset is offset in seconds from utc */
++/* daylight if non-zero then location obeys daylight savings */
++
++struct _TzInfo
++{
++ gchar *tzname_normal;
++ gchar *tzname_daylight;
++ glong utc_offset;
++ gint daylight;
++};
++
++
++TzDB *tz_load_db (void);
++void tz_free_db (TzDB *tz_db);
++GPtrArray *tz_get_locations (TzDB *db);
++void tz_location_get_position (TzLocation *loc,
++ double *longitude, double *latitude);
++char *tz_location_get_country (TzLocation *loc);
++gchar *tz_location_get_zone (TzLocation *loc);
++gchar *tz_location_get_comment (TzLocation *loc);
++glong tz_location_get_utc_offset (TzLocation *loc);
++gint tz_location_set_locally (TzLocation *loc);
++TzInfo *tz_info_from_location (TzLocation *loc);
++void tz_info_free (TzInfo *tz_info);
++void tz_location_free (TzLocation *loc);
++struct tm *tz_get_localtime_at (const char *zone,
++ const time_t *now);
++char * tz_get_system_timezone (void);
++TzLocation * tz_get_location_by_name (TzDB *tzdb,
++ gchar * name);
++#endif
+--- gnome-panel-2.10.1/config.h.in 2005-04-04 00:06:08.000000000 +0530
++++ gnome-panel-2.10.1-new/config.h.in 2005-06-30 22:37:14.826300448 +0530
+@@ -102,3 +102,6 @@
+
+ /* Define to 1 if the X Window System is missing or not being used. */
+ #undef X_DISPLAY_MISSING
++
++#undef HAVE_SOLARIS
++#undef HAVE_LINUX
+--- gnome-panel-2.10.1/configure.in 2005-06-30 22:37:05.622699608 +0530
++++ gnome-panel-2.10.1-new/configure.in 2005-06-30 22:37:51.583712472 +0530
+@@ -137,7 +137,7 @@ if test -n "$LIBECAL_REQUIREMENT"; then
+ fi
+ AM_CONDITIONAL(HAVE_LIBECAL, test -n "$LIBECAL_REQUIREMENT")
+
+-PKG_CHECK_MODULES(CLOCK, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED $LIBECAL_REQUIREMENT)
++PKG_CHECK_MODULES(CLOCK, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED $LIBECAL_REQUIREMENT libglade-2.0 >= $LIBGLADE_REQUIRED)
+ AC_SUBST(CLOCK_CFLAGS)
+ AC_SUBST(CLOCK_LIBS)
+
+@@ -216,6 +216,18 @@ fi
+
+ AM_GCONF_SOURCE_2
+
++dnl platform test
++case $host in
++*-*-solaris*)
++ ostype=solaris
++ AC_DEFINE(HAVE_SOLARIS, 1, [Define to 1])
++ ;;
++*-*-linux*)
++ ostype=linux
++ AC_DEFINE(HAVE_LINUX, 1, [Define to 1])
++ ;;
++esac
++
+ dnl Don't use AC_PROG_AWK since we need the full pathname.
+ AC_PATH_PROGS(AWK, mawk gawk nawk awk, )
+ AC_PATH_PROGS(PERL, perl5 perl)
--- a/patches/gnome-panel-09-menu-stripe.diff Sat May 13 01:34:47 2006 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,663 +0,0 @@
-diff -urNp gnome-panel-2.12.1/gnome-panel/Makefile.am gnome-panel-2.12.1-hacked/gnome-panel/Makefile.am
---- gnome-panel-2.12.1/gnome-panel/Makefile.am 2005-04-12 02:58:40.000000000 +1200
-+++ gnome-panel-2.12.1-hacked/gnome-panel/Makefile.am 2005-10-27 18:11:51.923618000 +1300
-@@ -97,6 +97,7 @@ panel_sources = \
- panel-background-monitor.c \
- panel-stock-icons.c \
- panel-action-button.c \
-+ panel-menu.c \
- panel-menu-bar.c \
- panel-menu-button.c \
- panel-menu-items.c \
-@@ -142,6 +143,7 @@ panel_headers = \
- panel-background-monitor.h \
- panel-stock-icons.h \
- panel-action-button.h \
-+ panel-menu.h \
- panel-menu-bar.h \
- panel-menu-button.h \
- panel-menu-items.h \
-diff -urNp gnome-panel-2.12.1/gnome-panel/menu.c gnome-panel-2.12.1-hacked/gnome-panel/menu.c
---- gnome-panel-2.12.1/gnome-panel/menu.c 2005-09-19 02:57:26.000000000 +1200
-+++ gnome-panel-2.12.1-hacked/gnome-panel/menu.c 2005-10-27 18:11:51.927300000 +1300
-@@ -48,6 +48,7 @@
- #include "panel-globals.h"
- #include "panel-run-dialog.h"
- #include "panel-lockdown.h"
-+#include "panel-menu.h"
-
- typedef struct {
- GtkWidget *pixmap;
-@@ -279,7 +280,7 @@ panel_create_menu (void)
- G_CALLBACK (icon_theme_changed), NULL);
- }
-
-- retval = gtk_menu_new ();
-+ retval = panel_menu_new (FALSE);
-
- panel_gconf_notify_add_while_alive ("/desktop/gnome/interface/menus_have_icons",
- (GConfClientNotifyFunc) menus_have_icons_changed,
-@@ -1584,6 +1585,8 @@ create_applications_menu (const char *me
-
- menu = create_empty_menu ();
-
-+ panel_menu_set_stripe_enabled (PANEL_MENU (menu), TRUE);
-+
- tree = gmenu_tree_lookup (menu_file, GMENU_TREE_FLAGS_NONE);
-
- g_object_set_data_full (G_OBJECT (menu),
-diff -urNp gnome-panel-2.12.1/gnome-panel/panel-menu-items.c gnome-panel-2.12.1-hacked/gnome-panel/panel-menu-items.c
---- gnome-panel-2.12.1/gnome-panel/panel-menu-items.c 2005-09-19 02:29:38.000000000 +1200
-+++ gnome-panel-2.12.1-hacked/gnome-panel/panel-menu-items.c 2005-10-27 18:11:51.929391000 +1300
-@@ -48,6 +48,7 @@
- #include "panel-recent.h"
- #include "panel-stock-icons.h"
- #include "panel-util.h"
-+#include "panel-menu.h"
-
- #define BOOKMARKS_FILENAME ".gtk-bookmarks"
- #define DESKTOP_IS_HOME_DIR_DIR "/apps/nautilus/preferences"
-@@ -523,6 +524,8 @@ panel_place_menu_item_create_menu (EggRe
-
- places_menu = panel_create_menu ();
-
-+ panel_menu_set_stripe_enabled (PANEL_MENU (places_menu), FALSE);
-+
- gconf_name = gconf_client_get_string (panel_gconf_get_client (),
- HOME_NAME_KEY,
- NULL);
-@@ -675,6 +678,7 @@ panel_desktop_menu_item_create_menu (Pan
- GtkWidget *desktop_menu;
-
- desktop_menu = create_applications_menu ("settings.menu", NULL);
-+ panel_menu_set_stripe_enabled (PANEL_MENU (desktop_menu), FALSE);
-
- g_signal_connect (desktop_menu, "show",
- G_CALLBACK (panel_desktop_menu_item_append_menu),
-diff -urNp gnome-panel-2.12.1/gnome-panel/panel-menu.c gnome-panel-2.12.1-hacked/gnome-panel/panel-menu.c
---- gnome-panel-2.12.1/gnome-panel/panel-menu.c 1970-01-01 12:00:00.000000000 +1200
-+++ gnome-panel-2.12.1-hacked/gnome-panel/panel-menu.c 2005-10-27 18:11:51.930515000 +1300
-@@ -0,0 +1,515 @@
-+/*
-+ * panel-menu.c: A GtkMenu with an ugly stripe down the side
-+ *
-+ * Copyright (C) 2003 Sun Microsystems, Inc.
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License as
-+ * published by the Free Software Foundation; either version 2 of the
-+ * License, or (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful, but
-+ * WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-+ * 02111-1307, USA.
-+ *
-+ * Authors:
-+ * Mark McLoughlin <[email protected]>
-+ * Erwann Chenede <[email protected]>
-+ *
-+ * The hack in size_allocate() is based on the menu stripe patch
-+ * with XD2 which is Copyright (C) 2002 Ximian, Inc. and written
-+ * by Thomas and Michael Meeks.
-+ */
-+
-+#include <config.h>
-+
-+#include "panel-menu.h"
-+#include "panel-globals.h"
-+#include "panel-util.h"
-+
-+#include <glib/gi18n.h>
-+
-+#define PANEL_MENU_DEFAULT_IMAGE "gnome-panel-menu-stripe"
-+#define PANEL_MENU_DEFAULT_GRADIENT_TOP { 0, 0xffff, 0xffff, 0xffff }
-+#define PANEL_MENU_DEFAULT_GRADIENT_BOTTOM { 0, 0x0000, 0x0000, 0xffff }
-+
-+struct _PanelMenuPrivate {
-+ gboolean stripe_enabled;
-+
-+ GdkPixbuf *stripe_image;
-+ GdkPixbuf *stripe_scaled;
-+};
-+
-+static GObjectClass *parent_class;
-+
-+enum {
-+ PROP_0,
-+ PROP_STRIPE_ENABLED
-+};
-+
-+static void
-+panel_menu_unset_stripe_image (PanelMenu *menu)
-+{
-+ if (menu->priv->stripe_image)
-+ g_object_unref (menu->priv->stripe_image);
-+ menu->priv->stripe_image = NULL;
-+
-+ if (menu->priv->stripe_scaled)
-+ g_object_unref (menu->priv->stripe_scaled);
-+ menu->priv->stripe_scaled = NULL;
-+}
-+
-+static gboolean
-+panel_menu_ensure_stripe_image (PanelMenu *menu)
-+{
-+ GError *error = NULL;
-+ char *name = NULL;
-+ char *full_path;
-+
-+ g_return_val_if_fail (menu->priv->stripe_enabled != FALSE, FALSE);
-+
-+ if (menu->priv->stripe_image)
-+ return TRUE;
-+
-+ gtk_widget_ensure_style (GTK_WIDGET (menu));
-+ gtk_widget_style_get (GTK_WIDGET (menu),
-+ "stripe-image", &name,
-+ NULL);
-+
-+ if (!name)
-+ goto out_no_name;
-+
-+ full_path = panel_find_icon (gtk_icon_theme_get_default (), name, 48);
-+ if (!full_path) {
-+ g_warning ("Unable to lookup stripe image '%s' against the current icon theme\n", name);
-+ goto out_no_path;
-+ }
-+
-+ menu->priv->stripe_image = gdk_pixbuf_new_from_file (full_path, &error);
-+ if (error) {
-+ g_warning ("Unable to load image '%s': %s", full_path, error->message);
-+ g_error_free (error);
-+ }
-+
-+ g_free (full_path);
-+ out_no_path:
-+ g_free (name);
-+ out_no_name:
-+ return menu->priv->stripe_image != NULL;
-+}
-+
-+static void
-+panel_menu_prepare_stripe_image (PanelMenu *menu,
-+ int height)
-+{
-+ g_return_if_fail (menu->priv->stripe_image != NULL);
-+
-+ if (menu->priv->stripe_scaled && height != gdk_pixbuf_get_height (menu->priv->stripe_scaled)) {
-+ g_object_unref (menu->priv->stripe_scaled);
-+ menu->priv->stripe_scaled = NULL;
-+ }
-+
-+ if (gdk_pixbuf_get_height (menu->priv->stripe_image) > height)
-+ menu->priv->stripe_scaled = gdk_pixbuf_scale_simple (menu->priv->stripe_image,
-+ gdk_pixbuf_get_width (menu->priv->stripe_image),
-+ height,
-+ GDK_INTERP_HYPER);
-+}
-+
-+static void
-+panel_menu_size_request (GtkWidget *widget,
-+ GtkRequisition *requisition)
-+{
-+ PanelMenu *menu = PANEL_MENU (widget);
-+
-+ if (GTK_WIDGET_CLASS (parent_class)->size_request)
-+ GTK_WIDGET_CLASS (parent_class)->size_request (widget, requisition);
-+
-+ if (menu->priv->stripe_enabled &&
-+ panel_menu_ensure_stripe_image (menu))
-+ requisition->width += gdk_pixbuf_get_width (menu->priv->stripe_image) +
-+ widget->style->xthickness;
-+}
-+
-+static void
-+panel_menu_size_allocate (GtkWidget *widget,
-+ GtkAllocation *allocation)
-+{
-+ PanelMenu *menu = PANEL_MENU (widget);
-+ GtkMenuShell *shell = GTK_MENU_SHELL (widget);
-+ GList *l;
-+ int stripe_width;
-+ int stripe_height = 0;
-+
-+ if (GTK_WIDGET_CLASS (parent_class)->size_allocate)
-+ GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
-+
-+ if (!menu->priv->stripe_enabled ||
-+ !panel_menu_ensure_stripe_image (menu))
-+ return;
-+
-+ stripe_width = gdk_pixbuf_get_width (menu->priv->stripe_image) + widget->style->xthickness;
-+
-+ for (l = shell->children; l; l = l->next) {
-+ GtkWidget *child = l->data;
-+ GtkAllocation challoc = child->allocation;
-+
-+ if (!GTK_WIDGET_VISIBLE (child))
-+ continue;
-+
-+ challoc.x += stripe_width;
-+
-+ if (!GTK_IS_SEPARATOR_MENU_ITEM (child))
-+ challoc.width -= stripe_width;
-+
-+ gtk_widget_size_allocate (child, &challoc);
-+
-+ if (GTK_WIDGET_REALIZED (child))
-+ gdk_window_move_resize (GTK_MENU_ITEM (child)->event_window,
-+ 0,
-+ challoc.y,
-+ allocation->width,
-+ challoc.height);
-+
-+ stripe_height += challoc.height;
-+ }
-+
-+ panel_menu_prepare_stripe_image (menu, stripe_height);
-+}
-+
-+static void
-+panel_menu_draw_hgradient (GdkDrawable *drawable,
-+ GdkGC *gc,
-+ GdkColormap *colormap,
-+ int x,
-+ int y,
-+ int width,
-+ int height,
-+ GdkColor *top_color,
-+ GdkColor *bottom_color,
-+ GdkRegion *clip)
-+{
-+ GdkGCValues old_values;
-+ GdkColor col;
-+ int dr, dg, db;
-+ int i;
-+
-+ col = *top_color;
-+
-+ dr = (bottom_color->red - top_color->red) / height;
-+ dg = (bottom_color->green - top_color->green) / height;
-+ db = (bottom_color->blue - top_color->blue) / height;
-+
-+ gdk_gc_get_values (gc, &old_values);
-+
-+ gdk_gc_set_clip_region (gc, clip);
-+
-+ for (i = 0; i < height; i++) {
-+ gdk_rgb_find_color (colormap, &col);
-+
-+ gdk_gc_set_foreground (gc, &col);
-+ gdk_draw_line (drawable,
-+ gc,
-+ x,
-+ y + i,
-+ x + width - 1,
-+ y + i);
-+
-+ col.red += dr;
-+ col.green += dg;
-+ col.blue += db;
-+ }
-+
-+ gdk_gc_set_foreground (gc, &old_values.foreground);
-+ gdk_gc_set_clip_region (gc, NULL);
-+}
-+
-+static void
-+panel_menu_draw_stripe (PanelMenu *menu,
-+ GdkEventExpose *event)
-+{
-+ GtkWidget *widget = GTK_WIDGET (menu);
-+ GdkDrawable *drawable;
-+ GdkPixbuf *stripe_image;
-+ GdkColor default_top_color = PANEL_MENU_DEFAULT_GRADIENT_TOP;
-+ GdkColor default_bottom_color = PANEL_MENU_DEFAULT_GRADIENT_BOTTOM;
-+ GdkColor *top_color = NULL;
-+ GdkColor *bottom_color = NULL;
-+ gboolean stripe_at_top = FALSE;
-+ GdkRectangle area;
-+ GdkRectangle exposed_area;
-+ int height;
-+ int stripe_width;
-+ int stripe_height;
-+
-+ if (!menu->priv->stripe_image)
-+ return;
-+
-+ gtk_widget_style_get (widget,
-+ "stripe-at-top", &stripe_at_top,
-+ "stripe-gradient-top", &top_color,
-+ "stripe-gradient-bottom", &bottom_color,
-+ NULL);
-+
-+ drawable = GTK_MENU (menu)->bin_window;
-+
-+ gdk_window_get_geometry (drawable, NULL, NULL, NULL, &height, NULL);
-+
-+ stripe_image = menu->priv->stripe_scaled ? menu->priv->stripe_scaled :
-+ menu->priv->stripe_image;
-+
-+ stripe_width = gdk_pixbuf_get_width (stripe_image);
-+ stripe_height = gdk_pixbuf_get_height (stripe_image);
-+
-+ panel_menu_draw_hgradient (drawable,
-+ widget->style->fg_gc [GTK_WIDGET_STATE (widget)],
-+ widget->style->colormap,
-+ 0,
-+ 0,
-+ stripe_width,
-+ height,
-+ top_color ? top_color : &default_top_color,
-+ bottom_color ? bottom_color : &default_bottom_color,
-+ event->region);
-+
-+ if (top_color)
-+ gdk_color_free (top_color);
-+ if (bottom_color)
-+ gdk_color_free (bottom_color);
-+
-+ area.x = 0;
-+ area.y = stripe_at_top ? 0 : height - stripe_height;
-+ area.width = stripe_width;
-+ area.height = stripe_height;
-+
-+ if (!gdk_rectangle_intersect (&event->area, &area, &exposed_area))
-+ return;
-+
-+ gdk_draw_pixbuf (drawable,
-+ widget->style->fg_gc [GTK_WIDGET_STATE (widget)],
-+ stripe_image,
-+ exposed_area.x,
-+ exposed_area.y - area.y,
-+ exposed_area.x,
-+ exposed_area.y,
-+ exposed_area.width,
-+ exposed_area.height,
-+ GDK_RGB_DITHER_NORMAL,
-+ 0, 0);
-+}
-+
-+static gboolean
-+panel_menu_expose (GtkWidget *widget,
-+ GdkEventExpose *event)
-+{
-+ PanelMenu *menu = (PanelMenu *) widget;
-+ gboolean retval = FALSE;
-+
-+ if (!GTK_WIDGET_DRAWABLE (widget))
-+ return retval;
-+
-+ if (GTK_WIDGET_CLASS (parent_class)->expose_event)
-+ retval = GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
-+
-+ panel_menu_draw_stripe (menu, event);
-+
-+ return retval;
-+}
-+
-+static void
-+panel_menu_finalize (GObject *object)
-+{
-+ PanelMenu *menu = PANEL_MENU (object);
-+
-+ panel_menu_unset_stripe_image (menu);
-+
-+ g_free (menu->priv);
-+ menu->priv = NULL;
-+
-+ if (parent_class->finalize)
-+ parent_class->finalize (object);
-+}
-+
-+static void
-+panel_menu_set_property (GObject *object,
-+ guint prop_id,
-+ const GValue *value,
-+ GParamSpec *pspec)
-+{
-+ PanelMenu *menu;
-+
-+ g_return_if_fail (PANEL_IS_MENU (object));
-+
-+ menu = PANEL_MENU (object);
-+
-+ switch (prop_id) {
-+ case PROP_STRIPE_ENABLED:
-+ panel_menu_set_stripe_enabled (menu, g_value_get_boolean (value));
-+ break;
-+ default:
-+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-+ break;
-+ }
-+}
-+
-+static void
-+panel_menu_get_property (GObject *object,
-+ guint prop_id,
-+ GValue *value,
-+ GParamSpec *pspec)
-+{
-+ PanelMenu *menu;
-+
-+ g_return_if_fail (PANEL_IS_MENU (object));
-+
-+ menu = PANEL_MENU (object);
-+
-+ switch (prop_id) {
-+ case PROP_STRIPE_ENABLED:
-+ g_value_set_boolean (value, menu->priv->stripe_enabled);
-+ break;
-+ default:
-+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-+ break;
-+ }
-+}
-+
-+static void
-+panel_menu_class_init (PanelMenuClass *klass)
-+{
-+ GObjectClass *gobject_class = (GObjectClass *) klass;
-+ GtkWidgetClass *widget_class = (GtkWidgetClass *) klass;
-+
-+ parent_class = g_type_class_peek_parent (klass);
-+
-+ gobject_class->finalize = panel_menu_finalize;
-+ gobject_class->set_property = panel_menu_set_property;
-+ gobject_class->get_property = panel_menu_get_property;
-+
-+ widget_class->size_request = panel_menu_size_request;
-+ widget_class->size_allocate = panel_menu_size_allocate;
-+ widget_class->expose_event = panel_menu_expose;
-+
-+ g_object_class_install_property (
-+ gobject_class,
-+ PROP_STRIPE_ENABLED,
-+ g_param_spec_boolean (
-+ "stripe-enabled",
-+ _("Stripe Enabled"),
-+ _("Whether the stripe image should be drawn beside the menu"),
-+ FALSE,
-+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
-+
-+
-+ gtk_widget_class_install_style_property (widget_class,
-+ g_param_spec_string ("stripe-image",
-+ _("Stripe Image Filename"),
-+ _("Name of the image with which to draw the menu stripe"),
-+ PANEL_MENU_DEFAULT_IMAGE,
-+ G_PARAM_READABLE));
-+
-+ gtk_widget_class_install_style_property (widget_class,
-+ g_param_spec_string ("stripe-at-top",
-+ _("Stripe at Top"),
-+ _("If true, place the stripe image at the top of the menu, otherwise place it at the bottom of the menu"),
-+ FALSE,
-+ G_PARAM_READABLE));
-+
-+ gtk_widget_class_install_style_property (widget_class,
-+ g_param_spec_boxed ("stripe-gradient-top",
-+ _("Stripe Gradient Top Color"),
-+ _("The top color of the gradient on the menu stripe"),
-+ GDK_TYPE_COLOR,
-+ G_PARAM_READABLE));
-+
-+ gtk_widget_class_install_style_property (widget_class,
-+ g_param_spec_boxed ("stripe-gradient-bottom",
-+ _("Stripe Gradient Bottom Color"),
-+ _("The bottom color of the gradient on the menu stripe"),
-+ GDK_TYPE_COLOR,
-+ G_PARAM_READABLE));
-+}
-+
-+static void
-+panel_menu_instance_init (PanelMenu *menu,
-+ PanelMenuClass *klass)
-+{
-+ menu->priv = g_new0 (PanelMenuPrivate, 1);
-+
-+ menu->priv->stripe_enabled = FALSE;
-+ menu->priv->stripe_image = NULL;
-+ menu->priv->stripe_scaled = NULL;
-+
-+ gtk_widget_add_events (GTK_WIDGET (menu),
-+ GDK_BUTTON_PRESS_MASK |
-+ GDK_BUTTON_RELEASE_MASK |
-+ GDK_ENTER_NOTIFY_MASK |
-+ GDK_LEAVE_NOTIFY_MASK |
-+ GDK_POINTER_MOTION_MASK);
-+}
-+
-+GType
-+panel_menu_get_type (void)
-+{
-+ static GType type = 0;
-+
-+ if (!type) {
-+ static const GTypeInfo info = {
-+ sizeof (PanelMenuClass),
-+ NULL,
-+ NULL,
-+ (GClassInitFunc) panel_menu_class_init,
-+ NULL,
-+ NULL,
-+ sizeof (PanelMenu),
-+ 0,
-+ (GInstanceInitFunc) panel_menu_instance_init,
-+ NULL
-+ };
-+
-+ type = g_type_register_static (GTK_TYPE_MENU, "PanelMenu", &info, 0);
-+ }
-+
-+ return type;
-+}
-+
-+GtkWidget *
-+panel_menu_new (gboolean stripe_enabled)
-+{
-+ return g_object_new (PANEL_TYPE_MENU,
-+ "stripe-enabled", stripe_enabled,
-+ NULL);
-+}
-+
-+void
-+panel_menu_set_stripe_enabled (PanelMenu *menu,
-+ gboolean stripe_enabled)
-+
-+{
-+ g_return_if_fail (PANEL_IS_MENU (menu));
-+
-+ stripe_enabled = stripe_enabled != FALSE;
-+
-+ if (menu->priv->stripe_enabled == stripe_enabled)
-+ return;
-+
-+ menu->priv->stripe_enabled = stripe_enabled;
-+
-+ gtk_widget_queue_resize (GTK_WIDGET (menu));
-+
-+ g_object_notify (G_OBJECT (menu), "stripe-enabled");
-+}
-+
-+gboolean
-+panel_menu_get_stripe_enabled (PanelMenu *menu)
-+{
-+ g_return_val_if_fail (PANEL_IS_MENU (menu), FALSE);
-+
-+ return menu->priv->stripe_enabled;
-+}
-diff -urNp gnome-panel-2.12.1/gnome-panel/panel-menu.h gnome-panel-2.12.1-hacked/gnome-panel/panel-menu.h
---- gnome-panel-2.12.1/gnome-panel/panel-menu.h 1970-01-01 12:00:00.000000000 +1200
-+++ gnome-panel-2.12.1-hacked/gnome-panel/panel-menu.h 2005-10-27 18:11:51.931047000 +1300
-@@ -0,0 +1,64 @@
-+/*
-+ * panel-menu.h: A GtkMenu with an ugly stripe down the side
-+ *
-+ * Copyright (C) 2003 Sun Microsystems, Inc.
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License as
-+ * published by the Free Software Foundation; either version 2 of the
-+ * License, or (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful, but
-+ * WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-+ * 02111-1307, USA.
-+
-+ * Authors:
-+ * Mark McLoughlin <[email protected]>
-+ * Erwann Chenede <[email protected]>
-+ */
-+
-+#ifndef __PANEL_MENU_H__
-+#define __PANEL_MENU_H__
-+
-+#include <gtk/gtk.h>
-+
-+G_BEGIN_DECLS
-+
-+#define PANEL_TYPE_MENU (panel_menu_get_type ())
-+#define PANEL_MENU(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PANEL_TYPE_MENU, PanelMenu))
-+#define PANEL_MENU_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PANEL_TYPE_MENU, PanelMenuClass))
-+#define PANEL_IS_MENU(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PANEL_TYPE_MENU))
-+#define PANEL_IS_MENU_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PANEL_TYPE_MENU))
-+#define PANEL_MENU_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PANEL_TYPE_MENU, PanelMenuClass))
-+
-+typedef struct _PanelMenu PanelMenu;
-+typedef struct _PanelMenuClass PanelMenuClass;
-+typedef struct _PanelMenuPrivate PanelMenuPrivate;
-+
-+struct _PanelMenu {
-+ GtkMenu parent_instance;
-+
-+ PanelMenuPrivate *priv;
-+};
-+
-+struct _PanelMenuClass {
-+ GtkMenuClass parent_class;
-+};
-+
-+GType panel_menu_get_type (void) G_GNUC_CONST;
-+
-+GtkWidget *panel_menu_new (gboolean stripe_enabled);
-+
-+void panel_menu_set_stripe_enabled (PanelMenu *menu,
-+ gboolean stripe_enabled);
-+gboolean panel_menu_get_stripe_enabled (PanelMenu *menu);
-+
-+G_END_DECLS
-+
-+#endif /* __PANEL_MENU_H__ */
--- a/patches/gnome-panel-10-input-method-filter-keypress.diff Sat May 13 01:34:47 2006 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
---- gnome-panel-2.13.3/gnome-panel/panel-run-dialog.c.orig 2006-01-04 17:43:03.000999000 +0000
-+++ gnome-panel-2.13.3/gnome-panel/panel-run-dialog.c 2006-01-04 17:44:14.640718000 +0000
-@@ -1357,6 +1357,12 @@
- char *temp;
- int pos, tmp;
-
-+ /* commit the string when IM is enable */
-+ if (GTK_ENTRY (entry)->editable && event->type == GDK_KEY_PRESS && event->length > 0) {
-+ if (gtk_im_context_filter_keypress (GTK_ENTRY (entry)->im_context, event))
-+ return TRUE;
-+ }
-+
- if (event->type != GDK_KEY_PRESS)
- return FALSE;
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/gnome-panel-10-restrict-app-launching.diff Sat May 13 17:59:05 2006 +0000
@@ -0,0 +1,1555 @@
+--- gnome-panel-2.14.1.old/gnome-panel/applet.c 2006-01-22 15:01:30.000000000 +0000
++++ gnome-panel-2.14.1/gnome-panel/applet.c 2006-04-21 11:06:11.736713000 +0100
+@@ -159,6 +159,31 @@
+ info->menu = panel_applet_create_menu (info);
+ }
+
++static void panel_applet_check_visibility(AppletInfo *info)
++{
++ if (info->type == PANEL_OBJECT_LAUNCHER) {
++ if (panel_launcher_is_forbidden(info->data)) {
++ gtk_widget_hide(info->widget) ;
++ }
++ else { gtk_widget_show(info->widget) ; }
++ }
++}
++
++static void panel_applet_refresh_state(AppletInfo *info)
++{
++ if (info->type == PANEL_OBJECT_BONOBO) {
++ if (!panel_applet_frame_refresh(info->data)) {
++ /* If the applet frame was rebuilt, no point in
++ recreating the menu. */
++ panel_applet_recreate_menu(info) ;
++ }
++ }
++ else {
++ panel_applet_check_visibility(info) ;
++ panel_applet_recreate_menu(info) ;
++ }
++}
++
+ static void
+ panel_applet_locked_change_notify (GConfClient *client,
+ guint cnxn_id,
+@@ -738,8 +763,7 @@
+ }
+ }
+
+- if (info->type != PANEL_OBJECT_BONOBO)
+- panel_lockdown_notify_remove (G_CALLBACK (panel_applet_recreate_menu),
++ panel_lockdown_notify_remove (G_CALLBACK (panel_applet_refresh_state),
+ info);
+
+ if (info->menu)
+@@ -1182,8 +1206,7 @@
+
+ g_object_set_data (G_OBJECT (applet), "applet_info", info);
+
+- if (type != PANEL_OBJECT_BONOBO)
+- panel_lockdown_notify_add (G_CALLBACK (panel_applet_recreate_menu),
++ panel_lockdown_notify_add (G_CALLBACK (panel_applet_refresh_state),
+ info);
+
+ key = panel_gconf_full_key ((type == PANEL_OBJECT_BONOBO) ?
+--- gnome-panel-2.14.1.old/gnome-panel/gnome-desktop-item-edit.c 2006-03-24 21:46:29.000000000 +0000
++++ gnome-panel-2.14.1/gnome-panel/gnome-desktop-item-edit.c 2006-04-21 11:06:11.814169000 +0100
+@@ -79,6 +79,7 @@
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+
++ panel_lockdown_init() ;
+ context = g_option_context_new (""); //FIXME 2.16 "- Edit .desktop files"
+
+ g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE);
+@@ -188,5 +189,6 @@
+
+ g_object_unref (program);
+
++ panel_lockdown_finalize() ;
+ return 0;
+ }
+--- gnome-panel-2.14.1.old/gnome-panel/launcher.c 2006-04-27 15:54:21.204589000 +0100
++++ gnome-panel-2.14.1/gnome-panel/launcher.c 2006-04-21 11:06:11.820944000 +0100
+@@ -180,6 +180,9 @@
+ }
+
+ free_url = gnome_vfs_make_uri_canonical (url);
++ if (panel_lockdown_is_forbidden_ditem(item)) {
++ return ;
++ }
+ gnome_url_show_on_screen (free_url, screen, &error);
+
+ if (error) {
+@@ -219,20 +222,22 @@
+ else {
+ GError *error = NULL;
+
+- panel_ditem_launch (
+- item, NULL, 0, launcher_get_screen (launcher), &error);
+- if (error) {
+- GtkWidget *error_dialog;
+-
+- error_dialog = panel_error_dialog (launcher_get_screen (launcher),
+- "cannot_launch_application",
+- TRUE,
+- _("Could not launch application"),
+- "%s",
+- error->message);
+- launcher_register_error_dialog (launcher, error_dialog);
+- g_clear_error (&error);
+- }
++ if (!panel_lockdown_is_forbidden_app((GnomeDesktopItem *) item)) {
++ panel_ditem_launch (
++ item, NULL, 0, launcher_get_screen (launcher), &error);
++ if (error) {
++ GtkWidget *error_dialog;
++
++ error_dialog = panel_error_dialog (launcher_get_screen (launcher),
++ "cannot_launch_application",
++ TRUE,
++ _("Could not launch application"),
++ "%s",
++ error->message);
++ launcher_register_error_dialog (launcher, error_dialog);
++ g_clear_error (&error);
++ }
++ }
+ }
+
+ if (panel_global_config_get_drawer_auto_close ()) {
+@@ -536,7 +541,12 @@
+ FALSE,
+ PANEL_ORIENTATION_TOP);
+
+- gtk_widget_show (launcher->button);
++ if (panel_lockdown_is_forbidden_ditem(ditem)) {
++ gtk_widget_hide(launcher->button) ;
++ }
++ else {
++ gtk_widget_show (launcher->button);
++ }
+
+ /*gtk_drag_dest_set (GTK_WIDGET (launcher->button),
+ GTK_DEST_DEFAULT_ALL,
+@@ -1020,7 +1030,6 @@
+ static void
+ really_add_launcher (GtkWidget *dialog, int response, gpointer data)
+ {
+- GtkWidget *err_dialog;
+ GnomeDItemEdit *dedit = GNOME_DITEM_EDIT(data);
+ int pos = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (dialog), "pos"));
+ PanelWidget *panel = g_object_get_data (G_OBJECT (dialog), "panel");
+@@ -1028,35 +1037,32 @@
+
+ if (response == GTK_RESPONSE_OK) {
+ const char *location;
++ const char *error_string = NULL ;
+
+ ditem = gnome_ditem_edit_get_ditem (dedit);
+
+ /* check for valid name */
+ if (string_empty (gnome_desktop_item_get_localestring (ditem, GNOME_DESKTOP_ITEM_NAME))) {
+- err_dialog = panel_error_dialog (gtk_window_get_screen (GTK_WINDOW (dialog)),
+- "cannot_create_launcher",
+- TRUE,
+- _("Could not create launcher"),
+- _("You have to specify a name."));
+- g_signal_connect_object (G_OBJECT (dialog),
+- "destroy",
+- G_CALLBACK (gtk_widget_destroy),
+- G_OBJECT (err_dialog),
+- G_CONNECT_SWAPPED);
+- return;
++ error_string = _("You have to specify a name.") ;
+ }
+-
+-
+ /* check for valid URL or command */
+- if ((gnome_desktop_item_get_entry_type (ditem) == GNOME_DESKTOP_ITEM_TYPE_APPLICATION &&
++ else if ((gnome_desktop_item_get_entry_type (ditem) == GNOME_DESKTOP_ITEM_TYPE_APPLICATION &&
+ string_empty (gnome_desktop_item_get_string (ditem, GNOME_DESKTOP_ITEM_EXEC))) ||
+ (gnome_desktop_item_get_entry_type (ditem) == GNOME_DESKTOP_ITEM_TYPE_LINK &&
+ string_empty (gnome_desktop_item_get_string (ditem, GNOME_DESKTOP_ITEM_URL)))) {
+- err_dialog = panel_error_dialog (gtk_window_get_screen (GTK_WINDOW (dialog)),
++ error_string = _("You have to specify a valid URL or command.") ;
++ }
++ else if (panel_lockdown_is_forbidden_ditem(ditem)) {
++ error_string = _("The system administrator has disallowed\n"
++ "use of this application.") ;
++ }
++ if (error_string != NULL) {
++ GtkWidget *err_dialog = panel_error_dialog (
++ gtk_window_get_screen (GTK_WINDOW (dialog)),
+ "cannot_create_launcher",
+ TRUE,
+ _("Could not create launcher"),
+- _("You have to specify a valid URL or command."));
++ error_string);
+ g_signal_connect_object (G_OBJECT (dialog),
+ "destroy",
+ G_CALLBACK (gtk_widget_destroy),
+@@ -1180,6 +1186,7 @@
+ gnome_desktop_item_set_entry_type (ditem, GNOME_DESKTOP_ITEM_TYPE_LINK);
+ }
+
++ if (panel_lockdown_is_forbidden_ditem(ditem)) { return ; }
+ panel_launcher_save_ditem (ditem, TRUE, gtk_window_get_screen (GTK_WINDOW (toplevel)));
+ location = gnome_desktop_item_get_location (ditem);
+
+@@ -1324,3 +1331,10 @@
+ } else
+ gtk_drag_source_unset (launcher->button);
+ }
++
++gboolean panel_launcher_is_forbidden(Launcher *launcher)
++{
++ return panel_lockdown_is_forbidden_ditem(launcher->ditem) ;
++}
++
++
+--- gnome-panel-2.14.1.old/gnome-panel/launcher.h 2004-12-19 11:35:49.000000000 +0000
++++ gnome-panel-2.14.1/gnome-panel/launcher.h 2006-04-21 11:06:11.828771000 +0100
+@@ -79,6 +79,7 @@
+ void panel_launcher_set_dnd_enabled (Launcher *launcher,
+ gboolean dnd_enabled);
+
++gboolean panel_launcher_is_forbidden(Launcher *launcher) ;
+
+ G_END_DECLS
+
+--- gnome-panel-2.14.1.old/gnome-panel/Makefile.am 2006-04-27 15:54:21.919467000 +0100
++++ gnome-panel-2.14.1/gnome-panel/Makefile.am 2006-04-21 11:06:11.830378000 +0100
+@@ -189,6 +189,8 @@
+ menu-ditem.c \
+ menu-ditem.h \
+ panel-util.c \
++ panel-lockdown.c \
++ panel-gconf.c \
+ xstuff.c
+
+ gnome_desktop_item_edit_LDFLAGS = -export-dynamic
+--- gnome-panel-2.14.1.old/gnome-panel/menu.c 2006-04-27 15:54:21.998780000 +0100
++++ gnome-panel-2.14.1/gnome-panel/menu.c 2006-04-27 14:20:53.900926000 +0100
+@@ -74,7 +74,7 @@
+ static GSList *image_menu_items = NULL;
+
+ static GtkWidget *populate_menu_from_directory (GtkWidget *menu,
+- GMenuTreeDirectory *directory);
++ GMenuTreeDirectory *directory, gboolean *is_hidden);
+
+ static void panel_load_menu_image_deferred (GtkWidget *image_menu_item,
+ GtkIconSize icon_size,
+@@ -1310,7 +1310,7 @@
+ }
+
+ static void
+-submenu_to_display (GtkWidget *menu)
++submenu_to_display (GtkWidget *menu, gboolean *is_hidden)
+ {
+ GMenuTree *tree;
+ GMenuTreeDirectory *directory;
+@@ -1342,18 +1342,25 @@
+ (GDestroyNotify) gmenu_tree_item_unref);
+ }
+
+- if (directory)
+- populate_menu_from_directory (menu, directory);
++ if (directory) {
++ /* It's possible that is_hidden is NULL if we end up here from the show
++ signal, which could only happen for the top level menu. */
++ gboolean local_is_hidden = FALSE ;
++
++ populate_menu_from_directory (menu, directory, &local_is_hidden);
++ if (is_hidden != NULL) { *is_hidden = local_is_hidden ; }
++ }
+ }
+
+ static gboolean
+ submenu_to_display_in_idle (gpointer data)
+ {
++ gboolean is_hidden = FALSE ;
+ GtkWidget *menu = GTK_WIDGET (data);
+
+ g_object_set_data (G_OBJECT (menu), "panel-menu-idle-id", NULL);
+
+- submenu_to_display (menu);
++ submenu_to_display (menu, &is_hidden);
+
+ return FALSE;
+ }
+@@ -1401,7 +1408,7 @@
+
+ g_signal_connect (menu, "button_press_event",
+ G_CALLBACK (menu_dummy_button_press_event), NULL);
+-
++
+ return menu;
+ }
+
+@@ -1439,28 +1446,38 @@
+ static void
+ create_submenu (GtkWidget *menu,
+ GMenuTreeDirectory *directory,
+- GMenuTreeDirectory *alias_directory)
++ GMenuTreeDirectory *alias_directory,
++ gboolean *is_hidden)
+ {
+ GtkWidget *menuitem;
+ GtkWidget *submenu;
+
++ submenu = create_fake_menu (directory);
++ if (panel_lockdown_get_restrict_application_launching()) {
++ submenu_to_display(submenu, is_hidden) ;
++ }
++ else {
++ *is_hidden = FALSE ;
++ }
++
+ if (alias_directory)
+ menuitem = create_submenu_entry (menu, alias_directory);
+ else
+ menuitem = create_submenu_entry (menu, directory);
+
+- submenu = create_fake_menu (directory);
+-
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
++ if (*is_hidden) { gtk_widget_hide(menuitem) ; }
+ }
+
+ static void
+ create_header (GtkWidget *menu,
+- GMenuTreeHeader *header)
++ GMenuTreeHeader *header,
++ gboolean *is_hidden)
+ {
+ GMenuTreeDirectory *directory;
+ GtkWidget *menuitem;
+
++ *is_hidden = FALSE ;
+ directory = gmenu_tree_header_get_directory (header);
+ menuitem = create_submenu_entry (menu, directory);
+ gmenu_tree_item_unref (directory);
+@@ -1474,13 +1491,16 @@
+ G_CALLBACK (gtk_false), NULL);
+ }
+
++
+ static void
+ create_menuitem (GtkWidget *menu,
+ GMenuTreeEntry *entry,
+- GMenuTreeDirectory *alias_directory)
++ GMenuTreeDirectory *alias_directory,
++ gboolean *is_hidden)
+ {
+ GtkWidget *menuitem;
+
++ *is_hidden = FALSE ;
+ menuitem = gtk_image_menu_item_new ();
+
+ g_object_set_data_full (G_OBJECT (menuitem),
+@@ -1510,6 +1530,10 @@
+ gmenu_tree_entry_get_name (entry),
+ TRUE);
+
++ if (entry != NULL && !panel_lockdown_is_allowed_menu_entry(entry)) {
++ gtk_widget_hide(menuitem) ;
++ *is_hidden = TRUE ;
++ }
+ if ((alias_directory &&
+ gmenu_tree_directory_get_comment (alias_directory)) ||
+ (!alias_directory &&
+@@ -1553,7 +1577,8 @@
+
+ static void
+ create_menuitem_from_alias (GtkWidget *menu,
+- GMenuTreeAlias *alias)
++ GMenuTreeAlias *alias,
++ gboolean *is_hidden)
+ {
+ GMenuTreeItem *aliased_item;
+
+@@ -1563,13 +1588,15 @@
+ case GMENU_TREE_ITEM_DIRECTORY:
+ create_submenu (menu,
+ GMENU_TREE_DIRECTORY (aliased_item),
+- gmenu_tree_alias_get_directory (alias));
++ gmenu_tree_alias_get_directory (alias),
++ is_hidden);
+ break;
+
+ case GMENU_TREE_ITEM_ENTRY:
+ create_menuitem (menu,
+ GMENU_TREE_ENTRY (aliased_item),
+- gmenu_tree_alias_get_directory (alias));
++ gmenu_tree_alias_get_directory (alias),
++ is_hidden);
+ break;
+
+ default:
+@@ -1679,17 +1706,20 @@
+
+ static GtkWidget *
+ populate_menu_from_directory (GtkWidget *menu,
+- GMenuTreeDirectory *directory)
++ GMenuTreeDirectory *directory,
++ gboolean *is_hidden)
+ {
+ GSList *l;
+ GSList *items;
+ gboolean add_separator;
+
++ *is_hidden = TRUE ;
+ add_separator = (GTK_MENU_SHELL (menu)->children != NULL);
+
+ items = gmenu_tree_directory_get_contents (directory);
+
+ for (l = items; l; l = l->next) {
++ gboolean is_item_hidden = TRUE ;
+ GMenuTreeItem *item = l->data;
+
+ if (add_separator ||
+@@ -1700,11 +1730,13 @@
+
+ switch (gmenu_tree_item_get_type (item)) {
+ case GMENU_TREE_ITEM_DIRECTORY:
+- create_submenu (menu, GMENU_TREE_DIRECTORY (item), NULL);
++ create_submenu (menu, GMENU_TREE_DIRECTORY (item), NULL,
++ &is_item_hidden);
+ break;
+
+ case GMENU_TREE_ITEM_ENTRY:
+- create_menuitem (menu, GMENU_TREE_ENTRY (item), NULL);
++ create_menuitem (menu, GMENU_TREE_ENTRY (item), NULL,
++ &is_item_hidden);
+ break;
+
+ case GMENU_TREE_ITEM_SEPARATOR :
+@@ -1712,11 +1744,13 @@
+ break;
+
+ case GMENU_TREE_ITEM_ALIAS:
+- create_menuitem_from_alias (menu, GMENU_TREE_ALIAS (item));
++ create_menuitem_from_alias (menu, GMENU_TREE_ALIAS (item),
++ &is_item_hidden);
+ break;
+
+ case GMENU_TREE_ITEM_HEADER:
+- create_header (menu, GMENU_TREE_HEADER (item));
++ create_header (menu, GMENU_TREE_HEADER (item),
++ &is_item_hidden);
+ break;
+
+ default:
+@@ -1724,6 +1758,7 @@
+ }
+
+ gmenu_tree_item_unref (item);
++ if (!is_item_hidden) { *is_hidden = FALSE ; }
+ }
+
+ g_slist_free (items);
+--- gnome-panel-2.14.1.old/gnome-panel/menu-ditem.c 2005-12-17 11:04:21.000000000 +0000
++++ gnome-panel-2.14.1/gnome-panel/menu-ditem.c 2006-04-21 11:06:11.885900000 +0100
+@@ -442,6 +442,7 @@
+ GError *error = NULL;
+ char *name, *loc, *dir;
+ GtkWidget *dialog;
++ const char *error_string = NULL ;
+
+ switch (response) {
+ case GTK_RESPONSE_OK:
+@@ -464,27 +465,24 @@
+
+ /* check for valid name */
+ if (string_empty (gnome_desktop_item_get_localestring (ditem, GNOME_DESKTOP_ITEM_NAME))) {
+- dialog = panel_error_dialog (gtk_window_get_screen (GTK_WINDOW (d)),
+- "cannot_create_launcher", TRUE,
+- _("Could not create launcher"),
+- _("You have to specify a name."));
+-
+- g_signal_connect_swapped (G_OBJECT (dialog),
+- "destroy",
+- G_CALLBACK (panel_pop_window_busy),
+- G_OBJECT (d));
+- return;
+- }
+-
++ error_string = _("You have to specify a name.") ;
++ }
+ /* check for valid URL or command */
+- if ((gnome_desktop_item_get_entry_type (ditem) == GNOME_DESKTOP_ITEM_TYPE_APPLICATION &&
++ else if ((gnome_desktop_item_get_entry_type (ditem) == GNOME_DESKTOP_ITEM_TYPE_APPLICATION &&
+ string_empty (gnome_desktop_item_get_string (ditem, GNOME_DESKTOP_ITEM_EXEC))) ||
+ (gnome_desktop_item_get_entry_type (ditem) == GNOME_DESKTOP_ITEM_TYPE_LINK &&
+ string_empty (gnome_desktop_item_get_string (ditem, GNOME_DESKTOP_ITEM_URL)))) {
++ error_string = _("You have to specify a valid URL or command.") ;
++ }
++ else if (panel_lockdown_is_forbidden_ditem(ditem)) {
++ error_string = _("The system administrator has disallowed\n"
++ "use of this application.") ;
++ }
++ if (error_string != NULL) {
+ dialog = panel_error_dialog (gtk_window_get_screen (GTK_WINDOW (d)),
+ "cannot_create_launcher", TRUE,
+ _("Could not create launcher"),
+- _("You have to specify a valid URL or command."));
++ error_string);
+ g_signal_connect_swapped (G_OBJECT (dialog),
+ "destroy",
+ G_CALLBACK (panel_pop_window_busy),
+--- gnome-panel-2.14.1.old/gnome-panel/panel-action-button.c 2006-02-12 12:36:56.000000000 +0000
++++ gnome-panel-2.14.1/gnome-panel/panel-action-button.c 2006-04-21 11:06:11.887747000 +0100
+@@ -178,8 +178,11 @@
+ static void
+ panel_action_run_program (GtkWidget *widget)
+ {
+- panel_run_dialog_present (gtk_widget_get_screen (widget),
+- gtk_get_current_event_time ());
++ if (!panel_lockdown_get_restrict_application_launching() &&
++ !panel_lockdown_get_disable_command_line()) {
++ panel_run_dialog_present (gtk_widget_get_screen (widget),
++ gtk_get_current_event_time ());
++ }
+ }
+
+ /* Search For Files
+@@ -193,6 +196,9 @@
+ char *argv[2] = {"gnome-search-tool", NULL};
+ char *file;
+
++ if (panel_lockdown_is_forbidden_command("/usr/bin/gnome-search-tool")) {
++ return ;
++ }
+ screen = gtk_widget_get_screen (widget);
+ file = panel_lookup_in_data_dirs ("applications/gnome-search-tool.desktop");
+
+--- gnome-panel-2.14.1.old/gnome-panel/panel-applet-frame.c 2006-03-06 20:19:20.000000000 +0000
++++ gnome-panel-2.14.1/gnome-panel/panel-applet-frame.c 2006-04-21 11:06:11.907293000 +0100
+@@ -115,6 +115,8 @@
+ gboolean movable;
+ gboolean removable;
+
++ /* If the applet is currently in a disabled state, no need for a menu. */
++ if (frame->priv->ui_component == NULL) { return ; }
+ panel_widget = PANEL_WIDGET (GTK_WIDGET (frame)->parent);
+
+ lockable = panel_applet_lockable (frame->priv->applet_info);
+@@ -323,17 +325,12 @@
+ const char *id)
+ {
+ PanelAppletFrame *frame;
+- CORBA_Environment ev;
+- char *moniker;
+ PanelAppletFrameActivating *frame_act;
+
+ g_return_if_fail (iid != NULL);
+ g_return_if_fail (panel != NULL);
+ g_return_if_fail (id != NULL);
+
+- if (panel_lockdown_is_applet_disabled (iid))
+- return;
+-
+ frame = g_object_new (PANEL_TYPE_APPLET_FRAME, NULL);
+ frame->priv->panel = panel;
+ frame->priv->iid = g_strdup (iid);
+@@ -345,15 +342,26 @@
+ frame_act->exactpos = exactpos;
+ frame_act->id = g_strdup (id);
+
+- moniker = panel_applet_frame_construct_moniker (frame, panel, iid, id);
+-
+- CORBA_exception_init (&ev);
++ /* If the applet is disabled, we don't actually load the bonobo component,
++ but keep the objects around so that, should the disabled state change,
++ we'll be able to reload the applet in its proper state. */
++ if (panel_lockdown_is_applet_disabled(iid)) {
++ panel_applet_frame_activated(NULL, NULL, frame_act) ;
++ }
++ else {
++ CORBA_Environment ev;
++ char *moniker;
++
++ moniker = panel_applet_frame_construct_moniker (frame, panel, iid, id);
++
++ CORBA_exception_init (&ev);
++
++ bonobo_get_object_async (moniker, "IDL:Bonobo/Control:1.0", &ev,
++ (BonoboMonikerAsyncFn) panel_applet_frame_activated,
++ frame_act);
+
+- bonobo_get_object_async (moniker, "IDL:Bonobo/Control:1.0", &ev,
+- (BonoboMonikerAsyncFn) panel_applet_frame_activated,
+- frame_act);
+-
+- g_free (moniker);
++ g_free (moniker);
++ }
+ }
+
+ void
+@@ -404,6 +412,18 @@
+ g_free (id);
+ }
+
++static void panel_applet_frame_reload(PanelAppletFrame *frame) ;
++
++gboolean panel_applet_frame_refresh(PanelAppletFrame *frame)
++{
++ if ((frame->priv->ui_component == NULL) !=
++ panel_lockdown_is_applet_disabled(frame->priv->iid)) {
++ panel_applet_frame_reload(frame) ;
++ return TRUE ;
++ }
++ return FALSE ;
++}
++
+ void
+ panel_applet_frame_change_orientation (PanelAppletFrame *frame,
+ PanelOrientation orientation)
+@@ -846,6 +866,33 @@
+ return handled;
+ }
+
++static void
++panel_applet_frame_reload(PanelAppletFrame *frame)
++{
++ PanelWidget *panel;
++ char *iid;
++ char *id = NULL;
++ int position = -1;
++ gboolean locked = FALSE;
++ AppletInfo *info = NULL ;
++
++ info = frame->priv->applet_info ;
++ panel = frame->priv->panel;
++ iid = g_strdup (frame->priv->iid);
++
++ if (info) {
++ id = g_strdup (info->id);
++ position = panel_applet_get_position (info);
++ locked = panel_widget_get_applet_locked (panel, info->widget);
++ panel_applet_clean (info);
++ }
++
++ panel_applet_frame_load (iid, panel, locked, position, TRUE, id);
++
++ g_free (iid);
++ g_free (id);
++}
++
+ static void
+ panel_applet_frame_reload_response (GtkWidget *dialog,
+ int response,
+@@ -861,28 +908,7 @@
+ info = frame->priv->applet_info;
+
+ if (response == GTK_RESPONSE_YES) {
+- PanelWidget *panel;
+- char *iid;
+- char *id = NULL;
+- int position = -1;
+- gboolean locked = FALSE;
+-
+- panel = frame->priv->panel;
+- iid = g_strdup (frame->priv->iid);
+-
+- if (info) {
+- id = g_strdup (info->id);
+- position = panel_applet_get_position (info);
+- locked = panel_widget_get_applet_locked (panel, info->widget);
+- panel_applet_clean (info);
+- }
+-
+- panel_applet_frame_load (iid, panel, locked,
+- position, TRUE, id);
+-
+- g_free (iid);
+- g_free (id);
+-
++ panel_applet_frame_reload(frame) ;
+ } else if (info) {
+ /* if we can't write to applets list we can't really delete
+ it, so we'll just ignore this. FIXME: handle this
+@@ -1253,129 +1279,134 @@
+ frame_act = (PanelAppletFrameActivating *) data;
+ frame = frame_act->frame;
+
+- /* according to the source of bonobo control == NULL && no
+- exception can happen, so handle it */
+- if (BONOBO_EX (ev) || object == CORBA_OBJECT_NIL) {
+- error = bonobo_exception_get_text (ev);
+- g_warning (G_STRLOC ": failed to load applet %s:\n%s",
+- frame->priv->iid, error);
+- panel_applet_frame_loading_failed (frame, frame_act->id);
+- g_free (frame_act->id);
+- g_free (frame_act);
+- g_free (error);
+- return;
+- }
+-
+- frame->priv->control = CORBA_Object_duplicate (object, NULL);
+-
+- widget = bonobo_widget_new_control_from_objref (object,
+- CORBA_OBJECT_NIL);
+-
+- bonobo_object_release_unref (object, NULL);
+-
+- if (!widget) {
+- g_warning (G_STRLOC ": failed to load applet %s",
+- frame->priv->iid);
+- panel_applet_frame_loading_failed (frame, frame_act->id);
+- g_free (frame_act->id);
+- g_free (frame_act);
+- return;
+- }
+-
+- control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (widget));
+- if (control_frame == NULL) {
+- g_warning (G_STRLOC ": failed to load applet %s "
+- "(can't get control frame)", frame->priv->iid);
+- panel_applet_frame_loading_failed (frame, frame_act->id);
+- gtk_object_sink (GTK_OBJECT (widget));
+- g_free (frame_act->id);
+- g_free (frame_act);
+- return;
+- }
+-
+- frame->priv->property_bag =
+- bonobo_control_frame_get_control_property_bag (control_frame,
+- &corba_ev);
+- if (frame->priv->property_bag == NULL || BONOBO_EX (&corba_ev)) {
+- error = bonobo_exception_get_text (&corba_ev);
+- CORBA_exception_free (&corba_ev);
+- g_warning (G_STRLOC ": failed to load applet %s "
+- "(can't get property bag):\n%s",
+- frame->priv->iid, error);
+- panel_applet_frame_loading_failed (frame, frame_act->id);
+- gtk_object_sink (GTK_OBJECT (widget));
+- g_free (frame_act->id);
+- g_free (frame_act);
+- g_free (error);
+- return;
+- }
+-
+- bonobo_event_source_client_add_listener (frame->priv->property_bag,
+- (BonoboListenerCallbackFn) panel_applet_frame_event_listener,
+- "Bonobo/Property:change:panel-applet",
+- NULL,
+- frame);
++ if (ev != NULL) {
++ /* Case where we end up here as a result of actually loading the
++ component. */
++ /* according to the source of bonobo control == NULL && no
++ exception can happen, so handle it */
++ if (BONOBO_EX (ev) || object == CORBA_OBJECT_NIL) {
++ error = bonobo_exception_get_text (ev);
++ g_warning (G_STRLOC ": failed to load applet %s:\n%s",
++ frame->priv->iid, error);
++ panel_applet_frame_loading_failed (frame, frame_act->id);
++ g_free (frame_act->id);
++ g_free (frame_act);
++ g_free (error);
++ return;
++ }
++
++ frame->priv->control = CORBA_Object_duplicate (object, NULL);
++
++ widget = bonobo_widget_new_control_from_objref (object,
++ CORBA_OBJECT_NIL);
++
++ bonobo_object_release_unref (object, NULL);
++
++ if (!widget) {
++ g_warning (G_STRLOC ": failed to load applet %s",
++ frame->priv->iid);
++ panel_applet_frame_loading_failed (frame, frame_act->id);
++ g_free (frame_act->id);
++ g_free (frame_act);
++ return;
++ }
++
++ control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (widget));
++ if (control_frame == NULL) {
++ g_warning (G_STRLOC ": failed to load applet %s "
++ "(can't get control frame)", frame->priv->iid);
++ panel_applet_frame_loading_failed (frame, frame_act->id);
++ gtk_object_sink (GTK_OBJECT (widget));
++ g_free (frame_act->id);
++ g_free (frame_act);
++ return;
++ }
++
++ frame->priv->property_bag =
++ bonobo_control_frame_get_control_property_bag (control_frame,
++ &corba_ev);
++ if (frame->priv->property_bag == NULL || BONOBO_EX (&corba_ev)) {
++ error = bonobo_exception_get_text (&corba_ev);
++ CORBA_exception_free (&corba_ev);
++ g_warning (G_STRLOC ": failed to load applet %s "
++ "(can't get property bag):\n%s",
++ frame->priv->iid, error);
++ panel_applet_frame_loading_failed (frame, frame_act->id);
++ gtk_object_sink (GTK_OBJECT (widget));
++ g_free (frame_act->id);
++ g_free (frame_act);
++ g_free (error);
++ return;
++ }
++
++ bonobo_event_source_client_add_listener (frame->priv->property_bag,
++ (BonoboListenerCallbackFn) panel_applet_frame_event_listener,
++ "Bonobo/Property:change:panel-applet",
++ NULL,
++ frame);
+
+- frame->priv->ui_component =
+- bonobo_control_frame_get_popup_component (control_frame,
+- &corba_ev);
+- if (frame->priv->ui_component == NULL || BONOBO_EX (&corba_ev)) {
+- error = bonobo_exception_get_text (&corba_ev);
+- CORBA_exception_free (&corba_ev);
+- g_warning (G_STRLOC ": failed to load applet %s "
+- "(can't get popup component):\n%s",
+- frame->priv->iid, error);
+- panel_applet_frame_loading_failed (frame, frame_act->id);
+- gtk_object_sink (GTK_OBJECT (widget));
+- g_free (frame_act->id);
+- g_free (frame_act);
+- g_free (error);
+- return;
+- }
+-
+- bonobo_ui_util_set_ui (frame->priv->ui_component, DATADIR,
+- "GNOME_Panel_Popup.xml", "panel", NULL);
+-
+- bonobo_ui_component_add_listener (frame->priv->ui_component,
+- "LockAppletToPanel",
+- listener_popup_handle_lock,
+- frame);
+-
+- bonobo_ui_component_add_verb_list_with_data (
+- frame->priv->ui_component, popup_verbs, frame);
+-
+- control = bonobo_control_frame_get_control (control_frame);
+- if (!control) {
+- CORBA_exception_free (&corba_ev);
+- g_warning (G_STRLOC ": failed to load applet %s "
+- "(can't get control)", frame->priv->iid);
+- panel_applet_frame_loading_failed (frame, frame_act->id);
+- gtk_object_sink (GTK_OBJECT (widget));
+- g_free (frame_act->id);
+- g_free (frame_act);
+- return;
+- }
+-
+- frame->priv->applet_shell = panel_applet_frame_get_applet_shell (control);
+- if (frame->priv->applet_shell == CORBA_OBJECT_NIL) {
+- CORBA_exception_free (&corba_ev);
+- g_warning (G_STRLOC ": failed to load applet %s "
+- "(can't get applet shell)", frame->priv->iid);
+- panel_applet_frame_loading_failed (frame, frame_act->id);
+- gtk_object_sink (GTK_OBJECT (widget));
+- g_free (frame_act->id);
+- g_free (frame_act);
+- return;
+- }
+-
+- CORBA_exception_free (&corba_ev);
+-
+- ORBit_small_listen_for_broken (object,
+- G_CALLBACK (panel_applet_frame_cnx_broken),
+- frame);
+-
+- gtk_container_add (GTK_CONTAINER (frame), widget);
+-
++ frame->priv->ui_component =
++ bonobo_control_frame_get_popup_component (control_frame,
++ &corba_ev);
++ if (frame->priv->ui_component == NULL || BONOBO_EX (&corba_ev)) {
++ error = bonobo_exception_get_text (&corba_ev);
++ CORBA_exception_free (&corba_ev);
++ g_warning (G_STRLOC ": failed to load applet %s "
++ "(can't get popup component):\n%s",
++ frame->priv->iid, error);
++ panel_applet_frame_loading_failed (frame, frame_act->id);
++ gtk_object_sink (GTK_OBJECT (widget));
++ g_free (frame_act->id);
++ g_free (frame_act);
++ g_free (error);
++ return;
++ }
++
++ bonobo_ui_util_set_ui (frame->priv->ui_component, DATADIR,
++ "GNOME_Panel_Popup.xml", "panel", NULL);
++
++ bonobo_ui_component_add_listener (frame->priv->ui_component,
++ "LockAppletToPanel",
++ listener_popup_handle_lock,
++ frame);
++
++ bonobo_ui_component_add_verb_list_with_data (
++ frame->priv->ui_component, popup_verbs, frame);
++
++ control = bonobo_control_frame_get_control (control_frame);
++ if (!control) {
++ CORBA_exception_free (&corba_ev);
++ g_warning (G_STRLOC ": failed to load applet %s "
++ "(can't get control)", frame->priv->iid);
++ panel_applet_frame_loading_failed (frame, frame_act->id);
++ gtk_object_sink (GTK_OBJECT (widget));
++ g_free (frame_act->id);
++ g_free (frame_act);
++ return;
++ }
++
++ frame->priv->applet_shell = panel_applet_frame_get_applet_shell (control);
++ if (frame->priv->applet_shell == CORBA_OBJECT_NIL) {
++ CORBA_exception_free (&corba_ev);
++ g_warning (G_STRLOC ": failed to load applet %s "
++ "(can't get applet shell)", frame->priv->iid);
++ panel_applet_frame_loading_failed (frame, frame_act->id);
++ gtk_object_sink (GTK_OBJECT (widget));
++ g_free (frame_act->id);
++ g_free (frame_act);
++ return;
++ }
++
++ CORBA_exception_free (&corba_ev);
++
++ ORBit_small_listen_for_broken (object,
++ G_CALLBACK (panel_applet_frame_cnx_broken),
++ frame);
++
++ gtk_container_add (GTK_CONTAINER (frame), widget);
++ }
++ /* Regardless of whether the object was actually loaded, the corresponding
++ applet is created to handle lockdown state changes. */
+ gtk_widget_show_all (GTK_WIDGET (frame));
+
+ info = panel_applet_register (GTK_WIDGET (frame), GTK_WIDGET (frame),
+--- gnome-panel-2.14.1.old/gnome-panel/panel-applet-frame.h 2005-01-02 12:57:44.000000000 +0000
++++ gnome-panel-2.14.1/gnome-panel/panel-applet-frame.h 2006-04-21 11:06:11.908225000 +0100
+@@ -78,6 +78,14 @@
+ void panel_applet_frame_set_panel (PanelAppletFrame *frame,
+ PanelWidget *panel);
+
++/**
++ * Checks whether the applet has been disabled or reenabled and if
++ * necessary rebuilds the applet.
++ * Returns true if the applet frame was rebuilt as a result of its
++ * restriction status changing.
++ */
++gboolean panel_applet_frame_refresh(PanelAppletFrame *frame) ;
++
+ G_END_DECLS
+
+ #endif /* __PANEL_APPLET_FRAME_H__ */
+--- gnome-panel-2.14.1.old/gnome-panel/panel-lockdown.c 2005-01-10 16:41:00.000000000 +0000
++++ gnome-panel-2.14.1/gnome-panel/panel-lockdown.c 2006-04-27 14:30:09.885843000 +0100
+@@ -29,12 +29,14 @@
+ #include <string.h>
+ #include "panel-gconf.h"
+
+-#define N_LISTENERS 6
++#define N_LISTENERS 8
+
+ #define PANEL_GLOBAL_LOCKDOWN_DIR "/apps/panel/global"
+ #define DESKTOP_GNOME_LOCKDOWN_DIR "/desktop/gnome/lockdown"
+ #define PANEL_GLOBAL_LOCKED_DOWN_KEY PANEL_GLOBAL_LOCKDOWN_DIR "/locked_down"
+ #define DISABLE_COMMAND_LINE_KEY DESKTOP_GNOME_LOCKDOWN_DIR "/disable_command_line"
++#define RESTRICT_APPLICATION_LAUNCHING_KEY DESKTOP_GNOME_LOCKDOWN_DIR "/restrict_application_launching"
++#define ALLOWED_APPLICATIONS_KEY DESKTOP_GNOME_LOCKDOWN_DIR "/allowed_applications"
+ #define DISABLE_LOCK_SCREEN_KEY PANEL_GLOBAL_LOCKDOWN_DIR "/disable_lock_screen"
+ #define DISABLE_LOG_OUT_KEY PANEL_GLOBAL_LOCKDOWN_DIR "/disable_log_out"
+ #define DISABLE_FORCE_QUIT_KEY PANEL_GLOBAL_LOCKDOWN_DIR "/disable_force_quit"
+@@ -48,6 +50,9 @@
+ guint disable_lock_screen : 1;
+ guint disable_log_out : 1;
+ guint disable_force_quit : 1;
++ guint restrict_application_launching : 1;
++
++ GSList *allowed_applications;
+
+ GSList *disabled_applets;
+
+@@ -56,6 +61,12 @@
+ GSList *closures;
+ } PanelLockdown;
+
++static const gchar *command_line_execs[] = {
++ "/usr/bin/gnome-terminal",
++ "/usr/bin/xterm"
++};
++#define NUMBER_COMMAND_LINE_EXECS 2
++
+ static PanelLockdown panel_lockdown = { 0, };
+
+
+@@ -63,9 +74,17 @@
+ panel_lockdown_invoke_closures (PanelLockdown *lockdown)
+ {
+ GSList *l;
++ GSList *copy = NULL ;
+
+- for (l = lockdown->closures; l; l = l->next)
++ copy = g_slist_copy(lockdown->closures) ;
++ for (l = copy ; l != NULL ; l = l->next) {
++ if (g_slist_find(lockdown->closures, l->data)) {
++ g_closure_ref(l->data) ;
+ g_closure_invoke (l->data, NULL, 0, NULL, NULL);
++ g_closure_unref(l->data) ;
++ }
++ }
++ g_slist_free(copy) ;
+ }
+
+ static void
+@@ -166,6 +185,50 @@
+ panel_lockdown_invoke_closures (lockdown);
+ }
+
++static void
++restrict_application_launching_notify (GConfClient *client,
++ guint cnxn_id,
++ GConfEntry *entry,
++ PanelLockdown *lockdown)
++{
++ if (!entry->value || entry->value->type != GCONF_VALUE_BOOL)
++ return;
++
++ lockdown->restrict_application_launching =
++ gconf_value_get_bool (entry->value);
++
++ panel_lockdown_invoke_closures (lockdown);
++}
++
++
++static void
++allowed_applications_notify (GConfClient *client,
++ guint cnxn_id,
++ GConfEntry *entry,
++ PanelLockdown *lockdown)
++{
++ GSList *l;
++
++ if (!entry->value || entry->value->type != GCONF_VALUE_LIST ||
++ gconf_value_get_list_type (entry->value) != GCONF_VALUE_STRING)
++ return;
++
++ for (l = lockdown->allowed_applications; l; l = l->next)
++ g_free (l->data);
++ g_slist_free (lockdown->allowed_applications);
++ lockdown->allowed_applications = NULL;
++
++ for (l = gconf_value_get_list (entry->value); l; l = l->next) {
++ const char *iid = gconf_value_get_string (l->data);
++
++ lockdown->allowed_applications =
++ g_slist_prepend (lockdown->allowed_applications,
++ g_strdup (iid));
++ }
++
++ panel_lockdown_invoke_closures (lockdown);
++}
++
+ static gboolean
+ panel_lockdown_load_bool (PanelLockdown *lockdown,
+ GConfClient *client,
+@@ -215,6 +278,29 @@
+ return retval;
+ }
+
++static GSList *
++panel_lockdown_load_allowed_applications (PanelLockdown *lockdown,
++ GConfClient *client,
++ int listener)
++{
++ GSList *retval;
++
++ retval = gconf_client_get_list (client,
++ ALLOWED_APPLICATIONS_KEY,
++ GCONF_VALUE_STRING,
++ NULL);
++
++ lockdown->listeners [listener] =
++ gconf_client_notify_add (client,
++ ALLOWED_APPLICATIONS_KEY,
++ (GConfClientNotifyFunc) allowed_applications_notify,
++ lockdown,
++ NULL, NULL);
++
++ return retval;
++}
++
++
+ void
+ panel_lockdown_init (void)
+ {
+@@ -273,6 +359,18 @@
+ client,
+ i++);
+
++ panel_lockdown.restrict_application_launching =
++ panel_lockdown_load_bool (&panel_lockdown,
++ client,
++ RESTRICT_APPLICATION_LAUNCHING_KEY,
++ (GConfClientNotifyFunc) restrict_application_launching_notify,
++ i++);
++
++ panel_lockdown.allowed_applications =
++ panel_lockdown_load_allowed_applications (&panel_lockdown,
++ client,
++ i++);
++
+ g_assert (i == N_LISTENERS);
+
+ panel_lockdown.initialized = TRUE;
+@@ -293,7 +391,11 @@
+ g_free (l->data);
+ g_slist_free (panel_lockdown.disabled_applets);
+ panel_lockdown.disabled_applets = NULL;
+-
++ for (l = panel_lockdown.allowed_applications ; l ; l = l->next) {
++ g_free(l->data) ;
++ }
++ g_slist_free(panel_lockdown.allowed_applications) ;
++ panel_lockdown.allowed_applications = NULL ;
+ for (i = 0; i < N_LISTENERS; i++) {
+ if (panel_lockdown.listeners [i])
+ gconf_client_notify_remove (client,
+@@ -371,6 +473,37 @@
+ return FALSE;
+ }
+
++gboolean
++panel_lockdown_get_restrict_application_launching (void)
++{
++ g_assert (panel_lockdown.initialized != FALSE);
++
++ return panel_lockdown.restrict_application_launching;
++}
++
++GSList *
++panel_lockdown_get_allowed_applications (void)
++{
++ g_assert (panel_lockdown.initialized == TRUE);
++
++ return panel_lockdown.allowed_applications;
++}
++
++gboolean
++panel_lockdown_is_allowed_application (const gchar *app)
++{
++ GSList *l;
++
++ g_assert (panel_lockdown.initialized != FALSE);
++
++ for (l = panel_lockdown.allowed_applications; l; l = l->next)
++ if (!strcmp (l->data, app))
++ return TRUE;
++
++ return FALSE;
++}
++
++
+ static GClosure *
+ panel_lockdown_notify_find (GSList *closures,
+ GCallback callback_func,
+@@ -440,3 +573,127 @@
+
+ g_closure_unref (closure);
+ }
++
++gchar *
++panel_lockdown_get_stripped_exec (const gchar *full_exec)
++{
++ gchar *str1, *str2, *retval, *p;
++
++ str1 = g_strdup (full_exec);
++ p = strtok (str1, " ");
++
++ if (p != NULL)
++ str2 = g_strdup (p);
++ else
++ str2 = g_strdup (full_exec);
++
++ g_free (str1);
++
++ if (g_path_is_absolute (str2))
++ retval = g_strdup (str2);
++ else
++ retval = g_strdup (g_find_program_in_path ((const gchar *)str2));
++ g_free (str2);
++
++ return retval;
++}
++
++gchar *
++panel_lockdown_get_exec_from_ditem (GnomeDesktopItem *ditem)
++{
++ const char *full_exec;
++ gchar *retval = NULL;
++
++ full_exec = gnome_desktop_item_get_string (ditem,
++ GNOME_DESKTOP_ITEM_EXEC);
++
++ if (full_exec != NULL)
++ retval = panel_lockdown_get_stripped_exec (full_exec);
++
++ return retval;
++}
++
++gboolean
++panel_lockdown_ditem_in_allowed_applications (GnomeDesktopItem *ditem)
++{
++ gboolean retval = FALSE;
++ gchar *stripped_exec;
++
++ stripped_exec = panel_lockdown_get_exec_from_ditem (ditem);
++
++ if (stripped_exec != NULL) {
++ retval = panel_lockdown_is_allowed_application (stripped_exec);
++ g_free (stripped_exec);
++ }
++
++ return retval;
++}
++
++gboolean
++panel_lockdown_is_disabled_command_line (const gchar *term_cmd)
++{
++ int i = 0;
++ gboolean retval = FALSE;
++
++ for (i=0; i<NUMBER_COMMAND_LINE_EXECS; i++) {
++ if (!strcmp (command_line_execs [i], term_cmd)) {
++ retval = TRUE;
++ break;
++ }
++ }
++
++ return retval;
++}
++
++gboolean panel_lockdown_is_forbidden_app(GnomeDesktopItem *ditem) {
++ g_return_val_if_fail(ditem != NULL, TRUE) ;
++ return panel_lockdown_get_restrict_application_launching() &&
++ !panel_lockdown_ditem_in_allowed_applications(ditem) ;
++}
++
++gboolean panel_lockdown_is_forbidden_ditem(GnomeDesktopItem *ditem)
++{
++ g_return_val_if_fail(ditem != NULL, TRUE) ;
++ if (panel_lockdown_is_forbidden_app(ditem)) { return TRUE ; }
++ if (panel_lockdown_get_disable_command_line()) {
++ char *stripped = panel_lockdown_get_exec_from_ditem(ditem) ;
++
++ if (stripped != NULL) {
++ gboolean retCode =
++ panel_lockdown_is_disabled_command_line(stripped) ;
++
++ g_free(stripped) ;
++ return retCode ;
++ }
++ }
++ return FALSE ;
++}
++
++gboolean panel_lockdown_is_forbidden_command(const char *command)
++{
++ g_return_val_if_fail(command != NULL, TRUE) ;
++ return panel_lockdown_get_restrict_application_launching() &&
++ !panel_lockdown_is_allowed_application(command) ;
++}
++
++gboolean panel_lockdown_is_allowed_menu_entry(GMenuTreeEntry *entry)
++{
++ const char *path;
++ GnomeDesktopItem *item = NULL ;
++
++ if (!panel_lockdown_get_restrict_application_launching())
++ return TRUE;
++
++ path = gmenu_tree_entry_get_desktop_file_path(entry) ;
++
++ if (path != NULL) {
++ item = gnome_desktop_item_new_from_file(path, 0, NULL) ;
++ if (item != NULL) {
++ gboolean retCode = !panel_lockdown_is_forbidden_ditem(item) ;
++
++ gnome_desktop_item_unref(item) ;
++ return retCode ;
++ }
++ }
++ return TRUE ;
++}
+--- gnome-panel-2.14.1.old/gnome-panel/panel-lockdown.h 2005-01-10 16:41:00.000000000 +0000
++++ gnome-panel-2.14.1/gnome-panel/panel-lockdown.h 2006-04-27 14:24:41.641330000 +0100
+@@ -25,8 +25,10 @@
+ #ifndef __PANEL_LOCKDOWN_H__
+ #define __PANEL_LOCKDOWN_H__
+
++#include <libgnome/gnome-desktop-item.h>
+ #include <glib.h>
+ #include <glib-object.h>
++#include <gmenu-tree.h>
+
+ G_BEGIN_DECLS
+
+@@ -38,14 +40,45 @@
+ gboolean panel_lockdown_get_disable_lock_screen (void);
+ gboolean panel_lockdown_get_disable_log_out (void);
+ gboolean panel_lockdown_get_disable_force_quit (void);
++gboolean panel_lockdown_get_restrict_application_launching (void);
++GSList *panel_lockdown_get_allowed_applications (void);
+
+ gboolean panel_lockdown_is_applet_disabled (const char *iid);
++gboolean panel_lockdown_is_allowed_application (const gchar *app);
+
+ void panel_lockdown_notify_add (GCallback callback_func,
+ gpointer user_data);
+ void panel_lockdown_notify_remove (GCallback callback_func,
+ gpointer user_data);
+
++gchar *panel_lockdown_get_stripped_exec (const gchar *full_exec);
++gchar *panel_lockdown_get_exec_from_ditem (GnomeDesktopItem *ditem);
++gboolean panel_lockdown_ditem_in_allowed_applications (GnomeDesktopItem *ditem);gboolean panel_lockdown_is_disabled_command_line (const gchar *term_cmd);
++
++/**
++ * Returns true if the ditem corresponds to an application whose use has been
++ * disallowed by the administrator (tests whether restrictions are in place
++ * and if the ditem matches the allowed applications list).
++ */
++gboolean panel_lockdown_is_forbidden_app(GnomeDesktopItem *ditem) ;
++/**
++ * Returns true if the ditem corresponds to either an application whose use
++ * has been disallowed by the administrator (same as previous function) or
++ * a shell when command line use has been restricted.
++ */
++gboolean panel_lockdown_is_forbidden_ditem(GnomeDesktopItem *ditem) ;
++/**
++ * Returns true if the command line corresponds to an application whose use
++ * has been disallowed by the administrator.
++ */
++gboolean panel_lockdown_is_forbidden_command(const gchar *command) ;
++
++/**
++ * Returns true if the menu entry corresponds to an application whose use
++ * has been allowed by the administrator.
++ */
++gboolean panel_lockdown_is_allowed_menu_entry(GMenuTreeEntry *entry) ;
++
+ G_END_DECLS
+
+ #endif /* __PANEL_LOCKDOWN_H__ */
+--- gnome-panel-2.14.1.old/gnome-panel/panel-menu-bar.c 2006-03-06 21:37:10.000000000 +0000
++++ gnome-panel-2.14.1/gnome-panel/panel-menu-bar.c 2006-04-21 11:06:12.001845000 +0100
+@@ -168,6 +168,16 @@
+ "", NULL);
+ }
+
++static void panel_menubar_recreate_menus(PanelMenuBar *menubar)
++{
++ if (menubar->priv->applications_menu != NULL) {
++ while (GTK_MENU_SHELL(menubar->priv->applications_menu)->children) {
++ gtk_widget_destroy(GTK_MENU_SHELL(menubar->priv->applications_menu)->children->data) ;
++ }
++ menubar->priv->applications_menu = create_applications_menu("applications.menu", NULL) ;
++ }
++}
++
+ static void
+ panel_menu_bar_instance_init (PanelMenuBar *menubar,
+ PanelMenuBarClass *klass)
+@@ -200,6 +210,8 @@
+ menubar->priv->desktop_item);
+
+ panel_menu_bar_setup_tooltip (menubar);
++ panel_lockdown_notify_add(G_CALLBACK(panel_menubar_recreate_menus),
++ menubar) ;
+ }
+
+ static void
+--- gnome-panel-2.14.1.old/gnome-panel/panel-menu-items.c 2006-04-27 15:54:22.003079000 +0100
++++ gnome-panel-2.14.1/gnome-panel/panel-menu-items.c 2006-04-21 11:06:12.063074000 +0100
+@@ -1120,8 +1120,10 @@
+ tooltip = NULL;
+ }
+
+- item = panel_menu_items_create_action_item_full (PANEL_ACTION_LOGOUT,
+- label, tooltip);
++ if (!panel_lockdown_get_disable_log_out()) {
++ item = panel_menu_items_create_action_item_full (PANEL_ACTION_LOGOUT,
++ label, tooltip);
++ }
+ g_free (label);
+ g_free (tooltip);
+
+@@ -1153,17 +1155,18 @@
+ if (item) {
+ g_assert (error == NULL);
+
+- panel_ditem_launch (item, NULL, 0,
+- menuitem_to_screen (menuitem), &error);
+- if (error) {
+- panel_error_dialog (menuitem_to_screen (menuitem),
+- "cannot_launch_entry", TRUE,
+- _("Could not launch menu item"),
+- "%s",
+- error->message);
+-
+- g_error_free (error);
+- }
++ if (!panel_lockdown_is_forbidden_ditem(item)) {
++ panel_ditem_launch (item, NULL, 0,
++ menuitem_to_screen (menuitem), &error);
++ if (error) {
++ panel_error_dialog (menuitem_to_screen (menuitem),
++ "cannot_launch_entry", TRUE,
++ _("Could not launch menu item"),
++ "%s",
++ error->message);
++ g_error_free (error);
++ }
++ }
+ gnome_desktop_item_unref (item);
+ } else {
+ g_assert (error != NULL);
+--- gnome-panel-2.14.1.old/gnome-panel/panel-util.c 2006-01-11 20:42:40.000000000 +0000
++++ gnome-panel-2.14.1/gnome-panel/panel-util.c 2006-04-21 11:06:12.082115000 +0100
+@@ -33,6 +33,7 @@
+ #include "xstuff.h"
+ #include "panel-globals.h"
+ #include "launcher.h"
++#include "panel-lockdown.h"
+
+ void
+ panel_launch_desktop_file (const char *desktop_file,
+@@ -682,6 +683,7 @@
+ char *command = NULL;
+ gboolean use_gscreensaver = FALSE;
+
++ if (panel_lockdown_get_disable_lock_screen()) { return NULL ; }
+ if (panel_is_program_in_path ("gnome-screensaver-command")
+ && panel_is_program_in_path ("gnome-screensaver-preferences"))
+ use_gscreensaver = TRUE;
+--- gnome-panel-2.14.1.old/gnome-panel/panel-addto.c 2006-01-22 15:01:31.000000000 +0000
++++ gnome-panel-2.14.1/gnome-panel/panel-addto.c 2006-04-27 14:57:03.811433000 +0100
+@@ -558,9 +558,10 @@
+ dialog, NULL);
+ }
+
+-static void panel_addto_make_application_list (GSList **parent_list,
++static gint panel_addto_make_application_list (GSList **parent_list,
+ GMenuTreeDirectory *directory,
+ const char *filename);
++static void panel_addto_dialog_free_item_info (PanelAddtoItemInfo *item_info);
+
+ static void
+ panel_addto_prepend_directory (GSList **parent_list,
+@@ -568,6 +569,7 @@
+ const char *filename)
+ {
+ PanelAddtoAppList *data;
++ gint entries_added = 0;
+
+ data = g_new0 (PanelAddtoAppList, 1);
+
+@@ -587,9 +589,17 @@
+ * So the iid is built when we select the row.
+ */
+
+- *parent_list = g_slist_prepend (*parent_list, data);
+-
+- panel_addto_make_application_list (&data->children, directory, filename);
++
++ entries_added = panel_addto_make_application_list (&data->children, directory, filename);
++ if (entries_added > 0) {
++ /* Only prepend if there are entries */
++ *parent_list = g_slist_prepend (*parent_list, data);
++ }
++ else {
++ /* Free data as not being appended */
++ panel_addto_dialog_free_item_info (&data->item_info);
++ g_free (data);
++ }
+ }
+
+ static void
+@@ -611,12 +621,13 @@
+ *parent_list = g_slist_prepend (*parent_list, data);
+ }
+
+-static void
++static gint
+ panel_addto_prepend_alias (GSList **parent_list,
+ GMenuTreeAlias *alias,
+ const char *filename)
+ {
+ GMenuTreeItem *aliased_item;
++ int entry = 0;
+
+ aliased_item = gmenu_tree_alias_get_item (alias);
+
+@@ -628,9 +639,12 @@
+ break;
+
+ case GMENU_TREE_ITEM_ENTRY:
+- panel_addto_prepend_entry (parent_list,
+- GMENU_TREE_ENTRY (aliased_item),
+- filename);
++ if (panel_lockdown_is_allowed_menu_entry(GMENU_TREE_ENTRY(aliased_item))) {
++ panel_addto_prepend_entry (parent_list,
++ GMENU_TREE_ENTRY (aliased_item),
++ filename);
++ entry = 1;
++ }
+ break;
+
+ default:
+@@ -638,15 +652,17 @@
+ }
+
+ gmenu_tree_item_unref (aliased_item);
++ return entry;
+ }
+
+-static void
++static gint
+ panel_addto_make_application_list (GSList **parent_list,
+ GMenuTreeDirectory *directory,
+ const char *filename)
+ {
+ GSList *items;
+ GSList *l;
++ gint number_entries = 0;
+
+ items = gmenu_tree_directory_get_contents (directory);
+
+@@ -657,11 +673,14 @@
+ break;
+
+ case GMENU_TREE_ITEM_ENTRY:
+- panel_addto_prepend_entry (parent_list, l->data, filename);
++ if (panel_lockdown_is_allowed_menu_entry(l->data)) {
++ panel_addto_prepend_entry (parent_list, l->data, filename);
++ number_entries = number_entries+1;
++ }
+ break;
+
+ case GMENU_TREE_ITEM_ALIAS:
+- panel_addto_prepend_alias (parent_list, l->data, filename);
++ number_entries = number_entries + panel_addto_prepend_alias (parent_list, l->data, filename);
+ break;
+
+ default:
+@@ -674,6 +693,8 @@
+ g_slist_free (items);
+
+ *parent_list = g_slist_reverse (*parent_list);
++
++ return number_entries;
+ }
+
+ static void
--- a/patches/gnome-panel-11-clock-timezone.diff Sat May 13 01:34:47 2006 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2965 +0,0 @@
---- gnome-panel-2.10.1/applets/clock/clock.c 2005-06-30 22:24:08.063906512 +0530
-+++ gnome-panel-2.10.1-new/applets/clock/clock.c 2005-06-30 22:37:14.807303336 +0530
-@@ -60,16 +60,7 @@
- #include <libgnome/gnome-init.h>
- #include <libgnomeui/gnome-url.h>
-
--#ifdef HAVE_LIBECAL
--#include "calendar-client.h"
--#endif
--
--#define INTERNETSECOND (864)
--#define INTERNETBEAT (86400)
--
--#define N_GCONF_PREFS 7
--
--#define NEVER_SENSITIVE "never_sensitive"
-+#include "clock.h"
-
- static const char* KEY_FORMAT = "format";
- static const char* KEY_SHOW_SECONDS = "show_seconds";
-@@ -78,6 +69,7 @@ static const char* KEY_GMT_TIME = "
- static const char* KEY_CONFIG_TOOL = "config_tool";
- static const char* KEY_CUSTOM_FORMAT = "custom_format";
- static const char* KEY_SHOW_WEEK = "show_week_numbers";
-+static const char* KEY_SHOW_ZONES = "show_zones";
-
- static const char *clock_config_tools [] = {
- "gnome-time-settings",
-@@ -86,16 +78,6 @@ static const char *clock_config_tools []
- "time-admin",
- };
-
--/* Needs to match the indices in the combo */
--typedef enum {
-- CLOCK_FORMAT_INVALID = 0,
-- CLOCK_FORMAT_12,
-- CLOCK_FORMAT_24,
-- CLOCK_FORMAT_UNIX,
-- CLOCK_FORMAT_INTERNET,
-- CLOCK_FORMAT_CUSTOM
--} ClockFormat;
--
- static GConfEnumStringPair format_type_enum_map [] = {
- { CLOCK_FORMAT_12, "12-hour" },
- { CLOCK_FORMAT_24, "24-hour" },
-@@ -88,62 +88,6 @@
- { 0, NULL }
- };
-
--typedef struct _ClockData ClockData;
--
--struct _ClockData {
-- /* widgets */
-- GtkWidget *applet;
-- GtkWidget *clockw;
-- GtkWidget *toggle;
-- GtkWidget *props;
-- GtkWidget *about;
-- GtkWidget *calendar_popup;
-- GtkWidget *calendar;
--
--#ifdef HAVE_LIBECAL
-- GtkWidget *task_list;
-- GtkWidget *appointment_list;
--
-- GtkListStore *appointments_model;
-- GtkListStore *tasks_model;
-- GtkTreeModelFilter *tasks_filter;
--
-- CalendarClient *client;
--#endif /* HAVE_LIBECAL */
--
-- /* preferences */
-- ClockFormat format;
-- char *custom_format;
-- gboolean showseconds;
-- gboolean showdate;
-- gboolean gmt_time;
-- gboolean showweek;
--
-- char *config_tool;
--
-- /* runtime data */
-- time_t current_time;
-- char *timeformat;
-- guint timeout;
-- PanelAppletOrient orient;
-- int size;
--
-- int fixed_width;
-- int fixed_height;
--
-- GtkWidget *showseconds_check;
-- GtkWidget *showdate_check;
-- GtkWidget *gmt_time_check;
-- GtkWidget *custom_hbox;
-- GtkWidget *custom_label;
-- GtkWidget *custom_entry;
-- gboolean custom_format_shown;
--
-- gboolean can_handle_format_12;
--
-- guint listeners [N_GCONF_PREFS];
--};
--
- static void update_clock (ClockData * cd);
- static float get_itime (time_t current_time);
-
-@@ -186,10 +114,10 @@ unfix_size (ClockData *cd)
- gtk_widget_queue_resize (cd->toggle);
- }
-
--static void
--set_tooltip (GtkWidget *applet,
-- GtkWidget *widget,
-- const char *tip)
-+void
-+clock_set_tooltip (GtkWidget *applet,
-+ GtkWidget *widget,
-+ const char *tip)
- {
- GtkTooltips *tooltips;
-
-@@ -350,8 +350,32 @@
- g_free (loc);
-
- utf8 = g_locale_to_utf8 (date, -1, NULL, NULL, NULL);
-- set_tooltip (cd->applet, cd->toggle, utf8);
-+ clock_set_tooltip (cd->applet, cd->toggle, utf8);
- g_free (utf8);
-+
-+ if (cd->multizone_popup && cd->tip_list && GTK_WIDGET_MAPPED (cd->multizone_popup)) {
-+ GSList *tmp_list;
-+ char timeformat [128];
-+ char *cr;
-+
-+ g_stpcpy (timeformat, cd->timeformat);
-+ cr = g_strrstr (timeformat, "\n");
-+ if (cr)
-+ *cr = ' ';
-+
-+ for (tmp_list = cd->tip_list; tmp_list ; tmp_list = tmp_list->next) {
-+ char tip_hour[256];
-+ TipZone *tip_zone = tmp_list->data;
-+
-+ tm = tz_get_localtime_at (tip_zone->zone, &cd->current_time);
-+
-+ if (strftime (tip_hour, sizeof (tip_hour), timeformat, tm) <= 0)
-+ strcpy (tip_hour, "???");
-+
-+ gtk_label_set_text (GTK_LABEL (tip_zone->time_label),
-+ g_locale_to_utf8 (tip_hour, -1, NULL, NULL, NULL));
-+ }
-+ }
- } else {
- #ifdef HAVE_LIBECAL
- set_tooltip (cd->applet, cd->toggle, _("Click to view your appointments and tasks"));
-@@ -465,6 +417,14 @@ destroy_clock(GtkWidget * widget, ClockD
- gtk_widget_destroy (cd->calendar_popup);
- cd->calendar_popup = NULL;
-
-+ if (cd->multizone_popup)
-+ gtk_widget_destroy (cd->multizone_popup);
-+ cd->multizone_popup = NULL;
-+
-+ if (cd->timezone_dialog)
-+ gtk_widget_destroy (cd->timezone_dialog);
-+ cd->timezone_dialog = NULL;
-+
- g_free (cd->timeformat);
- g_free (cd->config_tool);
- g_free (cd->custom_format);
-@@ -1448,12 +1408,46 @@ present_calendar_popup (ClockData *cd,
- }
-
- static void
-+pop_timezones (ClockData *cd)
-+{
-+ GtkWidget *button = cd->multizone_toggle;
-+
-+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button))) {
-+ GtkWidget *calendar = g_object_get_data (G_OBJECT (button), "calendar");
-+
-+ if (!cd->multizone_popup) {
-+ cd->multizone_popup = create_multi_timezones_popup (cd, gtk_widget_get_screen (cd->applet));
-+ }
-+
-+ refresh_clock (cd);
-+ gtk_widget_show_all (cd->multizone_popup);
-+
-+ if (calendar) {
-+ gtk_widget_hide (calendar);
-+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->toggle), FALSE);
-+ }
-+
-+ present_calendar_popup (cd, cd->multizone_popup, button);
-+ } else {
-+ if (cd->multizone_popup)
-+ gtk_widget_hide (cd->multizone_popup);
-+ }
-+
-+ update_clock (cd);
-+}
-+
-+static void
- update_popup (ClockData *cd)
- {
-+ GtkWindow *window;
-+
-+ window = g_object_get_data (G_OBJECT (cd->toggle), "calendar");
-+
- if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cd->toggle))) {
- if (cd->calendar_popup)
- gtk_widget_destroy (cd->calendar_popup);
- cd->calendar_popup = NULL;
-+ g_object_set_data (G_OBJECT (cd->toggle), "calendar", NULL);
- return;
- }
-
-@@ -1461,9 +1455,15 @@ update_popup (ClockData *cd)
- cd->calendar_popup = create_calendar (cd, gtk_widget_get_screen (cd->applet));
- g_object_add_weak_pointer (G_OBJECT (cd->calendar_popup),
- (gpointer *) &cd->calendar_popup);
-+ g_object_set_data (G_OBJECT (cd->toggle), "calendar", cd->calendar_popup);
- }
-
- if (cd->calendar_popup && GTK_WIDGET_REALIZED (cd->toggle)) {
-+ if (cd->multizone_popup) {
-+ gtk_widget_hide (cd->multizone_popup);
-+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->multizone_toggle), FALSE);
-+ }
-+
- #ifdef HAVE_LIBECAL
- if (cd->tasks_filter && cd->task_list)
- gtk_tree_model_filter_refilter (cd->tasks_filter);
-@@ -1475,6 +1475,12 @@ update_popup (ClockData *cd)
- }
-
- static void
-+toggle_timezone (GtkWidget *button, ClockData *cd)
-+{
-+ pop_timezones (cd);
-+}
-+
-+static void
- toggle_calendar (GtkWidget *button,
- ClockData *cd)
- {
-@@ -1530,12 +1536,92 @@ force_no_focus_padding (GtkWidget *widge
- }
-
- static void
-+change_clock_orientation (ClockData *cd)
-+{
-+ GtkWidget *box;
-+
-+ switch (cd->orient) {
-+ case PANEL_APPLET_ORIENT_RIGHT:
-+ case PANEL_APPLET_ORIENT_LEFT:
-+ box = gtk_vbox_new (FALSE, 1);
-+ break;
-+ case PANEL_APPLET_ORIENT_DOWN:
-+ case PANEL_APPLET_ORIENT_UP:
-+ box = gtk_hbox_new (FALSE, 1);
-+ break;
-+ }
-+
-+ if (cd->hbox) {
-+ gtk_widget_reparent (cd->multizone_toggle, box);
-+ gtk_widget_reparent (cd->toggle, box);
-+ gtk_container_remove (GTK_CONTAINER (cd->applet), cd->hbox);
-+ } else {
-+ gtk_container_add (GTK_CONTAINER (box), cd->multizone_toggle);
-+ gtk_container_add (GTK_CONTAINER (box), cd->toggle);
-+ }
-+
-+ cd->hbox = box;
-+ gtk_container_add (GTK_CONTAINER (cd->applet), box);
-+ gtk_widget_show_all (box);
-+
-+ if (!cd->show_multiple_timezones)
-+ gtk_widget_hide (cd->multizone_toggle);
-+}
-+
-+static void
-+multizone_scale_image (GtkWidget *widget,
-+ GtkAllocation *allocation,
-+ ClockData *cd)
-+{
-+#define TOGGLE_BUTTON_BORDER 10
-+ GdkPixbuf *pb;
-+ int w, h, new_w, new_h;
-+ gboolean need_to_scale = FALSE;
-+ w = gdk_pixbuf_get_width (cd->image);
-+ h = gdk_pixbuf_get_height (cd->image);
-+
-+ switch (cd->orient) {
-+ case PANEL_APPLET_ORIENT_UP:
-+ case PANEL_APPLET_ORIENT_DOWN:
-+
-+ if (cd->save_allocation_h != allocation->height) {
-+ cd->save_allocation_h = allocation->height;
-+ new_h = allocation->height - TOGGLE_BUTTON_BORDER;
-+ new_w = (w * new_h) / h;
-+ need_to_scale = TRUE;
-+ }
-+ break;
-+ case PANEL_APPLET_ORIENT_RIGHT:
-+ case PANEL_APPLET_ORIENT_LEFT:
-+ if (cd->save_allocation_w != allocation->width) {
-+ cd->save_allocation_w = allocation->width;
-+ new_w = allocation->width - TOGGLE_BUTTON_BORDER;
-+ new_h = (h * new_w) /w ;
-+ need_to_scale = TRUE;
-+ }
-+ break;
-+ }
-+
-+ if (need_to_scale) {
-+ if (new_h < TOGGLE_BUTTON_BORDER)
-+ new_h = TOGGLE_BUTTON_BORDER;
-+ if (new_w < TOGGLE_BUTTON_BORDER)
-+ new_w = TOGGLE_BUTTON_BORDER;
-+
-+ pb = gdk_pixbuf_scale_simple (cd->image, new_w, new_h, GDK_INTERP_HYPER);
-+ gtk_image_set_from_pixbuf (GTK_IMAGE (cd->multizone_image), pb);
-+ }
-+}
-+
-+static void
- create_clock_widget (ClockData *cd)
- {
- GtkWidget *clock;
- GtkWidget *toggle;
- GtkWidget *alignment;
--
-+ GtkIconInfo *icon_info;
-+
-+ cd->orient = panel_applet_get_orient (PANEL_APPLET (cd->applet));
- clock = gtk_label_new ("hmm?");
- g_signal_connect (clock, "size_request",
- G_CALLBACK (clock_size_request),
-@@ -1714,23 +1738,38 @@
-
- cd->clockw = clock;
-
-- cd->props = NULL;
-+ cd->size = panel_applet_get_size (PANEL_APPLET (cd->applet));
-
-- cd->orient = panel_applet_get_orient (PANEL_APPLET (cd->applet));
--
-- /* Initialize label orientation */
-- if (cd->orient == PANEL_APPLET_ORIENT_RIGHT)
-- gtk_label_set_angle (GTK_LABEL (cd->clockw), 90);
-- else if (cd->orient == PANEL_APPLET_ORIENT_LEFT)
-- gtk_label_set_angle (GTK_LABEL (cd->clockw), 270);
-- else
-- gtk_label_set_angle (GTK_LABEL (cd->clockw), 0);
-+ cd->multizone_toggle = gtk_toggle_button_new ();
-+ gtk_container_set_resize_mode (GTK_CONTAINER (cd->multizone_toggle),
-+ GTK_RESIZE_IMMEDIATE);
-+ gtk_button_set_relief (GTK_BUTTON (cd->multizone_toggle), GTK_RELIEF_NONE);
-+
-+ icon_info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), "stock_timezone", 48, 0);
-+ cd->image = gtk_icon_info_load_icon (icon_info, NULL);
-+ cd->multizone_image = gtk_image_new_from_pixbuf (cd->image);
-+ gtk_icon_info_free (icon_info);
-+ gtk_widget_show (cd->multizone_image);
-+
-+ gtk_container_add (GTK_CONTAINER (cd->multizone_toggle), cd->multizone_image);
-+ gtk_widget_show (cd->multizone_toggle);
-+
-+ change_clock_orientation (cd);
-+ cd->save_allocation_h = 0;
-+ cd->save_allocation_w = 0;
-
-- cd->size = panel_applet_get_size (PANEL_APPLET (cd->applet));
-+ cd->props = NULL;
-
- g_signal_connect (G_OBJECT(clock), "destroy",
- G_CALLBACK (destroy_clock),
- cd);
-+
-+ g_signal_connect (cd->multizone_toggle, "toggled",
-+ G_CALLBACK (toggle_timezone), cd);
-+
-+ g_signal_connect (cd->multizone_toggle, "size-allocate",
-+ G_CALLBACK (multizone_scale_image), cd);
-+
-
- set_atk_name_description (GTK_WIDGET (cd->applet), NULL,
- _("Computer Clock"));
-@@ -1599,6 +1709,7 @@ applet_change_orient (PanelApplet
- unfix_size (cd);
- update_clock (cd);
- update_popup (cd);
-+ change_clock_orientation (cd);
- }
-
- static void
-@@ -1972,6 +2083,29 @@ show_week_changed (GConfClient *client,
- }
-
- static void
-+show_multi_zones_changed (GConfClient *client,
-+ guint cnxn_id,
-+ GConfEntry *entry,
-+ ClockData *clock)
-+{
-+ gboolean value;
-+
-+ if (!entry->value || entry->value->type != GCONF_VALUE_BOOL)
-+ return;
-+
-+ value = gconf_value_get_bool (entry->value);
-+
-+ clock->show_multiple_timezones = (value != 0);
-+
-+ if (clock->show_multiple_timezones)
-+ gtk_widget_show (clock->multizone_toggle);
-+ else
-+ gtk_widget_hide (clock->multizone_toggle);
-+
-+ refresh_clock (clock);
-+}
-+
-+static void
- setup_gconf (ClockData *clock)
- {
- GConfClient *client;
-@@ -2042,6 +2176,15 @@ setup_gconf (ClockData *clock)
- clock, NULL, NULL);
- g_free (key);
-
-+ key = panel_applet_gconf_get_full_key (PANEL_APPLET (clock->applet),
-+ KEY_SHOW_ZONES);
-+ clock->listeners [7] =
-+ gconf_client_notify_add (
-+ client, key,
-+ (GConfClientNotifyFunc) show_multi_zones_changed,
-+ clock, NULL, NULL);
-+ g_free (key);
-+
- g_object_unref (G_OBJECT (client));
- }
-
-@@ -2133,12 +2276,9 @@ fill_clock_applet (PanelApplet *applet)
-
- cd->timeformat = NULL;
-
-+ cd->show_multiple_timezones = panel_applet_gconf_get_bool (applet, KEY_SHOW_ZONES, NULL);
- create_clock_widget (cd);
-
-- gtk_container_set_border_width (GTK_CONTAINER (cd->applet), 0);
-- gtk_container_set_border_width (GTK_CONTAINER (cd->toggle), 0);
-- gtk_container_add (GTK_CONTAINER (cd->applet), cd->toggle);
--
- gtk_window_set_default_icon_name ("clock");
- gtk_widget_show (cd->applet);
-
-@@ -2351,6 +2491,16 @@ set_custom_format_cb (GtkEntry *entry,
- }
-
- static void
-+set_show_zones_cb (GtkWidget *w,
-+ ClockData *clock)
-+{
-+ panel_applet_gconf_set_bool (PANEL_APPLET (clock->applet),
-+ KEY_SHOW_ZONES,
-+ GTK_TOGGLE_BUTTON (w)->active,
-+ NULL);
-+}
-+
-+static void
- properties_response_cb (GtkWidget *widget,
- int id,
- ClockData *cd)
-@@ -2496,6 +2646,15 @@ display_properties_dialog (BonoboUICompo
- cd);
- gtk_widget_show (cd->gmt_time_check);
-
-+ cd->showzones_check = gtk_check_button_new_with_mnemonic (_("Show _timezones button"));
-+ gtk_box_pack_start (GTK_BOX (vbox), cd->showzones_check, FALSE, FALSE, 0);
-+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->showzones_check),
-+ cd->show_multiple_timezones);
-+ g_signal_connect (G_OBJECT (cd->showzones_check), "toggled",
-+ G_CALLBACK (set_show_zones_cb),
-+ cd);
-+ gtk_widget_show (cd->showzones_check);
-+
- g_signal_connect (cd->props, "destroy",
- G_CALLBACK (gtk_widget_destroyed),
- &cd->props);
---- gnome-panel-2.10.1/applets/clock/clock.h 1970-01-01 05:30:00.000000000 +0530
-+++ gnome-panel-2.10.1-new/applets/clock/clock.h 2005-06-30 22:37:14.808303184 +0530
-@@ -0,0 +1,173 @@
-+#ifndef __CLOCK_H__
-+#define __CLOCK_H__
-+
-+#include <stdio.h>
-+#include <sys/stat.h>
-+#include <unistd.h>
-+#include <dirent.h>
-+#include <string.h>
-+#include <time.h>
-+#include <langinfo.h>
-+
-+#include <panel-applet.h>
-+#include <panel-applet-gconf.h>
-+
-+#include <gtk/gtk.h>
-+#include <gdk/gdkkeysyms.h>
-+#include <libbonobo.h>
-+#include <gconf/gconf-client.h>
-+#include <libgnomeui/gnome-help.h>
-+#include <libgnome/gnome-init.h>
-+#include <libgnomeui/gnome-url.h>
-+
-+#include <glade/glade.h>
-+
-+#ifdef HAVE_LIBECAL
-+#include "calendar-client.h"
-+#endif
-+#include "tz.h"
-+#include "../gnome-time-settings/e-map/e-map.h"
-+
-+#define INTERNETSECOND (864)
-+#define INTERNETBEAT (86400)
-+
-+#define N_GCONF_PREFS 8
-+
-+#define NEVER_SENSITIVE "never_sensitive"
-+
-+typedef struct _ClockData ClockData;
-+typedef struct _TimezoneSelectionDialog TimezoneSelectionDialog;
-+typedef struct _TipZone TipZone;
-+
-+typedef enum {
-+ CLOCK_FORMAT_INVALID = 0,
-+ CLOCK_FORMAT_12,
-+ CLOCK_FORMAT_24,
-+ CLOCK_FORMAT_UNIX,
-+ CLOCK_FORMAT_INTERNET,
-+ CLOCK_FORMAT_CUSTOM
-+} ClockFormat;
-+
-+struct _ClockData {
-+ /* widgets */
-+ GtkWidget *applet;
-+ GtkWidget *clockw;
-+ GtkWidget *toggle;
-+ GtkWidget *props;
-+ GtkWidget *about;
-+ GtkWidget *calendar_popup;
-+ GtkWidget *calendar;
-+ GtkWidget *timezone_dialog;
-+ GtkWidget *multizone_popup;
-+
-+
-+ GtkWidget *hbox;
-+
-+ GtkWidget *multizone_toggle;
-+ GtkWidget *multizone_image;
-+ GdkPixbuf *image;
-+
-+#ifdef HAVE_LIBECAL
-+ GtkWidget *task_list;
-+ GtkWidget *appointment_list;
-+
-+ GtkListStore *appointments_model;
-+ GtkListStore *tasks_model;
-+ GtkTreeModelFilter *tasks_filter;
-+
-+ CalendarClient *client;
-+#endif /* HAVE_LIBECAL */
-+
-+ /* preferences */
-+ ClockFormat format;
-+ char *custom_format;
-+ gboolean showseconds;
-+ gboolean showdate;
-+ gboolean gmt_time;
-+ gboolean showweek;
-+ gboolean show_multiple_timezones;
-+
-+ char *config_tool;
-+
-+ /* runtime data */
-+ time_t current_time;
-+ char *timeformat;
-+ guint timeout;
-+ PanelAppletOrient orient;
-+ int size;
-+ int save_allocation_h;
-+ int save_allocation_w;
-+
-+ TimezoneSelectionDialog *tsd;
-+ GSList *tip_list;
-+ TzDB *tzdb;
-+
-+ int fixed_width;
-+ int fixed_height;
-+
-+ GtkWidget *showseconds_check;
-+ GtkWidget *showdate_check;
-+ GtkWidget *gmt_time_check;
-+ GtkWidget *custom_hbox;
-+ GtkWidget *custom_label;
-+ GtkWidget *custom_entry;
-+ GtkWidget *showzones_check;
-+ gboolean custom_format_shown;
-+
-+ guint listeners [N_GCONF_PREFS];
-+};
-+
-+void
-+clock_set_tooltip (GtkWidget *applet,
-+ GtkWidget *widget,
-+ const char *tip);
-+
-+
-+#define TZ_MAP_POINT_NORMAL_RGBA 0xc070a0ff
-+#define TZ_MAP_POINT_HOVER_RGBA 0xffff60ff
-+#define TZ_MAP_POINT_SELECTED_1_RGBA 0xff60e0ff
-+#define TZ_MAP_POINT_SELECTED_2_RGBA 0x000000ff
-+
-+
-+struct _TimezoneSelectionDialog
-+{
-+ GtkWidget *dialog;
-+ GladeXML *xml;
-+
-+ EMapPoint *point_selected;
-+ EMapPoint *point_hover;
-+ EMap *map;
-+ glong correction;
-+ char *zone;
-+
-+ guint timeout;
-+
-+ /* multi timezone part */
-+ GtkWidget *tips_tree;
-+ GtkTreeStore *model;
-+
-+ ClockData *cd;
-+};
-+
-+void
-+display_timezone_selection_dialog (BonoboUIComponent *uic,
-+ ClockData *cd,
-+ const gchar *verbname);
-+
-+/* multi-timezone part */
-+
-+
-+struct _TipZone {
-+ char *zone;
-+ char *nick;
-+ GtkWidget *time_label;
-+ GtkWidget *nick_label;
-+};
-+
-+GtkWidget * create_multi_timezones_popup (ClockData *cd,
-+ GdkScreen *screen);
-+void create_multizone_table (TimezoneSelectionDialog *tsd);
-+void timzone_dialog_set_zones_only (TimezoneSelectionDialog *tsd);
-+void timzone_dialog_set_main_zone_only (TimezoneSelectionDialog *tsd);
-+gboolean multizone_is_zone_in_tip_list (ClockData *cd, char *zone);
-+#endif /* __CLOCK_H__ */
---- gnome-panel-2.10.1/applets/clock/clock.schemas.in 2005-06-30 22:24:08.042909704 +0530
-+++ gnome-panel-2.10.1-new/applets/clock/clock.schemas.in 2005-06-30 22:37:14.810302880 +0530
-@@ -189,6 +189,17 @@
- </locale>
- </schema>
-
-+ <schema>
-+ <key>/schemas/apps/clock_applet/prefs/show_zones</key>
-+ <owner>clock-applet</owner>
-+ <type>bool</type>
-+ <default>false</default>
-+ <locale name="C">
-+ <short>Show the timezone button</short>
-+ <long>If true, display the timezone button in the clock, in addition to time.</long>
-+ </locale>
-+ </schema>
-+
- </schemalist>
-
- </gconfschemafile>
---- gnome-panel-2.10.1/applets/clock/Makefile.am 2005-03-07 19:45:15.000000000 +0530
-+++ gnome-panel-2.10.1-new/applets/clock/Makefile.am 2005-06-30 22:37:14.811302728 +0530
-@@ -6,6 +6,7 @@ INCLUDES = \
- $(WARN_CFLAGS) \
- $(CLOCK_CFLAGS) \
- -DDATADIR=\""$(datadir)"\" \
-+ -DGLADEDIR=\""$(datadir)/gnome/panel/glade"\" \
- -DLIBDIR=\""$(libdir)"\" \
- -DSYSCONFDIR=\""$(sysconfdir)"\" \
- -DPREFIX=\""$(prefix)"\" \
-@@ -20,17 +21,27 @@ CALENDAR_SOURCES = \
- calendar-debug.h
- endif
-
--clock_applet_SOURCES = clock.c $(CALENDAR_SOURCES)
-+clock_applet_SOURCES = clock.c \
-+ $(CALENDAR_SOURCES) \
-+ tz.h \
-+ tz.c \
-+ clock.h \
-+ timezone-selection.c \
-+ multi-timezone.c
-
- clock_applet_LDADD = \
- ../../libpanel-applet/libpanel-applet-2.la \
-- $(CLOCK_LIBS)
-+ $(CLOCK_LIBS) \
-+ ../gnome-time-settings/e-map/libemap.a
-
- libexec_PROGRAMS = clock-applet
-
- GNOME_ClockApplet_Factory.server.in: GNOME_ClockApplet_Factory.server.in.in
- sed -e "s|\@LIBEXECDIR\@|$(libexecdir)|" $< > $@
-
-+gladedir = $(datadir)/gnome/panel/glade
-+glade_DATA = timezone.glade
-+
- uidir = $(datadir)/gnome-2.0/ui
- ui_DATA = GNOME_ClockApplet.xml
-
---- gnome-panel-2.10.1/applets/clock/multi-timezone.c 1970-01-01 05:30:00.000000000 +0530
-+++ gnome-panel-2.10.1-new/applets/clock/multi-timezone.c 2005-06-30 22:37:14.814302272 +0530
-@@ -0,0 +1,539 @@
-+#include "config.h"
-+#include "clock.h"
-+
-+#define GW(name) glade_xml_get_widget (tsd->xml, name)
-+static const char* KEY_TIPS_ZONE = "tips-zone";
-+/* popup part */
-+static void set_tip_zone_to_gconf (TimezoneSelectionDialog *tsd, char *zone, char *nick, int key_num);
-+static void update_list_tip_zone (ClockData *cd);
-+
-+static void
-+hide_it (GtkWidget* w, GdkEventButton *event, ClockData *cd)
-+{
-+ gtk_widget_hide (cd->multizone_popup);
-+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->multizone_toggle),
-+ FALSE);
-+}
-+
-+static void
-+set_zone_tip_from_name (ClockData *cd, GtkWidget *widget, char *zone)
-+{
-+ TzInfo *tz;
-+ TzLocation *tz_loc = NULL;
-+
-+ if (!zone)
-+ return;
-+
-+ if (!cd->tzdb)
-+ {
-+ cd->tzdb = tz_load_db ();
-+ if (!cd->tzdb)
-+ return;
-+ }
-+
-+ tz_loc = tz_get_location_by_name (cd->tzdb, zone);
-+
-+ if (!tz_loc)
-+ {
-+ char *current_timezone = tz_get_system_timezone ();
-+ if (current_timezone)
-+ {
-+ tz_loc = tz_get_location_by_name (cd->tzdb,
-+ current_timezone);
-+ g_free (current_timezone);
-+ }
-+ }
-+ if (tz_loc)
-+ {
-+ char *tip;
-+ tz = tz_info_from_location (tz_loc);
-+
-+ tip = g_strdup_printf ("%s - %s (%s)\nGMT%s%ld %s%s%s",
-+ _(tz_loc->zone),
-+ tz_loc->country,
-+ tz->tzname_normal,
-+ (tz->utc_offset / 3600) >= 0 ? "+" : " ",
-+ tz->utc_offset / 3600,
-+ tz->daylight == 0 ? " ": _("use daylight savings"),
-+ tz_loc->comment ? "\n" : " ",
-+ tz_loc->comment ? tz_loc->comment : " ");
-+ clock_set_tooltip (cd->applet, widget, tip);
-+ g_free (tip);
-+ }
-+}
-+
-+static GtkWidget *
-+add_timezone_button (ClockData *cd,
-+ TipZone *tip)
-+{
-+ GtkWidget *hbox, *label_zone, *label_time, *event_box;
-+
-+ hbox = gtk_hbox_new (TRUE, 0);
-+ label_zone = gtk_label_new (tip->nick);
-+ label_time = gtk_label_new ("12:00");
-+ event_box = gtk_event_box_new ();
-+
-+
-+ tip->time_label = label_time;
-+ tip->nick_label = label_zone;
-+
-+
-+ gtk_box_pack_start (GTK_BOX (hbox), label_zone, TRUE, TRUE, 2);
-+ gtk_misc_set_alignment (GTK_MISC (label_zone), 0, 0.5);
-+ gtk_box_pack_start (GTK_BOX (hbox), label_time, TRUE, TRUE, 2);
-+ gtk_misc_set_alignment (GTK_MISC (label_time), 1, 0.5);
-+
-+ gtk_container_add (GTK_CONTAINER (event_box), hbox);
-+
-+ set_zone_tip_from_name (cd, event_box, tip->zone);
-+
-+ g_signal_connect (event_box,
-+ "button-press-event",
-+ G_CALLBACK (hide_it),
-+ cd);
-+
-+ gtk_widget_show_all (event_box);
-+ return event_box;
-+}
-+
-+static gboolean
-+close_on_escape (GtkWidget *widget,
-+ GdkEventKey *event,
-+ ClockData *cd)
-+{
-+ if (event->keyval == GDK_Escape) {
-+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->toggle), FALSE);
-+ return TRUE;
-+ }
-+
-+ return FALSE;
-+}
-+
-+static gboolean
-+delete_event (GtkWidget *widget,
-+ GdkEvent *event,
-+ ClockData *cd)
-+{
-+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->toggle), FALSE);
-+ return TRUE;
-+}
-+
-+static void
-+edit_zones (GtkWidget *w, ClockData *cd)
-+{
-+ if (cd->multizone_popup)
-+ {
-+ gtk_widget_hide (cd->multizone_popup);
-+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->multizone_toggle),
-+ FALSE);
-+ }
-+ if (cd->tsd)
-+ {
-+ gtk_window_set_screen (GTK_WINDOW (cd->timezone_dialog),
-+ gtk_widget_get_screen (cd->applet));
-+ gtk_window_present (GTK_WINDOW (cd->timezone_dialog));
-+ return;
-+ }
-+
-+ display_timezone_selection_dialog (NULL, cd, NULL);
-+}
-+
-+GtkWidget *
-+create_multi_timezones_popup (ClockData *cd,
-+ GdkScreen *screen)
-+{
-+ GtkWindow *window;
-+ GtkWidget *vbox_zones, *vbox, *separ, *button, *frame;
-+ GSList *tmp_list;
-+
-+ update_list_tip_zone (cd);
-+
-+ window = GTK_WINDOW (gtk_window_new (GTK_WINDOW_POPUP));
-+
-+ gtk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_DOCK);
-+ gtk_window_set_decorated (window, FALSE);
-+ gtk_window_set_resizable (window, FALSE);
-+ gtk_window_stick (window);
-+ gtk_window_set_screen (window, screen);
-+
-+ g_signal_connect (window, "delete_event",
-+ G_CALLBACK (delete_event), cd);
-+
-+ g_signal_connect (window, "key_press_event",
-+ G_CALLBACK (close_on_escape), cd);
-+
-+ vbox_zones = gtk_vbox_new (TRUE, 4);
-+ vbox = gtk_vbox_new (FALSE, 4);
-+ frame = gtk_frame_new (NULL);
-+
-+ gtk_container_add (GTK_CONTAINER (frame), vbox);
-+
-+ for (tmp_list = cd->tip_list;
-+ tmp_list ; tmp_list = tmp_list->next)
-+ {
-+ GtkWidget *zone;
-+ TipZone *tip_zone = tmp_list->data;
-+
-+ zone = add_timezone_button (cd, tip_zone);
-+
-+ gtk_container_add (GTK_CONTAINER (vbox_zones), zone);
-+ }
-+
-+ gtk_container_add (GTK_CONTAINER (vbox), vbox_zones);
-+
-+ separ = gtk_hseparator_new ();
-+ gtk_container_add (GTK_CONTAINER (vbox), separ);
-+
-+ button = gtk_button_new_with_label (_("Edit Time Zones..."));
-+ gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
-+
-+ g_signal_connect (button, "clicked", G_CALLBACK (edit_zones),
-+ cd);
-+
-+ gtk_container_add (GTK_CONTAINER (vbox), button);
-+
-+ gtk_container_add (GTK_CONTAINER (window), frame);
-+
-+ return GTK_WIDGET (window);
-+}
-+
-+
-+static gchar *
-+get_timezone_msgid (TimezoneSelectionDialog *tsd, gchar *zone)
-+{
-+ GPtrArray *locs;
-+ gchar *msgid;
-+ int i;
-+
-+ locs = tz_get_locations (tsd->cd->tzdb);
-+
-+ for (i = 0; i < locs->len; i++)
-+ {
-+ msgid = tz_location_get_zone (g_ptr_array_index (locs, i));
-+
-+ if (!g_utf8_collate (_(msgid), zone))
-+ {
-+ g_free (zone);
-+ return g_strdup (msgid);
-+ }
-+ }
-+
-+ return zone;
-+}
-+
-+static int
-+get_next_available_tips_zone_key_num (TimezoneSelectionDialog *tsd)
-+{
-+ GSList *list = NULL, *li;
-+ int num = -1;
-+ char *tips_store_path = panel_applet_gconf_get_full_key (PANEL_APPLET (tsd->cd->applet), KEY_TIPS_ZONE);
-+
-+
-+ list = gconf_client_all_entries (gconf_client_get_default (), tips_store_path, NULL);
-+
-+ if (list == NULL)
-+ return 0;
-+
-+
-+ for (li = list; li != NULL; li = li->next)
-+ {
-+ GConfEntry *entry = li->data;
-+ char *key_name = g_path_get_basename (gconf_entry_get_key (entry));
-+ int key_num = atoi (key_name);
-+ num = key_num > num ? key_num : num;
-+ }
-+ return num + 1;
-+}
-+
-+enum {
-+ ZONE_COLUMN,
-+ NIK_COLUMN,
-+ EDITABLE_COL,
-+ KEY_NUM_COLUMN,
-+ NUM_COLUMNS
-+};
-+
-+void static
-+on_add_to_tip_button_clicked (GtkWidget * w,
-+ TimezoneSelectionDialog *tsd)
-+{
-+ GtkTreeIter iter;
-+ char *nick;
-+ char *zone = g_strdup (gtk_entry_get_text (GTK_ENTRY (GTK_COMBO ( GW ("location_combo"))->entry)));
-+ int key_num = get_next_available_tips_zone_key_num (tsd);
-+
-+ gtk_tree_store_append (tsd->model, &iter, NULL);
-+
-+ if (nick != NULL)
-+ nick = index (zone, '/');
-+ else
-+ nick = zone;
-+ nick = strdup (nick+1);
-+
-+ gtk_tree_store_set (tsd->model, &iter,
-+ ZONE_COLUMN, zone,
-+ NIK_COLUMN, nick,
-+ EDITABLE_COL, TRUE,
-+ KEY_NUM_COLUMN, key_num,
-+ -1);
-+
-+ zone = get_timezone_msgid (tsd, zone);
-+
-+ set_tip_zone_to_gconf (tsd, zone, nick, key_num);
-+
-+ gtk_widget_set_sensitive (GW ("remove_from_tip_button"), TRUE);
-+ gtk_widget_set_sensitive (GW ("add_to_tip_button"), FALSE);
-+
-+ g_free (zone);
-+ update_list_tip_zone (tsd->cd);
-+}
-+
-+void static
-+on_remove_from_tip_button_clicked (GtkWidget *widget,
-+ TimezoneSelectionDialog *tsd)
-+{
-+ GtkTreeIter iter;
-+ GtkTreeModel *model;
-+ gchar *zone, *nick;
-+ GtkTreeSelection *sel;
-+
-+ sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tsd->tips_tree));
-+
-+ if (gtk_tree_selection_get_selected (sel, &model, &iter))
-+ {
-+ char *path, *key;
-+ int key_num;
-+
-+ gtk_tree_model_get (model, &iter,
-+ ZONE_COLUMN, &zone,
-+ NIK_COLUMN, &nick,
-+ KEY_NUM_COLUMN, &key_num,
-+ -1);
-+
-+ gtk_tree_store_remove (GTK_TREE_STORE (model), &iter);
-+
-+ path = panel_applet_gconf_get_full_key (PANEL_APPLET (tsd->cd->applet),
-+ KEY_TIPS_ZONE);
-+ key = g_strdup_printf ("%s/%d", path, key_num);
-+
-+ gconf_client_unset (gconf_client_get_default (), key, NULL);
-+
-+ g_free (zone);
-+ g_free (nick);
-+ update_list_tip_zone (tsd->cd);
-+ }
-+}
-+
-+static void set_tip_zone_to_gconf (TimezoneSelectionDialog *tsd,
-+ char *zone,
-+ char *nick,
-+ int key_num)
-+{
-+ char *path = panel_applet_gconf_get_full_key (PANEL_APPLET (tsd->cd->applet),
-+ KEY_TIPS_ZONE);
-+
-+ char *key_name = g_strdup_printf ("%s/%d", path, key_num);
-+
-+ gconf_client_set_pair (gconf_client_get_default (),
-+ key_name,
-+ GCONF_VALUE_STRING,
-+ GCONF_VALUE_STRING,
-+ &zone,
-+ &nick,
-+ NULL);
-+ g_free (path);
-+ g_free (key_name);
-+}
-+
-+static void
-+edited (GtkCellRendererText *cell,
-+ gchar *path_string,
-+ gchar *new_text,
-+ TimezoneSelectionDialog *tsd)
-+{
-+ GtkTreeModel *model = GTK_TREE_MODEL (tsd->model);
-+ GtkTreeIter iter;
-+ GtkTreePath *path = gtk_tree_path_new_from_string (path_string);
-+ char *zone;
-+ int key_num;
-+
-+ gtk_tree_model_get_iter (model, &iter, path);
-+
-+ gtk_tree_model_get (model, &iter, ZONE_COLUMN, &zone, KEY_NUM_COLUMN, &key_num, -1);
-+
-+ zone = get_timezone_msgid (tsd, zone);
-+
-+ gtk_tree_store_set (GTK_TREE_STORE (model), &iter, NIK_COLUMN, new_text, -1);
-+
-+ set_tip_zone_to_gconf (tsd, zone, new_text, key_num);
-+
-+ gtk_tree_path_free (path);
-+ g_free (zone);
-+ update_list_tip_zone (tsd->cd);
-+}
-+static void
-+populate_tips_store (TimezoneSelectionDialog *tsd, GtkTreeStore *model)
-+{
-+ char *tips_store_path;
-+ GConfClient *client;
-+ GSList *list = NULL, *li;
-+ GtkTreeIter iter;
-+ client = gconf_client_get_default ();
-+
-+ tips_store_path = panel_applet_gconf_get_full_key (PANEL_APPLET (tsd->cd->applet),
-+ KEY_TIPS_ZONE);
-+
-+ list = gconf_client_all_entries (client, tips_store_path, NULL);
-+
-+ if (!list)
-+ gtk_widget_set_sensitive (GW ("remove_from_tip_button"), FALSE);
-+
-+ for (li = list; li != NULL; li = li->next)
-+ {
-+ char *zone, *nick;
-+ GConfEntry *entry = li->data;
-+ char *key_name = g_path_get_basename (gconf_entry_get_key (entry));
-+ GConfValue *key_value = gconf_entry_get_value (entry);
-+ int key_num = atoi (key_name);
-+
-+ zone = g_strdup (gconf_value_get_string (gconf_value_get_car (key_value)));
-+ nick = g_strdup (gconf_value_get_string (gconf_value_get_cdr (key_value)));
-+
-+ gtk_tree_store_append (model, &iter, NULL);
-+
-+ gtk_tree_store_set (model, &iter,
-+ ZONE_COLUMN, _(zone),
-+ NIK_COLUMN, nick,
-+ EDITABLE_COL, TRUE,
-+ KEY_NUM_COLUMN, key_num,
-+ -1);
-+
-+ g_free (key_name);
-+ g_free (zone);
-+ g_free (nick);
-+ }
-+
-+ g_free (tips_store_path);
-+}
-+
-+void
-+create_multizone_table (TimezoneSelectionDialog *tsd)
-+{
-+ GtkTreeStore *model;
-+ GtkWidget *tree_view;
-+ GtkCellRenderer *renderer;
-+
-+ model = gtk_tree_store_new (NUM_COLUMNS,
-+ G_TYPE_STRING,
-+ G_TYPE_STRING,
-+ G_TYPE_BOOLEAN,
-+ G_TYPE_INT);
-+
-+
-+ populate_tips_store (tsd, model);
-+
-+ tsd->tips_tree = GW ("tips_tree");
-+ tree_view = tsd->tips_tree;
-+ tsd->model = model;
-+
-+ gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), GTK_TREE_MODEL (model));
-+ gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (tree_view), TRUE);
-+
-+ renderer = gtk_cell_renderer_text_new ();
-+ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
-+ -1, _("Timezone"),
-+ renderer,
-+ "text", ZONE_COLUMN,
-+ NULL);
-+ g_signal_connect (renderer, "edited",
-+ G_CALLBACK (edited), model);
-+
-+ renderer = gtk_cell_renderer_text_new ();
-+
-+ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
-+ -1, _("Comments"),
-+ renderer,
-+ "text", NIK_COLUMN,
-+ "editable", EDITABLE_COL,
-+ NULL);
-+ g_signal_connect (renderer, "edited",
-+ G_CALLBACK (edited), tsd);
-+
-+ gtk_widget_show (tree_view);
-+
-+ g_signal_connect (G_OBJECT (GW ("add_to_tip_button")), "clicked",
-+ G_CALLBACK (on_add_to_tip_button_clicked), tsd);
-+
-+ g_signal_connect (G_OBJECT (GW ("remove_from_tip_button")), "clicked",
-+ G_CALLBACK (on_remove_from_tip_button_clicked), tsd);
-+
-+
-+}
-+
-+static void free_tip_list (GSList *tips)
-+{
-+ if (tips)
-+ {
-+ GSList *tmp_list;
-+ for (tmp_list = tips; tmp_list ; tmp_list = tmp_list->next)
-+ {
-+ TipZone *tip_tmp = tmp_list->data;
-+ g_free (tip_tmp->zone);
-+ g_free (tip_tmp->nick);
-+ g_free (tip_tmp);
-+ }
-+ g_slist_free (tips);
-+ }
-+}
-+
-+static void
-+update_list_tip_zone (ClockData *cd)
-+{
-+ GSList *list = NULL, *li;
-+
-+ char *tips_store_path = panel_applet_gconf_get_full_key (PANEL_APPLET (cd->applet), KEY_TIPS_ZONE);
-+
-+ free_tip_list (cd->tip_list);
-+ cd->tip_list = NULL;
-+
-+ if (cd->multizone_popup)
-+ {
-+ gtk_widget_destroy (cd->multizone_popup);
-+ cd->multizone_popup = NULL;
-+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->multizone_toggle),
-+ FALSE);
-+ }
-+
-+ list = gconf_client_all_entries (gconf_client_get_default (),
-+ tips_store_path, NULL);
-+
-+ if (list == NULL)
-+ return;
-+
-+ for (li = list; li != NULL; li = li->next)
-+ {
-+ GConfEntry *entry = li->data;
-+ GConfValue *key_value = gconf_entry_get_value (entry);
-+ if (key_value)
-+ {
-+ TipZone *tip_zone = g_new (TipZone, 1);
-+ tip_zone->zone = g_strdup (gconf_value_get_string (gconf_value_get_car (key_value)));
-+ tip_zone->nick = g_strdup (gconf_value_get_string (gconf_value_get_cdr (key_value)));
-+ cd->tip_list = g_slist_append (cd->tip_list, tip_zone);
-+ }
-+ }
-+}
-+
-+gboolean
-+multizone_is_zone_in_tip_list (ClockData *cd, char *zone)
-+{
-+ GSList *tmp_list = NULL;
-+ for (tmp_list = cd->tip_list; tmp_list ; tmp_list = tmp_list->next)
-+ {
-+ TipZone *tip_tmp = tmp_list->data;
-+ if (strcmp (tip_tmp->zone, zone) == 0)
-+ return TRUE;
-+ }
-+ return FALSE;
-+}
-+
---- gnome-panel-2.10.1/applets/clock/timezone.glade 1970-01-01 05:30:00.000000000 +0530
-+++ gnome-panel-2.10.1-new/applets/clock/timezone.glade 2005-06-30 22:37:14.818301664 +0530
-@@ -0,0 +1,581 @@
-+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-+
-+<glade-interface>
-+<requires lib="gnome"/>
-+
-+<widget class="GtkDialog" id="timezone_dialog">
-+ <property name="width_request">545</property>
-+ <property name="height_request">575</property>
-+ <property name="title" translatable="yes">Change Clock Applet Time Zone</property>
-+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
-+ <property name="window_position">GTK_WIN_POS_NONE</property>
-+ <property name="modal">False</property>
-+ <property name="resizable">True</property>
-+ <property name="destroy_with_parent">False</property>
-+ <property name="decorated">True</property>
-+ <property name="skip_taskbar_hint">False</property>
-+ <property name="skip_pager_hint">False</property>
-+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
-+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
-+ <property name="has_separator">True</property>
-+ <signal name="delete_event" handler="gtk_widget_hide" last_modification_time="Thu, 20 Nov 2003 16:52:00 GMT"/>
-+ <signal name="destroy_event" handler="gtk_widget_hide" last_modification_time="Thu, 20 Nov 2003 16:52:19 GMT"/>
-+
-+ <child internal-child="vbox">
-+ <widget class="GtkVBox" id="dialog-vbox3">
-+ <property name="width_request">635</property>
-+ <property name="height_request">384</property>
-+ <property name="visible">True</property>
-+ <property name="homogeneous">False</property>
-+ <property name="spacing">0</property>
-+
-+ <child internal-child="action_area">
-+ <widget class="GtkHButtonBox" id="dialog-action_area3">
-+ <property name="visible">True</property>
-+ <property name="layout_style">GTK_BUTTONBOX_END</property>
-+
-+ <child>
-+ <widget class="GtkButton" id="helpbutton">
-+ <property name="visible">True</property>
-+ <property name="can_default">True</property>
-+ <property name="can_focus">True</property>
-+ <property name="label">gtk-help</property>
-+ <property name="use_stock">True</property>
-+ <property name="relief">GTK_RELIEF_NORMAL</property>
-+ <property name="focus_on_click">True</property>
-+ <property name="response_id">-11</property>
-+ </widget>
-+ </child>
-+
-+ <child>
-+ <widget class="GtkButton" id="timezone_apply_button">
-+ <property name="visible">True</property>
-+ <property name="can_default">True</property>
-+ <property name="can_focus">True</property>
-+ <property name="label">gtk-close</property>
-+ <property name="use_stock">True</property>
-+ <property name="relief">GTK_RELIEF_NORMAL</property>
-+ <property name="focus_on_click">True</property>
-+ <property name="response_id">-7</property>
-+ <signal name="clicked" handler="gtk_widget_hide" object="timezone_dialog" last_modification_time="Thu, 20 Nov 2003 17:54:21 GMT"/>
-+ </widget>
-+ </child>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">False</property>
-+ <property name="fill">False</property>
-+ <property name="pack_type">GTK_PACK_END</property>
-+ </packing>
-+ </child>
-+
-+ <child>
-+ <widget class="GtkVBox" id="time_zone_dialog_content">
-+ <property name="border_width">12</property>
-+ <property name="visible">True</property>
-+ <property name="homogeneous">False</property>
-+ <property name="spacing">12</property>
-+
-+ <child>
-+ <widget class="GtkLabel" id="zoom_label">
-+ <property name="visible">True</property>
-+ <property name="label" translatable="yes">Click your nearerst city or select it from the list (left click to zoom in):</property>
-+ <property name="use_underline">False</property>
-+ <property name="use_markup">True</property>
-+ <property name="justify">GTK_JUSTIFY_LEFT</property>
-+ <property name="wrap">False</property>
-+ <property name="selectable">False</property>
-+ <property name="xalign">0</property>
-+ <property name="yalign">0.5</property>
-+ <property name="xpad">0</property>
-+ <property name="ypad">0</property>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">False</property>
-+ <property name="fill">False</property>
-+ </packing>
-+ </child>
-+
-+ <child>
-+ <widget class="GtkVBox" id="timezone_vbox">
-+ <property name="width_request">335</property>
-+ <property name="height_request">337</property>
-+ <property name="visible">True</property>
-+ <property name="homogeneous">False</property>
-+ <property name="spacing">12</property>
-+
-+ <child>
-+ <widget class="GtkScrolledWindow" id="map_window">
-+ <property name="width_request">60</property>
-+ <property name="height_request">230</property>
-+ <property name="visible">True</property>
-+ <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
-+ <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
-+ <property name="shadow_type">GTK_SHADOW_IN</property>
-+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-+
-+ <child>
-+ <placeholder/>
-+ </child>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">True</property>
-+ <property name="fill">True</property>
-+ </packing>
-+ </child>
-+
-+ <child>
-+ <widget class="GtkHBox" id="hbox52">
-+ <property name="visible">True</property>
-+ <property name="homogeneous">True</property>
-+ <property name="spacing">0</property>
-+
-+ <child>
-+ <widget class="GtkLabel" id="location_label">
-+ <property name="visible">True</property>
-+ <property name="label" translatable="yes"></property>
-+ <property name="use_underline">False</property>
-+ <property name="use_markup">False</property>
-+ <property name="justify">GTK_JUSTIFY_LEFT</property>
-+ <property name="wrap">False</property>
-+ <property name="selectable">False</property>
-+ <property name="xalign">0</property>
-+ <property name="yalign">0.5</property>
-+ <property name="xpad">0</property>
-+ <property name="ypad">11</property>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">False</property>
-+ <property name="fill">False</property>
-+ </packing>
-+ </child>
-+
-+ <child>
-+ <widget class="GtkLabel" id="time_clock_label">
-+ <property name="visible">True</property>
-+ <property name="label" translatable="yes"></property>
-+ <property name="use_underline">False</property>
-+ <property name="use_markup">False</property>
-+ <property name="justify">GTK_JUSTIFY_RIGHT</property>
-+ <property name="wrap">False</property>
-+ <property name="selectable">False</property>
-+ <property name="xalign">1</property>
-+ <property name="yalign">0.5</property>
-+ <property name="xpad">0</property>
-+ <property name="ypad">0</property>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">False</property>
-+ <property name="fill">False</property>
-+ </packing>
-+ </child>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">False</property>
-+ <property name="fill">False</property>
-+ </packing>
-+ </child>
-+
-+ <child>
-+ <widget class="GtkHBox" id="hbox_main_zone">
-+ <property name="visible">True</property>
-+ <property name="homogeneous">False</property>
-+ <property name="spacing">19</property>
-+
-+ <child>
-+ <widget class="GtkLabel" id="label45">
-+ <property name="visible">True</property>
-+ <property name="label" translatable="yes">Time_zone:</property>
-+ <property name="use_underline">True</property>
-+ <property name="use_markup">False</property>
-+ <property name="justify">GTK_JUSTIFY_CENTER</property>
-+ <property name="wrap">False</property>
-+ <property name="selectable">False</property>
-+ <property name="xalign">0.5</property>
-+ <property name="yalign">0.5</property>
-+ <property name="xpad">0</property>
-+ <property name="ypad">0</property>
-+ <property name="mnemonic_widget">entry_location</property>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">False</property>
-+ <property name="fill">False</property>
-+ </packing>
-+ </child>
-+
-+ <child>
-+ <widget class="GtkCombo" id="location_combo">
-+ <property name="visible">True</property>
-+ <property name="value_in_list">False</property>
-+ <property name="allow_empty">False</property>
-+ <property name="case_sensitive">False</property>
-+ <property name="enable_arrow_keys">True</property>
-+ <property name="enable_arrows_always">True</property>
-+
-+ <child internal-child="entry">
-+ <widget class="GtkEntry" id="entry_location">
-+ <property name="visible">True</property>
-+ <property name="editable">False</property>
-+ <property name="visibility">True</property>
-+ <property name="max_length">0</property>
-+ <property name="text" translatable="yes"></property>
-+ <property name="has_frame">True</property>
-+ <property name="invisible_char" translatable="yes">*</property>
-+ <property name="activates_default">False</property>
-+ </widget>
-+ </child>
-+
-+ <child internal-child="list">
-+ <widget class="GtkList" id="convertwidget5">
-+ <property name="visible">True</property>
-+ <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-+
-+ <child>
-+ <widget class="GtkListItem" id="convertwidget6">
-+ <property name="visible">True</property>
-+
-+ <child>
-+ <widget class="GtkLabel" id="convertwidget7">
-+ <property name="visible">True</property>
-+ <property name="label" translatable="yes"></property>
-+ <property name="use_underline">False</property>
-+ <property name="use_markup">False</property>
-+ <property name="justify">GTK_JUSTIFY_LEFT</property>
-+ <property name="wrap">False</property>
-+ <property name="selectable">False</property>
-+ <property name="xalign">0</property>
-+ <property name="yalign">0.5</property>
-+ <property name="xpad">0</property>
-+ <property name="ypad">0</property>
-+ </widget>
-+ </child>
-+ </widget>
-+ </child>
-+ </widget>
-+ </child>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">True</property>
-+ <property name="fill">True</property>
-+ </packing>
-+ </child>
-+
-+ <child>
-+ <placeholder/>
-+ </child>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">False</property>
-+ <property name="fill">False</property>
-+ </packing>
-+ </child>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">True</property>
-+ <property name="fill">True</property>
-+ </packing>
-+ </child>
-+
-+ <child>
-+ <widget class="GtkHSeparator" id="hseparator_main_zone">
-+ <property name="visible">True</property>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">True</property>
-+ <property name="fill">True</property>
-+ </packing>
-+ </child>
-+
-+ <child>
-+ <widget class="GtkHBox" id="tip_options_vbox">
-+ <property name="homogeneous">False</property>
-+ <property name="spacing">6</property>
-+
-+ <child>
-+ <widget class="GtkVBox" id="vbox27">
-+ <property name="visible">True</property>
-+ <property name="homogeneous">False</property>
-+ <property name="spacing">0</property>
-+
-+ <child>
-+ <widget class="GtkLabel" id="label127">
-+ <property name="visible">True</property>
-+ <property name="label" translatable="yes">_List:</property>
-+ <property name="use_underline">True</property>
-+ <property name="use_markup">False</property>
-+ <property name="justify">GTK_JUSTIFY_LEFT</property>
-+ <property name="wrap">False</property>
-+ <property name="selectable">False</property>
-+ <property name="xalign">0.5</property>
-+ <property name="yalign">0.5</property>
-+ <property name="xpad">0</property>
-+ <property name="ypad">0</property>
-+ <property name="mnemonic_widget">scrolledwindow1</property>
-+ </widget>
-+ <packing>
-+ <property name="padding">4</property>
-+ <property name="expand">False</property>
-+ <property name="fill">False</property>
-+ </packing>
-+ </child>
-+
-+ <child>
-+ <placeholder/>
-+ </child>
-+
-+ <child>
-+ <placeholder/>
-+ </child>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">False</property>
-+ <property name="fill">False</property>
-+ </packing>
-+ </child>
-+
-+ <child>
-+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
-+ <property name="visible">True</property>
-+ <property name="can_focus">True</property>
-+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-+ <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-+
-+ <child>
-+ <widget class="GtkTreeView" id="tips_tree">
-+ <property name="visible">True</property>
-+ <property name="can_focus">True</property>
-+ <property name="headers_visible">True</property>
-+ <property name="rules_hint">False</property>
-+ <property name="reorderable">False</property>
-+ <property name="enable_search">True</property>
-+ </widget>
-+ </child>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">True</property>
-+ <property name="fill">True</property>
-+ </packing>
-+ </child>
-+
-+ <child>
-+ <widget class="GtkVBox" id="vbox26">
-+ <property name="visible">True</property>
-+ <property name="homogeneous">False</property>
-+ <property name="spacing">0</property>
-+
-+ <child>
-+ <placeholder/>
-+ </child>
-+
-+ <child>
-+ <widget class="GtkButton" id="add_to_tip_button">
-+ <property name="visible">True</property>
-+ <property name="can_default">True</property>
-+ <property name="can_focus">True</property>
-+ <property name="relief">GTK_RELIEF_NORMAL</property>
-+ <property name="focus_on_click">True</property>
-+
-+ <child>
-+ <widget class="GtkAlignment" id="alignment2">
-+ <property name="visible">True</property>
-+ <property name="xalign">0.5</property>
-+ <property name="yalign">0.5</property>
-+ <property name="xscale">0</property>
-+ <property name="yscale">0</property>
-+ <property name="top_padding">0</property>
-+ <property name="bottom_padding">0</property>
-+ <property name="left_padding">0</property>
-+ <property name="right_padding">0</property>
-+
-+ <child>
-+ <widget class="GtkHBox" id="hbox53">
-+ <property name="visible">True</property>
-+ <property name="homogeneous">False</property>
-+ <property name="spacing">2</property>
-+
-+ <child>
-+ <widget class="GtkImage" id="image2">
-+ <property name="visible">True</property>
-+ <property name="stock">gtk-add</property>
-+ <property name="icon_size">4</property>
-+ <property name="xalign">0.5</property>
-+ <property name="yalign">0.5</property>
-+ <property name="xpad">0</property>
-+ <property name="ypad">0</property>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">False</property>
-+ <property name="fill">False</property>
-+ </packing>
-+ </child>
-+
-+ <child>
-+ <widget class="GtkLabel" id="label122">
-+ <property name="visible">True</property>
-+ <property name="label" translatable="yes">_Add</property>
-+ <property name="use_underline">True</property>
-+ <property name="use_markup">False</property>
-+ <property name="justify">GTK_JUSTIFY_LEFT</property>
-+ <property name="wrap">False</property>
-+ <property name="selectable">False</property>
-+ <property name="xalign">0.5</property>
-+ <property name="yalign">0.5</property>
-+ <property name="xpad">0</property>
-+ <property name="ypad">0</property>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">False</property>
-+ <property name="fill">False</property>
-+ </packing>
-+ </child>
-+ </widget>
-+ </child>
-+ </widget>
-+ </child>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">False</property>
-+ <property name="fill">True</property>
-+ </packing>
-+ </child>
-+
-+ <child>
-+ <widget class="GtkLabel" id="label129">
-+ <property name="visible">True</property>
-+ <property name="label" translatable="yes"></property>
-+ <property name="use_underline">False</property>
-+ <property name="use_markup">False</property>
-+ <property name="justify">GTK_JUSTIFY_LEFT</property>
-+ <property name="wrap">False</property>
-+ <property name="selectable">False</property>
-+ <property name="xalign">0.5</property>
-+ <property name="yalign">0.5</property>
-+ <property name="xpad">0</property>
-+ <property name="ypad">0</property>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">False</property>
-+ <property name="fill">False</property>
-+ </packing>
-+ </child>
-+
-+ <child>
-+ <widget class="GtkButton" id="remove_from_tip_button">
-+ <property name="visible">True</property>
-+ <property name="can_default">True</property>
-+ <property name="can_focus">True</property>
-+ <property name="relief">GTK_RELIEF_NORMAL</property>
-+ <property name="focus_on_click">True</property>
-+
-+ <child>
-+ <widget class="GtkAlignment" id="alignment3">
-+ <property name="visible">True</property>
-+ <property name="xalign">0.5</property>
-+ <property name="yalign">0.5</property>
-+ <property name="xscale">0</property>
-+ <property name="yscale">0</property>
-+ <property name="top_padding">0</property>
-+ <property name="bottom_padding">0</property>
-+ <property name="left_padding">0</property>
-+ <property name="right_padding">0</property>
-+
-+ <child>
-+ <widget class="GtkHBox" id="hbox57">
-+ <property name="visible">True</property>
-+ <property name="homogeneous">False</property>
-+ <property name="spacing">2</property>
-+
-+ <child>
-+ <widget class="GtkImage" id="image3">
-+ <property name="visible">True</property>
-+ <property name="stock">gtk-remove</property>
-+ <property name="icon_size">4</property>
-+ <property name="xalign">0.5</property>
-+ <property name="yalign">0.5</property>
-+ <property name="xpad">0</property>
-+ <property name="ypad">0</property>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">False</property>
-+ <property name="fill">False</property>
-+ </packing>
-+ </child>
-+
-+ <child>
-+ <widget class="GtkLabel" id="label124">
-+ <property name="visible">True</property>
-+ <property name="label" translatable="yes">_Remove</property>
-+ <property name="use_underline">True</property>
-+ <property name="use_markup">False</property>
-+ <property name="justify">GTK_JUSTIFY_LEFT</property>
-+ <property name="wrap">False</property>
-+ <property name="selectable">False</property>
-+ <property name="xalign">0.5</property>
-+ <property name="yalign">0.5</property>
-+ <property name="xpad">0</property>
-+ <property name="ypad">0</property>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">False</property>
-+ <property name="fill">False</property>
-+ </packing>
-+ </child>
-+ </widget>
-+ </child>
-+ </widget>
-+ </child>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">True</property>
-+ <property name="fill">False</property>
-+ </packing>
-+ </child>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">False</property>
-+ <property name="fill">False</property>
-+ <property name="pack_type">GTK_PACK_END</property>
-+ </packing>
-+ </child>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">True</property>
-+ <property name="fill">True</property>
-+ </packing>
-+ </child>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">True</property>
-+ <property name="fill">True</property>
-+ </packing>
-+ </child>
-+ </widget>
-+ </child>
-+</widget>
-+
-+</glade-interface>
---- gnome-panel-2.10.1/applets/clock/timezone-selection.c 1970-01-01 05:30:00.000000000 +0530
-+++ gnome-panel-2.10.1-new/applets/clock/timezone-selection.c 2005-06-30 22:37:14.820301360 +0530
-@@ -0,0 +1,450 @@
-+#include "config.h"
-+#include "clock.h"
-+
-+
-+#define GW(name) glade_xml_get_widget (tsd->xml, name)
-+
-+static void
-+mark_selected_city (TimezoneSelectionDialog * tsd, gchar * defaultv);
-+
-+static void
-+display_help (GtkWidget * w, gpointer data)
-+{
-+ GError *error = NULL;
-+
-+ gnome_help_display_desktop_on_screen (NULL, "clock", "clock", "clock-usage",
-+ gtk_widget_get_screen (w), &error);
-+
-+ if (error)
-+ {
-+ GtkWidget *dialog;
-+ dialog = gtk_message_dialog_new (GTK_WINDOW (w),
-+ GTK_DIALOG_DESTROY_WITH_PARENT,
-+ GTK_MESSAGE_ERROR,
-+ GTK_BUTTONS_OK,
-+ _("There was an error displaying help: %s"),
-+ error->message);
-+
-+ g_signal_connect (G_OBJECT (dialog), "response",
-+ G_CALLBACK (gtk_widget_destroy), NULL);
-+
-+ gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
-+ gtk_window_set_screen (GTK_WINDOW (dialog), gtk_widget_get_screen (w));
-+ gtk_widget_show (dialog);
-+ g_error_free (error);
-+ }
-+}
-+
-+
-+static TzLocation *
-+tz_location_from_point (TimezoneSelectionDialog * tsd, EMapPoint * point)
-+{
-+ TzLocation *tz_loc = NULL;
-+ GPtrArray *locs;
-+ double p_longitude, p_latitude;
-+ double l_longitude, l_latitude;
-+ int i;
-+
-+ locs = tz_get_locations (tsd->cd->tzdb);
-+ e_map_point_get_location (point, &p_longitude, &p_latitude);
-+
-+ for (i = 0; i < locs->len; i++)
-+ {
-+ tz_location_get_position (g_ptr_array_index (locs, i),
-+ &l_longitude, &l_latitude);
-+
-+ if (l_longitude - 0.005 <= p_longitude &&
-+ l_longitude + 0.005 >= p_longitude &&
-+ l_latitude - 0.005 <= p_latitude &&
-+ l_latitude + 0.005 >= p_latitude)
-+ {
-+ tz_loc = g_ptr_array_index (locs, i);
-+ break;
-+ }
-+ }
-+
-+ return (tz_loc);
-+}
-+
-+static void
-+set_tz_from_name (TimezoneSelectionDialog * tsd, gchar * name)
-+{
-+ TzLocation *tz_loc = NULL;
-+ GPtrArray *locs;
-+ double l_longitude = 0.0, l_latitude = 0.0;
-+ int i;
-+
-+ locs = tz_get_locations (tsd->cd->tzdb);
-+
-+ for (i = 0; i < locs->len; i++)
-+ {
-+ tz_loc = g_ptr_array_index (locs, i);
-+
-+ if (tz_loc
-+ && (!g_utf8_collate (_(tz_location_get_zone (tz_loc)), _(name))))
-+ {
-+ tz_location_get_position (tz_loc, &l_longitude, &l_latitude);
-+ break;
-+ }
-+ }
-+
-+ if (tsd->point_selected)
-+ e_map_point_set_color_rgba (tsd->map,
-+ tsd->point_selected,
-+ TZ_MAP_POINT_NORMAL_RGBA);
-+ tsd->point_selected =
-+ e_map_get_closest_point (tsd->map, l_longitude, l_latitude, FALSE);
-+
-+ gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (GW ("location_combo"))->entry),
-+ _(tz_location_get_zone
-+ (tz_location_from_point (tsd, tsd->point_selected))));
-+}
-+
-+static gchar *
-+get_selected_tz_name (TimezoneSelectionDialog * tsd)
-+{
-+ gchar *entry_text;
-+
-+ entry_text =
-+ (gchar *)
-+ gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (GW ("location_combo"))->entry));
-+
-+ return entry_text;
-+}
-+
-+static gboolean
-+update_map (GtkWidget * w, gpointer data)
-+{
-+ TimezoneSelectionDialog *tsd = (TimezoneSelectionDialog *) data;
-+ char *timezone = (char *) gtk_entry_get_text (GTK_ENTRY (w));
-+
-+ if (strlen (timezone) > 0)
-+ {
-+ gchar *tz_name;
-+ TzLocation *tz_location;
-+
-+ set_tz_from_name (tsd, g_strdup (timezone));
-+
-+ tz_name = get_selected_tz_name (tsd);
-+ tz_location = tz_get_location_by_name (tsd->cd->tzdb, tz_name);
-+ }
-+
-+ gtk_widget_set_sensitive (GW ("add_to_tip_button"),
-+ !multizone_is_zone_in_tip_list(tsd->cd, timezone));
-+
-+ return TRUE;
-+}
-+
-+static gboolean
-+out_map (GtkWidget * w, GdkEventCrossing * event, gpointer data)
-+{
-+ const char *old_zone;
-+ TimezoneSelectionDialog *tsd = (TimezoneSelectionDialog *) data;
-+ GtkWidget *location_label = GW ("location_label");
-+
-+ if (event->mode != GDK_CROSSING_NORMAL)
-+ return FALSE;
-+
-+ if (tsd->point_hover && tsd->point_hover != tsd->point_selected)
-+ e_map_point_set_color_rgba (tsd->map, tsd->point_hover,
-+ TZ_MAP_POINT_NORMAL_RGBA);
-+
-+ tsd->point_hover = NULL;
-+
-+ old_zone = gtk_label_get_text (GTK_LABEL (location_label));
-+
-+ if (strcmp (old_zone, ""))
-+ {
-+ gtk_label_set_text (GTK_LABEL (location_label), "");
-+ gtk_label_set_text (GTK_LABEL (GW ("time_clock_label")), "");
-+ }
-+
-+ return TRUE;
-+}
-+
-+static gboolean
-+button_pressed (GtkWidget * w, GdkEventButton * event, gpointer data)
-+{
-+ double longitude, latitude;
-+ TimezoneSelectionDialog *tsd = (TimezoneSelectionDialog *) data;
-+ GtkWidget *zoom_label = GW ("zoom_label");
-+
-+ e_map_window_to_world (tsd->map, (double) event->x, (double) event->y,
-+ &longitude, &latitude);
-+
-+ if (event->button != 1)
-+ {
-+ e_map_zoom_out (tsd->map);
-+ gtk_label_set_text (GTK_LABEL (zoom_label),
-+ _("Click your nearerst city or select it from the list (left click to zoom in):"));
-+ }
-+ else
-+ {
-+ GtkWidget *location_entry;
-+ TzLocation *tz_location;
-+ gchar *entry_text, *entry_text_new;
-+
-+ if (e_map_get_magnification (tsd->map) <= 1.0)
-+ e_map_zoom_to_location (tsd->map, longitude, latitude);
-+
-+ if (tsd->point_selected)
-+ e_map_point_set_color_rgba (tsd->map,
-+ tsd->point_selected,
-+ TZ_MAP_POINT_NORMAL_RGBA);
-+ tsd->point_selected = tsd->point_hover;
-+
-+ location_entry = GTK_COMBO (GW ("location_combo"))->entry;
-+ tz_location = tz_location_from_point (tsd, tsd->point_selected);
-+
-+ entry_text = (gchar *) gtk_entry_get_text (GTK_ENTRY (location_entry));
-+ entry_text_new = _(tz_location_get_zone (tz_location));
-+
-+
-+ if (!entry_text || !entry_text_new
-+ || g_utf8_collate (entry_text, entry_text_new))
-+ {
-+ gtk_entry_set_text (GTK_ENTRY (location_entry), entry_text_new);
-+ gtk_widget_set_sensitive (GW ("add_to_tip_button"),
-+ !multizone_is_zone_in_tip_list(tsd->cd, entry_text_new));
-+ }
-+ gtk_label_set_text (GTK_LABEL (zoom_label),
-+ _("Click your nearerst city or select it from the list (right click to zoom out):"));
-+ mark_selected_city (tsd, entry_text_new);
-+ }
-+
-+ return TRUE;
-+}
-+
-+static gboolean
-+motion (GtkWidget * widget, GdkEventMotion * event, gpointer data)
-+{
-+ TimezoneSelectionDialog *tsd = (TimezoneSelectionDialog *) data;
-+ double longitude, latitude;
-+ GtkWidget *time_label = GW ("time_clock_label");
-+ GtkWidget *location_label = GW ("location_label");
-+
-+
-+ e_map_window_to_world (tsd->map, (double) event->x, (double) event->y,
-+ &longitude, &latitude);
-+
-+ if (tsd->point_hover && tsd->point_hover != tsd->point_selected)
-+ e_map_point_set_color_rgba (tsd->map, tsd->point_hover,
-+ TZ_MAP_POINT_NORMAL_RGBA);
-+
-+ tsd->point_hover =
-+ e_map_get_closest_point (tsd->map, longitude, latitude, TRUE);
-+
-+ if (tsd->point_hover != tsd->point_selected)
-+ e_map_point_set_color_rgba (tsd->map, tsd->point_hover,
-+ TZ_MAP_POINT_HOVER_RGBA);
-+
-+ tsd->correction =
-+ tz_location_get_utc_offset (tz_location_from_point
-+ (tsd, tsd->point_hover));
-+
-+ /* e_tz_map_location_from_point() can in theory return NULL, but in
-+ * practice there are no reasons why it should */
-+
-+ gtk_label_set_text (GTK_LABEL (location_label),
-+ _(tz_location_get_zone
-+ (tz_location_from_point (tsd, tsd->point_hover))));
-+
-+ if (strcmp (gtk_label_get_text (GTK_LABEL (location_label)), "") == 0)
-+ {
-+ gtk_label_set_text (GTK_LABEL (time_label), "");
-+ }
-+ else
-+ {
-+ struct tm tm;
-+ time_t tt;
-+ char clock[256];
-+
-+ time (&tt);
-+ tt += tsd->correction;
-+ gmtime_r (&tt, &tm);
-+ memset (clock, 0, 256);
-+ sprintf (clock, "%02d:%02d:%02d", tm.tm_hour, tm.tm_min, tm.tm_sec);
-+ gtk_label_set_text (GTK_LABEL (time_label), clock);
-+ }
-+
-+
-+ return TRUE;
-+}
-+
-+static gboolean
-+flash_selected_point (gpointer data)
-+{
-+ TimezoneSelectionDialog *tsd = (TimezoneSelectionDialog *) data;
-+
-+ if (!IS_E_MAP (tsd->map))
-+ return FALSE;
-+
-+ if (!tsd->point_selected)
-+ return TRUE;
-+
-+ if (e_map_point_get_color_rgba (tsd->point_selected) ==
-+ TZ_MAP_POINT_SELECTED_1_RGBA)
-+ e_map_point_set_color_rgba (tsd->map, tsd->point_selected,
-+ TZ_MAP_POINT_SELECTED_2_RGBA);
-+ else
-+ e_map_point_set_color_rgba (tsd->map, tsd->point_selected,
-+ TZ_MAP_POINT_SELECTED_1_RGBA);
-+
-+ return TRUE;
-+}
-+
-+
-+static void
-+mark_selected_city (TimezoneSelectionDialog * tsd, gchar * defaultv)
-+{
-+ TzLocation *tz_loc = NULL;
-+ GPtrArray *locs;
-+ int i;
-+ double l_longitude = 0.0, l_latitude = 0.0;
-+ char *system_timezone = tz_get_system_timezone ();
-+
-+ if (!defaultv || !strcmp ("localtimezone", defaultv))
-+ tsd->zone = g_strdup (system_timezone);
-+ else
-+ {
-+ g_free (tsd->zone);
-+ tsd->zone = g_strdup (defaultv);
-+ }
-+
-+ locs = tz_get_locations (tsd->cd->tzdb);
-+
-+ for (i = 0; i < locs->len; i++)
-+ {
-+ tz_loc = g_ptr_array_index (locs, i);
-+
-+ if (tz_loc
-+ &&
-+ (!g_utf8_collate (_(tz_location_get_zone (tz_loc)), _(tsd->zone))))
-+ {
-+ tz_location_get_position (tz_loc, &l_longitude, &l_latitude);
-+ break;
-+ }
-+ }
-+
-+ if (tsd->point_selected)
-+ e_map_point_set_color_rgba (tsd->map,
-+ tsd->point_selected,
-+ TZ_MAP_POINT_NORMAL_RGBA);
-+ tsd->point_selected =
-+ e_map_get_closest_point (tsd->map, l_longitude, l_latitude, FALSE);
-+
-+ gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (GW ("location_combo"))->entry),
-+ _(tz_location_get_zone (tz_location_from_point
-+ (tsd, tsd->point_selected))));
-+}
-+
-+static void
-+reset_zone (GtkWidget * w, TimezoneSelectionDialog * tsd)
-+{
-+ char *current_zone = tz_get_system_timezone ();
-+
-+ mark_selected_city (tsd, current_zone);
-+
-+ g_free (current_zone);
-+}
-+
-+void
-+display_timezone_selection_dialog (BonoboUIComponent *uic,
-+ ClockData *cd,
-+ const gchar *verbname)
-+{
-+ GtkWidget *location_entry;
-+ GPtrArray *locs;
-+ GList *items = NULL;
-+ int i;
-+ TimezoneSelectionDialog *tsd;
-+
-+ if (cd->timezone_dialog)
-+ {
-+ gtk_window_set_screen (GTK_WINDOW (cd->timezone_dialog),
-+ gtk_widget_get_screen (cd->applet));
-+ gtk_window_present (GTK_WINDOW (cd->timezone_dialog));
-+ e_map_zoom_out (cd->tsd->map);
-+ return;
-+ }
-+
-+ tsd = g_new0 (TimezoneSelectionDialog, 1);
-+
-+ tsd->cd = cd;
-+ cd->tsd = tsd;
-+
-+ tsd->xml = glade_xml_new (GLADEDIR "/timezone.glade", NULL, NULL);
-+
-+ if (tsd->xml == NULL)
-+ {
-+ g_warning (G_STRLOC "timezone.glade cannot be found");
-+ return;
-+ }
-+ glade_xml_signal_autoconnect (tsd->xml);
-+
-+ tsd->map = e_map_new ();
-+
-+ e_map_set_smooth_zoom (tsd->map, TRUE);
-+
-+ gtk_widget_set_events (GTK_WIDGET (tsd->map),
-+ gtk_widget_get_events (GTK_WIDGET (tsd->map)) |
-+ GDK_LEAVE_NOTIFY_MASK | GDK_VISIBILITY_NOTIFY_MASK);
-+
-+ gtk_container_add (GTK_CONTAINER (GW ("map_window")),
-+ GTK_WIDGET (tsd->map));
-+ gtk_widget_show (GTK_WIDGET (tsd->map));
-+
-+
-+ if (!cd->tzdb)
-+ cd->tzdb = tz_load_db ();
-+ if (!cd->tzdb)
-+ {
-+ g_warning (G_STRLOC "Unable to load system timezone database.");
-+ return;
-+ }
-+
-+ locs = tz_get_locations (cd->tzdb);
-+
-+ for (i = 0; g_ptr_array_index (locs, i); i++)
-+ {
-+ TzLocation *tzl;
-+ tzl = g_ptr_array_index (locs, i);
-+ e_map_add_point (tsd->map, NULL, tzl->longitude, tzl->latitude,
-+ TZ_MAP_POINT_NORMAL_RGBA);
-+ items = g_list_append (items, _(tzl->zone));
-+ }
-+
-+ gtk_combo_set_popdown_strings (GTK_COMBO (GW ("location_combo")), items);
-+
-+ mark_selected_city (tsd, "localtimezone");
-+
-+ tsd->timeout = g_timeout_add (100, flash_selected_point, (gpointer) tsd);
-+
-+ g_signal_connect (G_OBJECT (tsd->map), "motion-notify-event",
-+ G_CALLBACK (motion), (gpointer) tsd);
-+ g_signal_connect (G_OBJECT (tsd->map), "button-press-event",
-+ G_CALLBACK (button_pressed), (gpointer) tsd);
-+ g_signal_connect (G_OBJECT (tsd->map), "leave-notify-event",
-+ G_CALLBACK (out_map), (gpointer) tsd);
-+
-+ location_entry = GTK_COMBO (GW ("location_combo"))->entry;
-+ g_signal_connect (G_OBJECT (location_entry), "changed",
-+ G_CALLBACK (update_map), (gpointer) tsd);
-+
-+ g_signal_connect (G_OBJECT (GW ("reset_button")), "clicked",
-+ G_CALLBACK (reset_zone), tsd);
-+
-+ g_signal_connect (G_OBJECT (GW ("helpbutton")), "clicked",
-+ G_CALLBACK (display_help), tsd);
-+
-+ tsd->dialog = GW ("timezone_dialog");
-+ cd->timezone_dialog = tsd->dialog;
-+
-+ gtk_window_set_screen (GTK_WINDOW (cd->timezone_dialog),
-+ gtk_widget_get_screen (cd->applet));
-+
-+ create_multizone_table (tsd);
-+
-+ gtk_widget_show_all (cd->timezone_dialog);
-+
-+}
---- gnome-panel-2.10.1/applets/clock/tz.c 1970-01-01 05:30:00.000000000 +0530
-+++ gnome-panel-2.10.1-new/applets/clock/tz.c 2005-06-30 22:37:14.823300904 +0530
-@@ -0,0 +1,499 @@
-+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-+/* Generic timezone utilities.
-+ *
-+ * Copyright (C) 2000-2001 Ximian, Inc.
-+ * Copyright (C) 2004 Sun Microsystems, Inc.
-+ *
-+ * Authors: Hans Petter Jansson <[email protected]>
-+ * additional functions by Erwann Chenede <[email protected]>
-+ *
-+ * Largely based on Michael Fulbright's work on Anaconda.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-+ */
-+
-+#include "tz.h"
-+
-+/* Forward declarations for private functions */
-+
-+static float convert_pos (gchar * pos, int digits);
-+static int compare_country_names (const void *a, const void *b);
-+static void sort_locations_by_country (GPtrArray * locations);
-+static gchar *tz_data_file_get (void);
-+
-+extern char **environ;
-+#ifdef HAVE_SOLARIS
-+extern time_t timezone;
-+extern char *tzname[2];
-+#endif
-+
-+/* ---------------- *
-+ * Public interface *
-+ * ---------------- */
-+
-+struct tm *
-+tz_get_localtime_at (const char *zone,
-+ const time_t *now)
-+{
-+ char **environ_old;
-+ char **envp;
-+ struct tm *retval;
-+ int i, env_len, tz_index;
-+
-+ tz_index = -1;
-+ for (env_len = 0; environ [env_len]; env_len++)
-+ if (!strncmp (environ [env_len], "TZ=", strlen ("TZ=")))
-+ tz_index = env_len;
-+
-+ if (tz_index == -1)
-+ tz_index = env_len++;
-+
-+ envp = g_new0 (char *, env_len + 1);
-+
-+ for (i = 0; i < env_len; i++)
-+ if (i == tz_index)
-+ envp [i] = g_strconcat ("TZ=", zone, NULL);
-+ else
-+ envp [i] = g_strdup (environ [i]);
-+
-+ environ_old = environ;
-+ environ = envp;
-+
-+ retval = localtime (now);
-+
-+ environ = environ_old;
-+ g_strfreev (envp);
-+
-+ return retval;
-+}
-+
-+TzDB *
-+tz_load_db (void)
-+{
-+ gchar *tz_data_file;
-+ TzDB *tz_db;
-+ FILE *tzfile;
-+ char buf[4096];
-+
-+ tz_data_file = tz_data_file_get ();
-+ if (!tz_data_file)
-+ {
-+ g_warning ("Could not get the TimeZone data file name");
-+ return NULL;
-+ }
-+ tzfile = fopen (tz_data_file, "r");
-+ if (!tzfile)
-+ {
-+ g_warning ("Could not open *%s*\n", tz_data_file);
-+ g_free (tz_data_file);
-+ return NULL;
-+ }
-+
-+ tz_db = g_new0 (TzDB, 1);
-+ tz_db->locations = g_ptr_array_new ();
-+
-+ while (fgets (buf, sizeof (buf), tzfile))
-+ {
-+ gchar **tmpstrarr;
-+ gchar *latstr, *lngstr, *p;
-+ TzLocation *loc;
-+
-+ if (*buf == '#')
-+ continue;
-+
-+ g_strchomp (buf);
-+ tmpstrarr = g_strsplit (buf, "\t", 4);
-+
-+ latstr = g_strdup (tmpstrarr[1]);
-+ p = latstr + 1;
-+ while (*p != '-' && *p != '+')
-+ p++;
-+ lngstr = g_strdup (p);
-+ *p = '\0';
-+
-+ loc = g_new (TzLocation, 1);
-+ loc->country = g_strdup (tmpstrarr[0]);
-+ loc->zone = g_strdup (tmpstrarr[2]);
-+ loc->comment = (tmpstrarr[3]) ? g_strdup (tmpstrarr[3]) : NULL;
-+ loc->latitude = convert_pos (latstr, 2);
-+ loc->longitude = convert_pos (lngstr, 3);
-+
-+ g_ptr_array_add (tz_db->locations, (gpointer) loc);
-+
-+ g_free (latstr);
-+ g_free (lngstr);
-+ g_strfreev (tmpstrarr);
-+ }
-+
-+ fclose (tzfile);
-+
-+ /* now sort by country */
-+ sort_locations_by_country (tz_db->locations);
-+
-+ /* added a NULL pointer at the end of the array to prevent errors. Carlos */
-+ g_ptr_array_add (tz_db->locations, (gpointer) NULL);
-+
-+ g_free (tz_data_file);
-+
-+ return tz_db;
-+}
-+void
-+tz_location_free (TzLocation * tz)
-+{
-+
-+ if (tz->country)
-+ g_free (tz->country);
-+ if (tz->zone)
-+ g_free (tz->zone);
-+ if (tz->comment)
-+ g_free (tz->comment);
-+
-+ g_free (tz);
-+}
-+
-+void
-+tz_free_db (TzDB *tz_db)
-+{
-+ int i;
-+ for (i = 0; g_ptr_array_index (tz_db->locations, i); i++)
-+ {
-+ TzLocation *loc = g_ptr_array_index (tz_db->locations, i);
-+ tz_location_free (loc);
-+ }
-+ g_ptr_array_free (tz_db->locations, FALSE);
-+ g_free (tz_db);
-+}
-+
-+GPtrArray *
-+tz_get_locations (TzDB * db)
-+{
-+ return db->locations;
-+}
-+
-+
-+gchar *
-+tz_location_get_country (TzLocation * loc)
-+{
-+ return loc->country;
-+}
-+
-+
-+gchar *
-+tz_location_get_zone (TzLocation * loc)
-+{
-+ return loc->zone;
-+}
-+
-+
-+gchar *
-+tz_location_get_comment (TzLocation * loc)
-+{
-+ return loc->comment;
-+}
-+
-+
-+void
-+tz_location_get_position (TzLocation * loc, double *longitude,
-+ double *latitude)
-+{
-+ *longitude = loc->longitude;
-+ *latitude = loc->latitude;
-+}
-+
-+
-+
-+
-+TzInfo *
-+tz_info_from_location (TzLocation * loc)
-+{
-+ TzInfo *tzinfo;
-+ time_t curtime;
-+ struct tm *curzone;
-+
-+ g_return_val_if_fail (loc != NULL, NULL);
-+ g_return_val_if_fail (loc->zone != NULL, NULL);
-+
-+ tzinfo = g_new0 (TzInfo, 1);
-+
-+ curtime = time (NULL);
-+ curzone = tz_get_localtime_at (loc->zone, &curtime);
-+#if 0
-+ g_print ("%s %s %d\n", curzone->tm_zone,
-+ &curzone->tm_zone[curzone->tm_isdst], curzone->tm_isdst);
-+#endif
-+
-+#ifdef HAVE_LINUX
-+ tzinfo->tzname_normal = g_strdup (curzone->tm_zone);
-+ if (curzone->tm_isdst)
-+ tzinfo->tzname_daylight = g_strdup (&curzone->tm_zone[curzone->tm_isdst]);
-+ else
-+ tzinfo->tzname_daylight = NULL;
-+
-+ tzinfo->utc_offset = curzone->tm_gmtoff;
-+#endif
-+
-+
-+#ifdef HAVE_SOLARIS
-+ tzinfo->tzname_normal = g_strdup (loc->zone);
-+
-+ if (curzone->tm_isdst)
-+ tzinfo->tzname_daylight = g_strdup (tzname[0]);
-+ else
-+ tzinfo->tzname_daylight = NULL;
-+
-+ tzinfo->utc_offset -= (timezone - 3600);
-+#endif
-+ tzinfo->daylight = curzone->tm_isdst;
-+
-+ return tzinfo;
-+}
-+
-+glong
-+tz_location_get_utc_offset (TzLocation * loc)
-+{
-+ TzInfo *tz_info;
-+ glong offset;
-+
-+ tz_info = tz_info_from_location (loc);
-+ offset = tz_info->utc_offset;
-+ tz_info_free (tz_info);
-+ return offset;
-+}
-+
-+void
-+tz_info_free (TzInfo * tzinfo)
-+{
-+ g_return_if_fail (tzinfo != NULL);
-+
-+ if (tzinfo->tzname_normal)
-+ g_free (tzinfo->tzname_normal);
-+ if (tzinfo->tzname_daylight)
-+ g_free (tzinfo->tzname_daylight);
-+ g_free (tzinfo);
-+}
-+
-+#ifdef HAVE_LINUX
-+static gboolean
-+find_from_inode (char *dir, int inode, char **filename)
-+{
-+ int num_dirent, i;
-+ struct dirent **namelist;
-+
-+ num_dirent = scandir (dir, &namelist, 0, alphasort);
-+
-+ if (num_dirent == 0)
-+ return FALSE;
-+
-+ for (i = 0; i < num_dirent; i++)
-+ {
-+ struct stat file_st;
-+
-+ if (strcmp (namelist[i]->d_name, ".") != 0 &&
-+ strcmp (namelist[i]->d_name, "..") != 0)
-+ {
-+ char path[1024];
-+
-+ sprintf (path, "%s/%s", dir, namelist[i]->d_name);
-+
-+ if (stat (path, &file_st) == 0)
-+ {
-+
-+ if (S_ISDIR (file_st.st_mode))
-+ {
-+ if (find_from_inode (path, inode, filename))
-+ {
-+ g_free (namelist);
-+ return TRUE;
-+ }
-+ }
-+ else if (inode == file_st.st_ino)
-+ {
-+ *filename = g_strdup (path);
-+ g_free (namelist);
-+ return TRUE;
-+ }
-+ }
-+ else
-+ {
-+ g_free (namelist);
-+ return FALSE;
-+ }
-+ }
-+ }
-+ g_free (namelist);
-+ return FALSE;
-+}
-+#endif
-+
-+char *
-+tz_get_system_timezone (void)
-+{
-+ struct stat st_clock, st_lt;
-+
-+ int fd, status;
-+
-+ char *tmpfilebuf, *tok_res, **toks, *file, *tz;
-+
-+ status = stat (SYS_CLOCK_FILE, &st_clock);
-+
-+ if (status == 0)
-+ {
-+ fd = open (SYS_CLOCK_FILE, O_RDONLY);
-+
-+ if (fd > 0)
-+ {
-+ tmpfilebuf = g_new (char, st_clock.st_size + 1);
-+
-+ status = read (fd, tmpfilebuf, st_clock.st_size);
-+
-+ close (fd);
-+
-+ if (status == st_clock.st_size)
-+ {
-+ printf ("ZONE_TOKEN is %s\n", ZONE_TOKEN);
-+ tok_res = strstr (tmpfilebuf, ZONE_TOKEN);
-+
-+ if (tok_res) /* found timezone */
-+ {
-+ char *tz = NULL, **toks2;
-+#ifdef HAVE_SOLARIS
-+ toks = g_strsplit (tok_res, "\n", 3);
-+
-+ if (toks[0])
-+ {
-+ toks2 = g_strsplit (toks[0], ZONE_TOKEN, 3);
-+ }
-+ g_strfreev (toks);
-+
-+ tz = g_strdup (toks2[1]);
-+#endif
-+#ifdef HAVE_LINUX
-+ toks = g_strsplit (tok_res, "\"", 3);
-+
-+ tz = g_strdup (toks[1]);
-+ g_strfreev (toks);
-+#endif
-+ g_free (tmpfilebuf);
-+ return tz;
-+ }
-+ }
-+ }
-+ }
-+
-+
-+#ifdef HAVE_LINUX
-+ /* the SYS_CLOCK_FILE didn't contain timezone info
-+ * find the timezone from hard link LOCALTIME_FILE */
-+
-+ status = stat (LOCALTIME_FILE, &st_lt);
-+
-+ if (find_from_inode (ZONE_DIR, st_lt.st_ino, &file))
-+ {
-+ file += strlen (ZONE_DIR) + 1; /* +1 is for the / */
-+
-+ tz = g_strdup (file);
-+ g_free (file);
-+ return tz;
-+ }
-+#endif
-+ return NULL;
-+}
-+
-+
-+/* ----------------- *
-+ * Private functions *
-+ * ----------------- */
-+
-+static gchar *
-+tz_data_file_get (void)
-+{
-+ gchar *file;
-+
-+ file = g_strdup (TZ_DATA_FILE);
-+
-+ return file;
-+}
-+
-+static float
-+convert_pos (gchar * pos, int digits)
-+{
-+ gchar whole[10];
-+ gchar *fraction;
-+ gint i;
-+ float t1, t2;
-+
-+ if (!pos || strlen (pos) < 4 || digits > 9)
-+ return 0.0;
-+
-+ for (i = 0; i < digits + 1; i++)
-+ whole[i] = pos[i];
-+ whole[i] = '\0';
-+ fraction = pos + digits + 1;
-+
-+ t1 = g_strtod (whole, NULL);
-+ t2 = g_strtod (fraction, NULL);
-+
-+ if (t1 >= 0.0)
-+ return t1 + t2 / pow (10.0, strlen (fraction));
-+ else
-+ return t1 - t2 / pow (10.0, strlen (fraction));
-+}
-+
-+
-+
-+
-+static int
-+compare_country_names (const void *a, const void *b)
-+{
-+ const TzLocation *tza = *(TzLocation **) a;
-+ const TzLocation *tzb = *(TzLocation **) b;
-+
-+ return strcmp (tza->zone, tzb->zone);
-+}
-+
-+
-+static void
-+sort_locations_by_country (GPtrArray * locations)
-+{
-+ qsort (locations->pdata, locations->len, sizeof (gpointer),
-+ compare_country_names);
-+}
-+
-+TzLocation *
-+tz_get_location_by_name (TzDB *tzdb, gchar * name)
-+{
-+ TzLocation *tz_loc = NULL;
-+ GPtrArray *locs;
-+ int i;
-+
-+ locs = tz_get_locations (tzdb);
-+
-+ for (i = 0; i < locs->len; i++)
-+ {
-+ TzLocation *tz_loc_temp;
-+
-+ tz_loc_temp = g_ptr_array_index (locs, i);
-+
-+ if (tz_loc_temp
-+ && !g_utf8_collate (_(tz_location_get_zone (tz_loc_temp)), _(name)))
-+ {
-+ tz_loc = tz_loc_temp;
-+ break;
-+ }
-+ }
-+
-+ return tz_loc;
-+}
-+
---- gnome-panel-2.10.1/applets/clock/tz.h 1970-01-01 05:30:00.000000000 +0530
-+++ gnome-panel-2.10.1-new/applets/clock/tz.h 2005-06-30 22:37:14.824300752 +0530
-@@ -0,0 +1,113 @@
-+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-+/* Generic timezone utilities.
-+ *
-+ * Copyright (C) 2000-2001 Ximian, Inc.
-+ * Copyright (C) 2004 Sun Microsystems, Inc.
-+ *
-+ * Authors: Hans Petter Jansson <[email protected]>
-+ * Erwann Chenede <[email protected]>
-+ *
-+ *
-+ * Largely based on Michael Fulbright's work on Anaconda.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-+ */
-+
-+
-+#ifndef _E_TZ_H
-+#define _E_TZ_H
-+
-+#include <glib.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <time.h>
-+#include <math.h>
-+#include <string.h>
-+#include <dirent.h>
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+#include <fcntl.h>
-+#include <time.h>
-+#include <config.h>
-+#include <libgnome/libgnome.h>
-+
-+#ifdef HAVE_LINUX
-+#define TZ_DATA_FILE "/usr/share/zoneinfo/zone.tab"
-+#define ZONE_TOKEN "TIMEZONE=\""
-+#define SYS_CLOCK_FILE "/etc/sysconfig/clock"
-+#endif
-+#ifdef HAVE_SOLARIS
-+#define TZ_DATA_FILE "/usr/share/lib/zoneinfo/tab/zone_sun.tab"
-+#define ZONE_TOKEN "TZ="
-+#define SYS_CLOCK_FILE "/etc/TIMEZONE"
-+#endif
-+
-+#define LOCALTIME_FILE "/etc/localtime"
-+#define ZONE_DIR "/usr/share/zoneinfo"
-+
-+typedef struct _TzDB TzDB;
-+typedef struct _TzLocation TzLocation;
-+typedef struct _TzInfo TzInfo;
-+
-+
-+struct _TzDB
-+{
-+ GPtrArray *locations;
-+};
-+
-+struct _TzLocation
-+{
-+ gchar *country;
-+ gdouble latitude;
-+ gdouble longitude;
-+ gchar *zone;
-+ gchar *comment;
-+};
-+
-+/* see the glibc info page information on time zone information */
-+/* tzname_normal is the default name for the timezone */
-+/* tzname_daylight is the name of the zone when in daylight savings */
-+/* utc_offset is offset in seconds from utc */
-+/* daylight if non-zero then location obeys daylight savings */
-+
-+struct _TzInfo
-+{
-+ gchar *tzname_normal;
-+ gchar *tzname_daylight;
-+ glong utc_offset;
-+ gint daylight;
-+};
-+
-+
-+TzDB *tz_load_db (void);
-+void tz_free_db (TzDB *tz_db);
-+GPtrArray *tz_get_locations (TzDB *db);
-+void tz_location_get_position (TzLocation *loc,
-+ double *longitude, double *latitude);
-+char *tz_location_get_country (TzLocation *loc);
-+gchar *tz_location_get_zone (TzLocation *loc);
-+gchar *tz_location_get_comment (TzLocation *loc);
-+glong tz_location_get_utc_offset (TzLocation *loc);
-+gint tz_location_set_locally (TzLocation *loc);
-+TzInfo *tz_info_from_location (TzLocation *loc);
-+void tz_info_free (TzInfo *tz_info);
-+void tz_location_free (TzLocation *loc);
-+struct tm *tz_get_localtime_at (const char *zone,
-+ const time_t *now);
-+char * tz_get_system_timezone (void);
-+TzLocation * tz_get_location_by_name (TzDB *tzdb,
-+ gchar * name);
-+#endif
---- gnome-panel-2.10.1/config.h.in 2005-04-04 00:06:08.000000000 +0530
-+++ gnome-panel-2.10.1-new/config.h.in 2005-06-30 22:37:14.826300448 +0530
-@@ -102,3 +102,6 @@
-
- /* Define to 1 if the X Window System is missing or not being used. */
- #undef X_DISPLAY_MISSING
-+
-+#undef HAVE_SOLARIS
-+#undef HAVE_LINUX
---- gnome-panel-2.10.1/configure.in 2005-06-30 22:37:05.622699608 +0530
-+++ gnome-panel-2.10.1-new/configure.in 2005-06-30 22:37:51.583712472 +0530
-@@ -137,7 +137,7 @@ if test -n "$LIBECAL_REQUIREMENT"; then
- fi
- AM_CONDITIONAL(HAVE_LIBECAL, test -n "$LIBECAL_REQUIREMENT")
-
--PKG_CHECK_MODULES(CLOCK, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED $LIBECAL_REQUIREMENT)
-+PKG_CHECK_MODULES(CLOCK, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED $LIBECAL_REQUIREMENT libglade-2.0 >= $LIBGLADE_REQUIRED)
- AC_SUBST(CLOCK_CFLAGS)
- AC_SUBST(CLOCK_LIBS)
-
-@@ -216,6 +216,18 @@ fi
-
- AM_GCONF_SOURCE_2
-
-+dnl platform test
-+case $host in
-+*-*-solaris*)
-+ ostype=solaris
-+ AC_DEFINE(HAVE_SOLARIS, 1, [Define to 1])
-+ ;;
-+*-*-linux*)
-+ ostype=linux
-+ AC_DEFINE(HAVE_LINUX, 1, [Define to 1])
-+ ;;
-+esac
-+
- dnl Don't use AC_PROG_AWK since we need the full pathname.
- AC_PATH_PROGS(AWK, mawk gawk nawk awk, )
- AC_PATH_PROGS(PERL, perl5 perl)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/gnome-panel-11-launch-menu.diff Sat May 13 17:59:05 2006 +0000
@@ -0,0 +1,368 @@
+diff -rup ../gnome-panel-before-patch-13/gnome-panel/menu.c gnome-panel-2.14.1/gnome-panel/menu.c
+--- ../gnome-panel-before-patch-13/gnome-panel/menu.c 2006-05-13 18:33:27.942178000 +0200
++++ gnome-panel-2.14.1/gnome-panel/menu.c 2006-05-13 18:42:56.057327000 +0200
+@@ -49,6 +49,8 @@
+ #include "panel-run-dialog.h"
+ #include "panel-lockdown.h"
+
++#define COMPUTER_NAME_KEY "/apps/nautilus/desktop/computer_icon_name"
++
+ typedef struct {
+ GtkWidget *pixmap;
+ const char *stock_id;
+@@ -1779,12 +1781,94 @@ setup_menu_item_with_icon (GtkWidget *
+ }
+
+ static void
++run_applications (GtkWidget *widget, gpointer user_data)
++{
++ if (!panel_lockdown_get_restrict_application_launching() &&
++ !panel_lockdown_get_disable_command_line()) {
++ panel_run_dialog_present (gtk_widget_get_screen (widget),
++ gtk_get_current_event_time ());
++ }
++}
++
++static void
++applications_menu_append (GtkWidget *main_menu)
++{
++ GtkWidget *item;
++ GtkWidget *accel_label;
++ GtkWidget *image;
++
++ if (panel_lockdown_get_disable_command_line())
++ return;
++
++ if (!g_object_get_data (G_OBJECT (main_menu),
++ "panel-menu-needs-appending"))
++ return;
++
++ g_object_set_data (G_OBJECT (main_menu),
++ "panel-menu-needs-appending", NULL);
++
++ add_menu_separator (main_menu);
++
++ item = gtk_image_menu_item_new ();
++
++ accel_label = gtk_accel_label_new (_("Run Application..."));
++ gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
++
++ gtk_container_add (GTK_CONTAINER (item), accel_label);
++ gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label),
++ GTK_WIDGET (item));
++ gtk_widget_show (accel_label);
++
++ image = gtk_image_new_from_icon_name (PANEL_RUN_ICON, panel_menu_icon_get_size ());
++ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
++
++ g_signal_connect (item, "activate",
++ G_CALLBACK (run_applications), NULL);
++ gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), item);
++ gtk_widget_show (item);
++}
++
++GtkWidget *
++add_xdg_menu (const char *name, const char *path, const char *icon)
++{
++ GtkWidget *item;
++ GtkWidget *accel_label;
++ GtkWidget *image;
++ GtkWidget *menu;
++
++ item = gtk_image_menu_item_new ();
++
++ accel_label = gtk_accel_label_new (name);
++ gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
++
++ gtk_container_add (GTK_CONTAINER (item), accel_label);
++ gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label),
++ GTK_WIDGET (item));
++ gtk_widget_show (accel_label);
++
++ image = gtk_image_new_from_icon_name (icon, panel_menu_icon_get_size ());
++
++ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
++ menu = create_applications_menu (path, NULL);
++
++
++ if (strcmp (name, "applications.menu") !=0) {
++ g_signal_connect (menu, "show",
++ G_CALLBACK (applications_menu_append), NULL);
++ }
++
++ gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), menu);
++
++ return item;
++}
++
++static void
+ main_menu_append (GtkWidget *main_menu,
+ PanelWidget *panel)
+ {
+ GtkWidget *item;
+- gboolean add_separator;
+- GList *children;
++ EggRecentViewGtk *recent_view;
++ char *gconf_name;
+
+ if (!g_object_get_data (G_OBJECT (main_menu),
+ "panel-menu-needs-appending"))
+@@ -1793,44 +1877,64 @@ main_menu_append (GtkWidget *main_menu
+ g_object_set_data (G_OBJECT (main_menu),
+ "panel-menu-needs-appending", NULL);
+
+- children = gtk_container_get_children (GTK_CONTAINER (main_menu));
++ item = add_xdg_menu (_("All Applications"), "applications.menu", "gnome-applications");
++ gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), item);
++ gtk_widget_show (item);
+
+- add_separator = FALSE;
+- if (children != NULL) {
+- while (children->next != NULL)
+- children = children->next;
+- add_separator = !GTK_IS_SEPARATOR (GTK_WIDGET (children->data));
+- }
++ add_menu_separator (main_menu);
+
+- if (add_separator)
+- add_menu_separator (main_menu);
++ gconf_name = gconf_client_get_string (panel_gconf_get_client (),
++ COMPUTER_NAME_KEY,
++ NULL);
++ panel_menu_items_append_from_desktop (main_menu,
++ "nautilus-computer.desktop",
++ gconf_name);
++ if (gconf_name)
++ g_free (gconf_name);
+
+ item = panel_place_menu_item_new (TRUE);
+ panel_place_menu_item_set_panel (item, panel);
+ gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), item);
+ gtk_widget_show (item);
+
+- item = panel_desktop_menu_item_new (TRUE, FALSE);
+- panel_desktop_menu_item_set_panel (item, panel);
+- gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), item);
++ recent_view = NULL;
++ recent_view = panel_recent_append_documents_menu (main_menu, recent_view);
++ panel_menu_items_append_from_desktop (main_menu,
++ "gnome-search-tool.desktop",
++ NULL);
++
++ add_menu_separator (main_menu);
++ add_menu_separator (main_menu);
++
++ item = add_xdg_menu (_("Preferences"), "preferences.menu", "gnome-settings");
++ gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), item);
++ gtk_widget_show (item);
++
++ item = add_xdg_menu (_("Administration"), "settings.menu", "gnome-system");
++ gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), item);
+ gtk_widget_show (item);
+
++ panel_menu_items_append_from_desktop (main_menu,
++ "yelp.desktop",
++ NULL);
++
+ panel_menu_items_append_lock_logout (main_menu);
+ }
+
+ GtkWidget *
+ create_main_menu (PanelWidget *panel)
+ {
+- GtkWidget *main_menu;
++ GtkWidget *main_menu;
++
++ main_menu = create_applications_menu ("quickstart.menu", NULL);
+
+- main_menu = create_applications_menu ("applications.menu", NULL);
+- g_object_set_data (G_OBJECT (main_menu), "menu_panel", panel);
+- /* FIXME need to update the panel on parent_set */
++ g_object_set_data (G_OBJECT (main_menu), "menu_panel", panel);
++ /* FIXME need to update the panel on parent_set */
+
+- g_signal_connect (main_menu, "show",
+- G_CALLBACK (main_menu_append), panel);
++ g_signal_connect (main_menu, "show",
++ G_CALLBACK (main_menu_append), panel);
+
+- return main_menu;
++ return main_menu;
+ }
+
+ static GList *
+diff -rup ../gnome-panel-before-patch-13/gnome-panel/panel-menu-button.c gnome-panel-2.14.1/gnome-panel/panel-menu-button.c
+--- ../gnome-panel-before-patch-13/gnome-panel/panel-menu-button.c 2006-05-13 18:33:28.326358000 +0200
++++ gnome-panel-2.14.1/gnome-panel/panel-menu-button.c 2006-05-13 18:41:35.453211000 +0200
+@@ -38,6 +38,8 @@
+ #include "panel-lockdown.h"
+ #include "panel-a11y.h"
+
++#define COMPUTER_NAME_KEY "/apps/nautilus/desktop/computer_icon_name"
++
+ #define PANEL_MENU_BUTTON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PANEL_TYPE_MENU_BUTTON, PanelMenuButtonPrivate))
+
+ enum {
+@@ -398,6 +400,18 @@ panel_menu_button_create_menu (PanelMenu
+ }
+
+ static void
++panel_menu_button_reload_menus (GConfClient *client,
++ guint cnxn_id,
++ GConfEntry *entry,
++ PanelMenuButton *button)
++{
++ if (button->priv->menu) {
++ gtk_widget_destroy (GTK_WIDGET (button->priv->menu));
++ panel_menu_button_create_menu (button);
++ }
++}
++
++static void
+ panel_menu_button_recreate_menu (PanelMenuButton *button)
+ {
+ if (button->priv->menu)
+@@ -694,6 +708,11 @@ panel_menu_button_load (const char *men
+
+ panel_lockdown_notify_add (G_CALLBACK (panel_menu_button_recreate_menu),
+ button);
++
++ panel_gconf_notify_add_while_alive (COMPUTER_NAME_KEY,
++ (GConfClientNotifyFunc) panel_menu_button_reload_menus,
++ G_OBJECT (button));
++
+ }
+
+ static char *
+diff -rup ../gnome-panel-before-patch-13/gnome-panel/panel-menu-items.c gnome-panel-2.14.1/gnome-panel/panel-menu-items.c
+--- ../gnome-panel-before-patch-13/gnome-panel/panel-menu-items.c 2006-05-13 18:33:28.326736000 +0200
++++ gnome-panel-2.14.1/gnome-panel/panel-menu-items.c 2006-05-13 18:44:44.072133000 +0200
+@@ -54,8 +54,6 @@
+ #define DESKTOP_IS_HOME_DIR_DIR "/apps/nautilus/preferences"
+ #define DESKTOP_IS_HOME_DIR_KEY "/apps/nautilus/preferences/desktop_is_home_dir"
+ #define NAMES_DIR "/apps/nautilus/desktop"
+-#define HOME_NAME_KEY "/apps/nautilus/desktop/home_icon_name"
+-#define COMPUTER_NAME_KEY "/apps/nautilus/desktop/computer_icon_name"
+ #define MAX_ITEMS_OR_SUBMENU 5
+
+ #define PANEL_PLACE_MENU_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PANEL_TYPE_PLACE_MENU_ITEM, PanelPlaceMenuItemPrivate))
+@@ -118,7 +116,7 @@ activate_uri (GtkWidget *menuitem,
+ g_free (url);
+ }
+
+-static void
++void
+ panel_menu_items_append_from_desktop (GtkWidget *menu,
+ char *path,
+ char *force_name)
+@@ -579,18 +577,10 @@ panel_place_menu_item_create_menu (EggRe
+ GtkWidget *places_menu;
+ GtkWidget *item;
+ char *gconf_name;
++ char *documents_link;
+
+ places_menu = panel_create_menu ();
+
+- gconf_name = gconf_client_get_string (panel_gconf_get_client (),
+- HOME_NAME_KEY,
+- NULL);
+- panel_menu_items_append_from_desktop (places_menu,
+- "nautilus-home.desktop",
+- gconf_name);
+- if (gconf_name)
+- g_free (gconf_name);
+-
+ if (!gconf_client_get_bool (panel_gconf_get_client (),
+ DESKTOP_IS_HOME_DIR_KEY,
+ NULL))
+@@ -606,18 +596,19 @@ panel_place_menu_item_create_menu (EggRe
+ G_CALLBACK (activate_uri),
+ "Desktop");
+
++ documents_link = g_build_filename (g_get_home_dir (), "Documents", NULL);
++
++ panel_menu_items_append_place_item ("gnome-fs-directory",
++ _("Documents"),
++ _("Open Documents folder"),
++ places_menu,
++ G_CALLBACK (activate_uri),
++ documents_link);
++ g_free (documents_link);
++
+ panel_place_menu_item_append_gtk_bookmarks (places_menu);
+ add_menu_separator (places_menu);
+
+- gconf_name = gconf_client_get_string (panel_gconf_get_client (),
+- COMPUTER_NAME_KEY,
+- NULL);
+- panel_menu_items_append_from_desktop (places_menu,
+- "nautilus-computer.desktop",
+- gconf_name);
+- if (gconf_name)
+- g_free (gconf_name);
+-
+ panel_menu_items_append_from_desktop (places_menu,
+ "nautilus-cd-burner.desktop",
+ NULL);
+@@ -637,15 +628,6 @@ panel_place_menu_item_create_menu (EggRe
+ item);
+ }
+
+- add_menu_separator (places_menu);
+-
+- panel_menu_items_append_from_desktop (places_menu,
+- "gnome-search-tool.desktop",
+- NULL);
+-
+- *recent_view = panel_recent_append_documents_menu (places_menu,
+- *recent_view);
+-
+ return places_menu;
+ }
+
+@@ -821,15 +803,9 @@ panel_place_menu_item_instance_init (Pan
+ GCONF_CLIENT_PRELOAD_NONE,
+ NULL);
+
+- panel_gconf_notify_add_while_alive (HOME_NAME_KEY,
+- (GConfClientNotifyFunc) panel_place_menu_item_key_changed,
+- G_OBJECT (menuitem));
+ panel_gconf_notify_add_while_alive (DESKTOP_IS_HOME_DIR_KEY,
+ (GConfClientNotifyFunc) panel_place_menu_item_key_changed,
+ G_OBJECT (menuitem));
+- panel_gconf_notify_add_while_alive (COMPUTER_NAME_KEY,
+- (GConfClientNotifyFunc) panel_place_menu_item_key_changed,
+- G_OBJECT (menuitem));
+
+ bookmarks_filename = g_build_filename (g_get_home_dir (),
+ BOOKMARKS_FILENAME, NULL);
+@@ -953,7 +929,6 @@ panel_desktop_menu_item_get_type (void)
+ return type;
+ }
+
+-
+ GtkWidget *
+ panel_place_menu_item_new (gboolean use_image)
+ {
+@@ -962,7 +937,7 @@ panel_place_menu_item_new (gboolean use_
+
+ menuitem = g_object_new (PANEL_TYPE_PLACE_MENU_ITEM, NULL);
+
+- accel_label = gtk_accel_label_new (_("Places"));
++ accel_label = gtk_accel_label_new (g_get_user_name ());
+ gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
+
+ gtk_container_add (GTK_CONTAINER (menuitem), accel_label);
+diff -rup ../gnome-panel-before-patch-13/gnome-panel/panel-menu-items.h gnome-panel-2.14.1/gnome-panel/panel-menu-items.h
+--- ../gnome-panel-before-patch-13/gnome-panel/panel-menu-items.h 2006-05-13 18:33:28.340364000 +0200
++++ gnome-panel-2.14.1/gnome-panel/panel-menu-items.h 2006-05-13 18:41:35.455784000 +0200
+@@ -90,6 +90,9 @@ void panel_desktop_menu_item_set_panel (
+ void panel_menu_items_append_lock_logout (GtkWidget *menu);
+ void panel_menu_item_activate_desktop_file (GtkWidget *menuitem,
+ const char *path);
++void panel_menu_items_append_from_desktop (GtkWidget *menu,
++ char *path,
++ char *force_name);
+
+ G_END_DECLS
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/gnome-panel-12-branding-hack.diff Sat May 13 17:59:05 2006 +0000
@@ -0,0 +1,12 @@
+diff -rup gnome-panel-2.14.1/gnome-panel/panel-menu-button.c ../gnome-panel-2.14.1/gnome-panel/panel-menu-button.c
+--- gnome-panel-2.14.1/gnome-panel/panel-menu-button.c 2006-05-13 19:57:07.483222000 +0200
++++ ../gnome-panel-2.14.1/gnome-panel/panel-menu-button.c 2006-05-13 19:57:47.701623000 +0200
+@@ -683,7 +683,7 @@ panel_menu_button_load (const char *men
+ "tooltip", tooltip,
+ "use-menu-path", use_menu_path,
+ "use-custom-icon", use_custom_icon,
+- "has-arrow", TRUE,
++ "has-arrow", FALSE,
+ NULL);
+
+ info = panel_applet_register (GTK_WIDGET (button), NULL, NULL,
--- a/patches/gnome-panel-12-restrict-app-launching.diff Sat May 13 01:34:47 2006 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1555 +0,0 @@
---- gnome-panel-2.14.1.old/gnome-panel/applet.c 2006-01-22 15:01:30.000000000 +0000
-+++ gnome-panel-2.14.1/gnome-panel/applet.c 2006-04-21 11:06:11.736713000 +0100
-@@ -159,6 +159,31 @@
- info->menu = panel_applet_create_menu (info);
- }
-
-+static void panel_applet_check_visibility(AppletInfo *info)
-+{
-+ if (info->type == PANEL_OBJECT_LAUNCHER) {
-+ if (panel_launcher_is_forbidden(info->data)) {
-+ gtk_widget_hide(info->widget) ;
-+ }
-+ else { gtk_widget_show(info->widget) ; }
-+ }
-+}
-+
-+static void panel_applet_refresh_state(AppletInfo *info)
-+{
-+ if (info->type == PANEL_OBJECT_BONOBO) {
-+ if (!panel_applet_frame_refresh(info->data)) {
-+ /* If the applet frame was rebuilt, no point in
-+ recreating the menu. */
-+ panel_applet_recreate_menu(info) ;
-+ }
-+ }
-+ else {
-+ panel_applet_check_visibility(info) ;
-+ panel_applet_recreate_menu(info) ;
-+ }
-+}
-+
- static void
- panel_applet_locked_change_notify (GConfClient *client,
- guint cnxn_id,
-@@ -738,8 +763,7 @@
- }
- }
-
-- if (info->type != PANEL_OBJECT_BONOBO)
-- panel_lockdown_notify_remove (G_CALLBACK (panel_applet_recreate_menu),
-+ panel_lockdown_notify_remove (G_CALLBACK (panel_applet_refresh_state),
- info);
-
- if (info->menu)
-@@ -1182,8 +1206,7 @@
-
- g_object_set_data (G_OBJECT (applet), "applet_info", info);
-
-- if (type != PANEL_OBJECT_BONOBO)
-- panel_lockdown_notify_add (G_CALLBACK (panel_applet_recreate_menu),
-+ panel_lockdown_notify_add (G_CALLBACK (panel_applet_refresh_state),
- info);
-
- key = panel_gconf_full_key ((type == PANEL_OBJECT_BONOBO) ?
---- gnome-panel-2.14.1.old/gnome-panel/gnome-desktop-item-edit.c 2006-03-24 21:46:29.000000000 +0000
-+++ gnome-panel-2.14.1/gnome-panel/gnome-desktop-item-edit.c 2006-04-21 11:06:11.814169000 +0100
-@@ -79,6 +79,7 @@
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
-+ panel_lockdown_init() ;
- context = g_option_context_new (""); //FIXME 2.16 "- Edit .desktop files"
-
- g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE);
-@@ -188,5 +189,6 @@
-
- g_object_unref (program);
-
-+ panel_lockdown_finalize() ;
- return 0;
- }
---- gnome-panel-2.14.1.old/gnome-panel/launcher.c 2006-04-27 15:54:21.204589000 +0100
-+++ gnome-panel-2.14.1/gnome-panel/launcher.c 2006-04-21 11:06:11.820944000 +0100
-@@ -180,6 +180,9 @@
- }
-
- free_url = gnome_vfs_make_uri_canonical (url);
-+ if (panel_lockdown_is_forbidden_ditem(item)) {
-+ return ;
-+ }
- gnome_url_show_on_screen (free_url, screen, &error);
-
- if (error) {
-@@ -219,20 +222,22 @@
- else {
- GError *error = NULL;
-
-- panel_ditem_launch (
-- item, NULL, 0, launcher_get_screen (launcher), &error);
-- if (error) {
-- GtkWidget *error_dialog;
--
-- error_dialog = panel_error_dialog (launcher_get_screen (launcher),
-- "cannot_launch_application",
-- TRUE,
-- _("Could not launch application"),
-- "%s",
-- error->message);
-- launcher_register_error_dialog (launcher, error_dialog);
-- g_clear_error (&error);
-- }
-+ if (!panel_lockdown_is_forbidden_app((GnomeDesktopItem *) item)) {
-+ panel_ditem_launch (
-+ item, NULL, 0, launcher_get_screen (launcher), &error);
-+ if (error) {
-+ GtkWidget *error_dialog;
-+
-+ error_dialog = panel_error_dialog (launcher_get_screen (launcher),
-+ "cannot_launch_application",
-+ TRUE,
-+ _("Could not launch application"),
-+ "%s",
-+ error->message);
-+ launcher_register_error_dialog (launcher, error_dialog);
-+ g_clear_error (&error);
-+ }
-+ }
- }
-
- if (panel_global_config_get_drawer_auto_close ()) {
-@@ -536,7 +541,12 @@
- FALSE,
- PANEL_ORIENTATION_TOP);
-
-- gtk_widget_show (launcher->button);
-+ if (panel_lockdown_is_forbidden_ditem(ditem)) {
-+ gtk_widget_hide(launcher->button) ;
-+ }
-+ else {
-+ gtk_widget_show (launcher->button);
-+ }
-
- /*gtk_drag_dest_set (GTK_WIDGET (launcher->button),
- GTK_DEST_DEFAULT_ALL,
-@@ -1020,7 +1030,6 @@
- static void
- really_add_launcher (GtkWidget *dialog, int response, gpointer data)
- {
-- GtkWidget *err_dialog;
- GnomeDItemEdit *dedit = GNOME_DITEM_EDIT(data);
- int pos = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (dialog), "pos"));
- PanelWidget *panel = g_object_get_data (G_OBJECT (dialog), "panel");
-@@ -1028,35 +1037,32 @@
-
- if (response == GTK_RESPONSE_OK) {
- const char *location;
-+ const char *error_string = NULL ;
-
- ditem = gnome_ditem_edit_get_ditem (dedit);
-
- /* check for valid name */
- if (string_empty (gnome_desktop_item_get_localestring (ditem, GNOME_DESKTOP_ITEM_NAME))) {
-- err_dialog = panel_error_dialog (gtk_window_get_screen (GTK_WINDOW (dialog)),
-- "cannot_create_launcher",
-- TRUE,
-- _("Could not create launcher"),
-- _("You have to specify a name."));
-- g_signal_connect_object (G_OBJECT (dialog),
-- "destroy",
-- G_CALLBACK (gtk_widget_destroy),
-- G_OBJECT (err_dialog),
-- G_CONNECT_SWAPPED);
-- return;
-+ error_string = _("You have to specify a name.") ;
- }
--
--
- /* check for valid URL or command */
-- if ((gnome_desktop_item_get_entry_type (ditem) == GNOME_DESKTOP_ITEM_TYPE_APPLICATION &&
-+ else if ((gnome_desktop_item_get_entry_type (ditem) == GNOME_DESKTOP_ITEM_TYPE_APPLICATION &&
- string_empty (gnome_desktop_item_get_string (ditem, GNOME_DESKTOP_ITEM_EXEC))) ||
- (gnome_desktop_item_get_entry_type (ditem) == GNOME_DESKTOP_ITEM_TYPE_LINK &&
- string_empty (gnome_desktop_item_get_string (ditem, GNOME_DESKTOP_ITEM_URL)))) {
-- err_dialog = panel_error_dialog (gtk_window_get_screen (GTK_WINDOW (dialog)),
-+ error_string = _("You have to specify a valid URL or command.") ;
-+ }
-+ else if (panel_lockdown_is_forbidden_ditem(ditem)) {
-+ error_string = _("The system administrator has disallowed\n"
-+ "use of this application.") ;
-+ }
-+ if (error_string != NULL) {
-+ GtkWidget *err_dialog = panel_error_dialog (
-+ gtk_window_get_screen (GTK_WINDOW (dialog)),
- "cannot_create_launcher",
- TRUE,
- _("Could not create launcher"),
-- _("You have to specify a valid URL or command."));
-+ error_string);
- g_signal_connect_object (G_OBJECT (dialog),
- "destroy",
- G_CALLBACK (gtk_widget_destroy),
-@@ -1180,6 +1186,7 @@
- gnome_desktop_item_set_entry_type (ditem, GNOME_DESKTOP_ITEM_TYPE_LINK);
- }
-
-+ if (panel_lockdown_is_forbidden_ditem(ditem)) { return ; }
- panel_launcher_save_ditem (ditem, TRUE, gtk_window_get_screen (GTK_WINDOW (toplevel)));
- location = gnome_desktop_item_get_location (ditem);
-
-@@ -1324,3 +1331,10 @@
- } else
- gtk_drag_source_unset (launcher->button);
- }
-+
-+gboolean panel_launcher_is_forbidden(Launcher *launcher)
-+{
-+ return panel_lockdown_is_forbidden_ditem(launcher->ditem) ;
-+}
-+
-+
---- gnome-panel-2.14.1.old/gnome-panel/launcher.h 2004-12-19 11:35:49.000000000 +0000
-+++ gnome-panel-2.14.1/gnome-panel/launcher.h 2006-04-21 11:06:11.828771000 +0100
-@@ -79,6 +79,7 @@
- void panel_launcher_set_dnd_enabled (Launcher *launcher,
- gboolean dnd_enabled);
-
-+gboolean panel_launcher_is_forbidden(Launcher *launcher) ;
-
- G_END_DECLS
-
---- gnome-panel-2.14.1.old/gnome-panel/Makefile.am 2006-04-27 15:54:21.919467000 +0100
-+++ gnome-panel-2.14.1/gnome-panel/Makefile.am 2006-04-21 11:06:11.830378000 +0100
-@@ -189,6 +189,8 @@
- menu-ditem.c \
- menu-ditem.h \
- panel-util.c \
-+ panel-lockdown.c \
-+ panel-gconf.c \
- xstuff.c
-
- gnome_desktop_item_edit_LDFLAGS = -export-dynamic
---- gnome-panel-2.14.1.old/gnome-panel/menu.c 2006-04-27 15:54:21.998780000 +0100
-+++ gnome-panel-2.14.1/gnome-panel/menu.c 2006-04-27 14:20:53.900926000 +0100
-@@ -74,7 +74,7 @@
- static GSList *image_menu_items = NULL;
-
- static GtkWidget *populate_menu_from_directory (GtkWidget *menu,
-- GMenuTreeDirectory *directory);
-+ GMenuTreeDirectory *directory, gboolean *is_hidden);
-
- static void panel_load_menu_image_deferred (GtkWidget *image_menu_item,
- GtkIconSize icon_size,
-@@ -1310,7 +1310,7 @@
- }
-
- static void
--submenu_to_display (GtkWidget *menu)
-+submenu_to_display (GtkWidget *menu, gboolean *is_hidden)
- {
- GMenuTree *tree;
- GMenuTreeDirectory *directory;
-@@ -1342,18 +1342,25 @@
- (GDestroyNotify) gmenu_tree_item_unref);
- }
-
-- if (directory)
-- populate_menu_from_directory (menu, directory);
-+ if (directory) {
-+ /* It's possible that is_hidden is NULL if we end up here from the show
-+ signal, which could only happen for the top level menu. */
-+ gboolean local_is_hidden = FALSE ;
-+
-+ populate_menu_from_directory (menu, directory, &local_is_hidden);
-+ if (is_hidden != NULL) { *is_hidden = local_is_hidden ; }
-+ }
- }
-
- static gboolean
- submenu_to_display_in_idle (gpointer data)
- {
-+ gboolean is_hidden = FALSE ;
- GtkWidget *menu = GTK_WIDGET (data);
-
- g_object_set_data (G_OBJECT (menu), "panel-menu-idle-id", NULL);
-
-- submenu_to_display (menu);
-+ submenu_to_display (menu, &is_hidden);
-
- return FALSE;
- }
-@@ -1401,7 +1408,7 @@
-
- g_signal_connect (menu, "button_press_event",
- G_CALLBACK (menu_dummy_button_press_event), NULL);
--
-+
- return menu;
- }
-
-@@ -1439,28 +1446,38 @@
- static void
- create_submenu (GtkWidget *menu,
- GMenuTreeDirectory *directory,
-- GMenuTreeDirectory *alias_directory)
-+ GMenuTreeDirectory *alias_directory,
-+ gboolean *is_hidden)
- {
- GtkWidget *menuitem;
- GtkWidget *submenu;
-
-+ submenu = create_fake_menu (directory);
-+ if (panel_lockdown_get_restrict_application_launching()) {
-+ submenu_to_display(submenu, is_hidden) ;
-+ }
-+ else {
-+ *is_hidden = FALSE ;
-+ }
-+
- if (alias_directory)
- menuitem = create_submenu_entry (menu, alias_directory);
- else
- menuitem = create_submenu_entry (menu, directory);
-
-- submenu = create_fake_menu (directory);
--
- gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
-+ if (*is_hidden) { gtk_widget_hide(menuitem) ; }
- }
-
- static void
- create_header (GtkWidget *menu,
-- GMenuTreeHeader *header)
-+ GMenuTreeHeader *header,
-+ gboolean *is_hidden)
- {
- GMenuTreeDirectory *directory;
- GtkWidget *menuitem;
-
-+ *is_hidden = FALSE ;
- directory = gmenu_tree_header_get_directory (header);
- menuitem = create_submenu_entry (menu, directory);
- gmenu_tree_item_unref (directory);
-@@ -1474,13 +1491,16 @@
- G_CALLBACK (gtk_false), NULL);
- }
-
-+
- static void
- create_menuitem (GtkWidget *menu,
- GMenuTreeEntry *entry,
-- GMenuTreeDirectory *alias_directory)
-+ GMenuTreeDirectory *alias_directory,
-+ gboolean *is_hidden)
- {
- GtkWidget *menuitem;
-
-+ *is_hidden = FALSE ;
- menuitem = gtk_image_menu_item_new ();
-
- g_object_set_data_full (G_OBJECT (menuitem),
-@@ -1510,6 +1530,10 @@
- gmenu_tree_entry_get_name (entry),
- TRUE);
-
-+ if (entry != NULL && !panel_lockdown_is_allowed_menu_entry(entry)) {
-+ gtk_widget_hide(menuitem) ;
-+ *is_hidden = TRUE ;
-+ }
- if ((alias_directory &&
- gmenu_tree_directory_get_comment (alias_directory)) ||
- (!alias_directory &&
-@@ -1553,7 +1577,8 @@
-
- static void
- create_menuitem_from_alias (GtkWidget *menu,
-- GMenuTreeAlias *alias)
-+ GMenuTreeAlias *alias,
-+ gboolean *is_hidden)
- {
- GMenuTreeItem *aliased_item;
-
-@@ -1563,13 +1588,15 @@
- case GMENU_TREE_ITEM_DIRECTORY:
- create_submenu (menu,
- GMENU_TREE_DIRECTORY (aliased_item),
-- gmenu_tree_alias_get_directory (alias));
-+ gmenu_tree_alias_get_directory (alias),
-+ is_hidden);
- break;
-
- case GMENU_TREE_ITEM_ENTRY:
- create_menuitem (menu,
- GMENU_TREE_ENTRY (aliased_item),
-- gmenu_tree_alias_get_directory (alias));
-+ gmenu_tree_alias_get_directory (alias),
-+ is_hidden);
- break;
-
- default:
-@@ -1679,17 +1706,20 @@
-
- static GtkWidget *
- populate_menu_from_directory (GtkWidget *menu,
-- GMenuTreeDirectory *directory)
-+ GMenuTreeDirectory *directory,
-+ gboolean *is_hidden)
- {
- GSList *l;
- GSList *items;
- gboolean add_separator;
-
-+ *is_hidden = TRUE ;
- add_separator = (GTK_MENU_SHELL (menu)->children != NULL);
-
- items = gmenu_tree_directory_get_contents (directory);
-
- for (l = items; l; l = l->next) {
-+ gboolean is_item_hidden = TRUE ;
- GMenuTreeItem *item = l->data;
-
- if (add_separator ||
-@@ -1700,11 +1730,13 @@
-
- switch (gmenu_tree_item_get_type (item)) {
- case GMENU_TREE_ITEM_DIRECTORY:
-- create_submenu (menu, GMENU_TREE_DIRECTORY (item), NULL);
-+ create_submenu (menu, GMENU_TREE_DIRECTORY (item), NULL,
-+ &is_item_hidden);
- break;
-
- case GMENU_TREE_ITEM_ENTRY:
-- create_menuitem (menu, GMENU_TREE_ENTRY (item), NULL);
-+ create_menuitem (menu, GMENU_TREE_ENTRY (item), NULL,
-+ &is_item_hidden);
- break;
-
- case GMENU_TREE_ITEM_SEPARATOR :
-@@ -1712,11 +1744,13 @@
- break;
-
- case GMENU_TREE_ITEM_ALIAS:
-- create_menuitem_from_alias (menu, GMENU_TREE_ALIAS (item));
-+ create_menuitem_from_alias (menu, GMENU_TREE_ALIAS (item),
-+ &is_item_hidden);
- break;
-
- case GMENU_TREE_ITEM_HEADER:
-- create_header (menu, GMENU_TREE_HEADER (item));
-+ create_header (menu, GMENU_TREE_HEADER (item),
-+ &is_item_hidden);
- break;
-
- default:
-@@ -1724,6 +1758,7 @@
- }
-
- gmenu_tree_item_unref (item);
-+ if (!is_item_hidden) { *is_hidden = FALSE ; }
- }
-
- g_slist_free (items);
---- gnome-panel-2.14.1.old/gnome-panel/menu-ditem.c 2005-12-17 11:04:21.000000000 +0000
-+++ gnome-panel-2.14.1/gnome-panel/menu-ditem.c 2006-04-21 11:06:11.885900000 +0100
-@@ -442,6 +442,7 @@
- GError *error = NULL;
- char *name, *loc, *dir;
- GtkWidget *dialog;
-+ const char *error_string = NULL ;
-
- switch (response) {
- case GTK_RESPONSE_OK:
-@@ -464,27 +465,24 @@
-
- /* check for valid name */
- if (string_empty (gnome_desktop_item_get_localestring (ditem, GNOME_DESKTOP_ITEM_NAME))) {
-- dialog = panel_error_dialog (gtk_window_get_screen (GTK_WINDOW (d)),
-- "cannot_create_launcher", TRUE,
-- _("Could not create launcher"),
-- _("You have to specify a name."));
--
-- g_signal_connect_swapped (G_OBJECT (dialog),
-- "destroy",
-- G_CALLBACK (panel_pop_window_busy),
-- G_OBJECT (d));
-- return;
-- }
--
-+ error_string = _("You have to specify a name.") ;
-+ }
- /* check for valid URL or command */
-- if ((gnome_desktop_item_get_entry_type (ditem) == GNOME_DESKTOP_ITEM_TYPE_APPLICATION &&
-+ else if ((gnome_desktop_item_get_entry_type (ditem) == GNOME_DESKTOP_ITEM_TYPE_APPLICATION &&
- string_empty (gnome_desktop_item_get_string (ditem, GNOME_DESKTOP_ITEM_EXEC))) ||
- (gnome_desktop_item_get_entry_type (ditem) == GNOME_DESKTOP_ITEM_TYPE_LINK &&
- string_empty (gnome_desktop_item_get_string (ditem, GNOME_DESKTOP_ITEM_URL)))) {
-+ error_string = _("You have to specify a valid URL or command.") ;
-+ }
-+ else if (panel_lockdown_is_forbidden_ditem(ditem)) {
-+ error_string = _("The system administrator has disallowed\n"
-+ "use of this application.") ;
-+ }
-+ if (error_string != NULL) {
- dialog = panel_error_dialog (gtk_window_get_screen (GTK_WINDOW (d)),
- "cannot_create_launcher", TRUE,
- _("Could not create launcher"),
-- _("You have to specify a valid URL or command."));
-+ error_string);
- g_signal_connect_swapped (G_OBJECT (dialog),
- "destroy",
- G_CALLBACK (panel_pop_window_busy),
---- gnome-panel-2.14.1.old/gnome-panel/panel-action-button.c 2006-02-12 12:36:56.000000000 +0000
-+++ gnome-panel-2.14.1/gnome-panel/panel-action-button.c 2006-04-21 11:06:11.887747000 +0100
-@@ -178,8 +178,11 @@
- static void
- panel_action_run_program (GtkWidget *widget)
- {
-- panel_run_dialog_present (gtk_widget_get_screen (widget),
-- gtk_get_current_event_time ());
-+ if (!panel_lockdown_get_restrict_application_launching() &&
-+ !panel_lockdown_get_disable_command_line()) {
-+ panel_run_dialog_present (gtk_widget_get_screen (widget),
-+ gtk_get_current_event_time ());
-+ }
- }
-
- /* Search For Files
-@@ -193,6 +196,9 @@
- char *argv[2] = {"gnome-search-tool", NULL};
- char *file;
-
-+ if (panel_lockdown_is_forbidden_command("/usr/bin/gnome-search-tool")) {
-+ return ;
-+ }
- screen = gtk_widget_get_screen (widget);
- file = panel_lookup_in_data_dirs ("applications/gnome-search-tool.desktop");
-
---- gnome-panel-2.14.1.old/gnome-panel/panel-applet-frame.c 2006-03-06 20:19:20.000000000 +0000
-+++ gnome-panel-2.14.1/gnome-panel/panel-applet-frame.c 2006-04-21 11:06:11.907293000 +0100
-@@ -115,6 +115,8 @@
- gboolean movable;
- gboolean removable;
-
-+ /* If the applet is currently in a disabled state, no need for a menu. */
-+ if (frame->priv->ui_component == NULL) { return ; }
- panel_widget = PANEL_WIDGET (GTK_WIDGET (frame)->parent);
-
- lockable = panel_applet_lockable (frame->priv->applet_info);
-@@ -323,17 +325,12 @@
- const char *id)
- {
- PanelAppletFrame *frame;
-- CORBA_Environment ev;
-- char *moniker;
- PanelAppletFrameActivating *frame_act;
-
- g_return_if_fail (iid != NULL);
- g_return_if_fail (panel != NULL);
- g_return_if_fail (id != NULL);
-
-- if (panel_lockdown_is_applet_disabled (iid))
-- return;
--
- frame = g_object_new (PANEL_TYPE_APPLET_FRAME, NULL);
- frame->priv->panel = panel;
- frame->priv->iid = g_strdup (iid);
-@@ -345,15 +342,26 @@
- frame_act->exactpos = exactpos;
- frame_act->id = g_strdup (id);
-
-- moniker = panel_applet_frame_construct_moniker (frame, panel, iid, id);
--
-- CORBA_exception_init (&ev);
-+ /* If the applet is disabled, we don't actually load the bonobo component,
-+ but keep the objects around so that, should the disabled state change,
-+ we'll be able to reload the applet in its proper state. */
-+ if (panel_lockdown_is_applet_disabled(iid)) {
-+ panel_applet_frame_activated(NULL, NULL, frame_act) ;
-+ }
-+ else {
-+ CORBA_Environment ev;
-+ char *moniker;
-+
-+ moniker = panel_applet_frame_construct_moniker (frame, panel, iid, id);
-+
-+ CORBA_exception_init (&ev);
-+
-+ bonobo_get_object_async (moniker, "IDL:Bonobo/Control:1.0", &ev,
-+ (BonoboMonikerAsyncFn) panel_applet_frame_activated,
-+ frame_act);
-
-- bonobo_get_object_async (moniker, "IDL:Bonobo/Control:1.0", &ev,
-- (BonoboMonikerAsyncFn) panel_applet_frame_activated,
-- frame_act);
--
-- g_free (moniker);
-+ g_free (moniker);
-+ }
- }
-
- void
-@@ -404,6 +412,18 @@
- g_free (id);
- }
-
-+static void panel_applet_frame_reload(PanelAppletFrame *frame) ;
-+
-+gboolean panel_applet_frame_refresh(PanelAppletFrame *frame)
-+{
-+ if ((frame->priv->ui_component == NULL) !=
-+ panel_lockdown_is_applet_disabled(frame->priv->iid)) {
-+ panel_applet_frame_reload(frame) ;
-+ return TRUE ;
-+ }
-+ return FALSE ;
-+}
-+
- void
- panel_applet_frame_change_orientation (PanelAppletFrame *frame,
- PanelOrientation orientation)
-@@ -846,6 +866,33 @@
- return handled;
- }
-
-+static void
-+panel_applet_frame_reload(PanelAppletFrame *frame)
-+{
-+ PanelWidget *panel;
-+ char *iid;
-+ char *id = NULL;
-+ int position = -1;
-+ gboolean locked = FALSE;
-+ AppletInfo *info = NULL ;
-+
-+ info = frame->priv->applet_info ;
-+ panel = frame->priv->panel;
-+ iid = g_strdup (frame->priv->iid);
-+
-+ if (info) {
-+ id = g_strdup (info->id);
-+ position = panel_applet_get_position (info);
-+ locked = panel_widget_get_applet_locked (panel, info->widget);
-+ panel_applet_clean (info);
-+ }
-+
-+ panel_applet_frame_load (iid, panel, locked, position, TRUE, id);
-+
-+ g_free (iid);
-+ g_free (id);
-+}
-+
- static void
- panel_applet_frame_reload_response (GtkWidget *dialog,
- int response,
-@@ -861,28 +908,7 @@
- info = frame->priv->applet_info;
-
- if (response == GTK_RESPONSE_YES) {
-- PanelWidget *panel;
-- char *iid;
-- char *id = NULL;
-- int position = -1;
-- gboolean locked = FALSE;
--
-- panel = frame->priv->panel;
-- iid = g_strdup (frame->priv->iid);
--
-- if (info) {
-- id = g_strdup (info->id);
-- position = panel_applet_get_position (info);
-- locked = panel_widget_get_applet_locked (panel, info->widget);
-- panel_applet_clean (info);
-- }
--
-- panel_applet_frame_load (iid, panel, locked,
-- position, TRUE, id);
--
-- g_free (iid);
-- g_free (id);
--
-+ panel_applet_frame_reload(frame) ;
- } else if (info) {
- /* if we can't write to applets list we can't really delete
- it, so we'll just ignore this. FIXME: handle this
-@@ -1253,129 +1279,134 @@
- frame_act = (PanelAppletFrameActivating *) data;
- frame = frame_act->frame;
-
-- /* according to the source of bonobo control == NULL && no
-- exception can happen, so handle it */
-- if (BONOBO_EX (ev) || object == CORBA_OBJECT_NIL) {
-- error = bonobo_exception_get_text (ev);
-- g_warning (G_STRLOC ": failed to load applet %s:\n%s",
-- frame->priv->iid, error);
-- panel_applet_frame_loading_failed (frame, frame_act->id);
-- g_free (frame_act->id);
-- g_free (frame_act);
-- g_free (error);
-- return;
-- }
--
-- frame->priv->control = CORBA_Object_duplicate (object, NULL);
--
-- widget = bonobo_widget_new_control_from_objref (object,
-- CORBA_OBJECT_NIL);
--
-- bonobo_object_release_unref (object, NULL);
--
-- if (!widget) {
-- g_warning (G_STRLOC ": failed to load applet %s",
-- frame->priv->iid);
-- panel_applet_frame_loading_failed (frame, frame_act->id);
-- g_free (frame_act->id);
-- g_free (frame_act);
-- return;
-- }
--
-- control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (widget));
-- if (control_frame == NULL) {
-- g_warning (G_STRLOC ": failed to load applet %s "
-- "(can't get control frame)", frame->priv->iid);
-- panel_applet_frame_loading_failed (frame, frame_act->id);
-- gtk_object_sink (GTK_OBJECT (widget));
-- g_free (frame_act->id);
-- g_free (frame_act);
-- return;
-- }
--
-- frame->priv->property_bag =
-- bonobo_control_frame_get_control_property_bag (control_frame,
-- &corba_ev);
-- if (frame->priv->property_bag == NULL || BONOBO_EX (&corba_ev)) {
-- error = bonobo_exception_get_text (&corba_ev);
-- CORBA_exception_free (&corba_ev);
-- g_warning (G_STRLOC ": failed to load applet %s "
-- "(can't get property bag):\n%s",
-- frame->priv->iid, error);
-- panel_applet_frame_loading_failed (frame, frame_act->id);
-- gtk_object_sink (GTK_OBJECT (widget));
-- g_free (frame_act->id);
-- g_free (frame_act);
-- g_free (error);
-- return;
-- }
--
-- bonobo_event_source_client_add_listener (frame->priv->property_bag,
-- (BonoboListenerCallbackFn) panel_applet_frame_event_listener,
-- "Bonobo/Property:change:panel-applet",
-- NULL,
-- frame);
-+ if (ev != NULL) {
-+ /* Case where we end up here as a result of actually loading the
-+ component. */
-+ /* according to the source of bonobo control == NULL && no
-+ exception can happen, so handle it */
-+ if (BONOBO_EX (ev) || object == CORBA_OBJECT_NIL) {
-+ error = bonobo_exception_get_text (ev);
-+ g_warning (G_STRLOC ": failed to load applet %s:\n%s",
-+ frame->priv->iid, error);
-+ panel_applet_frame_loading_failed (frame, frame_act->id);
-+ g_free (frame_act->id);
-+ g_free (frame_act);
-+ g_free (error);
-+ return;
-+ }
-+
-+ frame->priv->control = CORBA_Object_duplicate (object, NULL);
-+
-+ widget = bonobo_widget_new_control_from_objref (object,
-+ CORBA_OBJECT_NIL);
-+
-+ bonobo_object_release_unref (object, NULL);
-+
-+ if (!widget) {
-+ g_warning (G_STRLOC ": failed to load applet %s",
-+ frame->priv->iid);
-+ panel_applet_frame_loading_failed (frame, frame_act->id);
-+ g_free (frame_act->id);
-+ g_free (frame_act);
-+ return;
-+ }
-+
-+ control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (widget));
-+ if (control_frame == NULL) {
-+ g_warning (G_STRLOC ": failed to load applet %s "
-+ "(can't get control frame)", frame->priv->iid);
-+ panel_applet_frame_loading_failed (frame, frame_act->id);
-+ gtk_object_sink (GTK_OBJECT (widget));
-+ g_free (frame_act->id);
-+ g_free (frame_act);
-+ return;
-+ }
-+
-+ frame->priv->property_bag =
-+ bonobo_control_frame_get_control_property_bag (control_frame,
-+ &corba_ev);
-+ if (frame->priv->property_bag == NULL || BONOBO_EX (&corba_ev)) {
-+ error = bonobo_exception_get_text (&corba_ev);
-+ CORBA_exception_free (&corba_ev);
-+ g_warning (G_STRLOC ": failed to load applet %s "
-+ "(can't get property bag):\n%s",
-+ frame->priv->iid, error);
-+ panel_applet_frame_loading_failed (frame, frame_act->id);
-+ gtk_object_sink (GTK_OBJECT (widget));
-+ g_free (frame_act->id);
-+ g_free (frame_act);
-+ g_free (error);
-+ return;
-+ }
-+
-+ bonobo_event_source_client_add_listener (frame->priv->property_bag,
-+ (BonoboListenerCallbackFn) panel_applet_frame_event_listener,
-+ "Bonobo/Property:change:panel-applet",
-+ NULL,
-+ frame);
-
-- frame->priv->ui_component =
-- bonobo_control_frame_get_popup_component (control_frame,
-- &corba_ev);
-- if (frame->priv->ui_component == NULL || BONOBO_EX (&corba_ev)) {
-- error = bonobo_exception_get_text (&corba_ev);
-- CORBA_exception_free (&corba_ev);
-- g_warning (G_STRLOC ": failed to load applet %s "
-- "(can't get popup component):\n%s",
-- frame->priv->iid, error);
-- panel_applet_frame_loading_failed (frame, frame_act->id);
-- gtk_object_sink (GTK_OBJECT (widget));
-- g_free (frame_act->id);
-- g_free (frame_act);
-- g_free (error);
-- return;
-- }
--
-- bonobo_ui_util_set_ui (frame->priv->ui_component, DATADIR,
-- "GNOME_Panel_Popup.xml", "panel", NULL);
--
-- bonobo_ui_component_add_listener (frame->priv->ui_component,
-- "LockAppletToPanel",
-- listener_popup_handle_lock,
-- frame);
--
-- bonobo_ui_component_add_verb_list_with_data (
-- frame->priv->ui_component, popup_verbs, frame);
--
-- control = bonobo_control_frame_get_control (control_frame);
-- if (!control) {
-- CORBA_exception_free (&corba_ev);
-- g_warning (G_STRLOC ": failed to load applet %s "
-- "(can't get control)", frame->priv->iid);
-- panel_applet_frame_loading_failed (frame, frame_act->id);
-- gtk_object_sink (GTK_OBJECT (widget));
-- g_free (frame_act->id);
-- g_free (frame_act);
-- return;
-- }
--
-- frame->priv->applet_shell = panel_applet_frame_get_applet_shell (control);
-- if (frame->priv->applet_shell == CORBA_OBJECT_NIL) {
-- CORBA_exception_free (&corba_ev);
-- g_warning (G_STRLOC ": failed to load applet %s "
-- "(can't get applet shell)", frame->priv->iid);
-- panel_applet_frame_loading_failed (frame, frame_act->id);
-- gtk_object_sink (GTK_OBJECT (widget));
-- g_free (frame_act->id);
-- g_free (frame_act);
-- return;
-- }
--
-- CORBA_exception_free (&corba_ev);
--
-- ORBit_small_listen_for_broken (object,
-- G_CALLBACK (panel_applet_frame_cnx_broken),
-- frame);
--
-- gtk_container_add (GTK_CONTAINER (frame), widget);
--
-+ frame->priv->ui_component =
-+ bonobo_control_frame_get_popup_component (control_frame,
-+ &corba_ev);
-+ if (frame->priv->ui_component == NULL || BONOBO_EX (&corba_ev)) {
-+ error = bonobo_exception_get_text (&corba_ev);
-+ CORBA_exception_free (&corba_ev);
-+ g_warning (G_STRLOC ": failed to load applet %s "
-+ "(can't get popup component):\n%s",
-+ frame->priv->iid, error);
-+ panel_applet_frame_loading_failed (frame, frame_act->id);
-+ gtk_object_sink (GTK_OBJECT (widget));
-+ g_free (frame_act->id);
-+ g_free (frame_act);
-+ g_free (error);
-+ return;
-+ }
-+
-+ bonobo_ui_util_set_ui (frame->priv->ui_component, DATADIR,
-+ "GNOME_Panel_Popup.xml", "panel", NULL);
-+
-+ bonobo_ui_component_add_listener (frame->priv->ui_component,
-+ "LockAppletToPanel",
-+ listener_popup_handle_lock,
-+ frame);
-+
-+ bonobo_ui_component_add_verb_list_with_data (
-+ frame->priv->ui_component, popup_verbs, frame);
-+
-+ control = bonobo_control_frame_get_control (control_frame);
-+ if (!control) {
-+ CORBA_exception_free (&corba_ev);
-+ g_warning (G_STRLOC ": failed to load applet %s "
-+ "(can't get control)", frame->priv->iid);
-+ panel_applet_frame_loading_failed (frame, frame_act->id);
-+ gtk_object_sink (GTK_OBJECT (widget));
-+ g_free (frame_act->id);
-+ g_free (frame_act);
-+ return;
-+ }
-+
-+ frame->priv->applet_shell = panel_applet_frame_get_applet_shell (control);
-+ if (frame->priv->applet_shell == CORBA_OBJECT_NIL) {
-+ CORBA_exception_free (&corba_ev);
-+ g_warning (G_STRLOC ": failed to load applet %s "
-+ "(can't get applet shell)", frame->priv->iid);
-+ panel_applet_frame_loading_failed (frame, frame_act->id);
-+ gtk_object_sink (GTK_OBJECT (widget));
-+ g_free (frame_act->id);
-+ g_free (frame_act);
-+ return;
-+ }
-+
-+ CORBA_exception_free (&corba_ev);
-+
-+ ORBit_small_listen_for_broken (object,
-+ G_CALLBACK (panel_applet_frame_cnx_broken),
-+ frame);
-+
-+ gtk_container_add (GTK_CONTAINER (frame), widget);
-+ }
-+ /* Regardless of whether the object was actually loaded, the corresponding
-+ applet is created to handle lockdown state changes. */
- gtk_widget_show_all (GTK_WIDGET (frame));
-
- info = panel_applet_register (GTK_WIDGET (frame), GTK_WIDGET (frame),
---- gnome-panel-2.14.1.old/gnome-panel/panel-applet-frame.h 2005-01-02 12:57:44.000000000 +0000
-+++ gnome-panel-2.14.1/gnome-panel/panel-applet-frame.h 2006-04-21 11:06:11.908225000 +0100
-@@ -78,6 +78,14 @@
- void panel_applet_frame_set_panel (PanelAppletFrame *frame,
- PanelWidget *panel);
-
-+/**
-+ * Checks whether the applet has been disabled or reenabled and if
-+ * necessary rebuilds the applet.
-+ * Returns true if the applet frame was rebuilt as a result of its
-+ * restriction status changing.
-+ */
-+gboolean panel_applet_frame_refresh(PanelAppletFrame *frame) ;
-+
- G_END_DECLS
-
- #endif /* __PANEL_APPLET_FRAME_H__ */
---- gnome-panel-2.14.1.old/gnome-panel/panel-lockdown.c 2005-01-10 16:41:00.000000000 +0000
-+++ gnome-panel-2.14.1/gnome-panel/panel-lockdown.c 2006-04-27 14:30:09.885843000 +0100
-@@ -29,12 +29,14 @@
- #include <string.h>
- #include "panel-gconf.h"
-
--#define N_LISTENERS 6
-+#define N_LISTENERS 8
-
- #define PANEL_GLOBAL_LOCKDOWN_DIR "/apps/panel/global"
- #define DESKTOP_GNOME_LOCKDOWN_DIR "/desktop/gnome/lockdown"
- #define PANEL_GLOBAL_LOCKED_DOWN_KEY PANEL_GLOBAL_LOCKDOWN_DIR "/locked_down"
- #define DISABLE_COMMAND_LINE_KEY DESKTOP_GNOME_LOCKDOWN_DIR "/disable_command_line"
-+#define RESTRICT_APPLICATION_LAUNCHING_KEY DESKTOP_GNOME_LOCKDOWN_DIR "/restrict_application_launching"
-+#define ALLOWED_APPLICATIONS_KEY DESKTOP_GNOME_LOCKDOWN_DIR "/allowed_applications"
- #define DISABLE_LOCK_SCREEN_KEY PANEL_GLOBAL_LOCKDOWN_DIR "/disable_lock_screen"
- #define DISABLE_LOG_OUT_KEY PANEL_GLOBAL_LOCKDOWN_DIR "/disable_log_out"
- #define DISABLE_FORCE_QUIT_KEY PANEL_GLOBAL_LOCKDOWN_DIR "/disable_force_quit"
-@@ -48,6 +50,9 @@
- guint disable_lock_screen : 1;
- guint disable_log_out : 1;
- guint disable_force_quit : 1;
-+ guint restrict_application_launching : 1;
-+
-+ GSList *allowed_applications;
-
- GSList *disabled_applets;
-
-@@ -56,6 +61,12 @@
- GSList *closures;
- } PanelLockdown;
-
-+static const gchar *command_line_execs[] = {
-+ "/usr/bin/gnome-terminal",
-+ "/usr/bin/xterm"
-+};
-+#define NUMBER_COMMAND_LINE_EXECS 2
-+
- static PanelLockdown panel_lockdown = { 0, };
-
-
-@@ -63,9 +74,17 @@
- panel_lockdown_invoke_closures (PanelLockdown *lockdown)
- {
- GSList *l;
-+ GSList *copy = NULL ;
-
-- for (l = lockdown->closures; l; l = l->next)
-+ copy = g_slist_copy(lockdown->closures) ;
-+ for (l = copy ; l != NULL ; l = l->next) {
-+ if (g_slist_find(lockdown->closures, l->data)) {
-+ g_closure_ref(l->data) ;
- g_closure_invoke (l->data, NULL, 0, NULL, NULL);
-+ g_closure_unref(l->data) ;
-+ }
-+ }
-+ g_slist_free(copy) ;
- }
-
- static void
-@@ -166,6 +185,50 @@
- panel_lockdown_invoke_closures (lockdown);
- }
-
-+static void
-+restrict_application_launching_notify (GConfClient *client,
-+ guint cnxn_id,
-+ GConfEntry *entry,
-+ PanelLockdown *lockdown)
-+{
-+ if (!entry->value || entry->value->type != GCONF_VALUE_BOOL)
-+ return;
-+
-+ lockdown->restrict_application_launching =
-+ gconf_value_get_bool (entry->value);
-+
-+ panel_lockdown_invoke_closures (lockdown);
-+}
-+
-+
-+static void
-+allowed_applications_notify (GConfClient *client,
-+ guint cnxn_id,
-+ GConfEntry *entry,
-+ PanelLockdown *lockdown)
-+{
-+ GSList *l;
-+
-+ if (!entry->value || entry->value->type != GCONF_VALUE_LIST ||
-+ gconf_value_get_list_type (entry->value) != GCONF_VALUE_STRING)
-+ return;
-+
-+ for (l = lockdown->allowed_applications; l; l = l->next)
-+ g_free (l->data);
-+ g_slist_free (lockdown->allowed_applications);
-+ lockdown->allowed_applications = NULL;
-+
-+ for (l = gconf_value_get_list (entry->value); l; l = l->next) {
-+ const char *iid = gconf_value_get_string (l->data);
-+
-+ lockdown->allowed_applications =
-+ g_slist_prepend (lockdown->allowed_applications,
-+ g_strdup (iid));
-+ }
-+
-+ panel_lockdown_invoke_closures (lockdown);
-+}
-+
- static gboolean
- panel_lockdown_load_bool (PanelLockdown *lockdown,
- GConfClient *client,
-@@ -215,6 +278,29 @@
- return retval;
- }
-
-+static GSList *
-+panel_lockdown_load_allowed_applications (PanelLockdown *lockdown,
-+ GConfClient *client,
-+ int listener)
-+{
-+ GSList *retval;
-+
-+ retval = gconf_client_get_list (client,
-+ ALLOWED_APPLICATIONS_KEY,
-+ GCONF_VALUE_STRING,
-+ NULL);
-+
-+ lockdown->listeners [listener] =
-+ gconf_client_notify_add (client,
-+ ALLOWED_APPLICATIONS_KEY,
-+ (GConfClientNotifyFunc) allowed_applications_notify,
-+ lockdown,
-+ NULL, NULL);
-+
-+ return retval;
-+}
-+
-+
- void
- panel_lockdown_init (void)
- {
-@@ -273,6 +359,18 @@
- client,
- i++);
-
-+ panel_lockdown.restrict_application_launching =
-+ panel_lockdown_load_bool (&panel_lockdown,
-+ client,
-+ RESTRICT_APPLICATION_LAUNCHING_KEY,
-+ (GConfClientNotifyFunc) restrict_application_launching_notify,
-+ i++);
-+
-+ panel_lockdown.allowed_applications =
-+ panel_lockdown_load_allowed_applications (&panel_lockdown,
-+ client,
-+ i++);
-+
- g_assert (i == N_LISTENERS);
-
- panel_lockdown.initialized = TRUE;
-@@ -293,7 +391,11 @@
- g_free (l->data);
- g_slist_free (panel_lockdown.disabled_applets);
- panel_lockdown.disabled_applets = NULL;
--
-+ for (l = panel_lockdown.allowed_applications ; l ; l = l->next) {
-+ g_free(l->data) ;
-+ }
-+ g_slist_free(panel_lockdown.allowed_applications) ;
-+ panel_lockdown.allowed_applications = NULL ;
- for (i = 0; i < N_LISTENERS; i++) {
- if (panel_lockdown.listeners [i])
- gconf_client_notify_remove (client,
-@@ -371,6 +473,37 @@
- return FALSE;
- }
-
-+gboolean
-+panel_lockdown_get_restrict_application_launching (void)
-+{
-+ g_assert (panel_lockdown.initialized != FALSE);
-+
-+ return panel_lockdown.restrict_application_launching;
-+}
-+
-+GSList *
-+panel_lockdown_get_allowed_applications (void)
-+{
-+ g_assert (panel_lockdown.initialized == TRUE);
-+
-+ return panel_lockdown.allowed_applications;
-+}
-+
-+gboolean
-+panel_lockdown_is_allowed_application (const gchar *app)
-+{
-+ GSList *l;
-+
-+ g_assert (panel_lockdown.initialized != FALSE);
-+
-+ for (l = panel_lockdown.allowed_applications; l; l = l->next)
-+ if (!strcmp (l->data, app))
-+ return TRUE;
-+
-+ return FALSE;
-+}
-+
-+
- static GClosure *
- panel_lockdown_notify_find (GSList *closures,
- GCallback callback_func,
-@@ -440,3 +573,127 @@
-
- g_closure_unref (closure);
- }
-+
-+gchar *
-+panel_lockdown_get_stripped_exec (const gchar *full_exec)
-+{
-+ gchar *str1, *str2, *retval, *p;
-+
-+ str1 = g_strdup (full_exec);
-+ p = strtok (str1, " ");
-+
-+ if (p != NULL)
-+ str2 = g_strdup (p);
-+ else
-+ str2 = g_strdup (full_exec);
-+
-+ g_free (str1);
-+
-+ if (g_path_is_absolute (str2))
-+ retval = g_strdup (str2);
-+ else
-+ retval = g_strdup (g_find_program_in_path ((const gchar *)str2));
-+ g_free (str2);
-+
-+ return retval;
-+}
-+
-+gchar *
-+panel_lockdown_get_exec_from_ditem (GnomeDesktopItem *ditem)
-+{
-+ const char *full_exec;
-+ gchar *retval = NULL;
-+
-+ full_exec = gnome_desktop_item_get_string (ditem,
-+ GNOME_DESKTOP_ITEM_EXEC);
-+
-+ if (full_exec != NULL)
-+ retval = panel_lockdown_get_stripped_exec (full_exec);
-+
-+ return retval;
-+}
-+
-+gboolean
-+panel_lockdown_ditem_in_allowed_applications (GnomeDesktopItem *ditem)
-+{
-+ gboolean retval = FALSE;
-+ gchar *stripped_exec;
-+
-+ stripped_exec = panel_lockdown_get_exec_from_ditem (ditem);
-+
-+ if (stripped_exec != NULL) {
-+ retval = panel_lockdown_is_allowed_application (stripped_exec);
-+ g_free (stripped_exec);
-+ }
-+
-+ return retval;
-+}
-+
-+gboolean
-+panel_lockdown_is_disabled_command_line (const gchar *term_cmd)
-+{
-+ int i = 0;
-+ gboolean retval = FALSE;
-+
-+ for (i=0; i<NUMBER_COMMAND_LINE_EXECS; i++) {
-+ if (!strcmp (command_line_execs [i], term_cmd)) {
-+ retval = TRUE;
-+ break;
-+ }
-+ }
-+
-+ return retval;
-+}
-+
-+gboolean panel_lockdown_is_forbidden_app(GnomeDesktopItem *ditem) {
-+ g_return_val_if_fail(ditem != NULL, TRUE) ;
-+ return panel_lockdown_get_restrict_application_launching() &&
-+ !panel_lockdown_ditem_in_allowed_applications(ditem) ;
-+}
-+
-+gboolean panel_lockdown_is_forbidden_ditem(GnomeDesktopItem *ditem)
-+{
-+ g_return_val_if_fail(ditem != NULL, TRUE) ;
-+ if (panel_lockdown_is_forbidden_app(ditem)) { return TRUE ; }
-+ if (panel_lockdown_get_disable_command_line()) {
-+ char *stripped = panel_lockdown_get_exec_from_ditem(ditem) ;
-+
-+ if (stripped != NULL) {
-+ gboolean retCode =
-+ panel_lockdown_is_disabled_command_line(stripped) ;
-+
-+ g_free(stripped) ;
-+ return retCode ;
-+ }
-+ }
-+ return FALSE ;
-+}
-+
-+gboolean panel_lockdown_is_forbidden_command(const char *command)
-+{
-+ g_return_val_if_fail(command != NULL, TRUE) ;
-+ return panel_lockdown_get_restrict_application_launching() &&
-+ !panel_lockdown_is_allowed_application(command) ;
-+}
-+
-+gboolean panel_lockdown_is_allowed_menu_entry(GMenuTreeEntry *entry)
-+{
-+ const char *path;
-+ GnomeDesktopItem *item = NULL ;
-+
-+ if (!panel_lockdown_get_restrict_application_launching())
-+ return TRUE;
-+
-+ path = gmenu_tree_entry_get_desktop_file_path(entry) ;
-+
-+ if (path != NULL) {
-+ item = gnome_desktop_item_new_from_file(path, 0, NULL) ;
-+ if (item != NULL) {
-+ gboolean retCode = !panel_lockdown_is_forbidden_ditem(item) ;
-+
-+ gnome_desktop_item_unref(item) ;
-+ return retCode ;
-+ }
-+ }
-+ return TRUE ;
-+}
---- gnome-panel-2.14.1.old/gnome-panel/panel-lockdown.h 2005-01-10 16:41:00.000000000 +0000
-+++ gnome-panel-2.14.1/gnome-panel/panel-lockdown.h 2006-04-27 14:24:41.641330000 +0100
-@@ -25,8 +25,10 @@
- #ifndef __PANEL_LOCKDOWN_H__
- #define __PANEL_LOCKDOWN_H__
-
-+#include <libgnome/gnome-desktop-item.h>
- #include <glib.h>
- #include <glib-object.h>
-+#include <gmenu-tree.h>
-
- G_BEGIN_DECLS
-
-@@ -38,14 +40,45 @@
- gboolean panel_lockdown_get_disable_lock_screen (void);
- gboolean panel_lockdown_get_disable_log_out (void);
- gboolean panel_lockdown_get_disable_force_quit (void);
-+gboolean panel_lockdown_get_restrict_application_launching (void);
-+GSList *panel_lockdown_get_allowed_applications (void);
-
- gboolean panel_lockdown_is_applet_disabled (const char *iid);
-+gboolean panel_lockdown_is_allowed_application (const gchar *app);
-
- void panel_lockdown_notify_add (GCallback callback_func,
- gpointer user_data);
- void panel_lockdown_notify_remove (GCallback callback_func,
- gpointer user_data);
-
-+gchar *panel_lockdown_get_stripped_exec (const gchar *full_exec);
-+gchar *panel_lockdown_get_exec_from_ditem (GnomeDesktopItem *ditem);
-+gboolean panel_lockdown_ditem_in_allowed_applications (GnomeDesktopItem *ditem);gboolean panel_lockdown_is_disabled_command_line (const gchar *term_cmd);
-+
-+/**
-+ * Returns true if the ditem corresponds to an application whose use has been
-+ * disallowed by the administrator (tests whether restrictions are in place
-+ * and if the ditem matches the allowed applications list).
-+ */
-+gboolean panel_lockdown_is_forbidden_app(GnomeDesktopItem *ditem) ;
-+/**
-+ * Returns true if the ditem corresponds to either an application whose use
-+ * has been disallowed by the administrator (same as previous function) or
-+ * a shell when command line use has been restricted.
-+ */
-+gboolean panel_lockdown_is_forbidden_ditem(GnomeDesktopItem *ditem) ;
-+/**
-+ * Returns true if the command line corresponds to an application whose use
-+ * has been disallowed by the administrator.
-+ */
-+gboolean panel_lockdown_is_forbidden_command(const gchar *command) ;
-+
-+/**
-+ * Returns true if the menu entry corresponds to an application whose use
-+ * has been allowed by the administrator.
-+ */
-+gboolean panel_lockdown_is_allowed_menu_entry(GMenuTreeEntry *entry) ;
-+
- G_END_DECLS
-
- #endif /* __PANEL_LOCKDOWN_H__ */
---- gnome-panel-2.14.1.old/gnome-panel/panel-menu-bar.c 2006-03-06 21:37:10.000000000 +0000
-+++ gnome-panel-2.14.1/gnome-panel/panel-menu-bar.c 2006-04-21 11:06:12.001845000 +0100
-@@ -168,6 +168,16 @@
- "", NULL);
- }
-
-+static void panel_menubar_recreate_menus(PanelMenuBar *menubar)
-+{
-+ if (menubar->priv->applications_menu != NULL) {
-+ while (GTK_MENU_SHELL(menubar->priv->applications_menu)->children) {
-+ gtk_widget_destroy(GTK_MENU_SHELL(menubar->priv->applications_menu)->children->data) ;
-+ }
-+ menubar->priv->applications_menu = create_applications_menu("applications.menu", NULL) ;
-+ }
-+}
-+
- static void
- panel_menu_bar_instance_init (PanelMenuBar *menubar,
- PanelMenuBarClass *klass)
-@@ -200,6 +210,8 @@
- menubar->priv->desktop_item);
-
- panel_menu_bar_setup_tooltip (menubar);
-+ panel_lockdown_notify_add(G_CALLBACK(panel_menubar_recreate_menus),
-+ menubar) ;
- }
-
- static void
---- gnome-panel-2.14.1.old/gnome-panel/panel-menu-items.c 2006-04-27 15:54:22.003079000 +0100
-+++ gnome-panel-2.14.1/gnome-panel/panel-menu-items.c 2006-04-21 11:06:12.063074000 +0100
-@@ -1120,8 +1120,10 @@
- tooltip = NULL;
- }
-
-- item = panel_menu_items_create_action_item_full (PANEL_ACTION_LOGOUT,
-- label, tooltip);
-+ if (!panel_lockdown_get_disable_log_out()) {
-+ item = panel_menu_items_create_action_item_full (PANEL_ACTION_LOGOUT,
-+ label, tooltip);
-+ }
- g_free (label);
- g_free (tooltip);
-
-@@ -1153,17 +1155,18 @@
- if (item) {
- g_assert (error == NULL);
-
-- panel_ditem_launch (item, NULL, 0,
-- menuitem_to_screen (menuitem), &error);
-- if (error) {
-- panel_error_dialog (menuitem_to_screen (menuitem),
-- "cannot_launch_entry", TRUE,
-- _("Could not launch menu item"),
-- "%s",
-- error->message);
--
-- g_error_free (error);
-- }
-+ if (!panel_lockdown_is_forbidden_ditem(item)) {
-+ panel_ditem_launch (item, NULL, 0,
-+ menuitem_to_screen (menuitem), &error);
-+ if (error) {
-+ panel_error_dialog (menuitem_to_screen (menuitem),
-+ "cannot_launch_entry", TRUE,
-+ _("Could not launch menu item"),
-+ "%s",
-+ error->message);
-+ g_error_free (error);
-+ }
-+ }
- gnome_desktop_item_unref (item);
- } else {
- g_assert (error != NULL);
---- gnome-panel-2.14.1.old/gnome-panel/panel-util.c 2006-01-11 20:42:40.000000000 +0000
-+++ gnome-panel-2.14.1/gnome-panel/panel-util.c 2006-04-21 11:06:12.082115000 +0100
-@@ -33,6 +33,7 @@
- #include "xstuff.h"
- #include "panel-globals.h"
- #include "launcher.h"
-+#include "panel-lockdown.h"
-
- void
- panel_launch_desktop_file (const char *desktop_file,
-@@ -682,6 +683,7 @@
- char *command = NULL;
- gboolean use_gscreensaver = FALSE;
-
-+ if (panel_lockdown_get_disable_lock_screen()) { return NULL ; }
- if (panel_is_program_in_path ("gnome-screensaver-command")
- && panel_is_program_in_path ("gnome-screensaver-preferences"))
- use_gscreensaver = TRUE;
---- gnome-panel-2.14.1.old/gnome-panel/panel-addto.c 2006-01-22 15:01:31.000000000 +0000
-+++ gnome-panel-2.14.1/gnome-panel/panel-addto.c 2006-04-27 14:57:03.811433000 +0100
-@@ -558,9 +558,10 @@
- dialog, NULL);
- }
-
--static void panel_addto_make_application_list (GSList **parent_list,
-+static gint panel_addto_make_application_list (GSList **parent_list,
- GMenuTreeDirectory *directory,
- const char *filename);
-+static void panel_addto_dialog_free_item_info (PanelAddtoItemInfo *item_info);
-
- static void
- panel_addto_prepend_directory (GSList **parent_list,
-@@ -568,6 +569,7 @@
- const char *filename)
- {
- PanelAddtoAppList *data;
-+ gint entries_added = 0;
-
- data = g_new0 (PanelAddtoAppList, 1);
-
-@@ -587,9 +589,17 @@
- * So the iid is built when we select the row.
- */
-
-- *parent_list = g_slist_prepend (*parent_list, data);
--
-- panel_addto_make_application_list (&data->children, directory, filename);
-+
-+ entries_added = panel_addto_make_application_list (&data->children, directory, filename);
-+ if (entries_added > 0) {
-+ /* Only prepend if there are entries */
-+ *parent_list = g_slist_prepend (*parent_list, data);
-+ }
-+ else {
-+ /* Free data as not being appended */
-+ panel_addto_dialog_free_item_info (&data->item_info);
-+ g_free (data);
-+ }
- }
-
- static void
-@@ -611,12 +621,13 @@
- *parent_list = g_slist_prepend (*parent_list, data);
- }
-
--static void
-+static gint
- panel_addto_prepend_alias (GSList **parent_list,
- GMenuTreeAlias *alias,
- const char *filename)
- {
- GMenuTreeItem *aliased_item;
-+ int entry = 0;
-
- aliased_item = gmenu_tree_alias_get_item (alias);
-
-@@ -628,9 +639,12 @@
- break;
-
- case GMENU_TREE_ITEM_ENTRY:
-- panel_addto_prepend_entry (parent_list,
-- GMENU_TREE_ENTRY (aliased_item),
-- filename);
-+ if (panel_lockdown_is_allowed_menu_entry(GMENU_TREE_ENTRY(aliased_item))) {
-+ panel_addto_prepend_entry (parent_list,
-+ GMENU_TREE_ENTRY (aliased_item),
-+ filename);
-+ entry = 1;
-+ }
- break;
-
- default:
-@@ -638,15 +652,17 @@
- }
-
- gmenu_tree_item_unref (aliased_item);
-+ return entry;
- }
-
--static void
-+static gint
- panel_addto_make_application_list (GSList **parent_list,
- GMenuTreeDirectory *directory,
- const char *filename)
- {
- GSList *items;
- GSList *l;
-+ gint number_entries = 0;
-
- items = gmenu_tree_directory_get_contents (directory);
-
-@@ -657,11 +673,14 @@
- break;
-
- case GMENU_TREE_ITEM_ENTRY:
-- panel_addto_prepend_entry (parent_list, l->data, filename);
-+ if (panel_lockdown_is_allowed_menu_entry(l->data)) {
-+ panel_addto_prepend_entry (parent_list, l->data, filename);
-+ number_entries = number_entries+1;
-+ }
- break;
-
- case GMENU_TREE_ITEM_ALIAS:
-- panel_addto_prepend_alias (parent_list, l->data, filename);
-+ number_entries = number_entries + panel_addto_prepend_alias (parent_list, l->data, filename);
- break;
-
- default:
-@@ -674,6 +693,8 @@
- g_slist_free (items);
-
- *parent_list = g_slist_reverse (*parent_list);
-+
-+ return number_entries;
- }
-
- static void
--- a/patches/gnome-panel-13-launch-menu.diff Sat May 13 01:34:47 2006 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,377 +0,0 @@
-diff -urN gnome-panel-2.14.1/gnome-panel/menu.c gnome-panel-2.14.1-hacked/gnome-panel/menu.c
---- gnome-panel-2.14.1/gnome-panel/menu.c 2006-05-12 15:11:34.285448000 +1200
-+++ gnome-panel-2.14.1-hacked/gnome-panel/menu.c 2006-05-12 15:12:45.135973000 +1200
-@@ -50,6 +50,8 @@
- #include "panel-lockdown.h"
- #include "panel-menu.h"
-
-+#define COMPUTER_NAME_KEY "/apps/nautilus/desktop/computer_icon_name"
-+
- typedef struct {
- GtkWidget *pixmap;
- const char *stock_id;
-@@ -1782,12 +1784,94 @@
- }
-
- static void
-+run_applications (GtkWidget *widget, gpointer user_data)
-+{
-+ if (!panel_lockdown_get_restrict_application_launching() &&
-+ !panel_lockdown_get_disable_command_line()) {
-+ panel_run_dialog_present (gtk_widget_get_screen (widget),
-+ gtk_get_current_event_time ());
-+ }
-+}
-+
-+static void
-+applications_menu_append (GtkWidget *main_menu)
-+{
-+ GtkWidget *item;
-+ GtkWidget *accel_label;
-+ GtkWidget *image;
-+
-+ if (panel_lockdown_get_disable_command_line())
-+ return;
-+
-+ if (!g_object_get_data (G_OBJECT (main_menu),
-+ "panel-menu-needs-appending"))
-+ return;
-+
-+ g_object_set_data (G_OBJECT (main_menu),
-+ "panel-menu-needs-appending", NULL);
-+
-+ add_menu_separator (main_menu);
-+
-+ item = gtk_image_menu_item_new ();
-+
-+ accel_label = gtk_accel_label_new (_("Run Application..."));
-+ gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
-+
-+ gtk_container_add (GTK_CONTAINER (item), accel_label);
-+ gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label),
-+ GTK_WIDGET (item));
-+ gtk_widget_show (accel_label);
-+
-+ image = gtk_image_new_from_icon_name (PANEL_RUN_ICON, panel_menu_icon_get_size ());
-+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
-+
-+ g_signal_connect (item, "activate",
-+ G_CALLBACK (run_applications), NULL);
-+ gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), item);
-+ gtk_widget_show (item);
-+}
-+
-+GtkWidget *
-+add_xdg_menu (const char *name, const char *path, const char *icon)
-+{
-+ GtkWidget *item;
-+ GtkWidget *accel_label;
-+ GtkWidget *image;
-+ GtkWidget *menu;
-+
-+ item = gtk_image_menu_item_new ();
-+
-+ accel_label = gtk_accel_label_new (name);
-+ gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
-+
-+ gtk_container_add (GTK_CONTAINER (item), accel_label);
-+ gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label),
-+ GTK_WIDGET (item));
-+ gtk_widget_show (accel_label);
-+
-+ image = gtk_image_new_from_icon_name (icon, panel_menu_icon_get_size ());
-+
-+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
-+ menu = create_applications_menu (path, NULL);
-+ panel_menu_set_stripe_enabled (PANEL_MENU (menu), FALSE);
-+
-+ if (strcmp (name, "applications.menu") !=0) {
-+ g_signal_connect (menu, "show",
-+ G_CALLBACK (applications_menu_append), NULL);
-+ }
-+
-+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), menu);
-+
-+ return item;
-+}
-+
-+static void
- main_menu_append (GtkWidget *main_menu,
- PanelWidget *panel)
- {
- GtkWidget *item;
-- gboolean add_separator;
-- GList *children;
-+ EggRecentViewGtk *recent_view;
-+ char *gconf_name;
-
- if (!g_object_get_data (G_OBJECT (main_menu),
- "panel-menu-needs-appending"))
-@@ -1796,44 +1880,64 @@
- g_object_set_data (G_OBJECT (main_menu),
- "panel-menu-needs-appending", NULL);
-
-- children = gtk_container_get_children (GTK_CONTAINER (main_menu));
-+ item = add_xdg_menu (_("All Applications"), "applications.menu", "gnome-applications");
-+ gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), item);
-+ gtk_widget_show (item);
-
-- add_separator = FALSE;
-- if (children != NULL) {
-- while (children->next != NULL)
-- children = children->next;
-- add_separator = !GTK_IS_SEPARATOR (GTK_WIDGET (children->data));
-- }
-+ add_menu_separator (main_menu);
-
-- if (add_separator)
-- add_menu_separator (main_menu);
-+ gconf_name = gconf_client_get_string (panel_gconf_get_client (),
-+ COMPUTER_NAME_KEY,
-+ NULL);
-+ panel_menu_items_append_from_desktop (main_menu,
-+ "nautilus-computer.desktop",
-+ gconf_name);
-+ if (gconf_name)
-+ g_free (gconf_name);
-
- item = panel_place_menu_item_new (TRUE);
- panel_place_menu_item_set_panel (item, panel);
- gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), item);
- gtk_widget_show (item);
-
-- item = panel_desktop_menu_item_new (TRUE, FALSE);
-- panel_desktop_menu_item_set_panel (item, panel);
-- gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), item);
-+ recent_view = NULL;
-+ recent_view = panel_recent_append_documents_menu (main_menu, recent_view);
-+ panel_menu_items_append_from_desktop (main_menu,
-+ "gnome-search-tool.desktop",
-+ NULL);
-+
-+ add_menu_separator (main_menu);
-+ add_menu_separator (main_menu);
-+
-+ item = add_xdg_menu (_("Preferences"), "preferences.menu", "gnome-settings");
-+ gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), item);
-+ gtk_widget_show (item);
-+
-+ item = add_xdg_menu (_("Administration"), "settings.menu", "gnome-system");
-+ gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), item);
- gtk_widget_show (item);
-
-+ panel_menu_items_append_from_desktop (main_menu,
-+ "yelp.desktop",
-+ NULL);
-+
- panel_menu_items_append_lock_logout (main_menu);
- }
-
- GtkWidget *
- create_main_menu (PanelWidget *panel)
- {
-- GtkWidget *main_menu;
-+ GtkWidget *main_menu;
-+
-+ main_menu = create_applications_menu ("quickstart.menu", NULL);
-
-- main_menu = create_applications_menu ("applications.menu", NULL);
-- g_object_set_data (G_OBJECT (main_menu), "menu_panel", panel);
-- /* FIXME need to update the panel on parent_set */
-+ g_object_set_data (G_OBJECT (main_menu), "menu_panel", panel);
-+ /* FIXME need to update the panel on parent_set */
-
-- g_signal_connect (main_menu, "show",
-- G_CALLBACK (main_menu_append), panel);
-+ g_signal_connect (main_menu, "show",
-+ G_CALLBACK (main_menu_append), panel);
-
-- return main_menu;
-+ return main_menu;
- }
-
- static GList *
-diff -urN gnome-panel-2.14.1/gnome-panel/panel-menu-button.c gnome-panel-2.14.1-hacked/gnome-panel/panel-menu-button.c
---- gnome-panel-2.14.1/gnome-panel/panel-menu-button.c 2006-05-12 15:11:33.377618000 +1200
-+++ gnome-panel-2.14.1-hacked/gnome-panel/panel-menu-button.c 2006-05-12 15:11:46.202434000 +1200
-@@ -38,6 +38,8 @@
- #include "panel-lockdown.h"
- #include "panel-a11y.h"
-
-+#define COMPUTER_NAME_KEY "/apps/nautilus/desktop/computer_icon_name"
-+
- #define PANEL_MENU_BUTTON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PANEL_TYPE_MENU_BUTTON, PanelMenuButtonPrivate))
-
- enum {
-@@ -398,6 +400,18 @@
- }
-
- static void
-+panel_menu_button_reload_menus (GConfClient *client,
-+ guint cnxn_id,
-+ GConfEntry *entry,
-+ PanelMenuButton *button)
-+{
-+ if (button->priv->menu) {
-+ gtk_widget_destroy (GTK_WIDGET (button->priv->menu));
-+ panel_menu_button_create_menu (button);
-+ }
-+}
-+
-+static void
- panel_menu_button_recreate_menu (PanelMenuButton *button)
- {
- if (button->priv->menu)
-@@ -701,6 +715,11 @@
-
- panel_lockdown_notify_add (G_CALLBACK (panel_menu_button_recreate_menu),
- button);
-+
-+ panel_gconf_notify_add_while_alive (COMPUTER_NAME_KEY,
-+ (GConfClientNotifyFunc) panel_menu_button_reload_menus,
-+ G_OBJECT (button));
-+
- }
-
- static char *
-diff -urN gnome-panel-2.14.1/gnome-panel/panel-menu-items.c gnome-panel-2.14.1-hacked/gnome-panel/panel-menu-items.c
---- gnome-panel-2.14.1/gnome-panel/panel-menu-items.c 2006-05-12 15:11:34.321469000 +1200
-+++ gnome-panel-2.14.1-hacked/gnome-panel/panel-menu-items.c 2006-05-12 15:11:46.204442000 +1200
-@@ -55,8 +55,6 @@
- #define DESKTOP_IS_HOME_DIR_DIR "/apps/nautilus/preferences"
- #define DESKTOP_IS_HOME_DIR_KEY "/apps/nautilus/preferences/desktop_is_home_dir"
- #define NAMES_DIR "/apps/nautilus/desktop"
--#define HOME_NAME_KEY "/apps/nautilus/desktop/home_icon_name"
--#define COMPUTER_NAME_KEY "/apps/nautilus/desktop/computer_icon_name"
- #define MAX_ITEMS_OR_SUBMENU 5
-
- #define PANEL_PLACE_MENU_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PANEL_TYPE_PLACE_MENU_ITEM, PanelPlaceMenuItemPrivate))
-@@ -119,7 +117,7 @@
- g_free (url);
- }
-
--static void
-+void
- panel_menu_items_append_from_desktop (GtkWidget *menu,
- char *path,
- char *force_name)
-@@ -573,27 +571,18 @@
- g_list_free (volumes);
- }
-
--
- static GtkWidget *
- panel_place_menu_item_create_menu (EggRecentViewGtk **recent_view)
- {
- GtkWidget *places_menu;
- GtkWidget *item;
- char *gconf_name;
-+ char *documents_link;
-
- places_menu = panel_create_menu ();
-
- panel_menu_set_stripe_enabled (PANEL_MENU (places_menu), FALSE);
-
-- gconf_name = gconf_client_get_string (panel_gconf_get_client (),
-- HOME_NAME_KEY,
-- NULL);
-- panel_menu_items_append_from_desktop (places_menu,
-- "nautilus-home.desktop",
-- gconf_name);
-- if (gconf_name)
-- g_free (gconf_name);
--
- if (!gconf_client_get_bool (panel_gconf_get_client (),
- DESKTOP_IS_HOME_DIR_KEY,
- NULL))
-@@ -609,18 +598,19 @@
- G_CALLBACK (activate_uri),
- "Desktop");
-
-+ documents_link = g_build_filename (g_get_home_dir (), "Documents", NULL);
-+
-+ panel_menu_items_append_place_item ("gnome-fs-directory",
-+ _("Documents"),
-+ _("Open Documents folder"),
-+ places_menu,
-+ G_CALLBACK (activate_uri),
-+ documents_link);
-+ g_free (documents_link);
-+
- panel_place_menu_item_append_gtk_bookmarks (places_menu);
- add_menu_separator (places_menu);
-
-- gconf_name = gconf_client_get_string (panel_gconf_get_client (),
-- COMPUTER_NAME_KEY,
-- NULL);
-- panel_menu_items_append_from_desktop (places_menu,
-- "nautilus-computer.desktop",
-- gconf_name);
-- if (gconf_name)
-- g_free (gconf_name);
--
- panel_menu_items_append_from_desktop (places_menu,
- "nautilus-cd-burner.desktop",
- NULL);
-@@ -640,15 +630,6 @@
- item);
- }
-
-- add_menu_separator (places_menu);
--
-- panel_menu_items_append_from_desktop (places_menu,
-- "gnome-search-tool.desktop",
-- NULL);
--
-- *recent_view = panel_recent_append_documents_menu (places_menu,
-- *recent_view);
--
- return places_menu;
- }
-
-@@ -825,15 +806,9 @@
- GCONF_CLIENT_PRELOAD_NONE,
- NULL);
-
-- panel_gconf_notify_add_while_alive (HOME_NAME_KEY,
-- (GConfClientNotifyFunc) panel_place_menu_item_key_changed,
-- G_OBJECT (menuitem));
- panel_gconf_notify_add_while_alive (DESKTOP_IS_HOME_DIR_KEY,
- (GConfClientNotifyFunc) panel_place_menu_item_key_changed,
- G_OBJECT (menuitem));
-- panel_gconf_notify_add_while_alive (COMPUTER_NAME_KEY,
-- (GConfClientNotifyFunc) panel_place_menu_item_key_changed,
-- G_OBJECT (menuitem));
-
- bookmarks_filename = g_build_filename (g_get_home_dir (),
- BOOKMARKS_FILENAME, NULL);
-@@ -957,7 +932,6 @@
- return type;
- }
-
--
- GtkWidget *
- panel_place_menu_item_new (gboolean use_image)
- {
-@@ -966,7 +940,7 @@
-
- menuitem = g_object_new (PANEL_TYPE_PLACE_MENU_ITEM, NULL);
-
-- accel_label = gtk_accel_label_new (_("Places"));
-+ accel_label = gtk_accel_label_new (g_get_user_name ());
- gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
-
- gtk_container_add (GTK_CONTAINER (menuitem), accel_label);
-diff -urN gnome-panel-2.14.1/gnome-panel/panel-menu-items.h gnome-panel-2.14.1-hacked/gnome-panel/panel-menu-items.h
---- gnome-panel-2.14.1/gnome-panel/panel-menu-items.h 2006-01-23 04:01:31.000000000 +1300
-+++ gnome-panel-2.14.1-hacked/gnome-panel/panel-menu-items.h 2006-05-12 15:11:46.205702000 +1200
-@@ -90,6 +90,9 @@
- void panel_menu_items_append_lock_logout (GtkWidget *menu);
- void panel_menu_item_activate_desktop_file (GtkWidget *menuitem,
- const char *path);
-+void panel_menu_items_append_from_desktop (GtkWidget *menu,
-+ char *path,
-+ char *force_name);
-
- G_END_DECLS
-
--- a/patches/libgnome-01-default-background.diff Sat May 13 01:34:47 2006 +0000
+++ b/patches/libgnome-01-default-background.diff Sat May 13 17:59:05 2006 +0000
@@ -26,7 +26,7 @@
<owner>gnome</owner>
<type>string</type>
- <default></default>
-+ <default>@prefix@/share/pixmaps/backgrounds/sun/opensolaris.jpg</default>
++ <default>@prefix@/share/pixmaps/backgrounds/sun/di-elliptical-blue.png</default>
<locale name="C">
<short>Picture Filename</short>
<long>File to use for the background image</long>
--- a/patches/libgnome-02-default-theme.diff Sat May 13 01:34:47 2006 +0000
+++ b/patches/libgnome-02-default-theme.diff Sat May 13 17:59:05 2006 +0000
@@ -14,7 +14,7 @@
<owner>gnome</owner>
<type>string</type>
- <default>Clearlooks</default>
-+ <default>blueprint</default>
++ <default>nimbus</default>
<locale name="C">
<short>Gtk+ Theme</short>
<long>Basename of the default theme used by gtk+.</long>
--- a/sun-gdm-themes.spec Sat May 13 01:34:47 2006 +0000
+++ b/sun-gdm-themes.spec Sat May 13 17:59:05 2006 +0000
@@ -9,12 +9,12 @@
License: LGPL
Group: System/GUI/GNOME
BuildArchitectures: noarch
-Version: 0.18
-Release: 40
+Version: 0.22
+Release: 1
Distribution: Java Desktop System
Vendor: Sun Microsystems, Inc.
Summary: Sun branded GNOME login manager theme
-Source: %{name}-%{version}.os.tar.gz
+Source: %{name}-%{version}.tar.gz
URL: http://sun.com
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Docdir: %{_defaultdocdir}/%{name}
@@ -28,7 +28,7 @@
This package contains Sun branded GNOME login manager [GDM] themes
%prep
-%setup -q -n %name-%version.os
+%setup -q -n %name-%version
%build
%ifos linux